Represents all results of single search of multiple phrases in one Searchee (usually Searchee == file)
Beispiel #1
0
        private void GenerateSearchee(StringBuilder sb, SearcheeResult result)
        {
            sb.Append(result.Searchee.Path).Append(':').AppendLine();

            var matchPhraseGroups = from m in result.Matches
                                    group m by m.Value into g
                                    select g;

            foreach (var phraseGroup in matchPhraseGroups)
            {
                GeneratePhrase(sb, phraseGroup);
            }

            sb.AppendLine();
        }
        private void GenerateSearchee(StringBuilder sb, SearcheeResult result)
        {
            sb.Append(result.Searchee.Path).Append(':').AppendLine();

            var matchPhraseGroups = from m in result.Matches
                                    group m by m.Value into g
                                    select g;

            foreach (var phraseGroup in matchPhraseGroups)
            {
                GeneratePhrase(sb, phraseGroup);
            }

            sb.AppendLine();
        }
Beispiel #3
0
        private IEnumerable<SearcheeResult> PerformSearch(IEnumerable<ISearchee> searchees, List<string> preprocessedPhrases)
        {
            var results = new List<SearcheeResult>();

            if (preprocessedPhrases.Any())
            {
                foreach (var searchee in searchees)
                {
                    var matcher = _matcherFactory.Create(preprocessedPhrases);
                    var matches = matcher.Matches(searchee.Reader);

                    if (matches.Any())
                    {
                        var searcheeResult = new SearcheeResult(searchee, matches);
                        results.Add(searcheeResult);
                    }
                }
            }

            return results;
        }
Beispiel #4
0
        private IEnumerable <SearcheeResult> PerformSearch(IEnumerable <ISearchee> searchees, List <string> preprocessedPhrases)
        {
            var results = new List <SearcheeResult>();

            if (preprocessedPhrases.Any())
            {
                foreach (var searchee in searchees)
                {
                    var matcher = _matcherFactory.Create(preprocessedPhrases);
                    var matches = matcher.Matches(searchee.Reader);

                    if (matches.Any())
                    {
                        var searcheeResult = new SearcheeResult(searchee, matches);
                        results.Add(searcheeResult);
                    }
                }
            }

            return(results);
        }