示例#1
0
 public PostingList(string term, List <string> directories, string filename)
 {
     this.Term = term;
     shards    = new PostingUnion[directories.Count()];
     for (int shard = 0; shard < directories.Count; shard++)
     {
         shards[shard] = new PostingUnion(Path.Combine(directories[shard], filename));
     }
 }
示例#2
0
        public PostingUnion Union(PostingUnion iother, bool max)
        {
            PostingUnion other  = iother as PostingUnion;
            PostingUnion result = new PostingUnion(max);

            foreach (var a in this.arrays)
            {
                result.arrays.Add(a);
            }
            foreach (var a in other.arrays)
            {
                result.arrays.Add(a);
            }

            return(result);
        }
示例#3
0
        public PostingUnion Intersection(PostingUnion iother, bool max)
        {
            PostingUnion        other    = iother as PostingUnion;
            List <PostingArray> newArray = new List <PostingArray>();

            for (int i = 0; i < this.arrays.Count(); i++)
            {
                for (int j = 0; j < other.arrays.Count(); j++)
                {
                    newArray.Add(this.arrays[i].Intersection(other.arrays[j], max) as PostingArray);
                }
            }

            PostingUnion result = new PostingUnion(newArray, this.max);

            if (newArray.Count() > 10)
            {
                result.Resolve();
            }

            return(result);
        }