Esempio n. 1
0
        /// <summary>
        /// Creates a sorted list of ExtractedResult  which contain the
        /// top limit most similar choices
        /// </summary>
        /// <param name="query"></param>
        /// <param name="choices"></param>
        /// <param name="processor"></param>
        /// <param name="scorer"></param>
        /// <param name="limit"></param>
        /// <param name="cutoff"></param>
        /// <returns></returns>
        public static IEnumerable <ExtractedResult <string> > ExtractTop(
            string query,
            IEnumerable <string> choices,
            int limit)
        {
            var processor = s_defaultStringProcessor;
            var scorer    = s_defaultScorer;

            return(ResultExtractor.ExtractTop(query, choices, processor, scorer, limit, 0));
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a sorted list of ExtractedResult  which contain the
 /// top limit most similar choices
 /// </summary>
 /// <param name="query"></param>
 /// <param name="choices"></param>
 /// <param name="processor"></param>
 /// <param name="scorer"></param>
 /// <param name="limit"></param>
 /// <param name="cutoff"></param>
 /// <returns></returns>
 public static IEnumerable <ExtractedResult <T> > ExtractTop <T>(
     T query,
     IEnumerable <T> choices,
     Func <T, string> processor,
     IRatioScorer scorer = null,
     int limit           = 5,
     int cutoff          = 0)
 {
     if (scorer == null)
     {
         scorer = s_defaultScorer;
     }
     return(ResultExtractor.ExtractTop(query, choices, processor, scorer, limit, cutoff));
 }
Esempio n. 3
0
 /// <summary>
 /// Creates a sorted list of ExtractedResult  which contain the
 /// top limit most similar choices
 /// </summary>
 /// <param name="query"></param>
 /// <param name="choices"></param>
 /// <param name="processor"></param>
 /// <param name="scorer"></param>
 /// <param name="limit"></param>
 /// <param name="cutoff"></param>
 /// <returns></returns>
 public static IEnumerable <ExtractedResult <string> > ExtractTop(
     string query,
     IEnumerable <string> choices,
     Func <string, string> processor,
     IRatioScorer scorer,
     int limit,
     int cutoff)
 {
     if (processor == null)
     {
         processor = s_defaultStringProcessor;
     }
     if (scorer == null)
     {
         scorer = s_defaultScorer;
     }
     return(ResultExtractor.ExtractTop(query, choices, processor, scorer, limit, cutoff));
 }