@Test public void testIsStopword() { List<String> stopwords = Arrays.asList("stop", "word"); assertTrue(StopwordUtils.isStopWord("stop", stopwords, false)); assertTrue(StopwordUtils.isStopWord("STOP", stopwords, false)); assertFalse(StopwordUtils.isStopWord("STOP", stopwords, true)); assertTrue(StopwordUtils.isStopWord("stop", stopwords, true)); assertFalse(StopwordUtils.isStopWord("hello", stopwords, false)); assertFalse(StopwordUtils.isStopWord("hello", stopwords, true)); }
public static boolean isStopWord( String word, Collection<String> stopwords, Boolean caseSensitive) { if (!caseSensitive) { return stopwords.stream().filter(s -> s.equalsIgnoreCase(word)).count() >= 1; } else { return stopwords.contains(word); } }
StopwordUtils { public static boolean isStopWord( String word, Collection<String> stopwords, Boolean caseSensitive) { if (!caseSensitive) { return stopwords.stream().filter(s -> s.equalsIgnoreCase(word)).count() >= 1; } else { return stopwords.contains(word); } } }
StopwordUtils { public static boolean isStopWord( String word, Collection<String> stopwords, Boolean caseSensitive) { if (!caseSensitive) { return stopwords.stream().filter(s -> s.equalsIgnoreCase(word)).count() >= 1; } else { return stopwords.contains(word); } } private  StopwordUtils(); }
StopwordUtils { public static boolean isStopWord( String word, Collection<String> stopwords, Boolean caseSensitive) { if (!caseSensitive) { return stopwords.stream().filter(s -> s.equalsIgnoreCase(word)).count() >= 1; } else { return stopwords.contains(word); } } private  StopwordUtils(); static Pattern buildStopwordPattern(
      Collection<String> stopwords, Boolean caseSensitive, String... additionalTerms); static boolean isStopWord(
      String word, Collection<String> stopwords, Boolean caseSensitive); }
StopwordUtils { public static boolean isStopWord( String word, Collection<String> stopwords, Boolean caseSensitive) { if (!caseSensitive) { return stopwords.stream().filter(s -> s.equalsIgnoreCase(word)).count() >= 1; } else { return stopwords.contains(word); } } private  StopwordUtils(); static Pattern buildStopwordPattern(
      Collection<String> stopwords, Boolean caseSensitive, String... additionalTerms); static boolean isStopWord(
      String word, Collection<String> stopwords, Boolean caseSensitive);  }