Dispose() public method

Frees persistent resources used by this Analyzer
public Dispose ( ) : void
return void
Exemplo n.º 1
0
        public void TestRandomRegexps()
        {
            int iters = TEST_NIGHTLY ? AtLeast(30) : AtLeast(1);

            for (int i = 0; i < iters; i++)
            {
                CharacterRunAutomaton dfa = new CharacterRunAutomaton(AutomatonTestUtil.RandomAutomaton(Random) /*, int.MaxValue*/);
                bool     lowercase        = Random.nextBoolean();
                int      limit            = TestUtil.NextInt32(Random, 0, 500);
                Analyzer a = Analyzer.NewAnonymous(createComponents: (fieldName, reader) => {
                    Tokenizer t = new MockTokenizer(reader, dfa, lowercase, limit);
                    return(new TokenStreamComponents(t, t));
                });
                CheckRandomData(Random, a, 100);
                a.Dispose();
            }
        }
Exemplo n.º 2
0
        public void TestRandomRegexps()
        {
            //int iters = TestNightly ? AtLeast(30) : AtLeast(1);
            // LUCENENET specific - reduced Nightly iterations from 30 to 15
            // to keep it under the 1 hour free limit of Azure DevOps
            int iters = TestNightly ? AtLeast(15) : AtLeast(1);

            for (int i = 0; i < iters; i++)
            {
                CharacterRunAutomaton dfa = new CharacterRunAutomaton(AutomatonTestUtil.RandomAutomaton(Random) /*, int.MaxValue*/);
                bool     lowercase        = Random.NextBoolean();
                int      limit            = TestUtil.NextInt32(Random, 0, 500);
                Analyzer a = Analyzer.NewAnonymous(createComponents: (fieldName, reader) => {
                    Tokenizer t = new MockTokenizer(reader, dfa, lowercase, limit);
                    return(new TokenStreamComponents(t, t));
                });
                CheckRandomData(Random, a, 100);
                a.Dispose();
            }
        }