Package opennlp.tools.chunker
Klasse ChunkSample
java.lang.Object
opennlp.tools.chunker.ChunkSample
- Alle implementierten Schnittstellen:
Serializable,Sample
Class for holding chunks for a single unit of text.
- Siehe auch:
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungChunkSample(String[] sentence, String[] tags, String[] preds) Initializes aChunkSampleinstance.Initializes aChunkSampleinstance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanSpan[]String[]getPreds()String[]String[]getTags()inthashCode()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) Create arrays ofspansof phrases.toString()
-
Konstruktordetails
-
ChunkSample
Initializes aChunkSampleinstance.- Parameter:
sentence- The training sentence.tags- The POS tags for thesentence.preds- The chunk tags in B-* I-* notation.
-
ChunkSample
Initializes aChunkSampleinstance.- Parameter:
sentence- The training sentence.tags- The POS tags for thesentence.preds- The chunk tags in B-* I-* notation.
-
-
Methodendetails
-
getSentence
- Gibt zurück:
- Retrieves the training sentence.
-
getTags
- Gibt zurück:
- Retrieves the POS Tags for the sentence.
-
getPreds
- Gibt zurück:
- Retrieves the chunk tags in B-* I-* notation.
-
getPhrasesAsSpanList
- Gibt zurück:
- the phrases as an array of spans.
-
phrasesAsSpanList
Create arrays ofspansof phrases.- Parameter:
aSentence- The training sentence.aTags- The POS tags for thesentence.aPreds- The chunk tags in B-* I-* notation.- Gibt zurück:
- 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 ] ._.- Gibt zurück:
- A nice to read string representation of the chunk phases
-
toString
-
hashCode
public int hashCode() -
equals
-