/// <summary> /// checks for synonyms of "second" in synonyms-wordnet.txt </summary> private void CheckWordnetSynonyms(TokenFilterFactory factory) { Reader reader = new StringReader("second"); TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false); stream = factory.Create(stream); assertTrue(stream is SynonymFilter); AssertTokenStreamContents(stream, new string[] { "second", "2nd", "two" }, new int[] { 1, 0, 0 }); }
/// <summary> /// checks for synonyms of "GB" in synonyms.txt </summary> private void CheckSolrSynonyms(TokenFilterFactory factory) { Reader reader = new StringReader("GB"); TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false); stream = factory.Create(stream); assertTrue(stream is SynonymFilter); AssertTokenStreamContents(stream, new string[] { "GB", "gib", "gigabyte", "gigabytes" }, new int[] { 1, 0, 0, 0 }); }