kylm.model.ngram
Class BranchNode
java.lang.Object
kylm.model.ngram.NgramNode
kylm.model.ngram.BranchNode
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Iterable<NgramNode>
public final class BranchNode
- extends NgramNode
- See Also:
- Serialized Form
Methods inherited from class kylm.model.ngram.NgramNode |
getChild, getCount, getFallback, getId, getParent, getScore, incrementCount, setCount, setId, setParent, setScore |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BranchNode
public BranchNode(int id,
NgramNode parent)
getChild
public NgramNode getChild(int id,
int add)
- Description copied from class:
NgramNode
- Get a child from the child vector. If add is true and no child exists, add
one. If add is false and no child exists, return null.
- Overrides:
getChild
in class NgramNode
- Parameters:
id
- The id of the child to find.add
- Whether or not to add the child if it exists.
- Returns:
- The child.
hasChildren
public boolean hasChildren()
- Description copied from class:
NgramNode
- Return whether this node has children or not
- Overrides:
hasChildren
in class NgramNode
getBackoffScore
public float getBackoffScore()
- Overrides:
getBackoffScore
in class NgramNode
setBackoffScore
public void setBackoffScore(float backoff)
- Overrides:
setBackoffScore
in class NgramNode
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class NgramNode
setChildren
public void setChildren(java.util.Vector<NgramNode> newChildren)
- Overrides:
setChildren
in class NgramNode
setChildrenSize
public void setChildrenSize(int size)
iterator
public java.util.Iterator<NgramNode> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<NgramNode>
- Overrides:
iterator
in class NgramNode
getChildCount
public int getChildCount()
- Overrides:
getChildCount
in class NgramNode