Esempio n. 1
0
int main (int argc, char *argv[])
{
    // open file
    std::fstream file(argv[1], std::ios::in);
    // if file opened
    if (file)
    {
        // get each line and call the method to get the count
        std::string line;
        while (std::getline(file, line))
            SetCounts(line);
    }
    
    // close file
    file.close();
    return 0;
}
Esempio n. 2
0
void SuffixTree<Symb,NSymb>::TransformForPPM(PPMParam param_)
{
	param = param_;

	// compute counts of all nodes in the 'tree'
	SetCounts();

#	ifdef SUFTREE_CDAWG_SIZE
	cout << "No. of nodes: " << GetNNodes() << endl;
	cout << "No. of edges to remove if the tree were turned into CDAWG: " << GetSizeCDAWG() << endl;
#	endif

	// cut off unnecessary branches
	//if(param.valid_count > 1.0)
	//	Prune(ROOT, false);

	// set cumulative counts of nodes - field 'sum'
	// TODO: time - merge SetSums() and SetSuffix()
	SetSums();

	// set 'suf' links
	SetSuffix();
}