Beispiel #1
0
 public static void BuildIndex(IBuildableIndex <string> index, string[][] sentenceBlocks)
 {
     for (var blockId = 0; blockId < sentenceBlocks.Length; ++blockId)
     {
         var block = sentenceBlocks[blockId];
         for (var localId = 0; localId < block.Length; ++localId)
         {
             var doc   = block[localId].ToLower().Split();
             var docId = new DocumentId((uint)(blockId * 10 + localId));
             for (var position = 0; position < doc.Length; ++position)
             {
                 index.IndexTerm(docId, doc[position], position);
             }
         }
     }
 }
 public IndexBuilder(IBuildableIndex <TTerm> index)
 {
     Index = index;
 }