Esempio n. 1
0
 static void Main(string[] args)
 {
     InvertedIndex ii = new InvertedIndex();
     ii.Add("what do you expect from me");
     ii.Add("what did you say");
     ii.Add("what does the fox say");
     //ii.Query("what");
     //ii.Query("what & do | ( you | say )");
     //ii.Query("what | fox & ( did | does )");
     //ii.Query("me & say | ( expect | did ) & what");
     //ii.Query("what & ( do | expect ) | you");
 }
Esempio n. 2
0
 public void PN3()
 {
     ii = new InvertedIndex();
     ii.Add("what do you expect from me");
     ii.Add("what did you say");
     ii.Add("what does the fox say");
     string query = "me & say | ( expect | did ) & what";
     Assert.AreEqual(ii.Query(query), "{ 0, 1 }");
 }
Esempio n. 3
0
 public void PN4()
 {
     ii = new InvertedIndex();
     ii.Add("what do you expect from me");
     ii.Add("what did you say");
     ii.Add("what does the fox say");
     string query = "what & ( do | expect ) | you";
     Assert.AreEqual(ii.Query(query), "{ 0, 1 }");
 }
Esempio n. 4
0
 public void PN2()
 {
     ii = new InvertedIndex();
     ii.Add("what do you expect from me");
     ii.Add("what did you say");
     ii.Add("what does the fox say");
     string query = "what | fox & ( did | does )";
     Assert.AreEqual(ii.Query(query), "{ 0, 1, 2 }");
 }