Beispiel #1
0
        public void SetMatchmakerToStrictContainsMatch(bool singleMatchmaker = true)
        {
            if (singleMatchmaker || Matchmakers == null)
            {
                Matchmakers = new List <IKeywordMatchmaker>();
            }

            Matchmakers.Add(new StrictContainsKeywordMatchmaker(toLowerMasterFilteredKeywords));

            compositeMatchmaker = new KeywordMatchmaker(Matchmakers);
        }
Beispiel #2
0
        public void SetMatchmakerToLucenePortStem(bool singleMatchmaker = true)
        {
            if (singleMatchmaker || Matchmakers == null)
            {
                Matchmakers = new List <IKeywordMatchmaker>();
            }

            Matchmakers.Add(new LucenePorterStemMatchmaker(toLowerMasterFilteredKeywords));

            compositeMatchmaker = new KeywordMatchmaker(Matchmakers);
        }
Beispiel #3
0
        public void SetMatchmakerToDictionary(bool singleMatchmaker = true)
        {
            if (singleMatchmaker || Matchmakers == null)
            {
                Matchmakers = new List <IKeywordMatchmaker>();
            }

            Matchmakers.Add(new DictionaryMatchmaker(toLowerMasterFilteredKeywords));

            compositeMatchmaker = new KeywordMatchmaker(Matchmakers);
        }
Beispiel #4
0
        public void SetMatchmakerToContainsSansSpaceAndNumberMatch(bool singleMatchmaker = true)
        {
            if (singleMatchmaker || Matchmakers == null)
            {
                Matchmakers = new List <IKeywordMatchmaker>();
            }

            Matchmakers.Add(new ContainsSansSpaceAndNumberKeywordMatchmaker(toLowerMasterFilteredKeywords));

            compositeMatchmaker = new KeywordMatchmaker(Matchmakers);
        }
Beispiel #5
0
        public KeywordFilterer(IEnumerable <FilteredKeyword> masterFilteredKeywords, bool usePluralizationService = true)
        {
            suspectKeywordsList = new List <string>();

            toLowerMasterFilteredKeywords =
                masterFilteredKeywords.Select(
                    masterKeyword =>
                    new FilteredKeyword
            {
                Keyword     = masterKeyword.Keyword.ToLower(),
                Category    = masterKeyword.Category,
                CategoryBit = masterKeyword.CategoryBit
            }).ToList();

            Matchmakers = new List <IKeywordMatchmaker>
            {
                new ExactMatchKeywordMatchmaker(toLowerMasterFilteredKeywords)//,
                //new FuzzyContainsKeywordMatchmaker(toLowerMasterFilteredKeywords),
                //new StrictContainsKeywordMatchmaker(toLowerMasterFilteredKeywords),
                //new ContainsSansSpaceAndNumberKeywordMatchmaker(toLowerMasterFilteredKeywords, usePluralizationService)
            };

            compositeMatchmaker = new KeywordMatchmaker(Matchmakers);
        }