Package WordUtils :: Module dawg :: Class Node
[show private | hide private]
[frames | no frames]

Class Node


Class representing a node in an in-memory trie or dawg.
Method Summary
  __init__(self, key)
Default constructor.
  addChild(self, key)
Adds a child with the given key, or return existing child with same key.
  getChild(self, key)
Returns the child (if any) having the indicated key.
  getChildValues(self)
Returns the values of this node's children.
  hasChild(self, key)
Indicates whether node has a child with the indicated key.

Class Variable Summary
dict children
staticmethod commonValues
staticmethod compare
int endpoint
staticmethod merge
NoneType value

Method Details

__init__(self, key=None)
(Constructor)

Default constructor.
Parameters:
key - key to be used to construct this node
           (type=single-character string)

addChild(self, key)

Adds a child with the given key, or return existing child with same key.
Parameters:
key - key to be used to construct this node
           (type=single-character string)
Returns:
the new or existing child as an Node instance

getChild(self, key)

Returns the child (if any) having the indicated key.
Parameters:
key - key used to search for a child.
           (type=single-character string)
Returns:
child as Node instance or None if no child has the indicated key

getChildValues(self)

Returns the values of this node's children.
Returns:
list of children as Node instances

hasChild(self, key)

Indicates whether node has a child with the indicated key.
Parameters:
key - key used to search for a child.
           (type=single-character string)
Returns:
boolean True/False

Class Variable Details

children

Type:
dict
Value:
{}                                                                     

commonValues

Type:
staticmethod
Value:
<staticmethod object at 0x81ad794>                                     

compare

Type:
staticmethod
Value:
<staticmethod object at 0x8198f04>                                     

endpoint

Type:
int
Value:
0                                                                      

merge

Type:
staticmethod
Value:
<staticmethod object at 0x819da64>                                     

value

Type:
NoneType
Value:
None                                                                   

Generated by Epydoc 1.1 on Mon Sep 8 16:37:49 2003 http://epydoc.sf.net