Example #1
0
        public void Should_return_a_list_of_complete_words_in_the_dictionay_given_some_digits(int[] digits, string[] expected)
        {
            var actual = _predictions.GetPredictions(digits).ToArray();

            Assert.Equal(expected.Length, actual.Length);
            foreach (var w in actual)
            {
                Assert.Contains(w, expected);
            }
        }
Example #2
0
        public static async Task <List <PredictionCorrection> > InitPredictions([ActivityTrigger] DataOpParameters pipe, ILogger log)
        {
            log.LogInformation($"InitPredictions: Starting");
            List <PredictionCorrection> predictionList = new List <PredictionCorrection>();
            Predictions          predictions           = new Predictions(pipe.StorageAccount);
            PredictionParameters parms = JObject.Parse(pipe.JsonParameters).ToObject <PredictionParameters>();

            predictionList = await predictions.GetPredictions(parms.DataConnector);

            log.LogInformation($"Number of predictions are {predictionList.Count}");
            log.LogInformation($"InitPredictions: Complete");
            return(predictionList);
        }
 public async Task<ActionResult<List<PredictionCorrection>>> Get(string source)
 {
     List<PredictionCorrection> predictionResuls = new List<PredictionCorrection>();
     try
     {
         string tmpConnString = Request.Headers["AzureStorageConnection"];
         Predictions predict = new Predictions(tmpConnString);
         predictionResuls = await predict.GetPredictions(source);
     }
     catch (Exception ex)
     {
         return BadRequest(ex.ToString());
     }
     return predictionResuls;
 }