Class ParseSentence

    • Method Detail

      • appendWord

        public void appendWord​(ParseWord word)
        Appends a word to the sentence. See also addWord(ParseWord).
        Parameters:
        word - the word that should be appended
      • prependWord

        public void prependWord​(ParseWord word)
        Prepends a word to the sentence.
        Parameters:
        word - the word that should be prepended
      • addWord

        public void addWord​(ParseWord word)
        Adds a word to the end of the sentence.
        Parameters:
        word - the word that should be added
      • addWord

        public void addWord​(ParseWord word,
                            int position)
        Adds a word to the given position within the sentence.
        Parameters:
        word - the word that should be added
        position - position where the word should be added
      • contains

        public boolean contains​(Word word)
        Checks whether the sentence contains a given word.
        Parameters:
        word - Word that should be checked for
        Returns:
        true if the sentence contains the word
      • containsPhrase

        public boolean containsPhrase​(Phrase phrase)
        Checks whether the sentence contains a given phrase.
        Parameters:
        phrase - phrase that should be checked for
        Returns:
        true if the sentence contains the phrase
      • getPhrasesOfType

        public List<ParsePhrase> getPhrasesOfType​(PhraseType type)
        Specified by:
        getPhrasesOfType in interface Sentence
        Parameters:
        type - type of phrase
        Returns:
        list of phrase of the specific phrasetype contained in the sentence
      • getPhrases

        public org.eclipse.collections.api.list.MutableList<ParsePhrase> getPhrases()
        Specified by:
        getPhrases in interface Sentence
        Returns:
        returns the phrases of this sentence
      • getWords

        public org.eclipse.collections.api.list.MutableList<ParseWord> getWords()
        Specified by:
        getWords in interface Sentence
        Returns:
        the words contained in the sentence
      • getDocument

        public Document getDocument()
        Specified by:
        getDocument in interface Sentence
        Returns:
        the document the sentence is contained in
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object