#include <StringTreeNode.h>
Public Member Functions | |
StringTreeNode (string name) | |
~StringTreeNode (void) | |
void | attachSuffix (StringTreeNode *nodeRef) |
void | pushCount () |
void | normalize (float absCt) |
void | truncate () |
void | sortByDensity () |
list< StringTreeNode * > & | getChildren () |
string | getName () |
float | getDensity () |
void | cleanup () |
Private Attributes | |
string | myName |
float | density |
list< StringTreeNode * > | children |
StringTreeNode::StringTreeNode | ( | string | name | ) |
Constructs a new node with the given term
StringTreeNode::~StringTreeNode | ( | void | ) |
void StringTreeNode::attachSuffix | ( | StringTreeNode * | nodeRef | ) |
Attaches a new suffix as child node
void StringTreeNode::cleanup | ( | ) |
Frees memory recursively
list< StringTreeNode * > & StringTreeNode::getChildren | ( | ) |
Returns a reference to the child nodes
float StringTreeNode::getDensity | ( | ) |
Returns the relative density
std::string StringTreeNode::getName | ( | ) |
Returns the contained term
void StringTreeNode::normalize | ( | float | absCt | ) |
Normalizes the frequency of this term in the text to the interval [ 0, 1 ], where absCt is the total count of words in the text
void StringTreeNode::pushCount | ( | ) |
Increases the number of occurences of this term in the text by one
void StringTreeNode::sortByDensity | ( | ) |
Sorts the child nodes by their density
void StringTreeNode::truncate | ( | ) |
Nodes containing only one child node are merged to a common node
list< StringTreeNode* > StringTreeNode::children [private] |
float StringTreeNode::density [private] |
string StringTreeNode::myName [private] |