Class ParsePhrase
- java.lang.Object
-
- edu.kit.ipd.are.archdoclink.nlp.parse.ParsePhrase
-
- All Implemented Interfaces:
Annotatable,Phrase,TextElement
public class ParsePhrase extends Object implements Phrase
-
-
Constructor Summary
Constructors Constructor Description ParsePhrase(String type)ParsePhrase(List<edu.kit.ipd.parse.luna.graph.INode> containedNodes, String type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWord(ParseWord word)Adds a word to the end of this phrase.voidaddWord(ParseWord word, int position)Adds a word at the given position to this phrase.voidannotate(Document document, Annotation annotation)Annotates the given annotation to the given documentvoidappendWord(ParseWord word)Appends a word to this phrase.booleancontainsWord(Word word)Checks whether a word is contained in the phrase.booleanequals(Object obj)StringgetText()StringgetTextWithoutLeadingStopwords()PhraseTypegetType()org.eclipse.collections.api.list.MutableList<ParseWord>getWords()inthashCode()voidprependWord(ParseWord word)Prepends a word to this phrase.StringtoString()
-
-
-
Method Detail
-
appendWord
public void appendWord(ParseWord word)
Appends a word to this phrase. Same asaddWord(ParseWord).- Parameters:
word- Word that should be added
-
prependWord
public void prependWord(ParseWord word)
Prepends a word to this phrase.- Parameters:
word- Word that should be added
-
addWord
public void addWord(ParseWord word)
Adds a word to the end of this phrase.- Parameters:
word- Word that should be added
-
addWord
public void addWord(ParseWord word, int position)
Adds a word at the given position to this phrase.- Parameters:
word- Word that should be addedposition- Position where the word should be inserted
-
getType
public PhraseType getType()
-
getWords
public org.eclipse.collections.api.list.MutableList<ParseWord> getWords()
-
containsWord
public boolean containsWord(Word word)
Description copied from interface:PhraseChecks whether a word is contained in the phrase.- Specified by:
containsWordin interfacePhrase- Parameters:
word- Word that should be checked for- Returns:
- true, if the given word is contained in the phrase, else false
-
getText
public String getText()
- Specified by:
getTextin interfaceTextElement- Returns:
- the text of the element
-
getTextWithoutLeadingStopwords
public String getTextWithoutLeadingStopwords()
- Specified by:
getTextWithoutLeadingStopwordsin interfacePhrase- Returns:
- String containing the text without any leading stopwords
-
annotate
public void annotate(Document document, Annotation annotation)
Description copied from interface:AnnotatableAnnotates the given annotation to the given document- Specified by:
annotatein interfaceAnnotatable- Parameters:
document- Document where the annotation should be added toannotation- Annotation that should be added
-
-