C# 字符串 计算相似度的算法,用于搜索排序推荐?

//程序来源:Hands on software Architecture with c# 8 and .net core3

using System;

namespace SmartSearch
{
   
    class Program
    {
   
        static string[] fruits = new string[]{
   
            "Apples", "Apricots", "Avocados",
            "Bananas", "Boysenberries", "Blueberries", "Bing Cherry", "Blackberries",
            "Cherries", "Cantaloupe", "Crab apples", "Clementine", "Cucumbers",
            "Meloms", "Pears", "Grapes", "Strawberries",
        };
        static void Main(string[] args)
        {
   
            var sd = new SmartDDictionary<string>(m => m, fruits);
            bool finished = false;
            while (!finished)
            {
   
                var search = Console.ReadLine();
                Console.WriteLine();
                foreach (var fruit in sd.Search(search, 5))
                {
   
                    Console.

你可能感兴趣的:(C#知识点)