ACAT.Extensions.Default.WordPredictors.PresageWCF.PresageWordPredictor.Predict C# (CSharp) Method

Predict() public method

Returns a list of next word predictions based on the context from the previous words in the sentence. The number of words returned is set by the PredictionWordCount property
public Predict ( String prevWords, String currentWord ) : IEnumerable
prevWords String Previous words in the sentence
currentWord String current word (may be partially spelt out
return IEnumerable
        public IEnumerable<String> Predict(String prevWords, String currentWord)
        {
            bool success = true;
            
            var wordList = predict(prevWords, currentWord, ref success);
            if (!success)
            {
                Log.Debug("Prediction error.  Will initialize again");

                var retVal = Init();
                if (retVal)
                {
                    wordList = predict(prevWords, currentWord, ref success);
                }
            }

            return wordList;
        }