2 * Copyright 2004 The Apache Software Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 using CharTokenizer
= Lucene
.Net
.Analysis
.CharTokenizer
;
18 namespace Lucene
.Net
.Analysis
.RU
21 /// <summary> A RussianLetterTokenizer is a tokenizer that extends LetterTokenizer by additionally looking up letters
22 /// in a given "russian charset". The problem with LeterTokenizer is that it uses Character.isLetter() method,
23 /// which doesn't know how to detect letters in encodings like CP1252 and KOI8
24 /// (well-known problems with 0xD7 and 0xF7 chars)
27 /// <author> Boris Okner, b.okner@rogers.com
29 /// <version> $Id: RussianLetterTokenizer.cs,v 1.2 2005/01/17 19:54:28 joeshaw Exp $
32 public class RussianLetterTokenizer
: CharTokenizer
34 /// <summary>Construct a new LetterTokenizer. </summary>
35 private char[] charset
;
37 public RussianLetterTokenizer(System
.IO
.TextReader in_Renamed
, char[] charset
) : base(in_Renamed
)
39 this.charset
= charset
;
42 /// <summary> Collects only characters which satisfy
43 /// {@link Character#isLetter(char)}.
45 protected internal override bool IsTokenChar(char c
)
47 if (System
.Char
.IsLetter(c
))
49 for (int i
= 0; i
< charset
.Length
; i
++)