// Read a school from a serialized binary file public static InvertedWordIndex Read(string path) { IFormatter formatter = new BinaryFormatter(); Stream stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read); InvertedWordIndex obj = formatter.Deserialize(stream) as InvertedWordIndex; stream.Close(); return(obj); }
public void Init() { index = new InvertedWordIndex(); IndexableItem item1 = new IndexableItem(); IndexableItem item2 = new IndexableItem(); item1.ID = 0; item2.ID = 1; item1.Strings = new string[] { "good0", "bad0", "bad1" }; item2.Strings = new string[] { "good1", "bad1" }; index.Add(item1); index.Add(item2); }
public Indexer(string name) { this.InvertedIndex = new InvertedWordIndex(name); }
public Indexer() { this.InvertedIndex = new InvertedWordIndex(); }