Exemple #1
0
        public async Task GetSimilarWords(string a, int n = 15)
        {
            var result = await _wordVectors.Similar(a);

            if (result == null)
            {
                await TypingReplyAsync($"I don't know the word `{a}`");

                return;
            }

            await DisplayItemList(
                result.Take(n).ToArray(),
                () => "I can't find any similar words",
                items => $"The {items.Count} most similar words are:",
                (t, i) => $"`{t.Word}` ({t.Similarity})"
                );
        }