如何在列表中找到最接近的字符串:
var list = new List<string>
{
"hello how are you",
"weather is good today",
"what is your name",
"what time is it",
"what is your favorite color",
"hello world",
"how much money you got",
"where are you",
"like you"
};
如果更新后的输入为:
string input = "how are you";
还有一个类型错误:
string input = "how are ytou";
对于这两种情况,获取以下内容会很有帮助:
hello how are you
where are you
甚至可以得到这个结果:
hello how are you
where are you
how much money you got
或者至少只是:
hello how are you
我需要这个来避免用户请求中的最小类型错误以生成响应。