use of com.att.aro.core.searching.pojo.SearchingPattern in project VideoOptimzer by attdevsupport.
the class KeywordSearchingHandlerTest method testUnknownSearchingPattern.
@Test
public void testUnknownSearchingPattern() {
SearchingPattern pattern = null;
SearchingContent content = new SearchingContent("abcde");
SearchingResult result = searchingHandler.search(pattern, content);
assertNotNull(result);
assertEquals(0, result.getWords().size());
}
use of com.att.aro.core.searching.pojo.SearchingPattern in project VideoOptimzer by attdevsupport.
the class PatternSearchingHandlerTest method testUnknownSearchingPattern.
@Test
public void testUnknownSearchingPattern() {
SearchingPattern pattern = null;
SearchingContent content = new SearchingContent("abcde");
SearchingResult result = searchingHandler.search(pattern, content);
assertNotNull(result);
assertEquals(0, result.getWords().size());
}
use of com.att.aro.core.searching.pojo.SearchingPattern in project VideoOptimzer by attdevsupport.
the class TransmissionPrivateDataImpl method search.
/**
* searching method depends on the type of searching handler (exact keyword searching or pattern searching)
* @param sessions
* @param handler
* @param privateDataSet
* @return
*/
private List<TransmissionPrivateDataEntry> search(List<Session> sessions, ISearchingHandler handler, Map<String, String> privateDataSet) {
List<TransmissionPrivateDataEntry> entries = new LinkedList<>();
SearchingPattern pattern = getSearchingPattern(handler, privateDataSet);
if (pattern.isEmpty()) {
return entries;
}
for (Session session : sessions) {
SearchingContent content = getContent(session);
SearchingResult result = handler.search(pattern, content);
List<String> wordsFound = result.getWords();
List<String> types = result.getTypes();
for (int i = 0; i < wordsFound.size(); i++) {
entries.add(populateEntry(session, wordsFound.get(i), types.get(i)));
}
}
return entries;
}
Aggregations