protected internal override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
            {
                Tokenizer   t  = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
                TokenStream t1 = new MockHoleInjectingTokenFilter(Random, t);
                TokenStream t2 = new MockGraphTokenFilter(Random, t1);

                return(new TokenStreamComponents(t, t2));
            }
        public virtual void TestMockGraphTokenFilterAfterHolesRandom()
        {
            for (int iter = 0; iter < 10 * RandomMultiplier; iter++)
            {
                if (Verbose)
                {
                    Console.WriteLine("\nTEST: iter=" + iter);
                }

                // Make new analyzer each time, because MGTF has fixed
                // seed:
                Analyzer a = Analyzer.NewAnonymous(createComponents: (fieldName, reader) =>
                {
                    Tokenizer t    = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
                    TokenStream t1 = new MockHoleInjectingTokenFilter(Random, t);
                    TokenStream t2 = new MockGraphTokenFilter(Random, t1);
                    return(new TokenStreamComponents(t, t2));
                });

                Random random = Random;
                CheckRandomData(random, a, 5, AtLeast(100));
            }
        }
Esempio n. 3
0
 protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
 {
     Tokenizer t = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
     TokenStream t1 = new MockHoleInjectingTokenFilter(Random(), t);
     TokenStream t2 = new MockGraphTokenFilter(Random(), t1);
     return new TokenStreamComponents(t, t2);
 }