public void IdentifyNotExist() { var config = new ConfigurationBuilder().AddIntent("foobar", "verbatim", new List <string>() { "aho" }, new Dictionary <string, string>()).Build(); var identifier = new IntentIdentifier(config); Assert.AreEqual(IntentIdentifier.NO_MATCH_EXIST, identifier.Identify("perl is not a researcher.", state).Name); }
public void IdentifyIntentWithVerbatimOnCapitalCaseTest() { var config = new ConfigurationBuilder().AddIntent("foobar", "verbatim", new List <string>() { "Aho" }, new Dictionary <string, string>()).Build(); var identifier = new IntentIdentifier(config); Assert.AreEqual("foobar", identifier.Identify("aho is a researcher.", state).Name); }
public void IdentityIntentWithTemplateMatcherOnCapitalCaseTest2() { var config = new ConfigurationBuilder().AddIntent("ingredient", "template", new List <string>() { "this is a ${ingredient1}" }, new Dictionary <string, string>() { { "ingredient1", "ingredient" } }) .AddType("ingredient", new List <string>() { "potato", "cherry" }).Build(); var identifier = new IntentIdentifier(config); Assert.AreEqual("ingredient", identifier.Identify("this is a Potato", state).Name); }
public void IdentityNotMatchWithTemplateMatcher() { var config = new ConfigurationBuilder().AddIntent("ingredient", "template", new List <string>() { "this is a ${ingredient1}" }, new Dictionary <string, string>() { { "ingredient1", "ingredient" } }) .AddType("ingredient", new List <string>() { "potato", "cherry" }).Build(); var identifier = new IntentIdentifier(config); Assert.AreEqual(IntentIdentifier.NO_MATCH_EXIST, identifier.Identify("this is a UFO", state).Name); }
public void SaveSlotValueToStateWithMatchWithTemplateMatcher() { var config = new ConfigurationBuilder().AddIntent("ingredient", "template", new List <string>() { "this is a ${ingredient1}" }, new Dictionary <string, string>() { { "ingredient1", "ingredient" } }) .AddType("ingredient", new List <string>() { "potato", "cherry" }).Build(); var identifier = new IntentIdentifier(config); Assert.AreEqual("ingredient", identifier.Identify("this is a potato", state).Name); Assert.AreEqual("potato", state.GetString("ingredient1")); }