|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectopennlp.tools.chunker.ChunkSample
public class ChunkSample
Class for holding chunks for a single unit of text.
| Constructor Summary | |
|---|---|
ChunkSample(List<String> sentence,
List<String> tags,
List<String> preds)
Initializes the current instance. |
|
ChunkSample(String[] sentence,
String[] tags,
String[] preds)
Initializes the current instance. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
Span[] |
getPhrasesAsSpanList()
Gets the phrases as an array of spans |
String[] |
getPreds()
Gets the Chunk tags in B-* I-* notation |
String[] |
getSentence()
Gets the training sentence |
String[] |
getTags()
Gets the POS Tags for the sentence |
String |
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 ] ._. |
static Span[] |
phrasesAsSpanList(String[] aSentence,
String[] aTags,
String[] aPreds)
Static method to create arrays of spans of phrases |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ChunkSample(String[] sentence,
String[] tags,
String[] preds)
sentence - training sentencetags - POS Tags for the sentencepreds - Chunk tags in B-* I-* notation
public ChunkSample(List<String> sentence,
List<String> tags,
List<String> preds)
sentence - training sentencetags - POS Tags for the sentencepreds - Chunk tags in B-* I-* notation| Method Detail |
|---|
public String[] getSentence()
public String[] getTags()
public String[] getPreds()
public Span[] getPhrasesAsSpanList()
public static Span[] phrasesAsSpanList(String[] aSentence,
String[] aTags,
String[] aPreds)
aSentence - training sentenceaTags - POS Tags for the sentenceaPreds - Chunk tags in B-* I-* notation
public String nicePrint()
[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 ] ._.
public String toString()
toString in class Objectpublic boolean equals(Object obj)
equals in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||