Exemple #1
0
        public Task <Option <RichFormatting> > Answer(Request request, CancellationToken token)
        {
            var rich    = new RichFormatting();
            var text    = request.AllText();
            var glosses = autoglosser.Gloss(text);

            rich.Paragraphs.Add(
                new TextParagraph(EnumerableExt.OfSingle(new Text(Descriptor.AcknowledgementText))));
            var s = string.Join("\n", glosses.Select(gloss => $"- {gloss.Foreign}:\n{string.Join("\n", gloss.GlossCandidates.Select(c => $"    - {c}"))}"));

            rich.Paragraphs.Add(new TextParagraph(EnumerableExt.OfSingle(new Text(s))));
            return(Task.FromResult(Option.Some(rich)));
        }
 public void DoesntCrash(string input, IEnumerable <AutoGlosserNote> expected)
 {
     var notes = glosser.Gloss(input).ToList();
 }