/**f * 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. */ options { STATIC = false; //IGNORE_CASE = true; //BUILD_PARSER = false; UNICODE_INPUT = true; USER_CHAR_STREAM = true; OPTIMIZE_TOKEN_MANAGER = true; //DEBUG_TOKEN_MANAGER = true; } PARSER_BEGIN(StandardTokenizer) package org.apache.lucene.analysis.standard; import java.io.*; /** A grammar-based tokenizer constructed with JavaCC. * *
This should be a good tokenizer for most European-language documents: * *
Many applications have specific tokenizer needs. If this tokenizer does
* not suit your application, please consider copying this source code
* directory to your project and maintaining your own grammar-based tokenizer.
*/
public class StandardTokenizer extends org.apache.lucene.analysis.Tokenizer {
/** Constructs a tokenizer for this Reader. */
public StandardTokenizer(Reader reader) {
this(new FastCharStream(reader));
this.input = reader;
}
}
PARSER_END(StandardTokenizer)
TOKEN : { // token patterns
// basic word: a sequence of digits & letters
The returned token's type is set to an element of {@link
* StandardTokenizerConstants#tokenImage}.
*/
org.apache.lucene.analysis.Token next() throws IOException :
{
Token token = null;
}
{
( token =