Example #1
0
        public ActionResult Index(TaggerViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var corpus = CorpusFactory.GetCorpus("brills");

            var tokenizer = TokenizerFactory.GetTokenizer("simple");
            var tokens    = tokenizer.Tokenize(model.Text);

            var tagger  = TaggerFactory.GetTagger("simple");
            var results = tagger.Tag(corpus, tokens.Where(x => !string.IsNullOrWhiteSpace(x)).ToList());

            ViewBag.Results = String.Join(" ", results.Select(x => string.Format("{0}({1})", x.Token, x.Tag)));

            return(View(model));
        }
Example #2
0
 public TaggerWindow()
 {
     InitializeComponent();
     DataContext = new TaggerViewModel(this);
 }