Beispiel #1
0
        public void ImperativeWordParserTest()
        {
            var words = _wordParser.Parse("glob prok Gold is 57800 Credits");

            Assert.IsTrue(1 <= words.Count(p => p.Type == WordType.Constant));
            Assert.AreEqual(1, words.Count(p => p.Type == WordType.Product));
            Assert.AreEqual(1, words.Count(p => p.Type == WordType.Operator));
            Assert.AreEqual(1, words.Count(p => p.Type == WordType.Number));
            Assert.AreEqual(1, words.Count(p => p.Type == WordType.Unit));
        }
 /// <summary>
 /// Parse method parses a given input string content to its equivalent sentence.
 /// </summary>
 /// <param name="content">Input sentence in string format.</param>
 /// <returns>Well formed parsed sentence.</returns>
 public Sentence Parse(string content)
 {
     var sentence = new Sentence(_wordParser.Parse(content));
     sentence.TypeDefinition = DetermineSentenceType(sentence);
     return sentence;
 }