private void  TestTeeSinkCustomToken(int api)
        {
            TokenStream stream = new WhitespaceTokenizer(new System.IO.StringReader(doc));

            stream = new PartOfSpeechTaggingFilter(stream);
            stream = new LowerCaseFilter(stream);
            stream = new StopFilter(stream, stopwords);

            SinkTokenizer sink    = new SinkTokenizer();
            TokenStream   stream1 = new PartOfSpeechAnnotatingFilter(sink);

            stream = new TeeTokenFilter(stream, sink);
            stream = new PartOfSpeechAnnotatingFilter(stream);

            switch (api)
            {
            case 0:
                ConsumeStreamNewAPI(stream);
                ConsumeStreamNewAPI(stream1);
                break;

            case 1:
                ConsumeStreamOldAPI(stream);
                ConsumeStreamOldAPI(stream1);
                break;

            case 2:
                ConsumeStreamVeryOldAPI(stream);
                ConsumeStreamVeryOldAPI(stream1);
                break;
            }
        }
Example #2
0
 public TeeTokenFilter(TokenStream input, SinkTokenizer sink)
     : base(input)
 {
     this.sink = sink;
 }
		private void  TestTeeSinkCustomToken(int api)
		{
			TokenStream stream = new WhitespaceTokenizer(new System.IO.StringReader(doc));
			stream = new PartOfSpeechTaggingFilter(stream);
			stream = new LowerCaseFilter(stream);
			stream = new StopFilter(stream, stopwords);
			
			SinkTokenizer sink = new SinkTokenizer();
			TokenStream stream1 = new PartOfSpeechAnnotatingFilter(sink);
			
			stream = new TeeTokenFilter(stream, sink);
			stream = new PartOfSpeechAnnotatingFilter(stream);
			
			switch (api)
			{
				
				case 0: 
					ConsumeStreamNewAPI(stream);
					ConsumeStreamNewAPI(stream1);
					break;
				
				case 1: 
					ConsumeStreamOldAPI(stream);
					ConsumeStreamOldAPI(stream1);
					break;
				
				case 2: 
					ConsumeStreamVeryOldAPI(stream);
					ConsumeStreamVeryOldAPI(stream1);
					break;
				}
		}
Example #4
0
 public TeeTokenFilter(TokenStream input, SinkTokenizer sink) : base(input)
 {
     this.sink = sink;
 }