|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kylm.model.ngram.NgramNode
public class NgramNode
A single node in a tree holding n-gram data
Nested Class Summary | |
---|---|
static class |
NgramNode.NgramNodeIdComparator
|
Field Summary | |
---|---|
static int |
ADD_BRANCH
|
static int |
ADD_LEAF
|
static int |
ADD_NONE
|
static float |
TRIM_SCORE
|
Constructor Summary | |
---|---|
NgramNode(int id,
NgramNode parent)
Create a new NgramNode that represents id and has a parent parent |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
float |
getBackoffScore()
|
NgramNode |
getChild(int id)
Get a child from the child vector, return null if no child exists. |
NgramNode |
getChild(int id,
int add)
Get a child from the child vector. |
int |
getChildCount()
|
int |
getCount()
|
NgramNode |
getFallback()
Get the node to be fallen back to when the context doesn't exist. |
int |
getId()
|
NgramNode |
getParent()
|
float |
getScore()
|
boolean |
hasChildren()
Return whether this node has children or not |
void |
incrementCount()
|
java.util.Iterator<NgramNode> |
iterator()
|
void |
setBackoffScore(float backoff)
|
void |
setChildren(java.util.Vector<NgramNode> children)
|
void |
setCount(int count)
|
void |
setId(int id)
|
void |
setParent(NgramNode parent)
|
void |
setScore(float score)
|
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ADD_NONE
public static final int ADD_LEAF
public static final int ADD_BRANCH
public static final float TRIM_SCORE
Constructor Detail |
---|
public NgramNode(int id, NgramNode parent)
id
- The id of the symbol represented by this ngramparent
- The parent of this ngram in the treeMethod Detail |
---|
public NgramNode getChild(int id)
id
- The id of the child to find.
public NgramNode getChild(int id, int add)
id
- The id of the child to find.add
- Whether or not to add the child if it exists.
public boolean hasChildren()
public NgramNode getFallback()
public final NgramNode getParent()
public final void setParent(NgramNode parent)
public final int getId()
public final void setId(int id)
public final int getCount()
public final void setCount(int count)
public final float getScore()
public final void setScore(float score)
public float getBackoffScore()
public void setBackoffScore(float backoff)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public final void incrementCount()
public void setChildren(java.util.Vector<NgramNode> children)
public java.util.Iterator<NgramNode> iterator()
iterator
in interface java.lang.Iterable<NgramNode>
public int getChildCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |