Abstract parent class for analysis factories that create TokenFilter instances.
Inheritance: AbstractAnalysisFactory
 /// <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 });
 }
 /// <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 });
 }
        public SynonymFilterFactory(IDictionary<string, string> args)
            : base(args)
	  {
		assureMatchVersion();
		if (luceneMatchVersion.OnOrAfter(Lucene.Net.Util.Version.LUCENE_34))
		{
		  delegator = new FSTSynonymFilterFactory(new Dictionary<string, string>(OriginalArgs));
		}
		else
		{
		  // check if you use the new optional arg "format". this makes no sense for the old one, 
		  // as its wired to solr's synonyms format only.
		  if (args.ContainsKey("format") && !args["format"].Equals("solr"))
		  {
			throw new System.ArgumentException("You must specify luceneMatchVersion >= 3.4 to use alternate synonyms formats");
		  }
		  delegator = new SlowSynonymFilterFactory(new Dictionary<>(OriginalArgs));
		}
	  }
 internal FactoryAnalyzer(TokenizerFactory tokenizer, TokenFilterFactory tokenfilter, CharFilterFactory charFilter)
 {
     Debug.Assert(tokenizer != null);
     this.tokenizer = tokenizer;
     this.charFilter = charFilter;
     this.tokenfilter = tokenfilter;
 }
        private static void AssertDelegator(TokenFilterFactory factory, Type delegatorClass)
        {
            assertNotNull(factory);
            assertTrue("factory not expected class: " + factory.GetType(), factory is SynonymFilterFactory);
            SynonymFilterFactory synFac = (SynonymFilterFactory)factory;
#pragma warning disable 612, 618
            object delegator = synFac.Delegator;
#pragma warning restore 612, 618
            assertNotNull(delegator);
            assertTrue("delegator not expected class: " + delegator.GetType(), delegatorClass.IsInstanceOfType(delegator));

        }