MCPcopy Create free account
hub / github.com/codebox/homoglyph / search

Method search

src/main/java/net/codebox/homoglyph/Homoglyph.java:39–49  ·  view source on GitHub ↗

Search the String text to locate all occurrences of the words contained in targetWords, accounting for homoglyph substitution and variations of case. @param text text to be searched @param targetWords words to be located @return a List containing the results of the search, if no mat

(final String text, final Collection<String> targetWords)

Source from the content-addressed store, hash-verified

37 * @return a List containing the results of the search, if no matches were found an empty list will be returned
38 */
39 public List<SearchResult> search(final String text, final Collection<String> targetWords){
40 final List<SearchResult> allResults = new ArrayList<SearchResult>();
41
42 final CodePoints textCodepoints = new CodePoints(text);
43
44 for (final String targetWord : targetWords) {
45 allResults.addAll(checkForWord(textCodepoints, new CodePoints(targetWord)));
46 }
47
48 return allResults;
49 }
50
51 /**
52 * Search the String {@code text} to locate all occurrences of the words contained in {@code targetWords},

Calls 1

checkForWordMethod · 0.95