Example #1
0
        public void Tag()
        {
            var TestObject = new BrillTagger();
            var Tokenizer  = new DefaultTokenizer(new[] { new EnglishLanguage(new IEnglishTokenFinder[] { new Word(), new Whitespace(), new Symbol() }) });
            var Results    = TestObject.Tag(Tokenizer.Tokenize("I would go buy a computer.", TokenizerLanguage.EnglishRuleBased));

            Assert.Equal("NN VM VVB NN RR NN", Results.Where(x => x.TokenType == TokenType.Word).ToString(x => x.PartOfSpeech, " "));
        }
Example #2
0
        private static object NatLangTestHandler(string cmd, Request requestOrNull)
        {
            var    toks    = Tokenize(cmd);
            var    pos1    = POSTag(toks);
            var    pos2    = GetWordInfos(toks);
            string collect = "";

            for (int i = 0; i < toks.Count; i++)
            {
                string tw = (string)toks[i];
                string p1 = (string)pos1[i];
                string p2 = (string)pos2[i];
                string o  = tw + " " + p1 + " " + p2;
                collect += o + "\n";
            }
            var tout = BrillTagger.CeateBrillTags(cmd, true, true, true);

            return(collect + "\n" + tout.ToString());
        }
Example #3
0
        public void Setup()
        {
            var TestObject = new BrillTagger();

            Assert.Equal(98822, TestObject.Lexicon.Keys.Count);
        }