Class ParseSentence
- java.lang.Object
-
- edu.kit.ipd.are.archdoclink.nlp.parse.ParseSentence
-
- All Implemented Interfaces:
Annotatable,Identifiable,Sentence,TextElement
public class ParseSentence extends Object implements Sentence
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWord(ParseWord word)Adds a word to the end of the sentence.voidaddWord(ParseWord word, int position)Adds a word to the given position within the sentence.voidannotate(Annotation annotation)Annotates the sentence to the document.voidappendWord(ParseWord word)Appends a word to the sentence.booleancontains(Word word)Checks whether the sentence contains a given word.booleancontainsPhrase(Phrase phrase)Checks whether the sentence contains a given phrase.booleanequals(Object obj)DocumentgetDocument()StringgetId()List<ParsePhrase>getNounPhrases()org.eclipse.collections.api.list.MutableList<ParsePhrase>getPhrases()List<ParsePhrase>getPhrasesOfType(PhraseType type)StringgetText()org.eclipse.collections.api.list.MutableList<ParseWord>getWords()inthashCode()voidprependWord(ParseWord word)Prepends a word to the sentence.StringtoString()
-
-
-
Method Detail
-
appendWord
public void appendWord(ParseWord word)
Appends a word to the sentence. See alsoaddWord(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 addedposition- 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
-
getNounPhrases
public List<ParsePhrase> getNounPhrases()
- Specified by:
getNounPhrasesin interfaceSentence- Returns:
- list of noun phrase contained in the sentence
-
getPhrasesOfType
public List<ParsePhrase> getPhrasesOfType(PhraseType type)
- Specified by:
getPhrasesOfTypein interfaceSentence- 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:
getPhrasesin interfaceSentence- Returns:
- returns the phrases of this sentence
-
getText
public String getText()
- Specified by:
getTextin interfaceTextElement- Returns:
- the text of the element
-
getWords
public org.eclipse.collections.api.list.MutableList<ParseWord> getWords()
-
getId
public String getId()
- Specified by:
getIdin interfaceIdentifiable- Returns:
- the Id
-
getDocument
public Document getDocument()
- Specified by:
getDocumentin interfaceSentence- Returns:
- the document the sentence is contained in
-
annotate
public void annotate(Annotation annotation)
Description copied from interface:SentenceAnnotates the sentence to the document. Should be similar toSentence.annotate(Document, Annotation), but usesSentence.getDocument()for the document.
-
-