Package banner.types
Class Sentence
- java.lang.Object
-
- banner.types.Sentence
-
public class Sentence extends Object
This class represents a single sentence, and provides for the text to be tokenized and for mentions.- Author:
- Bob
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSentence.OverlapOption
-
Method Summary
-
-
-
Method Detail
-
addToken
public void addToken(Token token)
- Parameters:
token-
-
countWhitespace
public int countWhitespace(int index)
-
addMention
public boolean addMention(Mention mention)
Adds aMentionto this Sentence, ignoring any potential overlap with existingMentions. Normally called by instance ofTaggeror post-processors.- Parameters:
mention-
-
removeMention
public boolean removeMention(Mention mention)
-
getDocumentId
public String getDocumentId()
-
getTokenIndex
public int getTokenIndex(int charIndex, boolean returnNextIfBoundary)
-
getText
public String getText(int start, int end)
-
getMentions
public List<Mention> getMentions(Mention.MentionType mentionType)
-
getTokenLabels
public List<String> getTokenLabels(TagFormat format, Set<Mention.MentionType> mentionTypes, Sentence.OverlapOption sameType, Sentence.OverlapOption differentType)
-
getMentions
public List<Mention> getMentions(Token token, Set<Mention.MentionType> mentionTypes)
-
setIdentification
public EntityIdentification setIdentification(Mention mention, EntityIdentification identification)
-
getIdentification
public EntityIdentification getIdentification(Mention mention)
-
copy
public Sentence copy(boolean includeTokens, boolean includeMentions)
-
-