1 package org.apache.lucene.analysis.standard;
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
22 import java.io.Reader;
23 import java.io.IOException;
25 /** @lucene.internal */
26 public interface StandardTokenizerInterface {
28 /** This character denotes the end of file */
29 public static final int YYEOF = -1;
32 * Copies the matched text into the CharTermAttribute
34 public void getText(CharTermAttribute t);
37 * Returns the current position.
42 * Resets the scanner to read from a new input stream.
43 * Does not close the old reader.
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>.
49 * @param reader the new input stream
51 public void yyreset(Reader reader);
54 * Returns the length of the matched text region.
56 public int yylength();
59 * Resumes scanning until the next regular expression is matched,
60 * the end of input is encountered or an I/O-Error occurs.
62 * @return the next token, {@link #YYEOF} on end of stream
63 * @exception IOException if any I/O-Error occurs
65 public int getNextToken() throws IOException;