void addSymbol(fsmTree_t tree, const Uchar sym)
Adds a new symbol to this tree node.
fsmTree_t initFsmTree()
Creates and initializes a new fsm tree structure instance.
void printContext(fsmTree_t tree)
struct fsmTree ** transitions
List of FSM transitions from this state.
BOOL isRootFsmTree(const fsmTree_t tree)
Indicates if the parameter node is the root of the tree.
Uint getHeight(const fsmTree_t tree)
unsigned char Uchar
Unsigned char type.
BOOL used
Flag that indicates if this node has been used to encode a symbol.
BOOL * traversed
List of flags indicating an attempt was made to traverse each child edge.
struct fsmTree * origin
Pointer to the original node this one descends from.
unsigned long Uint
Unsigned int type.
#define BOOL
Boolean data type.
Uint * count
List containing the number of occurrences of each character in this state.
Encoder context tree structure.
void writeFsmTree(const fsmTree_t tree, FILE *file)
Writes this tree into a file.
struct obstack nodeStack
Obstack used to allocate memory for this tree.
Uint right
Index of the rightmost character of this node label in the input string.
struct fsmTree * fsmTree_t
Encoder context tree structure.
Uint left
Index of the leftmost character of this node label in the input string.
Uint totalSyms
Total number of symbols occuring at this state.
void makeFsm(fsmTree_t tree)
Calculates the FSM closure of this tree.
struct fsmTree ** children
List of pointers to all the children of this node.
void copyStatistics(const fsmTree_t orig, fsmTree_t dest, const Uchar *text2)
struct fsmTree * tail
Pointer to the node whose label is the tail of this one.
struct fsmTree * parent
Pointer to the parent of this node.
void freeFsmTree(fsmTree_t tree)
Deletes a fsm tree structure instance.
Uint length
Distance from this node to the root of the tree.
void compareTrees(const fsmTree_t treeA, const fsmTree_t treeB)