Thumbnail file hits. Based on a patch from D Bera
[beagle.git] / beagled / Lucene.Net / Analysis / Analyzer.cs
blob6d5902f076426ea77ec8373064336c40768f2d29
1 /*
2 * Copyright 2004 The Apache Software Foundation
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
16 using System;
17 namespace Lucene.Net.Analysis
20 /// <summary>An Analyzer builds TokenStreams, which analyze text. It thus represents a
21 /// policy for extracting index terms from text.
22 /// <p>
23 /// Typical implementations first build a Tokenizer, which breaks the stream of
24 /// characters from the Reader into raw Tokens. One or more TokenFilters may
25 /// then be applied to the output of the Tokenizer.
26 /// </p>
27 /// <p>
28 /// WARNING: You must override one of the methods defined by this class in your
29 /// subclass or the Analyzer will enter an infinite loop.
30 /// </p>
31 /// </summary>
32 public abstract class Analyzer
34 /// <summary>Creates a TokenStream which tokenizes all the text in the provided
35 /// Reader. Default implementation forwards to tokenStream(Reader) for
36 /// compatibility with older version. Override to allow Analyzer to choose
37 /// strategy based on document and/or Field. Must be able to handle null
38 /// Field name for backward compatibility.
39 /// </summary>
40 public virtual TokenStream TokenStream(System.String fieldName, System.IO.TextReader reader)
42 // implemented for backward compatibility
43 return TokenStream(reader);
46 /// <summary>Creates a TokenStream which tokenizes all the text in the provided
47 /// Reader. Provided for backward compatibility only.
48 /// </summary>
49 /// <deprecated> use TokenStream(String, Reader) instead.
50 /// </deprecated>
51 /// <seealso cref="Reader)">
52 /// </seealso>
53 public virtual TokenStream TokenStream(System.IO.TextReader reader)
55 return TokenStream(null, reader);