pylucene 3.5.0-3
[pylucene.git] / lucene-java-3.5.0 / lucene / src / java / org / apache / lucene / analysis / standard / StandardTokenizerInterface.java
1 package org.apache.lucene.analysis.standard;
2
3 /**
4  * Licensed to the Apache Software Foundation (ASF) under one or more
5  * contributor license agreements.  See the NOTICE file distributed with
6  * this work for additional information regarding copyright ownership.
7  * The ASF licenses this file to You under the Apache License, Version 2.0
8  * (the "License"); you may not use this file except in compliance with
9  * the License.  You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
21
22 import java.io.Reader;
23 import java.io.IOException;
24
25 /** @lucene.internal */
26 public interface StandardTokenizerInterface {
27
28   /** This character denotes the end of file */
29   public static final int YYEOF = -1;
30
31   /**
32    * Copies the matched text into the CharTermAttribute
33    */
34   public void getText(CharTermAttribute t);
35
36   /**
37    * Returns the current position.
38    */
39   public int yychar();
40
41   /**
42    * Resets the scanner to read from a new input stream.
43    * Does not close the old reader.
44    *
45    * All internal variables are reset, the old input stream 
46    * <b>cannot</b> be reused (internal buffer is discarded and lost).
47    * Lexical state is set to <tt>ZZ_INITIAL</tt>.
48    *
49    * @param reader   the new input stream 
50    */
51   public void yyreset(Reader reader);
52
53   /**
54    * Returns the length of the matched text region.
55    */
56   public int yylength();
57
58   /**
59    * Resumes scanning until the next regular expression is matched,
60    * the end of input is encountered or an I/O-Error occurs.
61    *
62    * @return      the next token, {@link #YYEOF} on end of stream
63    * @exception   IOException  if any I/O-Error occurs
64    */
65   public int getNextToken() throws IOException;
66
67 }