Package opennlp.tools.chunker
Class ChunkSample
java.lang.Object
opennlp.tools.chunker.ChunkSample
- All Implemented Interfaces:
Serializable
Class for holding chunks for a single unit of text.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanSpan[]Gets the phrases as an array of spansString[]getPreds()Gets the Chunk tags in B-* I-* notationString[]Gets the training sentenceString[]getTags()Gets the POS Tags for the sentenceinthashCode()Creates a nice to read string for the phrases formatted as following:
[NP Rockwell_NNP ] [VP said_VBD ] [NP the_DT agreement_NN ] [VP calls_VBZ ] [SBAR for_IN ] [NP it_PRP ] [VP to_TO supply_VB ] [NP 200_CD additional_JJ so-called_JJ shipsets_NNS ] [PP for_IN ] [NP the_DT planes_NNS ] ._.static Span[]phrasesAsSpanList(String[] aSentence, String[] aTags, String[] aPreds) Static method to create arrays of spans of phrasestoString()
-
Constructor Details
-
ChunkSample
Initializes the current instance.- Parameters:
sentence- training sentencetags- POS Tags for the sentencepreds- Chunk tags in B-* I-* notation
-
ChunkSample
Initializes the current instance.- Parameters:
sentence- training sentencetags- POS Tags for the sentencepreds- Chunk tags in B-* I-* notation
-
-
Method Details
-
getSentence
Gets the training sentence -
getTags
Gets the POS Tags for the sentence -
getPreds
Gets the Chunk tags in B-* I-* notation -
getPhrasesAsSpanList
Gets the phrases as an array of spans -
phrasesAsSpanList
Static method to create arrays of spans of phrases- Parameters:
aSentence- training sentenceaTags- POS Tags for the sentenceaPreds- Chunk tags in B-* I-* notation- Returns:
- the phrases as an array of spans
-
nicePrint
Creates a nice to read string for the phrases formatted as following:
[NP Rockwell_NNP ] [VP said_VBD ] [NP the_DT agreement_NN ] [VP calls_VBZ ] [SBAR for_IN ] [NP it_PRP ] [VP to_TO supply_VB ] [NP 200_CD additional_JJ so-called_JJ shipsets_NNS ] [PP for_IN ] [NP the_DT planes_NNS ] ._.- Returns:
- a nice to read string representation of the chunk phases
-
toString
-
hashCode
public int hashCode() -
equals
-