|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopennlp.tools.parser.AbstractContextGenerator
public abstract class AbstractContextGenerator
Abstract class containing many of the methods used to generate contexts for parsing.
| Field Summary | |
|---|---|
protected static java.lang.String |
EOS
|
protected java.util.Set |
punctSet
Set of punctuation to be used in generating features. |
protected boolean |
useLabel
|
protected boolean |
zeroBackOff
|
| Constructor Summary | |
|---|---|
AbstractContextGenerator()
|
|
| Method Summary | |
|---|---|
protected void |
checkcons(Parse p1,
Parse p2,
java.lang.String type,
java.util.List features)
|
protected void |
checkcons(Parse child,
java.lang.String i,
java.lang.String type,
java.util.List features)
Produces features to determine whether the specified child node is part of a complete constituent of the specified type and adds those features to the specfied list. |
protected java.lang.String |
cons(Parse p,
int i)
|
protected void |
cons2(java.util.List features,
Cons c0,
Cons c1,
java.util.Collection punct1s,
boolean bigram)
|
protected void |
cons3(java.util.List features,
Cons c0,
Cons c1,
Cons c2,
java.util.Collection punct1s,
java.util.Collection punct2s,
boolean trigram,
boolean bigram1,
boolean bigram2)
Creates cons features involving the 3 specified nodes and adds them to the specified feature list. |
protected java.lang.String |
consbo(Parse p,
int i)
|
protected void |
getFrontierNodes(java.util.List rf,
Parse[] nodes)
Populates specified nodes array with left-most right frontier node with a unique head. |
protected java.lang.String |
production(Parse p,
boolean includePunctuation)
Generates a string representing the grammar rule production that the specified parse is starting. |
protected java.lang.String |
punct(Parse punct,
int i)
Creates punctuation feature for the specified punctuation at the specified index based on the punctuation mark. |
protected java.lang.String |
punctbo(Parse punct,
int i)
Creates punctuation feature for the specified punctuation at the specfied index based on the punctuation's tag. |
protected void |
surround(Parse node,
int i,
java.lang.String type,
java.util.Collection punctuation,
java.util.List features)
Generates features for nodes surrounding a completed node of the specified type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String EOS
protected boolean zeroBackOff
protected java.util.Set punctSet
protected boolean useLabel
| Constructor Detail |
|---|
public AbstractContextGenerator()
| Method Detail |
|---|
protected java.lang.String punct(Parse punct,
int i)
punct - The punctuation which is in context.i - The index of the punctuation with relative to the parse.
protected java.lang.String punctbo(Parse punct,
int i)
punct - The punctuation which is in context.i - The index of the punctuation relative to the parse.
protected java.lang.String cons(Parse p,
int i)
protected java.lang.String consbo(Parse p,
int i)
protected java.lang.String production(Parse p,
boolean includePunctuation)
p - The parse which stats teh production.includePunctuation - Whether punctuation should be included in the production.
protected void cons2(java.util.List features,
Cons c0,
Cons c1,
java.util.Collection punct1s,
boolean bigram)
protected void cons3(java.util.List features,
Cons c0,
Cons c1,
Cons c2,
java.util.Collection punct1s,
java.util.Collection punct2s,
boolean trigram,
boolean bigram1,
boolean bigram2)
features - The list of features.c0 - The first node.c1 - The second node.c2 - The third node.punct1s - The punctuation between the first and second node.punct2s - The punctuation between the second and third node.trigram - Specifies whether lexical tri-gram features between these nodes should be generated.bigram1 - Specifies whether lexical bi-gram features between the first and second node should be generated.bigram2 - Specifies whether lexical bi-gram features between the second and third node should be generated.
protected void surround(Parse node,
int i,
java.lang.String type,
java.util.Collection punctuation,
java.util.List features)
node - A surrounding node.i - The index of the surrounding node with respect to the completed node.type - The type of the completed node.punctuation - The punctuation adjacent and between the specified surrounding node.features - A list to which features are added.
protected void checkcons(Parse child,
java.lang.String i,
java.lang.String type,
java.util.List features)
child - The parse node to consider.i - A string indicating the position of the child node.type - The type of constituent being built.features - List to add features to.
protected void checkcons(Parse p1,
Parse p2,
java.lang.String type,
java.util.List features)
protected void getFrontierNodes(java.util.List rf,
Parse[] nodes)
rf - The current right frontier.nodes - The array to be populated.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||