public List <string> Search(string[] strings) { /* * var newStrings = InitAlphaEngine(strings).ToList(); * foreach (var newString in newStrings) * { * AddWord(newString.Trim()); * } */ InitAlphaEngine(strings).ToList().ForEach(word => AddWord(word.Trim())); return(_alphaEngine.ExecuteQuery()); }
public void ExecuteQueryTest() { _alphaEngine = new AlphaEngine(_map); AlphaEngine alphaEngine = _alphaEngine.AddMustIncludes("The", "WitcheR", "A").AddLeastIncludes("HunTeR", "Bank"); AlphaEngine copyAlphaEngine = alphaEngine.Clone(); Assert.Equal(new List <string>() { "1.txt", "2.txt", "3.txt" }, alphaEngine.ExecuteQuery()); Assert.Equal(new List <string>() { "2.txt" }, copyAlphaEngine.AddExcludes("role-playing").ExecuteQuery()); }