Package opennlp.tools.formats.masc
Class MascSentence
- java.lang.Object
- 
- opennlp.tools.util.Span
- 
- opennlp.tools.formats.masc.MascSentence
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<Span>
 
 public class MascSentence extends Span - See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description MascSentence(int s, int e, String text, List<MascWord> sentenceQuarks, List<MascWord> allQuarks)Initializes aMascSentencecontaining its associated text and quarks
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Span>getNamedEntities()StringgetSentDetectText()List<String>getTags()List<Span>getTokensSpans()Retrieves the boundaries of individual tokens.List<String>getTokenStrings()StringgetTokenText()- 
Methods inherited from class opennlp.tools.util.SpancompareTo, contains, contains, crosses, equals, getCoveredText, getEnd, getProb, getStart, getType, hashCode, intersects, length, spansToStrings, spansToStrings, startsWith, toString, trim
 
- 
 
- 
- 
- 
Constructor Detail- 
MascSentencepublic MascSentence(int s, int e, String text, List<MascWord> sentenceQuarks, List<MascWord> allQuarks)Initializes aMascSentencecontaining its associated text and quarks- Parameters:
- s- Start of the sentence within the corpus file
- e- End of the sentence within the corpus file
- text- The reference to text of the corpus file
- sentenceQuarks- The quarks found in that sentence
- allQuarks- The reference to a list of all quarks in the file
 
 
- 
 - 
Method Detail- 
getNamedEntitiespublic List<Span> getNamedEntities() - Returns:
- Retrieves the named entities, e.g.Span(1,3, "org")for tokens [1,3).
 
 - 
getSentDetectTextpublic String getSentDetectText() - Returns:
- Retrieves text of the sentence as defined by the sentence segmentation annotation.
 
 - 
getTokenTextpublic String getTokenText() - Returns:
- Retrieves text of the sentence as defined by the tokens in it.
 
 - 
getTokenStringspublic List<String> getTokenStrings() - Returns:
- The texts of the individual tokens in the sentence
 
 - 
getTokensSpanspublic List<Span> getTokensSpans() Retrieves the boundaries of individual tokens.- Returns:
- The spansrepresenting the tokens of the sentence, according to Penn tokenization.
 
 - 
getTagspublic List<String> getTags() throws IOException - Returns:
- Get the (individual) tags of tokens in the sentence.
- Throws:
- IOException- Thrown if used on an un-tokenized sentence.
 
 
- 
 
-