예제 #1
0
 private void ModifyResultForPoss(ResultSet resultSet, MapExtractor mapExtractor)
 {
     foreach (string word in resultSet.Query.poss)
     {
         resultSet.Result.UnionWith(mapExtractor.GetDocsByKeyword(word));
     }
 }
 private void ModifyResultForNegs(ResultSet resultSet, MapExtractor mapExtractor)
 {
     foreach (string keyword in resultSet.Query.negs)
     {
         foreach (string docId in mapExtractor.GetDocsByKeyword(keyword))
         {
             resultSet.Result.Remove(docId);
         }
     }
 }
예제 #3
0
        private void ModifyResultForNorms(ResultSet resultSet, MapExtractor mapExtractor)
        {
            foreach (string norm in resultSet.Query.norms)
            {
                resultSet.Result.UnionWith(mapExtractor.GetDocsByKeyword(norm));
            }

            foreach (var docId in GetAndPrimedSet(resultSet, mapExtractor))
            {
                resultSet.Result.Remove(docId);
            }
        }
예제 #4
0
        private HashSet <string> GetAndPrimedSet(ResultSet resultSet, MapExtractor mapExtractor)
        {
            HashSet <string> hashSetPrime = new HashSet <string>();

            foreach (string norm in resultSet.Query.norms)
            {
                HashSet <string> hashSet = new HashSet <string>(resultSet.Result);
                foreach (var docId in mapExtractor.GetDocsByKeyword(norm))
                {
                    hashSet.Remove(docId);
                }
                hashSetPrime.UnionWith(hashSet);
            }
            return(hashSetPrime);
        }