public void CorrectSpelling() { Corrections = new List <CorrectedSentence>(); foreach (List <string> sentence in Tokenise()) { var client = new SpellingServiceClient.SpellingServiceClient(); var results = client.CorrectSpelling(sentence.ToArray()); var correction = new CorrectedSentence(); correction.NewSentence = new List <string>(results.CorrectedSentence); foreach (var result in results.Corrections) { var correct = new DemoCorrection(); correct.Word = result.CorrectSpellingOfWord; correct.Index = result.WordIndex; correction.Corrections.Add(correct); } Corrections.Add(correction); } IsCorrected = true; }
public void CorrectSpelling() { Corrections = new List<CorrectedSentence>(); foreach (List<string> sentence in Tokenise()) { var client = new SpellingServiceClient.SpellingServiceClient(); var results = client.CorrectSpelling(sentence.ToArray()); var correction = new CorrectedSentence(); correction.NewSentence = new List<string>(results.CorrectedSentence); foreach (var result in results.Corrections) { var correct = new DemoCorrection(); correct.Word = result.CorrectSpellingOfWord; correct.Index = result.WordIndex; correction.Corrections.Add(correct); } Corrections.Add(correction); } IsCorrected = true; }