Beispiel #1
0
        public IActionResult ParseBigrams(string text)
        {
            string msg;

            try
            {
                var bigrams = _nGramHelper.GetNGrams(text, 2);
                return(Json(new { success = true, content = bigrams.OrderByDescending(x => x.Value) }));
            }
            catch (Exception e)
            {
                msg = e.Message;
            }

            return(Json(new { success = false, message = msg }));
        }
Beispiel #2
0
 public void TestGetNGramsBasicSuccess()
 {
     // this verifies a basic success so we know the method works and the two parameters are valid inputs
     Assert.True(_nGramHelper.GetNGrams("this is good text", 2) != null);
 }