rita.support
Interface RiTextNode

All Known Implementing Classes:
TextNode

public interface RiTextNode


Method Summary
 RiTextNode addChild(char c, int initialCount)
           
 RiTextNode addChild(java.lang.String newToken)
          If the newToken does not exist as a child, creates a new child node with a frequency of 1 (e.g., else increments the existing child node's frequency by 1.
 RiTextNode addChild(java.lang.String newToken, int initialCount)
          If the newToken does not exist as a child, creates a new child node with initialCount as its frequency (e.g., for smoothing), else increments the existing child nodes frequency by 1
 java.lang.String asTree(boolean sort)
           
 java.util.Iterator childIterator()
           
 int compareTo(java.lang.Object o)
           
 java.util.Map getChildMap()
           
 java.util.Collection getChildNodes()
           
 java.util.List getChildNodes(java.lang.String regex)
          Returns a List of all children matching the supplied regular expression.
 int getCount()
           
 float getProbability()
           
 java.lang.String getToken()
           
 boolean hasChildren()
           
 boolean hasChildren(java.lang.String regex)
          Return true if the node has at least one child matching the given regular expression (if one is supplied).
 int increment()
           
 boolean isIgnoringCase()
           
 boolean isLeaf()
           
 boolean isRoot()
           
 boolean isSentenceStart()
           
 RiTextNode lookup(char charToLookup)
          Does a lookup on the children of this node and returns any nodes that match charToLookup, else returns null.
 RiTextNode lookup(RiTextNode tokenToLookup)
          Does a lookup on the children of this node and returns any nodes that match tokenToLookup, else returns null.
 RiTextNode lookup(java.lang.String tokenToLookup)
          Does a lookup on the children of this node and returns any nodes that match tokenToLookup, else returns null.
 int numChildren()
          Returns number of children of this node
 void pathFromRoot(java.util.Stack result)
           
 RiTextNode selectChild()
           
 RiTextNode selectChild(boolean probabalisticSelect)
           
 RiTextNode selectChild(java.lang.String regex, boolean probabalisticSelect)
           
 void setCount(int initialCount)
           
 void setIgnoreCase(boolean b)
           
 void setIsSentenceStart(boolean isSentenceStart)
           
 java.lang.String toString()
           
 int uniqueCount()
           
 

Method Detail

addChild

RiTextNode addChild(java.lang.String newToken)
If the newToken does not exist as a child, creates a new child node with a frequency of 1 (e.g., else increments the existing child node's frequency by 1.

Parameters:
newToken -
Returns:
the child node

addChild

RiTextNode addChild(char c,
                    int initialCount)

addChild

RiTextNode addChild(java.lang.String newToken,
                    int initialCount)
If the newToken does not exist as a child, creates a new child node with initialCount as its frequency (e.g., for smoothing), else increments the existing child nodes frequency by 1

Parameters:
newToken -
initialCount -
Returns:
the child node

getToken

java.lang.String getToken()

getCount

int getCount()

increment

int increment()

toString

java.lang.String toString()
Overrides:
toString in class java.lang.Object

isRoot

boolean isRoot()

pathFromRoot

void pathFromRoot(java.util.Stack result)

uniqueCount

int uniqueCount()

getProbability

float getProbability()

childIterator

java.util.Iterator childIterator()

numChildren

int numChildren()
Returns number of children of this node


compareTo

int compareTo(java.lang.Object o)

lookup

RiTextNode lookup(java.lang.String tokenToLookup)
Does a lookup on the children of this node and returns any nodes that match tokenToLookup, else returns null.


lookup

RiTextNode lookup(RiTextNode tokenToLookup)
Does a lookup on the children of this node and returns any nodes that match tokenToLookup, else returns null.


lookup

RiTextNode lookup(char charToLookup)
Does a lookup on the children of this node and returns any nodes that match charToLookup, else returns null.


getChildNodes

java.util.Collection getChildNodes()

asTree

java.lang.String asTree(boolean sort)

isLeaf

boolean isLeaf()

setIgnoreCase

void setIgnoreCase(boolean b)

isIgnoringCase

boolean isIgnoringCase()

selectChild

RiTextNode selectChild()

selectChild

RiTextNode selectChild(boolean probabalisticSelect)

selectChild

RiTextNode selectChild(java.lang.String regex,
                       boolean probabalisticSelect)

getChildNodes

java.util.List getChildNodes(java.lang.String regex)
Returns a List of all children matching the supplied regular expression.

Parameters:
regex -
Returns:
a List of matching children or null if none are found.

hasChildren

boolean hasChildren(java.lang.String regex)
Return true if the node has at least one child matching the given regular expression (if one is supplied).


hasChildren

boolean hasChildren()

getChildMap

java.util.Map getChildMap()

isSentenceStart

boolean isSentenceStart()

setIsSentenceStart

void setIsSentenceStart(boolean isSentenceStart)

setCount

void setCount(int initialCount)