private static void CheckJsonEquivalent(StringTokens tokens, TokenPredictor l, TokenPredictor r) { var lString = l.ToJson(tokens); var rString = r.ToJson(tokens); Assert.AreEqual(lString, rString); }
public void CreateAlphabetTest() { var tokens = new StringTokens(); var predictor = new TokenPredictor(3); List <int> alphabet = GetAlphabet(tokens); predictor.AddSequence(alphabet, 1); var json = predictor.ToJson(tokens); Assert.AreEqual(AlphabetJson, json); }
public void CreateAlphabetLetterByLetterTest() { var tokens = new StringTokens(); var predictor = new TokenPredictor(3); var alphabet = GetAlphabet(tokens); var incrementalAlphabet = new List <int>(); foreach (var token in alphabet) { incrementalAlphabet.Add(token); predictor.AddSequenceTail(incrementalAlphabet, 1); } var json = predictor.ToJson(tokens); Assert.AreEqual(AlphabetJson, json); }