@Test void createStemmedWordSet() { Set<String> actualStemmedWordSet = informationContentService.createStemmedWordSet("hearing-impairment_eye ball"); Set<String> expectedStemmedWordSet = Sets.newHashSet("hear", "impair", "ey", "ball"); assertEquals(expectedStemmedWordSet.size(), actualStemmedWordSet.size()); assertTrue(expectedStemmedWordSet.containsAll(actualStemmedWordSet)); }
public Set<String> createStemmedWordSet(String queryString) { Set<String> uniqueTerms = Sets.newHashSet(queryString.toLowerCase().trim().split(NON_WORD_SEPARATOR)).stream() .filter(term -> !NGramDistanceAlgorithm.STOPWORDSLIST.contains(term)) .map(Stemmer::stem) .filter(StringUtils::isNotBlank) .collect(Collectors.toSet()); return Sets.newHashSet(uniqueTerms); }
InformationContentService { public Set<String> createStemmedWordSet(String queryString) { Set<String> uniqueTerms = Sets.newHashSet(queryString.toLowerCase().trim().split(NON_WORD_SEPARATOR)).stream() .filter(term -> !NGramDistanceAlgorithm.STOPWORDSLIST.contains(term)) .map(Stemmer::stem) .filter(StringUtils::isNotBlank) .collect(Collectors.toSet()); return Sets.newHashSet(uniqueTerms); } }
InformationContentService { public Set<String> createStemmedWordSet(String queryString) { Set<String> uniqueTerms = Sets.newHashSet(queryString.toLowerCase().trim().split(NON_WORD_SEPARATOR)).stream() .filter(term -> !NGramDistanceAlgorithm.STOPWORDSLIST.contains(term)) .map(Stemmer::stem) .filter(StringUtils::isNotBlank) .collect(Collectors.toSet()); return Sets.newHashSet(uniqueTerms); } InformationContentService(DataService dataService); }
InformationContentService { public Set<String> createStemmedWordSet(String queryString) { Set<String> uniqueTerms = Sets.newHashSet(queryString.toLowerCase().trim().split(NON_WORD_SEPARATOR)).stream() .filter(term -> !NGramDistanceAlgorithm.STOPWORDSLIST.contains(term)) .map(Stemmer::stem) .filter(StringUtils::isNotBlank) .collect(Collectors.toSet()); return Sets.newHashSet(uniqueTerms); } InformationContentService(DataService dataService); Map<String, Double> redistributedNGramScore(String queryString, String ontologyIri); Set<String> createStemmedWordSet(String queryString); }
InformationContentService { public Set<String> createStemmedWordSet(String queryString) { Set<String> uniqueTerms = Sets.newHashSet(queryString.toLowerCase().trim().split(NON_WORD_SEPARATOR)).stream() .filter(term -> !NGramDistanceAlgorithm.STOPWORDSLIST.contains(term)) .map(Stemmer::stem) .filter(StringUtils::isNotBlank) .collect(Collectors.toSet()); return Sets.newHashSet(uniqueTerms); } InformationContentService(DataService dataService); Map<String, Double> redistributedNGramScore(String queryString, String ontologyIri); Set<String> createStemmedWordSet(String queryString);  }