public static SuggestionQuery GetQuery(string term, StringDistanceTypes stringDistanceTypes)
 {
     return(new SuggestionQuery
     {
         Distance = stringDistanceTypes,
         Field = "Name",
         MaxSuggestions = 10,
         Term = term
     });
 }
Beispiel #2
0
 public static SuggestionQuery GetQuery(string term, StringDistanceTypes stringDistanceTypes)
 {
     return new SuggestionQuery
                {
                    Distance = stringDistanceTypes,
                    Field = "Name",
                    MaxSuggestions = 10,
                    Term = term
                };
 }
		public static StringDistance GetStringDistance(StringDistanceTypes distanceAlg)
		{
			switch (distanceAlg)
			{
				case StringDistanceTypes.NGram:
					return new NGramDistance();
				case StringDistanceTypes.JaroWinkler:
					return new JaroWinklerDistance();
				default:
					return new LevenshteinDistance();
			}
		}
Beispiel #4
0
        public static StringDistance GetStringDistance(StringDistanceTypes distanceAlg)
        {
            switch (distanceAlg)
            {
            case StringDistanceTypes.NGram:
                return(new NGramDistance());

            case StringDistanceTypes.JaroWinkler:
                return(new JaroWinklerDistance());

            default:
                return(new LevenshteinDistance());
            }
        }