Ejemplo n.º 1
0
 public JapaneseBaseFormFilter(TokenStream input)
     : base(input)
 {
     this.termAtt      = AddAttribute <ICharTermAttribute>();
     this.basicFormAtt = AddAttribute <IBaseFormAttribute>();
     this.keywordAtt   = AddAttribute <IKeywordAttribute>();
 }
Ejemplo n.º 2
0
        private void assertBaseForms(String input, params String[] baseForms)
        {
            TokenStream ts = analyzer.GetTokenStream("ignored", input);

            try
            {
                IBaseFormAttribute baseFormAtt = ts.AddAttribute <IBaseFormAttribute>();
                ts.Reset();
                foreach (String baseForm in baseForms)
                {
                    assertTrue(ts.IncrementToken());
                    assertEquals(baseForm, baseFormAtt.GetBaseForm());
                }
                assertFalse(ts.IncrementToken());
                ts.End();
            }
            finally
            {
                IOUtils.DisposeWhileHandlingException(ts);
            }
        }