August 2018
Beginner
334 pages
10h 19m
English
Just like the N-Gram predictor, the building of the hierarchical version is a few steps long:
using System;
using System.Collections;
using System.Text;
public class HierarchicalNGramP<T>
{
public int threshold;
public NGramPredictor<T>[] predictors;
private int nValue;
}
public HierarchicalNGramP(int windowSize)
{
nValue = windowSize + 1;
predictors = new NGramPredictor<T>[nValue];
int i;
for (i = 0; i < nValue; i++)
predictors[i] = new NGramPredictor<T>(i + 1);
}
public void RegisterSequence(T[] actions) { int i; for (i = 0; i < nValue; i++) { T[] subactions = new ...Read now
Unlock full access