Class StopWords

    • Constructor Detail

      • StopWords

        public StopWords()
    • Method Detail

      • getStopWords

        public static StopWords getStopWords​(Language language)
        Gets the Stopwords instance for the given language.
        Parameters:
        language - the language
        Returns:
        the Stopwords instance
      • hasOnlyContentWords

        public static SerializablePredicate<HString> hasOnlyContentWords()
        Returns:
        predicate returning true when all tokens in the given HString are content words (i.e. not a stopword)
      • hasStopWord

        public static SerializablePredicate<HString> hasStopWord()
        Returns:
        predicate returning true when any token in a given HString is a stopword
      • isContentWord

        public static SerializablePredicate<HString> isContentWord()
        Returns:
        predicate returning true when the given HString is a content word (i.e. not a stopword)
      • hasStopWord

        public boolean hasStopWord​(HString text)
        Returns true when any token in a given HString is a stopword
        Parameters:
        text - the text
        Returns:
        true when any token in a given HString is a stopword
      • isStopWord

        public boolean isStopWord​(HString text)
        Checks if the given text is a stopword
        Parameters:
        text - the text
        Returns:
        True if a stopword, False if a content word.
      • isStopWord

        public abstract boolean isStopWord​(String word)
        Checks if the given word is a stopword
        Parameters:
        word - the word
        Returns:
        True if a stopword, False if a content word.
      • isTokenStopWord

        protected abstract boolean isTokenStopWord​(Annotation token)
        Checks if the given token is a stopword
        Parameters:
        token - the token
        Returns:
        True if a stopword, False if a content word.