/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/
using System;
using System.IO;
using System.Text;
using System.Collections;
using System.Globalization;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Tokenattributes;
using Lucene.Net.Util;
namespace Lucene.Net.Analysis.Cn
{
///
/// The difference between ChineseTokenizer and
/// CJKTokenizer is that they have different
/// token parsing logic.
///
/// For example, if the Chinese text
/// "C1C2C3C4" is to be indexed:
///
///
///
/// Therefore the index created by CJKTokenizer is much larger. ///
////// The problem is that when searching for C1, C1C2, C1C3, /// C4C2, C1C2C3 ... the ChineseTokenizer works, but the /// CJKTokenizer will not work. ///
/// public sealed class ChineseTokenizer : Tokenizer { public ChineseTokenizer(TextReader _in) : base(_in) { Init(); } public ChineseTokenizer(AttributeSource source, TextReader _in) : base(source, _in) { Init(); } public ChineseTokenizer(AttributeFactory factory, TextReader _in) : base(factory, _in) { Init(); } private void Init() { termAtt = AddAttribute