예제 #1
0
            public override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
            {
                Tokenizer   tokenizer   = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
                TokenStream tokenStream = new MockGraphTokenFilter(Random(), tokenizer);

                return(new TokenStreamComponents(tokenizer, tokenStream));
            }
예제 #2
0
        public virtual void TestRandom2GraphAfter()
        {
            int    numIters = AtLeast(3);
            Random random   = Random;

            for (int i = 0; i < numIters; i++)
            {
                b = new SynonymMap.Builder(random.nextBoolean());
                int numEntries = AtLeast(10);
                for (int j = 0; j < numEntries; j++)
                {
                    Add(RandomNonEmptyString(), RandomNonEmptyString(), random.nextBoolean());
                }
                SynonymMap map        = b.Build();
                bool       ignoreCase = random.nextBoolean();

                Analyzer analyzer = Analyzer.NewAnonymous(createComponents: (fieldName, reader) =>
                {
                    Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
                    TokenStream syns    = new SynonymFilter(tokenizer, map, ignoreCase);
                    TokenStream graph   = new MockGraphTokenFilter(Random, syns);
                    return(new TokenStreamComponents(tokenizer, graph));
                });

                CheckRandomData(random, analyzer, 100);
            }
        }
            public override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
            {
                Tokenizer   tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
                TokenStream syns      = new SynonymFilter(tokenizer, map, ignoreCase);
                TokenStream graph     = new MockGraphTokenFilter(Random(), syns);

                return(new TokenStreamComponents(tokenizer, graph));
            }
예제 #4
0
        public virtual void TestRandomHugeStringsGraphAfter()
        {
            Random random = Random;

            CheckRandomData(random,
                            Analyzer.NewAnonymous(createComponents: (fieldName, reader) =>
            {
                Tokenizer tokenizer     = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
                TokenStream tokenStream = new MockGraphTokenFilter(Random, tokenizer);
                return(new TokenStreamComponents(tokenizer, tokenStream));
            })
                            , 100 * RandomMultiplier, 8192);
        }
예제 #5
0
        public void TestRandomHugeStringsMockGraphAfter()
        {
            // Randomly inject graph tokens after JapaneseTokenizer:
            Random random = Random;

            CheckRandomData(random,
                            Analyzer.NewAnonymous(createComponents: (fieldName, reader) =>
            {
                Tokenizer tokenizer = new JapaneseTokenizer(reader, ReadDict(), false, JapaneseTokenizerMode.SEARCH);
                TokenStream graph   = new MockGraphTokenFilter(Random, tokenizer);
                return(new TokenStreamComponents(tokenizer, graph));
            }),
                            100 * RandomMultiplier, 8192);
        }
 public override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
 {
     Tokenizer tokenizer = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
     TokenStream tokenStream = new MockGraphTokenFilter(Random(), tokenizer);
     return new TokenStreamComponents(tokenizer, tokenStream);
 }
예제 #7
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);
 }
예제 #8
0
 protected override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
 {
     Tokenizer t = new GraphTokenizer(reader);
     TokenStream t2 = new MockGraphTokenFilter(Random(), t);
     return new TokenStreamComponents(t, t2);
 }
예제 #9
0
 public override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
 {
     Tokenizer t = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
     TokenStream t2 = new RemoveATokens(t);
     TokenStream t3 = new MockGraphTokenFilter(Random(), t2);
     return new TokenStreamComponents(t, t3);
 }
 public override TokenStreamComponents CreateComponents(string fieldName, TextReader reader)
 {
     Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
     TokenStream syns = new SynonymFilter(tokenizer, map, ignoreCase);
     TokenStream graph = new MockGraphTokenFilter(Random(), syns);
     return new TokenStreamComponents(tokenizer, graph);
 }
예제 #11
0
		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
		  {
			Tokenizer tokenizer = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
			TokenStream tokenStream = new MockGraphTokenFilter(random(), tokenizer);
			return new TokenStreamComponents(tokenizer, tokenStream);
		  }