Beispiel #1
0
        /// <summary>
        /// Creates a list of ExtractedResult which contain all the choices with
        /// their corresponding score where higher is more similar
        /// </summary>
        /// <param name="query"></param>
        /// <param name="choices"></param>
        /// <param name="processor"></param>
        /// <param name="scorer"></param>
        /// <param name="cutoff"></param>
        /// <returns></returns>
        public static IEnumerable <ExtractedResult <string> > ExtractAll(
            string query,
            IEnumerable <string> choices)
        {
            var processor = s_defaultStringProcessor;
            var scorer    = s_defaultScorer;
            var cutoff    = 0;

            return(ResultExtractor.ExtractWithoutOrder(query, choices, processor, scorer, cutoff));
        }
Beispiel #2
0
 /// <summary>
 /// Creates a list of ExtractedResult which contain all the choices with
 /// their corresponding score where higher is more similar
 /// </summary>
 /// <param name="query"></param>
 /// <param name="choices"></param>
 /// <param name="processor"></param>
 /// <param name="scorer"></param>
 /// <param name="cutoff"></param>
 /// <returns></returns>
 public static IEnumerable <ExtractedResult <T> > ExtractAll <T>(
     T query,
     IEnumerable <T> choices,
     Func <T, string> processor,
     IRatioScorer scorer = null,
     int cutoff          = 0)
 {
     if (scorer == null)
     {
         scorer = s_defaultScorer;
     }
     return(ResultExtractor.ExtractWithoutOrder(query, choices, processor, scorer, cutoff));
 }
Beispiel #3
0
 /// <summary>
 /// Creates a list of ExtractedResult which contain all the choices with
 /// their corresponding score where higher is more similar
 /// </summary>
 /// <param name="query"></param>
 /// <param name="choices"></param>
 /// <param name="processor"></param>
 /// <param name="scorer"></param>
 /// <param name="cutoff"></param>
 /// <returns></returns>
 public static IEnumerable <ExtractedResult <string> > ExtractAll(
     string query,
     IEnumerable <string> choices,
     Func <string, string> processor,
     IRatioScorer scorer,
     int cutoff)
 {
     if (processor == default(Func <string, string>))
     {
         processor = s_defaultStringProcessor;
     }
     if (scorer == default(IRatioScorer))
     {
         scorer = s_defaultScorer;
     }
     if (cutoff == default(int))
     {
         cutoff = 0;
     }
     return(ResultExtractor.ExtractWithoutOrder(query, choices, processor, scorer, cutoff));
 }