public void MatchNumber() { const string str = "123"; var d = new Decomposition("#", Array.Empty <string>()); var matches = d.Match(str, _synonyms); Assert.IsNotNull(matches); Assert.AreEqual("123", matches[0]); }
public void TildeIsIgnored() { const string str = "abc ~123"; var d = new Decomposition("*", Array.Empty <string>()); var matches = d.Match(str, _synonyms); Assert.IsNotNull(matches); Assert.AreEqual(str, matches[0]); }
public void MatchStringWithSpace() { const string str = "abc 123"; var d = new Decomposition("* *", Array.Empty <string>()); var matches = d.Match(str, _synonyms); Assert.IsNotNull(matches); Assert.AreEqual("abc", matches[0]); Assert.AreEqual("123", matches[1]); }
public void BrotherRegression() { const string str = "my brother is philip"; var d = new Decomposition("*my* brother *", Array.Empty <string>()); var matches = d.Match(str, _synonyms); Assert.IsNotNull(matches); Assert.AreEqual("", matches[0]); Assert.AreEqual("", matches[1]); Assert.AreEqual("is philip", matches[2]); }
public void MatchWithSynonyms() { const string str = "hello aa bb ccc world"; var d = new Decomposition("* @a @b @c *", Array.Empty <string>()); var matches = d.Match(str, _synonyms); Assert.IsNotNull(matches); Assert.AreEqual("hello", matches[0]); Assert.AreEqual("aa", matches[1]); Assert.AreEqual("bb", matches[2]); Assert.AreEqual("ccc", matches[3]); Assert.AreEqual("world", matches[4]); }