Пример #1
0
        public TokenStream TokenStream(string fieldName, TextReader reader)
        {
            var tokenizer = new JieBaTokenizer(reader, _mode);

            var tokenStream = (TokenStream) new LowerCaseFilter(LuceneVersion.LUCENE_48, tokenizer);

            tokenStream.AddAttribute <ICharTermAttribute>();
            tokenStream.AddAttribute <IOffsetAttribute>();

            return(tokenStream);
        }
Пример #2
0
        protected override TokenStreamComponents CreateComponents(string filedName, TextReader reader)
        {
            var tokenizer = new JieBaTokenizer(reader, _mode);

            var tokenStream = (TokenStream) new LowerCaseFilter(LuceneVersion.LUCENE_48, tokenizer);

            tokenStream.AddAttribute <ICharTermAttribute>();
            tokenStream.AddAttribute <IOffsetAttribute>();

            return(new TokenStreamComponents(tokenizer, tokenStream));
        }