LUCENE-10239: upgrade jflex (1.7.0 -> 1.8.2) (#452)

Upgrade jflex.

Change doesn't alter the behavior of any of the analyzers (unicode
version or grammar refactorings), just the minimal to get new tooling
working.
This commit is contained in:
Robert Muir 2021-11-19 09:24:27 -05:00 committed by GitHub
parent ad911df260
commit af831d2810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 67433 additions and 68107 deletions

View File

@ -26,7 +26,7 @@ ext {
"ecj": "3.25.0",
"flexmark": "0.61.24",
"javacc": "7.0.4",
"jflex": "1.7.0",
"jflex": "1.8.2",
"jgit": "5.9.0.202009080501-r",
]
}

View File

@ -331,7 +331,7 @@ public class MissingDoclet extends StandardDoclet {
if (hasOverrides) {
// If an element has explicit @Overrides annotation, assume it does
// have inherited javadocs somewhere.
reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but @Override declared, skipping.");
// reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but @Override declared, skipping.");
return true;
}
@ -348,7 +348,7 @@ public class MissingDoclet extends StandardDoclet {
// We could check supMethod for non-empty javadoc here. Don't know if this makes
// sense though as all methods will be verified in the end so it'd fail on the
// top of the hierarchy (if empty) anyway.
reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but method overrides another, skipping.");
// reporter.print(Diagnostic.Kind.NOTE, element, "javadoc empty but method overrides another, skipping.");
return true;
}
}

View File

@ -270,6 +270,17 @@ class JFlexTask extends DefaultTask {
]
}
// fix invalid SuppressWarnings from jflex, so that it works with javac.
// we also need to suppress 'unused' because of dead code, so it passes ecjLint
// you can't "stack" SuppressWarnings annotations, jflex adds its own, this is the only way
// https://github.com/jflex-de/jflex/issues/762
project.ant.replace(
file: target,
encoding: "UTF-8",
token: 'SuppressWarnings("FallThrough")',
value: 'SuppressWarnings({"fallthrough","unused"})'
)
// Correct line endings for Windows.
project.ant.fixcrlf(
file: target,

View File

@ -1,80 +1,69 @@
/** This character denotes the end of file */
/** This character denotes the end of file. */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
/** Initial size of the lookahead buffer. */
--- private static final int ZZ_BUFFERSIZE = ...;
/** lexical states */
/** Lexical states. */
--- lexical states, charmap
/* error codes */
/** Error code for "Unknown internal scanner error". */
private static final int ZZ_UNKNOWN_ERROR = 0;
/** Error code for "could not match input". */
private static final int ZZ_NO_MATCH = 1;
/** Error code for "pushback value was too large". */
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String[] ZZ_ERROR_MSG = {
/**
* Error messages for {@link #ZZ_UNKNOWN_ERROR}, {@link #ZZ_NO_MATCH}, and
* {@link #ZZ_PUSHBACK_2BIG} respectively.
*/
private static final String ZZ_ERROR_MSG[] = {
"Unknown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
--- isFinal list
/** the input device */
/** Input device. */
private java.io.Reader zzReader;
/** the current state of the DFA */
/** Current state of the DFA. */
private int zzState;
/** the current lexical state */
/** Current lexical state. */
private int zzLexicalState = YYINITIAL;
/** this buffer contains the current text to be matched and is
the source of the yytext() string */
private char[] zzBuffer = new char[ZZ_BUFFERSIZE];
/**
* This buffer contains the current text to be matched and is the source of the {@link #yytext()}
* string.
*/
private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
/** the textposition at the last accepting state */
/** Text position at the last accepting state. */
private int zzMarkedPos;
/** the current text position in the buffer */
/** Current text position in the buffer. */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
/** Marks the beginning of the {@link #yytext()} string in the buffer. */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read
from input */
/** Marks the last character in the buffer, that has been read from input. */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/**
* the number of characters from the last newline up to the start of the
* matched text
* Whether the scanner is at the end of file.
* @see #yyatEOF
*/
private int yycolumn;
/**
* zzAtBOL == true iff the scanner is currently at the beginning of a line
*/
private boolean zzAtBOL = true;
/** zzAtEOF == true iff the scanner is at the EOF */
private boolean zzAtEOF;
/** denotes if the user-EOF-code has already been executed */
private boolean zzEOFDone;
/**
* The number of occupied positions in zzBuffer beyond zzEndRead.
* When a lead/high surrogate has been read from the input stream
* into the final zzBuffer position, this will have a value of 1;
* otherwise, it will have a value of 0.
/**
* The number of occupied positions in {@link #zzBuffer} beyond {@link #zzEndRead}.
*
* <p>When a lead/high surrogate has been read from the input stream into the final
* {@link #zzBuffer} position, this will have a value of 1; otherwise, it will have a value of 0.
*/
private int zzFinalHighSurrogate = 0;
@ -82,13 +71,11 @@
--- constructor declaration
/**
* Refills the input buffer.
*
* @return <code>false</code>, iff there was new input.
*
* @exception java.io.IOException if any I/O-Error occurs
* @return {@code false} iff there was new input.
* @exception java.io.IOException if any I/O-Error occurs
*/
private boolean zzRefill() throws java.io.IOException {
@ -98,19 +85,19 @@
zzFinalHighSurrogate = 0;
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
zzEndRead - zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRead;
zzCurrentPos-= zzStartRead;
zzMarkedPos-= zzStartRead;
zzEndRead -= zzStartRead;
zzCurrentPos -= zzStartRead;
zzMarkedPos -= zzStartRead;
zzStartRead = 0;
}
/* is the buffer big enough? */
if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) {
/* if not: blow it up */
char[] newBuffer = new char[zzBuffer.length*2];
char newBuffer[] = new char[zzBuffer.length * 2];
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
zzBuffer = newBuffer;
zzEndRead += zzFinalHighSurrogate;
@ -123,17 +110,22 @@
/* not supposed to occur according to specification of java.io.Reader */
if (numRead == 0) {
throw new java.io.IOException("Reader returned 0 characters. See JFlex examples for workaround.");
throw new java.io.IOException(
"Reader returned 0 characters. See JFlex examples/zero-reader for a workaround.");
}
if (numRead > 0) {
zzEndRead += numRead;
/* If numRead == requested, we might have requested to few chars to
encode a full Unicode character. We assume that a Reader would
otherwise never return half characters. */
if (numRead == requested) {
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
if (numRead == requested) { // We requested too few chars to encode a full Unicode character
--zzEndRead;
zzFinalHighSurrogate = 1;
} else { // There is room in the buffer for at least one more char
int c = zzReader.read(); // Expecting to read a paired low surrogate char
if (c == -1) {
return true;
} else {
zzBuffer[zzEndRead++] = (char)c;
}
}
}
/* potentially more input available */
@ -144,48 +136,75 @@
return true;
}
/**
* Closes the input stream.
* Closes the input reader.
*
* @throws java.io.IOException if the reader could not be closed.
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
zzAtEOF = true; // indicate end of file
zzEndRead = zzStartRead; // invalidate buffer
if (zzReader != null)
if (zzReader != null) {
zzReader.close();
}
}
/**
* Resets the scanner to read from a new input stream.
* Does not close the old reader.
*
* All internal variables are reset, the old input stream
* <b>cannot</b> be reused (internal buffer is discarded and lost).
* Lexical state is set to <code>ZZ_INITIAL</code>.
* <p>Does not close the old reader.
*
* Internal scan buffer is resized down to its initial length, if it has grown.
* <p>All internal variables are reset, the old input stream <b>cannot</b> be reused (internal
* buffer is discarded and lost). Lexical state is set to {@code ZZ_INITIAL}.
*
* @param reader the new input stream
* <p>Internal scan buffer is resized down to its initial length, if it has grown.
*
* @param reader The new input stream.
*/
public final void yyreset(java.io.Reader reader) {
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
zzEOFDone = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = 0;
zzFinalHighSurrogate = 0;
yyline = yychar = yycolumn = 0;
yyResetPosition();
zzLexicalState = YYINITIAL;
if (zzBuffer.length > ZZ_BUFFERSIZE)
if (zzBuffer.length > ZZ_BUFFERSIZE) {
zzBuffer = new char[ZZ_BUFFERSIZE];
}
}
/**
* Resets the input position.
*/
private final void yyResetPosition() {
zzAtBOL = true;
zzAtEOF = false;
zzCurrentPos = 0;
zzMarkedPos = 0;
zzStartRead = 0;
zzEndRead = 0;
zzFinalHighSurrogate = 0;
yyline = 0;
yycolumn = 0;
yychar = 0L;
}
/**
* Returns whether the scanner has reached the end of the reader it reads from.
*
* @return whether the scanner has reached EOF.
*/
public final boolean yyatEOF() {
return zzAtEOF;
}
/**
* Returns the current lexical state.
*
* @return the current lexical state.
*/
public final int yystate() {
return zzLexicalState;
@ -193,7 +212,7 @@
/**
* Enters a new lexical state
* Enters a new lexical state.
*
* @param newState the new lexical state
*/
@ -204,30 +223,32 @@
/**
* Returns the text matched by the current regular expression.
*
* @return the matched text.
*/
public final String yytext() {
return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
return new String(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead);
}
/**
* Returns the character at position <code>pos</code> from the
* matched text.
*
* It is equivalent to yytext().charAt(pos), but faster
* Returns the character at the given position from the matched text.
*
* @param pos the position of the character to fetch.
* A value from 0 to yylength()-1.
* <p>It is equivalent to {@code yytext().charAt(pos)}, but faster.
*
* @return the character at position pos
* @param position the position of the character to fetch. A value from 0 to {@code yylength()-1}.
*
* @return the character at {@code position}.
*/
public final char yycharat(int pos) {
return zzBuffer[zzStartRead+pos];
public final char yycharat(int position) {
return zzBuffer[zzStartRead + position];
}
/**
* Returns the length of the matched text region.
* How many characters were matched.
*
* @return the length of the matched text region.
*/
public final int yylength() {
return zzMarkedPos-zzStartRead;
@ -235,39 +256,38 @@
/**
* Reports an error that occured while scanning.
* Reports an error that occurred while scanning.
*
* In a wellformed scanner (no or only correct usage of
* yypushback(int) and a match-all fallback rule) this method
* will only be called with things that "Can't Possibly Happen".
* If this method is called, something is seriously wrong
* (e.g. a JFlex bug producing a faulty scanner etc.).
* <p>In a well-formed scanner (no or only correct usage of {@code yypushback(int)} and a
* match-all fallback rule) this method will only be called with things that
* "Can't Possibly Happen".
*
* Usual syntax/scanner level error handling should be done
* in error fallback rules.
* <p>If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty
* scanner etc.).
*
* @param errorCode the code of the errormessage to display
* <p>Usual syntax/scanner level error handling should be done in error fallback rules.
*
* @param errorCode the code of the error message to display.
*/
--- zzScanError declaration
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
}
catch (ArrayIndexOutOfBoundsException e) {
} catch (ArrayIndexOutOfBoundsException e) {
message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
--- throws clause
}
}
/**
* Pushes the specified amount of characters back into the input stream.
*
* They will be read again by then next call of the scanning method
* <p>They will be read again by then next call of the scanning method.
*
* @param number the number of characters to be read again.
* This number must not be greater than yylength()!
* @param number the number of characters to be read again. This number must not be greater than
* {@link #yylength()}.
*/
--- yypushback decl (contains zzScanError exception)
if ( number > yylength() )
@ -278,12 +298,14 @@
--- zzDoEOF
/**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
* Resumes scanning until the next regular expression is matched, the end of input is encountered
* or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
* @return the next token.
* @exception java.io.IOException if any I/O-Error occurs.
*/
--- yylex declaration
int zzInput;
@ -293,8 +315,7 @@
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
char[] zzBufferL = zzBuffer;
--- local declarations
@ -305,12 +326,12 @@
zzAction = -1;
zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
--- start admin (lexstate etc)
zzForAction: {
while (true) {
--- next input, line, col, char count, next transition, isFinal action
zzAction = zzState;
zzMarkedPosL = zzCurrentPosL;

View File

@ -1,80 +1,69 @@
/** This character denotes the end of file */
/** This character denotes the end of file. */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
/** Initial size of the lookahead buffer. */
--- private static final int ZZ_BUFFERSIZE = ...;
/** lexical states */
/** Lexical States. */
--- lexical states, charmap
/* error codes */
/** Error code for "Unknown internal scanner error". */
private static final int ZZ_UNKNOWN_ERROR = 0;
/** Error code for "could not match input". */
private static final int ZZ_NO_MATCH = 1;
/** Error code for "pushback value was too large". */
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String[] ZZ_ERROR_MSG = {
/**
* Error messages for {@link #ZZ_UNKNOWN_ERROR}, {@link #ZZ_NO_MATCH}, and
* {@link #ZZ_PUSHBACK_2BIG} respectively.
*/
private static final String ZZ_ERROR_MSG[] = {
"Unknown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
--- isFinal list
/** the input device */
/** Input device. */
private java.io.Reader zzReader;
/** the current state of the DFA */
/** Current state of the DFA. */
private int zzState;
/** the current lexical state */
/** Current lexical state. */
private int zzLexicalState = YYINITIAL;
/** this buffer contains the current text to be matched and is
the source of the yytext() string */
private char[] zzBuffer = new char[ZZ_BUFFERSIZE];
/**
* This buffer contains the current text to be matched and is the source of the {@link #yytext()}
* string.
*/
private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
/** the textposition at the last accepting state */
/** Text position at the last accepting state. */
private int zzMarkedPos;
/** the current text position in the buffer */
/** Current text position in the buffer. */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
/** Marks the beginning of the {@link #yytext()} string in the buffer. */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read
from input */
/** Marks the last character in the buffer, that has been read from input. */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/**
* the number of characters from the last newline up to the start of the
* matched text
* Whether the scanner is at the end of file.
* @see #yyatEOF
*/
private int yycolumn;
/**
* zzAtBOL == true iff the scanner is currently at the beginning of a line
*/
private boolean zzAtBOL = true;
/** zzAtEOF == true iff the scanner is at the EOF */
private boolean zzAtEOF;
/** denotes if the user-EOF-code has already been executed */
private boolean zzEOFDone;
/**
* The number of occupied positions in zzBuffer beyond zzEndRead.
* When a lead/high surrogate has been read from the input stream
* into the final zzBuffer position, this will have a value of 1;
* otherwise, it will have a value of 0.
/**
* The number of occupied positions in {@link #zzBuffer} beyond {@link #zzEndRead}.
*
* <p>When a lead/high surrogate has been read from the input stream into the final
* {@link #zzBuffer} position, this will have a value of 1; otherwise, it will have a value of 0.
*/
private int zzFinalHighSurrogate = 0;
@ -82,15 +71,11 @@
--- constructor declaration
/* -------------------------------------------------------------------------------- */
/* Begin Lucene-specific disable-buffer-expansion modifications to skeleton.default */
/**
* Refills the input buffer.
*
* @return <code>false</code>, iff there was new input.
*
* @exception java.io.IOException if any I/O-Error occurs
* @return {@code false} iff there was new input.
* @exception java.io.IOException if any I/O-Error occurs
*/
private boolean zzRefill() throws java.io.IOException {
@ -100,16 +85,15 @@
zzFinalHighSurrogate = 0;
System.arraycopy(zzBuffer, zzStartRead,
zzBuffer, 0,
zzEndRead-zzStartRead);
zzEndRead - zzStartRead);
/* translate stored positions */
zzEndRead-= zzStartRead;
zzCurrentPos-= zzStartRead;
zzMarkedPos-= zzStartRead;
zzEndRead -= zzStartRead;
zzCurrentPos -= zzStartRead;
zzMarkedPos -= zzStartRead;
zzStartRead = 0;
}
/* fill the buffer with new input */
int requested = zzBuffer.length - zzEndRead - zzFinalHighSurrogate;
if (requested == 0) {
@ -119,24 +103,24 @@
/* not supposed to occur according to specification of java.io.Reader */
if (numRead == 0) {
throw new java.io.IOException("Reader returned 0 characters. See JFlex examples for workaround.");
throw new java.io.IOException(
"Reader returned 0 characters. See JFlex examples/zero-reader for a workaround.");
}
if (numRead > 0) {
zzEndRead += numRead;
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
if (numRead == requested) { // We might have requested too few chars to encode a full Unicode character.
if (numRead == requested) { // We requested too few chars to encode a full Unicode character
--zzEndRead;
zzFinalHighSurrogate = 1;
if (numRead == 1) {
return true;
}
} else { // There is room in the buffer for at least one more char
int c = zzReader.read(); // Expecting to read a low surrogate char
int c = zzReader.read(); // Expecting to read a paired low surrogate char
if (c == -1) {
return true;
} else {
zzBuffer[zzEndRead++] = (char)c;
return false;
}
}
}
@ -148,50 +132,75 @@
return true;
}
/* End Lucene-specific disable-buffer-expansion modifications to skeleton.default */
/* ------------------------------------------------------------------------------ */
/**
* Closes the input stream.
* Closes the input reader.
*
* @throws java.io.IOException if the reader could not be closed.
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
zzAtEOF = true; // indicate end of file
zzEndRead = zzStartRead; // invalidate buffer
if (zzReader != null)
if (zzReader != null) {
zzReader.close();
}
}
/**
* Resets the scanner to read from a new input stream.
* Does not close the old reader.
*
* All internal variables are reset, the old input stream
* <b>cannot</b> be reused (internal buffer is discarded and lost).
* Lexical state is set to <code>ZZ_INITIAL</code>.
* <p>Does not close the old reader.
*
* Internal scan buffer is resized down to its initial length, if it has grown.
* <p>All internal variables are reset, the old input stream <b>cannot</b> be reused (internal
* buffer is discarded and lost). Lexical state is set to {@code ZZ_INITIAL}.
*
* @param reader the new input stream
* <p>Internal scan buffer is resized down to its initial length, if it has grown.
*
* @param reader The new input stream.
*/
public final void yyreset(java.io.Reader reader) {
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
zzEOFDone = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = 0;
zzFinalHighSurrogate = 0;
yyline = yychar = yycolumn = 0;
yyResetPosition();
zzLexicalState = YYINITIAL;
if (zzBuffer.length > ZZ_BUFFERSIZE)
if (zzBuffer.length > ZZ_BUFFERSIZE) {
zzBuffer = new char[ZZ_BUFFERSIZE];
}
}
/**
* Resets the input position.
*/
private final void yyResetPosition() {
zzAtBOL = true;
zzAtEOF = false;
zzCurrentPos = 0;
zzMarkedPos = 0;
zzStartRead = 0;
zzEndRead = 0;
zzFinalHighSurrogate = 0;
yyline = 0;
yycolumn = 0;
yychar = 0L;
}
/**
* Returns whether the scanner has reached the end of the reader it reads from.
*
* @return whether the scanner has reached EOF.
*/
public final boolean yyatEOF() {
return zzAtEOF;
}
/**
* Returns the current lexical state.
*
* @return the current lexical state.
*/
public final int yystate() {
return zzLexicalState;
@ -199,7 +208,7 @@
/**
* Enters a new lexical state
* Enters a new lexical state.
*
* @param newState the new lexical state
*/
@ -210,30 +219,32 @@
/**
* Returns the text matched by the current regular expression.
*
* @return the matched text.
*/
public final String yytext() {
return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
return new String(zzBuffer, zzStartRead, zzMarkedPos-zzStartRead);
}
/**
* Returns the character at position <code>pos</code> from the
* matched text.
*
* It is equivalent to yytext().charAt(pos), but faster
* Returns the character at the given position from the matched text.
*
* @param pos the position of the character to fetch.
* A value from 0 to yylength()-1.
* <p>It is equivalent to {@code yytext().charAt(pos)}, but faster.
*
* @return the character at position pos
* @param position the position of the character to fetch. A value from 0 to {@code yylength()-1}.
*
* @return the character at {@code position}.
*/
public final char yycharat(int pos) {
return zzBuffer[zzStartRead+pos];
public final char yycharat(int position) {
return zzBuffer[zzStartRead + position];
}
/**
* Returns the length of the matched text region.
* How many characters were matched.
*
* @return the length of the matched text region.
*/
public final int yylength() {
return zzMarkedPos-zzStartRead;
@ -241,39 +252,38 @@
/**
* Reports an error that occured while scanning.
* Reports an error that occurred while scanning.
*
* In a wellformed scanner (no or only correct usage of
* yypushback(int) and a match-all fallback rule) this method
* will only be called with things that "Can't Possibly Happen".
* If this method is called, something is seriously wrong
* (e.g. a JFlex bug producing a faulty scanner etc.).
* <p>In a well-formed scanner (no or only correct usage of {@code yypushback(int)} and a
* match-all fallback rule) this method will only be called with things that
* "Can't Possibly Happen".
*
* Usual syntax/scanner level error handling should be done
* in error fallback rules.
* <p>If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty
* scanner etc.).
*
* @param errorCode the code of the errormessage to display
* <p>Usual syntax/scanner level error handling should be done in error fallback rules.
*
* @param errorCode the code of the error message to display.
*/
--- zzScanError declaration
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
}
catch (ArrayIndexOutOfBoundsException e) {
} catch (ArrayIndexOutOfBoundsException e) {
message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
--- throws clause
}
}
/**
* Pushes the specified amount of characters back into the input stream.
*
* They will be read again by then next call of the scanning method
* <p>They will be read again by then next call of the scanning method.
*
* @param number the number of characters to be read again.
* This number must not be greater than yylength()!
* @param number the number of characters to be read again. This number must not be greater than
* {@link #yylength()}.
*/
--- yypushback decl (contains zzScanError exception)
if ( number > yylength() )
@ -284,12 +294,14 @@
--- zzDoEOF
/**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
* Resumes scanning until the next regular expression is matched, the end of input is encountered
* or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
* @return the next token.
* @exception java.io.IOException if any I/O-Error occurs.
*/
--- yylex declaration
int zzInput;
@ -299,8 +311,7 @@
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
char[] zzBufferL = zzBuffer;
--- local declarations
@ -311,12 +322,12 @@
zzAction = -1;
zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
--- start admin (lexstate etc)
zzForAction: {
while (true) {
--- next input, line, col, char count, next transition, isFinal action
zzAction = zzState;
zzMarkedPosL = zzCurrentPosL;

View File

@ -1,5 +1,5 @@
{
"gradle/generation/jflex/skeleton.default.txt": "883b32da9ff37f859964af9c2c665361c621b2c2",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.java": "50f43f43859e63a5470f3c8249cad3ea9c131dc0",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.jflex": "958b028ef3f0aec36488fb2bb033cdec5858035f"
"gradle/generation/jflex/skeleton.default.txt": "58944f66c9113a940dfaf6a17210ec8219024390",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.java": "381a9627fd7da6402216e3279cf81a09af222aaf",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.jflex": "f52109bb7d5701979fde90aeeeda726246a8d5fd"
}

View File

@ -1,6 +1,6 @@
{
"gradle/generation/jflex/skeleton.default.txt": "883b32da9ff37f859964af9c2c665361c621b2c2",
"gradle/generation/jflex/skeleton.default.txt": "58944f66c9113a940dfaf6a17210ec8219024390",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/HTMLCharacterEntities.jflex": "d1aa75b9b37646efe31731394f84a063eb7eed9d",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.java": "8470ed427633f58905a8269c78927d7794451e55",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.jflex": "44a271b04ad1564284982be166553584d38b5ea0"
"lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.java": "b937fd938448c5165912bd9a1cd81db291b50940",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/HTMLStripCharFilter.jflex": "1b5b88aed5e25b443fd33279d5be5138701cfb41"
}

View File

@ -1,7 +1,7 @@
{
"gradle/generation/jflex/skeleton.disable.buffer.expansion.txt": "1424f4df33c977bb150d7377c3bd61f819113091",
"gradle/generation/jflex/skeleton.disable.buffer.expansion.txt": "6e43a3a64a9b5eb82ec5b4bc21f95aff5a2a061e",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/ASCIITLD.jflex": "b79e24f254afcd138287049394f22bac9e094e13",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizerImpl.java": "d7e19b7a7c06173750f3d16b1d8ade1950727481",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizerImpl.jflex": "56a751d27e481fb55388f91ebf34f5a0cb8cb1b2",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizerImpl.java": "e91f1cfdd3cc6ca341eab366460bb3b924a287bd",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/email/UAX29URLEmailTokenizerImpl.jflex": "c1f5899cae026a48486ed0eef547e835116d4759",
"lucene/core/src/data/jflex/UnicodeEmojiProperties.jflex": "704643e507c77a66142dd5b1c84ac4273559371a"
}

View File

@ -1,5 +1,5 @@
{
"gradle/generation/jflex/skeleton.default.txt": "883b32da9ff37f859964af9c2c665361c621b2c2",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java": "743fb4cc4b88d36242b3d227320c85e89a6868a8",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.jflex": "a23a4b7cbcdba1fc864c0b85bc2784c8893a0f9f"
"gradle/generation/jflex/skeleton.default.txt": "58944f66c9113a940dfaf6a17210ec8219024390",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.java": "d36e38342f984050b3a314f153b7a001a2d2be82",
"lucene/analysis/common/src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.jflex": "0b8c7774b98e8237702013e82c352d4711509bd0"
}

View File

@ -30,10 +30,9 @@ import org.apache.lucene.analysis.util.OpenStringBuilder;
/**
* A CharFilter that wraps another Reader and attempts to strip out HTML constructs.
*/
@SuppressWarnings({"unused","fallthrough"})
%%
%unicode 9.0
%unicode 9
%apiprivate
%type int
%final
@ -155,7 +154,7 @@ InlineElment = ( [aAbBiIqQsSuU] |
private static final char REPLACEMENT_CHARACTER = '\uFFFD';
private CharArraySet escapedTags = null;
private int inputStart;
private long inputStart;
private int cumulativeDiff;
private boolean escapeBR = false;
private boolean escapeSCRIPT = false;
@ -287,7 +286,7 @@ InlineElment = ( [aAbBiIqQsSuU] |
case SERVER_SIDE_INCLUDE:
case START_TAG_TAIL_SUBSTITUTE: { // Exclude
// add (length of input that won't be output) [ - (substitution length) = 0 ]
cumulativeDiff += yychar - inputStart;
cumulativeDiff += (int) (yychar - inputStart);
// position the correction at (already output length) [ + (substitution length) = 0 ]
addOffCorrectMap(outputCharCount, cumulativeDiff);
outputSegment.clear();
@ -805,7 +804,7 @@ InlineElment = ( [aAbBiIqQsSuU] |
"<!--#" { restoreState = COMMENT; yybegin(SERVER_SIDE_INCLUDE); }
"-->" {
// add (previously matched input length) + (this match length) [ - (substitution length) = 0]
cumulativeDiff += yychar - inputStart + yylength();
cumulativeDiff += (int) (yychar - inputStart + yylength());
// position the correction at (already output length) [ + (substitution length) = 0]
addOffCorrectMap(outputCharCount, cumulativeDiff);
inputSegment.clear();
@ -890,7 +889,7 @@ InlineElment = ( [aAbBiIqQsSuU] |
inputSegment.clear();
yybegin(YYINITIAL);
// add (previously matched input length) -- current match and substitution handled below
cumulativeDiff += yychar - inputStart;
cumulativeDiff += (int) (yychar - inputStart);
// position the offset correction at (already output length) -- substitution handled below
int offsetCorrectionPos = outputCharCount;
int returnValue;

View File

@ -1,4 +1,6 @@
/* The following code was generated by JFlex 1.7.0 */
// DO NOT EDIT
// Generated by JFlex 1.8.2 http://jflex.de/
// source: src/java/org/apache/lucene/analysis/classic/ClassicTokenizerImpl.jflex
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,16 +24,18 @@ package org.apache.lucene.analysis.classic;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
/** This class implements the classic lucene StandardTokenizer up until 3.0 */
@SuppressWarnings({"unused", "fallthrough"})
// See https://github.com/jflex-de/jflex/issues/222
@SuppressWarnings({"fallthrough", "unused"})
class ClassicTokenizerImpl {
/** This character denotes the end of file */
/** This character denotes the end of file. */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
/** Initial size of the lookahead buffer. */
private static final int ZZ_BUFFERSIZE = 4096;
/** lexical states */
/** Lexical states. */
public static final int YYINITIAL = 0;
/**
@ -41,76 +45,140 @@ class ClassicTokenizerImpl {
*/
private static final int ZZ_LEXSTATE[] = {0, 0};
/** Translates characters to character classes */
private static final String ZZ_CMAP_PACKED =
"\46\0\1\5\1\3\4\0\1\11\1\7\1\4\1\11\12\2\6\0"
+ "\1\6\32\12\4\0\1\10\1\0\32\12\57\0\1\12\12\0\1\12"
+ "\4\0\1\12\5\0\27\12\1\0\37\12\1\0\u0128\12\2\0\22\12"
+ "\34\0\136\12\2\0\11\12\2\0\7\12\16\0\2\12\16\0\5\12"
+ "\11\0\1\12\213\0\1\12\13\0\1\12\1\0\3\12\1\0\1\12"
+ "\1\0\24\12\1\0\54\12\1\0\10\12\2\0\32\12\14\0\202\12"
+ "\12\0\71\12\2\0\2\12\2\0\2\12\3\0\46\12\2\0\2\12"
+ "\67\0\46\12\2\0\1\12\7\0\47\12\110\0\33\12\5\0\3\12"
+ "\56\0\32\12\5\0\13\12\25\0\12\2\7\0\143\12\1\0\1\12"
+ "\17\0\2\12\11\0\12\2\3\12\23\0\1\12\1\0\33\12\123\0"
+ "\46\12\u015f\0\65\12\3\0\1\12\22\0\1\12\7\0\12\12\4\0"
+ "\12\2\25\0\10\12\2\0\2\12\2\0\26\12\1\0\7\12\1\0"
+ "\1\12\3\0\4\12\42\0\2\12\1\0\3\12\4\0\12\2\2\12"
+ "\23\0\6\12\4\0\2\12\2\0\26\12\1\0\7\12\1\0\2\12"
+ "\1\0\2\12\1\0\2\12\37\0\4\12\1\0\1\12\7\0\12\2"
+ "\2\0\3\12\20\0\7\12\1\0\1\12\1\0\3\12\1\0\26\12"
+ "\1\0\7\12\1\0\2\12\1\0\5\12\3\0\1\12\22\0\1\12"
+ "\17\0\1\12\5\0\12\2\25\0\10\12\2\0\2\12\2\0\26\12"
+ "\1\0\7\12\1\0\2\12\2\0\4\12\3\0\1\12\36\0\2\12"
+ "\1\0\3\12\4\0\12\2\25\0\6\12\3\0\3\12\1\0\4\12"
+ "\3\0\2\12\1\0\1\12\1\0\2\12\3\0\2\12\3\0\3\12"
+ "\3\0\10\12\1\0\3\12\55\0\11\2\25\0\10\12\1\0\3\12"
+ "\1\0\27\12\1\0\12\12\1\0\5\12\46\0\2\12\4\0\12\2"
+ "\25\0\10\12\1\0\3\12\1\0\27\12\1\0\12\12\1\0\5\12"
+ "\44\0\1\12\1\0\2\12\4\0\12\2\25\0\10\12\1\0\3\12"
+ "\1\0\27\12\1\0\20\12\46\0\2\12\4\0\12\2\25\0\22\12"
+ "\3\0\30\12\1\0\11\12\1\0\1\12\2\0\7\12\71\0\1\1"
+ "\60\12\1\1\2\12\14\1\7\12\11\1\12\2\47\0\2\12\1\0"
+ "\1\12\2\0\2\12\1\0\1\12\2\0\1\12\6\0\4\12\1\0"
+ "\7\12\1\0\3\12\1\0\1\12\1\0\1\12\2\0\2\12\1\0"
+ "\4\12\1\0\2\12\11\0\1\12\2\0\5\12\1\0\1\12\11\0"
+ "\12\2\2\0\2\12\42\0\1\12\37\0\12\2\26\0\10\12\1\0"
+ "\42\12\35\0\4\12\164\0\42\12\1\0\5\12\1\0\2\12\25\0"
+ "\12\2\6\0\6\12\112\0\46\12\12\0\47\12\11\0\132\12\5\0"
+ "\104\12\5\0\122\12\6\0\7\12\1\0\77\12\1\0\1\12\1\0"
+ "\4\12\2\0\7\12\1\0\1\12\1\0\4\12\2\0\47\12\1\0"
+ "\1\12\1\0\4\12\2\0\37\12\1\0\1\12\1\0\4\12\2\0"
+ "\7\12\1\0\1\12\1\0\4\12\2\0\7\12\1\0\7\12\1\0"
+ "\27\12\1\0\37\12\1\0\1\12\1\0\4\12\2\0\7\12\1\0"
+ "\47\12\1\0\23\12\16\0\11\2\56\0\125\12\14\0\u026c\12\2\0"
+ "\10\12\12\0\32\12\5\0\113\12\225\0\64\12\54\0\12\2\46\0"
+ "\12\2\6\0\130\12\10\0\51\12\u0557\0\234\12\4\0\132\12\6\0"
+ "\26\12\2\0\6\12\2\0\46\12\2\0\6\12\2\0\10\12\1\0"
+ "\1\12\1\0\1\12\1\0\1\12\1\0\37\12\2\0\65\12\1\0"
+ "\7\12\1\0\1\12\3\0\3\12\1\0\7\12\3\0\4\12\2\0"
+ "\6\12\4\0\15\12\5\0\3\12\1\0\7\12\202\0\1\12\202\0"
+ "\1\12\4\0\1\12\2\0\12\12\1\0\1\12\3\0\5\12\6\0"
+ "\1\12\1\0\1\12\1\0\1\12\1\0\4\12\1\0\3\12\1\0"
+ "\7\12\u0ecb\0\2\12\52\0\5\12\12\0\1\13\124\13\10\13\2\13"
+ "\2\13\132\13\1\13\3\13\6\13\50\13\3\13\1\0\136\12\21\0"
+ "\30\12\70\0\20\13\u0100\0\200\13\200\0\u19b6\13\12\13\100\0\u51a6\13"
+ "\132\13\u048d\12\u0773\0\u2ba4\12\u215c\0\u012e\13\322\13\7\12\14\0\5\12"
+ "\5\0\1\12\1\0\12\12\1\0\15\12\1\0\5\12\1\0\1\12"
+ "\1\0\2\12\1\0\2\12\1\0\154\12\41\0\u016b\12\22\0\100\12"
+ "\2\0\66\12\50\0\14\12\164\0\3\12\1\0\1\12\1\0\207\12"
+ "\23\0\12\2\7\0\32\12\6\0\32\12\12\0\1\13\72\13\37\12"
+ "\3\0\6\12\2\0\6\12\2\0\6\12\2\0\3\12\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\63\0";
/** Top-level table for translating characters to character classes */
private static final int[] ZZ_CMAP_TOP = zzUnpackcmap_top();
/** Translates characters to character classes */
private static final char[] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
private static final String ZZ_CMAP_TOP_PACKED_0 =
"\1\0\1\u0100\1\u0200\1\u0300\1\u0400\1\u0500\1\u0600\1\u0700"
+ "\1\u0800\1\u0900\1\u0a00\1\u0b00\1\u0c00\1\u0d00\1\u0e00\1\u0f00"
+ "\1\u1000\1\u1100\1\u1200\1\u1300\1\u1400\1\u0100\1\u1500\1\u1600"
+ "\1\u1700\5\u0800\1\u1800\1\u1900\1\u1a00\1\u1b00\16\u0800\1\u1c00"
+ "\1\u1d00\1\u0800\1\u1e00\31\u1f00\1\u2000\121\u1f00\1\u2100\4\u0100"
+ "\1\u2200\7\u0800\53\u0100\1\u2300\41\u0800\1\u1f00\1\u2400\1\u2500"
+ "\1\u0100\1\u2600\1\u2700\1\u2800\u1000\u0800";
private static int[] zzUnpackcmap_top() {
int[] result = new int[4352];
int offset = 0;
offset = zzUnpackcmap_top(ZZ_CMAP_TOP_PACKED_0, offset, result);
return result;
}
private static int zzUnpackcmap_top(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value;
while (--count > 0);
}
return j;
}
/** Second-level tables for translating characters to character classes */
private static final int[] ZZ_CMAP_BLOCKS = zzUnpackcmap_blocks();
private static final String ZZ_CMAP_BLOCKS_PACKED_0 =
"\46\0\1\1\1\2\4\0\1\3\1\4\1\5\1\3"
+ "\12\6\6\0\1\7\32\10\4\0\1\11\1\0\32\10"
+ "\57\0\1\10\12\0\1\10\4\0\1\10\5\0\27\10"
+ "\1\0\37\10\1\0\u0128\10\2\0\22\10\34\0\136\10"
+ "\2\0\11\10\2\0\7\10\16\0\2\10\16\0\5\10"
+ "\11\0\1\10\213\0\1\10\13\0\1\10\1\0\3\10"
+ "\1\0\1\10\1\0\24\10\1\0\54\10\1\0\10\10"
+ "\2\0\32\10\14\0\202\10\12\0\71\10\2\0\2\10"
+ "\2\0\2\10\3\0\46\10\2\0\2\10\67\0\46\10"
+ "\2\0\1\10\7\0\47\10\110\0\33\10\5\0\3\10"
+ "\56\0\32\10\5\0\13\10\25\0\12\6\7\0\143\10"
+ "\1\0\1\10\17\0\2\10\11\0\12\6\3\10\23\0"
+ "\1\10\1\0\33\10\123\0\46\10\u015f\0\65\10\3\0"
+ "\1\10\22\0\1\10\7\0\12\10\4\0\12\6\25\0"
+ "\10\10\2\0\2\10\2\0\26\10\1\0\7\10\1\0"
+ "\1\10\3\0\4\10\42\0\2\10\1\0\3\10\4\0"
+ "\12\6\2\10\23\0\6\10\4\0\2\10\2\0\26\10"
+ "\1\0\7\10\1\0\2\10\1\0\2\10\1\0\2\10"
+ "\37\0\4\10\1\0\1\10\7\0\12\6\2\0\3\10"
+ "\20\0\7\10\1\0\1\10\1\0\3\10\1\0\26\10"
+ "\1\0\7\10\1\0\2\10\1\0\5\10\3\0\1\10"
+ "\22\0\1\10\17\0\1\10\5\0\12\6\25\0\10\10"
+ "\2\0\2\10\2\0\26\10\1\0\7\10\1\0\2\10"
+ "\2\0\4\10\3\0\1\10\36\0\2\10\1\0\3\10"
+ "\4\0\12\6\25\0\6\10\3\0\3\10\1\0\4\10"
+ "\3\0\2\10\1\0\1\10\1\0\2\10\3\0\2\10"
+ "\3\0\3\10\3\0\10\10\1\0\3\10\55\0\11\6"
+ "\25\0\10\10\1\0\3\10\1\0\27\10\1\0\12\10"
+ "\1\0\5\10\46\0\2\10\4\0\12\6\25\0\10\10"
+ "\1\0\3\10\1\0\27\10\1\0\12\10\1\0\5\10"
+ "\44\0\1\10\1\0\2\10\4\0\12\6\25\0\10\10"
+ "\1\0\3\10\1\0\27\10\1\0\20\10\46\0\2\10"
+ "\4\0\12\6\25\0\22\10\3\0\30\10\1\0\11\10"
+ "\1\0\1\10\2\0\7\10\71\0\1\12\60\10\1\12"
+ "\2\10\14\12\7\10\11\12\12\6\47\0\2\10\1\0"
+ "\1\10\2\0\2\10\1\0\1\10\2\0\1\10\6\0"
+ "\4\10\1\0\7\10\1\0\3\10\1\0\1\10\1\0"
+ "\1\10\2\0\2\10\1\0\4\10\1\0\2\10\11\0"
+ "\1\10\2\0\5\10\1\0\1\10\11\0\12\6\2\0"
+ "\2\10\42\0\1\10\37\0\12\6\26\0\10\10\1\0"
+ "\42\10\35\0\4\10\164\0\42\10\1\0\5\10\1\0"
+ "\2\10\25\0\12\6\6\0\6\10\112\0\46\10\12\0"
+ "\47\10\11\0\132\10\5\0\104\10\5\0\122\10\6\0"
+ "\7\10\1\0\77\10\1\0\1\10\1\0\4\10\2\0"
+ "\7\10\1\0\1\10\1\0\4\10\2\0\47\10\1\0"
+ "\1\10\1\0\4\10\2\0\37\10\1\0\1\10\1\0"
+ "\4\10\2\0\7\10\1\0\1\10\1\0\4\10\2\0"
+ "\7\10\1\0\7\10\1\0\27\10\1\0\37\10\1\0"
+ "\1\10\1\0\4\10\2\0\7\10\1\0\47\10\1\0"
+ "\23\10\16\0\11\6\56\0\125\10\14\0\u016c\10\2\0"
+ "\10\10\12\0\32\10\5\0\113\10\225\0\64\10\54\0"
+ "\12\6\46\0\12\6\6\0\130\10\10\0\51\10\127\0"
+ "\234\10\4\0\132\10\6\0\26\10\2\0\6\10\2\0"
+ "\46\10\2\0\6\10\2\0\10\10\1\0\1\10\1\0"
+ "\1\10\1\0\1\10\1\0\37\10\2\0\65\10\1\0"
+ "\7\10\1\0\1\10\3\0\3\10\1\0\7\10\3\0"
+ "\4\10\2\0\6\10\4\0\15\10\5\0\3\10\1\0"
+ "\7\10\202\0\1\10\202\0\1\10\4\0\1\10\2\0"
+ "\12\10\1\0\1\10\3\0\5\10\6\0\1\10\1\0"
+ "\1\10\1\0\1\10\1\0\4\10\1\0\3\10\1\0"
+ "\7\10\313\0\2\10\52\0\5\10\12\0\360\13\1\0"
+ "\136\10\21\0\30\10\70\0\220\13\200\0\u01c0\13\100\0"
+ "\u0100\13\215\10\163\0\244\10\134\0\u0100\13\7\10\14\0"
+ "\5\10\5\0\1\10\1\0\12\10\1\0\15\10\1\0"
+ "\5\10\1\0\1\10\1\0\2\10\1\0\2\10\1\0"
+ "\154\10\41\0\153\10\22\0\100\10\2\0\66\10\50\0"
+ "\14\10\164\0\3\10\1\0\1\10\1\0\207\10\23\0"
+ "\12\6\7\0\32\10\6\0\32\10\12\0\73\13\37\10"
+ "\3\0\6\10\2\0\6\10\2\0\6\10\2\0\3\10"
+ "\43\0";
private static int[] zzUnpackcmap_blocks() {
int[] result = new int[10496];
int offset = 0;
offset = zzUnpackcmap_blocks(ZZ_CMAP_BLOCKS_PACKED_0, offset, result);
return result;
}
private static int zzUnpackcmap_blocks(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value;
while (--count > 0);
}
return j;
}
/** Translates DFA states to action switch labels. */
private static final int[] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\1\0\1\1\3\2\1\3\13\0\1\2\3\4\2\0"
+ "\1\5\1\0\1\5\3\4\6\5\1\6\1\4\2\7"
+ "\1\10\1\0\1\10\3\0\2\10\1\11\1\12\1\4";
"\1\0\1\1\3\2\1\3\12\0\1\2\1\0\6\4"
+ "\3\5\1\0\1\6\1\7\2\4\2\0\3\5\1\6"
+ "\1\5\2\10\4\0\1\10\1\11\1\10\1\12\1\5";
private static int[] zzUnpackAction() {
int[] result = new int[50];
@ -139,9 +207,9 @@ class ClassicTokenizerImpl {
"\0\0\0\14\0\30\0\44\0\60\0\14\0\74\0\110"
+ "\0\124\0\140\0\154\0\170\0\204\0\220\0\234\0\250"
+ "\0\264\0\300\0\314\0\330\0\344\0\360\0\374\0\u0108"
+ "\0\u0114\0\u0120\0\u012c\0\u0138\0\u0144\0\u0150\0\u015c\0\u0168"
+ "\0\u0174\0\u0180\0\u018c\0\u0198\0\u01a4\0\250\0\u01b0\0\u01bc"
+ "\0\u01c8\0\u01d4\0\u01e0\0\u01ec\0\u01f8\0\74\0\154\0\u0204"
+ "\0\u0114\0\u0120\0\u012c\0\u0138\0\154\0\u0144\0\u0150\0\u015c"
+ "\0\u0168\0\u0174\0\u0180\0\u018c\0\u0198\0\u01a4\0\u01b0\0\124"
+ "\0\300\0\u01bc\0\u01c8\0\u01d4\0\u01e0\0\u01ec\0\u01f8\0\u0204"
+ "\0\u0210\0\u021c";
private static int[] zzUnpackRowMap() {
@ -166,46 +234,45 @@ class ClassicTokenizerImpl {
private static final int[] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\1\2\1\3\1\4\7\2\1\5\1\6\15\0\2\3"
+ "\1\0\1\7\1\0\1\10\2\11\1\12\1\3\2\0"
+ "\1\3\1\4\1\0\1\13\1\0\1\10\2\14\1\15"
+ "\1\4\2\0\1\3\1\4\1\16\1\17\1\20\1\21"
+ "\2\11\1\12\1\22\2\0\1\23\1\24\7\0\1\25"
+ "\2\0\2\26\7\0\1\26\2\0\1\27\1\30\7\0"
+ "\1\31\3\0\1\32\7\0\1\12\2\0\1\33\1\34"
+ "\7\0\1\35\2\0\1\36\1\37\7\0\1\40\2\0"
+ "\1\41\1\42\7\0\1\43\13\0\1\44\2\0\1\23"
+ "\1\24\7\0\1\45\13\0\1\46\2\0\2\26\7\0"
+ "\1\47\2\0\1\3\1\4\1\16\1\7\1\20\1\21"
+ "\2\11\1\12\1\22\2\0\2\23\1\0\1\50\1\0"
+ "\1\10\2\51\1\0\1\23\2\0\1\23\1\24\1\0"
+ "\1\52\1\0\1\10\2\53\1\54\1\24\2\0\1\23"
+ "\1\24\1\0\1\50\1\0\1\10\2\51\1\0\1\25"
+ "\2\0\2\26\1\0\1\55\2\0\1\55\2\0\1\26"
+ "\2\0\2\27\1\0\1\51\1\0\1\10\2\51\1\0"
+ "\1\27\2\0\1\27\1\30\1\0\1\53\1\0\1\10"
+ "\2\53\1\54\1\30\2\0\1\27\1\30\1\0\1\51"
+ "\1\0\1\10\2\51\1\0\1\31\3\0\1\32\1\0"
+ "\1\54\2\0\3\54\1\32\2\0\2\33\1\0\1\56"
+ "\1\0\1\10\2\11\1\12\1\33\2\0\1\33\1\34"
+ "\1\0\1\57\1\0\1\10\2\14\1\15\1\34\2\0"
+ "\1\33\1\34\1\0\1\56\1\0\1\10\2\11\1\12"
+ "\1\35\2\0\2\36\1\0\1\11\1\0\1\10\2\11"
+ "\1\12\1\36\2\0\1\36\1\37\1\0\1\14\1\0"
+ "\1\10\2\14\1\15\1\37\2\0\1\36\1\37\1\0"
+ "\1\11\1\0\1\10\2\11\1\12\1\40\2\0\2\41"
+ "\1\0\1\12\2\0\3\12\1\41\2\0\1\41\1\42"
+ "\1\0\1\15\2\0\3\15\1\42\2\0\1\41\1\42"
+ "\1\0\1\12\2\0\3\12\1\43\4\0\1\16\6\0"
+ "\1\44\2\0\1\23\1\24\1\0\1\60\1\0\1\10"
+ "\2\51\1\0\1\25\2\0\2\26\1\0\1\55\2\0"
+ "\1\55\2\0\1\47\2\0\2\23\7\0\1\23\2\0"
+ "\2\27\7\0\1\27\2\0\2\33\7\0\1\33\2\0"
+ "\2\36\7\0\1\36\2\0\2\41\7\0\1\41\2\0"
+ "\2\61\7\0\1\61\2\0\2\23\7\0\1\62\2\0"
+ "\2\61\1\0\1\55\2\0\1\55\2\0\1\61\2\0"
+ "\2\23\1\0\1\60\1\0\1\10\2\51\1\0\1\23"
+ "\1\0";
"\6\2\1\3\1\2\1\4\1\2\1\5\1\6\17\0"
+ "\1\7\1\10\1\11\1\3\1\12\1\3\1\10\1\5"
+ "\2\0\1\13\1\14\1\15\1\16\1\17\1\3\1\20"
+ "\1\21\1\16\1\5\4\0\1\15\1\16\1\22\1\5"
+ "\1\12\1\5\1\16\1\5\7\0\1\23\1\0\1\24"
+ "\1\0\1\25\7\0\1\26\1\0\1\27\1\0\1\30"
+ "\7\0\1\31\1\0\1\32\1\0\1\33\7\0\1\34"
+ "\1\0\1\34\1\0\1\34\11\0\1\35\13\0\1\36"
+ "\11\0\1\37\1\0\1\15\11\0\1\40\1\0\1\41"
+ "\1\0\1\42\7\0\1\43\1\0\1\44\1\0\1\45"
+ "\7\0\1\34\1\0\1\46\1\0\1\34\2\0\1\13"
+ "\1\14\1\15\1\16\1\22\1\3\1\20\1\21\1\16"
+ "\1\5\7\0\1\43\1\0\1\47\1\0\1\45\4\0"
+ "\3\7\1\23\1\0\1\23\1\7\1\25\4\0\3\15"
+ "\1\23\1\0\1\24\1\15\1\25\4\0\3\15\1\25"
+ "\1\0\1\25\1\15\1\25\4\0\1\7\2\10\1\26"
+ "\1\12\1\26\1\10\1\30\4\0\1\15\2\16\1\26"
+ "\1\12\1\27\1\16\1\30\4\0\1\15\2\16\1\30"
+ "\1\12\1\30\1\16\1\30\4\0\1\7\1\10\1\50"
+ "\1\31\1\12\1\31\1\10\1\33\4\0\1\15\1\16"
+ "\1\51\1\31\1\12\1\32\1\16\1\33\4\0\1\15"
+ "\1\16\1\51\1\33\1\12\1\33\1\16\1\33\5\0"
+ "\2\52\1\34\1\0\1\34\1\0\1\34\3\0\1\14"
+ "\5\0\1\36\6\0\3\53\1\37\1\0\1\37\1\53"
+ "\5\0\1\53\2\54\1\40\1\12\1\40\1\54\1\42"
+ "\5\0\2\55\1\40\1\12\1\41\1\55\1\42\5\0"
+ "\2\55\1\42\1\12\1\42\1\55\1\42\4\0\1\53"
+ "\1\54\1\56\1\43\1\12\1\43\1\54\1\45\5\0"
+ "\1\55\1\57\1\43\1\12\1\47\1\55\1\45\5\0"
+ "\1\55\1\60\1\45\1\12\1\45\1\55\1\45\5\0"
+ "\2\52\1\34\1\0\1\46\1\0\1\34\5\0\1\55"
+ "\1\60\1\43\1\12\1\47\1\55\1\45\7\0\1\61"
+ "\1\0\1\61\1\0\1\61\7\0\1\25\1\0\1\25"
+ "\1\0\1\25\7\0\1\30\1\0\1\30\1\0\1\30"
+ "\7\0\1\42\1\0\1\42\1\0\1\42\7\0\1\33"
+ "\1\0\1\33\1\0\1\33\7\0\1\45\1\0\1\62"
+ "\1\0\1\45\7\0\1\45\1\0\1\45\1\0\1\45"
+ "\5\0\2\52\1\61\1\0\1\61\1\0\1\61\5\0"
+ "\1\55\1\57\1\45\1\12\1\45\1\55\1\45\1\0";
private static int[] zzUnpackTrans() {
int[] result = new int[552];
@ -228,23 +295,28 @@ class ClassicTokenizerImpl {
return j;
}
/* error codes */
/** Error code for "Unknown internal scanner error". */
private static final int ZZ_UNKNOWN_ERROR = 0;
/** Error code for "could not match input". */
private static final int ZZ_NO_MATCH = 1;
/** Error code for "pushback value was too large". */
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String[] ZZ_ERROR_MSG = {
/**
* Error messages for {@link #ZZ_UNKNOWN_ERROR}, {@link #ZZ_NO_MATCH}, and {@link
* #ZZ_PUSHBACK_2BIG} respectively.
*/
private static final String ZZ_ERROR_MSG[] = {
"Unknown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
/** ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code> */
/** ZZ_ATTRIBUTE[aState] contains the attributes of state {@code aState} */
private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\1\0\1\11\3\1\1\11\13\0\4\1\2\0\1\1" + "\1\0\17\1\1\0\1\1\3\0\5\1";
"\1\0\1\11\3\1\1\11\12\0\1\1\1\0\11\1" + "\1\0\4\1\2\0\7\1\4\0\5\1";
private static int[] zzUnpackAttribute() {
int[] result = new int[50];
@ -266,57 +338,67 @@ class ClassicTokenizerImpl {
return j;
}
/** the input device */
/** Input device. */
private java.io.Reader zzReader;
/** the current state of the DFA */
/** Current state of the DFA. */
private int zzState;
/** the current lexical state */
/** Current lexical state. */
private int zzLexicalState = YYINITIAL;
/**
* this buffer contains the current text to be matched and is the source of the yytext() string
* This buffer contains the current text to be matched and is the source of the {@link #yytext()}
* string.
*/
private char[] zzBuffer = new char[ZZ_BUFFERSIZE];
private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
/** the textposition at the last accepting state */
/** Text position at the last accepting state. */
private int zzMarkedPos;
/** the current text position in the buffer */
/** Current text position in the buffer. */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
/** Marks the beginning of the {@link #yytext()} string in the buffer. */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read from input */
/** Marks the last character in the buffer, that has been read from input. */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/** the number of characters from the last newline up to the start of the matched text */
private int yycolumn;
/** zzAtBOL == true iff the scanner is currently at the beginning of a line */
private boolean zzAtBOL = true;
/** zzAtEOF == true iff the scanner is at the EOF */
/**
* Whether the scanner is at the end of file.
*
* @see #yyatEOF
*/
private boolean zzAtEOF;
/** denotes if the user-EOF-code has already been executed */
private boolean zzEOFDone;
/**
* The number of occupied positions in zzBuffer beyond zzEndRead. When a lead/high surrogate has
* been read from the input stream into the final zzBuffer position, this will have a value of 1;
* otherwise, it will have a value of 0.
* The number of occupied positions in {@link #zzBuffer} beyond {@link #zzEndRead}.
*
* <p>When a lead/high surrogate has been read from the input stream into the final {@link
* #zzBuffer} position, this will have a value of 1; otherwise, it will have a value of 0.
*/
private int zzFinalHighSurrogate = 0;
/** Number of newlines encountered up to the start of the matched text. */
@SuppressWarnings("unused")
private int yyline;
/** Number of characters from the last newline up to the start of the matched text. */
@SuppressWarnings("unused")
private int yycolumn;
/** Number of characters up to the start of the matched text. */
private long yychar;
/** Whether the scanner is currently at the beginning of a line. */
@SuppressWarnings("unused")
private boolean zzAtBOL = true;
/** Whether the user-EOF-code has already been executed. */
@SuppressWarnings("unused")
private boolean zzEOFDone;
/* user code: */
public static final int ALPHANUM = ClassicTokenizer.ALPHANUM;
@ -332,7 +414,8 @@ class ClassicTokenizerImpl {
public static final String[] TOKEN_TYPES = ClassicTokenizer.TOKEN_TYPES;
public final int yychar() {
return yychar;
// jflex supports > 2GB docs but not lucene
return (int) yychar;
}
/** Fills CharTermAttribute with the current token text. */
@ -353,29 +436,18 @@ class ClassicTokenizerImpl {
this.zzReader = in;
}
/**
* Unpacks the compressed character translation table.
*
* @param packed the packed character translation table
* @return the unpacked character translation table
*/
private static char[] zzUnpackCMap(String packed) {
char[] map = new char[0x110000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 1170) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
do map[j++] = value;
while (--count > 0);
}
return map;
/** Translates raw input code points to DFA table row */
private static int zzCMap(int input) {
int offset = input & 255;
return offset == input
? ZZ_CMAP_BLOCKS[offset]
: ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset];
}
/**
* Refills the input buffer.
*
* @return <code>false</code>, iff there was new input.
* @return {@code false} iff there was new input.
* @exception java.io.IOException if any I/O-Error occurs
*/
private boolean zzRefill() throws java.io.IOException {
@ -396,7 +468,7 @@ class ClassicTokenizerImpl {
/* is the buffer big enough? */
if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) {
/* if not: blow it up */
char[] newBuffer = new char[zzBuffer.length * 2];
char newBuffer[] = new char[zzBuffer.length * 2];
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
zzBuffer = newBuffer;
zzEndRead += zzFinalHighSurrogate;
@ -410,17 +482,21 @@ class ClassicTokenizerImpl {
/* not supposed to occur according to specification of java.io.Reader */
if (numRead == 0) {
throw new java.io.IOException(
"Reader returned 0 characters. See JFlex examples for workaround.");
"Reader returned 0 characters. See JFlex examples/zero-reader for a workaround.");
}
if (numRead > 0) {
zzEndRead += numRead;
/* If numRead == requested, we might have requested to few chars to
encode a full Unicode character. We assume that a Reader would
otherwise never return half characters. */
if (numRead == requested) {
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
if (numRead == requested) { // We requested too few chars to encode a full Unicode character
--zzEndRead;
zzFinalHighSurrogate = 1;
} else { // There is room in the buffer for at least one more char
int c = zzReader.read(); // Expecting to read a paired low surrogate char
if (c == -1) {
return true;
} else {
zzBuffer[zzEndRead++] = (char) c;
}
}
}
/* potentially more input available */
@ -431,44 +507,76 @@ class ClassicTokenizerImpl {
return true;
}
/** Closes the input stream. */
/**
* Closes the input reader.
*
* @throws java.io.IOException if the reader could not be closed.
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
zzAtEOF = true; // indicate end of file
zzEndRead = zzStartRead; // invalidate buffer
if (zzReader != null) zzReader.close();
if (zzReader != null) {
zzReader.close();
}
}
/**
* Resets the scanner to read from a new input stream. Does not close the old reader.
* Resets the scanner to read from a new input stream.
*
* <p>Does not close the old reader.
*
* <p>All internal variables are reset, the old input stream <b>cannot</b> be reused (internal
* buffer is discarded and lost). Lexical state is set to <code>ZZ_INITIAL</code>.
* buffer is discarded and lost). Lexical state is set to {@code ZZ_INITIAL}.
*
* <p>Internal scan buffer is resized down to its initial length, if it has grown.
*
* @param reader the new input stream
* @param reader The new input stream.
*/
public final void yyreset(java.io.Reader reader) {
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
zzEOFDone = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = 0;
zzFinalHighSurrogate = 0;
yyline = yychar = yycolumn = 0;
yyResetPosition();
zzLexicalState = YYINITIAL;
if (zzBuffer.length > ZZ_BUFFERSIZE) zzBuffer = new char[ZZ_BUFFERSIZE];
if (zzBuffer.length > ZZ_BUFFERSIZE) {
zzBuffer = new char[ZZ_BUFFERSIZE];
}
}
/** Returns the current lexical state. */
/** Resets the input position. */
private final void yyResetPosition() {
zzAtBOL = true;
zzAtEOF = false;
zzCurrentPos = 0;
zzMarkedPos = 0;
zzStartRead = 0;
zzEndRead = 0;
zzFinalHighSurrogate = 0;
yyline = 0;
yycolumn = 0;
yychar = 0L;
}
/**
* Returns whether the scanner has reached the end of the reader it reads from.
*
* @return whether the scanner has reached EOF.
*/
public final boolean yyatEOF() {
return zzAtEOF;
}
/**
* Returns the current lexical state.
*
* @return the current lexical state.
*/
public final int yystate() {
return zzLexicalState;
}
/**
* Enters a new lexical state
* Enters a new lexical state.
*
* @param newState the new lexical state
*/
@ -476,41 +584,51 @@ class ClassicTokenizerImpl {
zzLexicalState = newState;
}
/** Returns the text matched by the current regular expression. */
/**
* Returns the text matched by the current regular expression.
*
* @return the matched text.
*/
public final String yytext() {
return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
}
/**
* Returns the character at position <code>pos</code> from the matched text.
* Returns the character at the given position from the matched text.
*
* <p>It is equivalent to yytext().charAt(pos), but faster
* <p>It is equivalent to {@code yytext().charAt(pos)}, but faster.
*
* @param pos the position of the character to fetch. A value from 0 to yylength()-1.
* @return the character at position pos
* @param position the position of the character to fetch. A value from 0 to {@code yylength()-1}.
* @return the character at {@code position}.
*/
public final char yycharat(int pos) {
return zzBuffer[zzStartRead + pos];
public final char yycharat(int position) {
return zzBuffer[zzStartRead + position];
}
/** Returns the length of the matched text region. */
/**
* How many characters were matched.
*
* @return the length of the matched text region.
*/
public final int yylength() {
return zzMarkedPos - zzStartRead;
}
/**
* Reports an error that occured while scanning.
* Reports an error that occurred while scanning.
*
* <p>In a wellformed scanner (no or only correct usage of yypushback(int) and a match-all
* fallback rule) this method will only be called with things that "Can't Possibly Happen". If
* this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty
* <p>In a well-formed scanner (no or only correct usage of {@code yypushback(int)} and a
* match-all fallback rule) this method will only be called with things that "Can't Possibly
* Happen".
*
* <p>If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty
* scanner etc.).
*
* <p>Usual syntax/scanner level error handling should be done in error fallback rules.
*
* @param errorCode the code of the errormessage to display
* @param errorCode the code of the error message to display.
*/
private void zzScanError(int errorCode) {
private static void zzScanError(int errorCode) {
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
@ -524,10 +642,10 @@ class ClassicTokenizerImpl {
/**
* Pushes the specified amount of characters back into the input stream.
*
* <p>They will be read again by then next call of the scanning method
* <p>They will be read again by then next call of the scanning method.
*
* @param number the number of characters to be read again. This number must not be greater than
* yylength()!
* {@link #yylength()}.
*/
public void yypushback(int number) {
if (number > yylength()) zzScanError(ZZ_PUSHBACK_2BIG);
@ -539,8 +657,8 @@ class ClassicTokenizerImpl {
* Resumes scanning until the next regular expression is matched, the end of input is encountered
* or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
* @return the next token.
* @exception java.io.IOException if any I/O-Error occurs.
*/
public int getNextToken() throws java.io.IOException {
int zzInput;
@ -551,7 +669,6 @@ class ClassicTokenizerImpl {
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char[] zzBufferL = zzBuffer;
char[] zzCMapL = ZZ_CMAP;
int[] zzTransL = ZZ_TRANS;
int[] zzRowMapL = ZZ_ROWMAP;
@ -602,7 +719,7 @@ class ClassicTokenizerImpl {
zzCurrentPosL += Character.charCount(zzInput);
}
}
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]];
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMap(zzInput)];
if (zzNext == -1) break zzForAction;
zzState = zzNext;
@ -647,28 +764,28 @@ class ClassicTokenizerImpl {
break;
case 4:
{
return HOST;
return NUM;
}
// fall through
case 14:
break;
case 5:
{
return NUM;
return HOST;
}
// fall through
case 15:
break;
case 6:
{
return APOSTROPHE;
return COMPANY;
}
// fall through
case 16:
break;
case 7:
{
return COMPANY;
return APOSTROPHE;
}
// fall through
case 17:

View File

@ -22,7 +22,6 @@ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
/**
* This class implements the classic lucene StandardTokenizer up until 3.0
*/
@SuppressWarnings({"unused","fallthrough"})
%%
%class ClassicTokenizerImpl
@ -49,7 +48,8 @@ public static final String [] TOKEN_TYPES = ClassicTokenizer.TOKEN_TYPES;
public final int yychar()
{
return yychar;
// jflex supports > 2GB docs but not lucene
return (int) yychar;
}
/**

View File

@ -40,10 +40,9 @@ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
* <li>&lt;EMOJI&gt;: A sequence of Emoji characters</li>
* </ul>
*/
@SuppressWarnings({"unused","fallthrough"})
%%
%unicode 9.0
%unicode 9
%integer
%final
%public
@ -250,7 +249,8 @@ EMAIL = {EMAILlocalPart} "@" ({DomainNameStrict} | {EMAILbracketedHost})
/** Character count processed so far */
public final int yychar()
{
return yychar;
// jflex supports > 2GB docs but not lucene
return (int) yychar;
}
/**
@ -430,4 +430,4 @@ EMAIL = {EMAILlocalPart} "@" ({DomainNameStrict} | {EMAILbracketedHost})
// WB999. Any ÷ Any
//
[^] { /* Break so we don't hit fall-through warning: */ break; /* Not numeric, word, ideographic, hiragana, emoji or SE Asian -- ignore it. */ }
}
}

View File

@ -1,4 +1,6 @@
/* The following code was generated by JFlex 1.7.0 */
// DO NOT EDIT
// Generated by JFlex 1.8.2 http://jflex.de/
// source: src/java/org/apache/lucene/analysis/wikipedia/WikipediaTokenizerImpl.jflex
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,16 +24,18 @@ package org.apache.lucene.analysis.wikipedia;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
/** JFlex-generated tokenizer that is aware of Wikipedia syntax. */
@SuppressWarnings({"unused", "fallthrough"})
// See https://github.com/jflex-de/jflex/issues/222
@SuppressWarnings({"fallthrough", "unused"})
class WikipediaTokenizerImpl {
/** This character denotes the end of file */
/** This character denotes the end of file. */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
/** Initial size of the lookahead buffer. */
private static final int ZZ_BUFFERSIZE = 4096;
/** lexical states */
/** Lexical states. */
public static final int YYINITIAL = 0;
public static final int CATEGORY_STATE = 2;
@ -53,39 +57,89 @@ class WikipediaTokenizerImpl {
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9
};
/** Translates characters to character classes */
private static final String ZZ_CMAP_PACKED =
"\11\0\1\24\1\23\1\0\1\24\1\22\22\0\1\24\1\0\1\12"
+ "\1\53\2\0\1\3\1\1\4\0\1\14\1\5\1\2\1\10\12\16"
+ "\1\27\1\0\1\7\1\11\1\13\1\53\1\4\2\15\1\30\5\15"
+ "\1\41\21\15\1\25\1\0\1\26\1\0\1\6\1\0\1\31\1\43"
+ "\2\15\1\33\1\40\1\34\1\50\1\41\4\15\1\42\1\35\1\51"
+ "\1\15\1\36\1\52\1\32\3\15\1\44\1\37\1\15\1\45\1\47"
+ "\1\46\102\0\27\15\1\0\37\15\1\0\u0568\15\12\17\206\15\12\17"
+ "\u026c\15\12\17\166\15\12\17\166\15\12\17\166\15\12\17\166\15\12\17"
+ "\167\15\11\17\166\15\12\17\166\15\12\17\166\15\12\17\340\15\12\17"
+ "\166\15\12\17\u0166\15\12\17\266\15\u0100\15\u0e00\15\u1040\0\u0150\21\140\0"
+ "\20\21\u0100\0\200\21\200\0\u19c0\21\100\0\u5200\21\u0c00\0\u2bb0\20\u2150\0"
+ "\u0200\21\u0465\0\73\21\75\15\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\uffff\0\63\0";
/** Top-level table for translating characters to character classes */
private static final int[] ZZ_CMAP_TOP = zzUnpackcmap_top();
/** Translates characters to character classes */
private static final char[] ZZ_CMAP = zzUnpackCMap(ZZ_CMAP_PACKED);
private static final String ZZ_CMAP_TOP_PACKED_0 =
"\1\0\5\u0100\1\u0200\2\u0100\2\u0300\1\u0400\1\u0300\1\u0500"
+ "\1\u0600\1\u0100\1\u0700\1\u0800\16\u0100\20\u0900\1\u0a00\1\u0b00"
+ "\1\u0900\1\u0c00\31\u0d00\1\u0e00\122\u0d00\14\u0900\53\u0f00\1\u1000"
+ "\41\u0900\2\u0d00\4\u0900\1\u1100\u1000\u0900";
private static int[] zzUnpackcmap_top() {
int[] result = new int[4352];
int offset = 0;
offset = zzUnpackcmap_top(ZZ_CMAP_TOP_PACKED_0, offset, result);
return result;
}
private static int zzUnpackcmap_top(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value;
while (--count > 0);
}
return j;
}
/** Second-level tables for translating characters to character classes */
private static final int[] ZZ_CMAP_BLOCKS = zzUnpackcmap_blocks();
private static final String ZZ_CMAP_BLOCKS_PACKED_0 =
"\11\0\1\1\1\2\1\0\1\1\1\3\22\0\1\1"
+ "\1\0\1\4\1\5\2\0\1\6\1\7\4\0\1\10"
+ "\1\11\1\12\1\13\12\14\1\15\1\0\1\16\1\17"
+ "\1\20\1\5\1\21\2\22\1\23\5\22\1\24\21\22"
+ "\1\25\1\0\1\26\1\0\1\27\1\0\1\30\1\31"
+ "\2\22\1\32\1\33\1\34\1\35\1\24\4\22\1\36"
+ "\1\37\1\40\1\22\1\41\1\42\1\43\3\22\1\44"
+ "\1\45\1\22\1\46\1\47\1\50\102\0\27\22\1\0"
+ "\37\22\1\0\u0168\22\12\51\206\22\12\51\154\22\12\51"
+ "\166\22\12\51\166\22\12\51\167\22\11\51\166\22\12\51"
+ "\340\22\12\51\166\22\12\51\146\22\12\51\u01b6\22\u0140\0"
+ "\u0150\52\140\0\220\52\200\0\u01c0\52\100\0\u01b0\53\265\0"
+ "\73\52\75\22\43\0";
private static int[] zzUnpackcmap_blocks() {
int[] result = new int[4608];
int offset = 0;
offset = zzUnpackcmap_blocks(ZZ_CMAP_BLOCKS_PACKED_0, offset, result);
return result;
}
private static int zzUnpackcmap_blocks(String packed, int offset, int[] result) {
int i = 0; /* index in packed string */
int j = offset; /* index in unpacked array */
int l = packed.length();
while (i < l) {
int count = packed.charAt(i++);
int value = packed.charAt(i++);
do result[j++] = value;
while (--count > 0);
}
return j;
}
/** Translates DFA states to action switch labels. */
private static final int[] ZZ_ACTION = zzUnpackAction();
private static final String ZZ_ACTION_PACKED_0 =
"\12\0\4\1\4\2\1\3\1\4\1\1\2\5\1\6"
+ "\1\5\1\7\1\5\2\10\1\11\1\5\1\12\1\11"
+ "\1\13\1\14\1\15\1\16\1\15\1\17\1\20\1\10"
+ "\1\21\1\10\4\22\1\23\1\24\1\25\1\26\3\0"
+ "\1\27\14\0\1\30\1\31\1\32\1\33\1\11\1\0"
+ "\1\34\1\35\1\36\1\0\1\37\1\0\1\40\3\0"
+ "\1\41\1\42\2\43\1\42\2\44\2\0\1\43\1\0"
+ "\14\43\1\42\3\0\1\11\1\45\3\0\1\46\1\47"
+ "\5\0\1\50\4\0\1\50\2\0\2\50\2\0\1\11"
+ "\5\0\1\31\1\42\1\43\1\51\3\0\1\11\2\0"
+ "\1\52\30\0\1\53\2\0\1\54\1\55\1\56";
"\12\0\2\1\1\2\2\1\1\2\1\3\1\1\1\2"
+ "\1\4\1\2\1\5\1\6\2\5\1\7\1\5\1\10"
+ "\1\5\1\11\1\10\1\12\1\11\1\13\1\14\1\15"
+ "\1\16\1\15\1\17\1\20\1\21\2\10\2\22\1\23"
+ "\2\22\1\24\1\25\1\26\7\0\1\27\6\0\1\30"
+ "\1\31\2\0\1\32\1\33\1\11\1\0\1\34\1\35"
+ "\1\36\1\0\1\37\1\0\1\40\11\41\4\0\1\42"
+ "\1\43\2\41\2\0\1\41\1\44\1\41\1\44\1\42"
+ "\3\0\2\41\1\44\1\11\1\45\3\0\1\46\1\47"
+ "\12\0\2\50\3\0\2\50\1\11\4\0\1\51\1\0"
+ "\1\31\1\44\1\41\3\0\1\11\2\0\1\52\30\0"
+ "\1\53\2\0\1\54\1\55\1\56";
private static int[] zzUnpackAction() {
int[] result = new int[181];
@ -113,22 +167,22 @@ class WikipediaTokenizerImpl {
private static final String ZZ_ROWMAP_PACKED_0 =
"\0\0\0\54\0\130\0\204\0\260\0\334\0\u0108\0\u0134"
+ "\0\u0160\0\u018c\0\u01b8\0\u01e4\0\u0210\0\u023c\0\u0268\0\u0294"
+ "\0\u02c0\0\u02ec\0\u01b8\0\u0318\0\u0344\0\u01b8\0\u0370\0\u039c"
+ "\0\u03c8\0\u03f4\0\u0420\0\u01b8\0\u0370\0\u044c\0\u0478\0\u01b8"
+ "\0\u02c0\0\u02ec\0\u0318\0\u01b8\0\u0344\0\u01b8\0\u0370\0\u039c"
+ "\0\u03c8\0\u03f4\0\u0420\0\u01b8\0\u044c\0\u0478\0\u039c\0\u01b8"
+ "\0\u04a4\0\u04d0\0\u04fc\0\u0528\0\u0554\0\u0580\0\u05ac\0\u05d8"
+ "\0\u0604\0\u0630\0\u065c\0\u01b8\0\u0688\0\u0370\0\u06b4\0\u06e0"
+ "\0\u070c\0\u01b8\0\u01b8\0\u0738\0\u0764\0\u0790\0\u01b8\0\u07bc"
+ "\0\u07e8\0\u0814\0\u0840\0\u086c\0\u0898\0\u08c4\0\u08f0\0\u091c"
+ "\0\u0604\0\u0630\0\u065c\0\u01b8\0\u0688\0\u06b4\0\u039c\0\u06e0"
+ "\0\u070c\0\u01b8\0\u01b8\0\u0738\0\u0764\0\u0790\0\u07bc\0\u07e8"
+ "\0\u0814\0\u0840\0\u01b8\0\u086c\0\u0898\0\u08c4\0\u08f0\0\u091c"
+ "\0\u0948\0\u0974\0\u09a0\0\u09cc\0\u09f8\0\u01b8\0\u01b8\0\u0a24"
+ "\0\u0a50\0\u0a7c\0\u0a7c\0\u01b8\0\u0aa8\0\u0ad4\0\u0b00\0\u0b2c"
+ "\0\u0b58\0\u0b84\0\u0bb0\0\u0bdc\0\u0c08\0\u0c34\0\u0c60\0\u0c8c"
+ "\0\u0814\0\u0cb8\0\u0ce4\0\u0d10\0\u0d3c\0\u0d68\0\u0d94\0\u0dc0"
+ "\0\u0cb8\0\u0ce4\0\u0d10\0\u0d3c\0\u0d68\0\u086c\0\u0d94\0\u0dc0"
+ "\0\u0dec\0\u0e18\0\u0e44\0\u0e70\0\u0e9c\0\u0ec8\0\u0ef4\0\u0f20"
+ "\0\u0f4c\0\u0f78\0\u0fa4\0\u0fd0\0\u0ffc\0\u1028\0\u1054\0\u01b8"
+ "\0\u1080\0\u10ac\0\u10d8\0\u1104\0\u01b8\0\u1130\0\u115c\0\u1188"
+ "\0\u11b4\0\u11e0\0\u120c\0\u1238\0\u1264\0\u1290\0\u12bc\0\u12e8"
+ "\0\u1314\0\u1340\0\u07e8\0\u0974\0\u136c\0\u1398\0\u13c4\0\u13f0"
+ "\0\u141c\0\u1448\0\u1474\0\u14a0\0\u01b8\0\u14cc\0\u14f8\0\u1524"
+ "\0\u1314\0\u1340\0\u136c\0\u1398\0\u091c\0\u09cc\0\u13c4\0\u13f0"
+ "\0\u141c\0\u1448\0\u1474\0\u14a0\0\u14cc\0\u01b8\0\u14f8\0\u1524"
+ "\0\u1550\0\u157c\0\u15a8\0\u15d4\0\u1600\0\u162c\0\u01b8\0\u1658"
+ "\0\u1684\0\u16b0\0\u16dc\0\u1708\0\u1734\0\u1760\0\u178c\0\u17b8"
+ "\0\u17e4\0\u1810\0\u183c\0\u1868\0\u1894\0\u18c0\0\u18ec\0\u1918"
@ -157,147 +211,173 @@ class WikipediaTokenizerImpl {
private static final int[] ZZ_TRANS = zzUnpackTrans();
private static final String ZZ_TRANS_PACKED_0 =
"\1\13\1\14\5\13\1\15\1\13\1\16\3\13\1\17"
+ "\1\20\1\21\1\22\1\23\3\13\1\24\2\13\15\17"
+ "\1\25\2\13\3\17\1\13\7\26\1\27\5\26\4\30"
+ "\5\26\1\31\1\26\15\30\3\26\3\30\10\26\1\27"
+ "\5\26\4\32\5\26\1\33\1\26\15\32\3\26\3\32"
+ "\1\26\7\34\1\35\5\34\4\36\1\34\1\37\2\26"
+ "\1\34\1\40\1\34\15\36\3\34\1\41\2\36\2\34"
+ "\1\42\5\34\1\35\5\34\4\43\4\34\1\44\2\34"
+ "\15\43\3\34\3\43\10\34\1\35\5\34\4\45\4\34"
+ "\1\44\2\34\15\45\3\34\3\45\10\34\1\35\5\34"
+ "\4\45\4\34\1\46\2\34\15\45\3\34\3\45\10\34"
+ "\1\35\1\34\1\47\3\34\4\50\7\34\15\50\3\34"
+ "\3\50\10\34\1\51\5\34\4\52\7\34\15\52\1\34"
+ "\1\53\1\34\3\52\1\34\1\54\1\55\5\54\1\56"
+ "\1\54\1\57\3\54\4\60\4\54\1\61\2\54\15\60"
+ "\2\54\1\62\3\60\1\54\55\0\1\63\62\0\1\64"
+ "\4\0\4\65\7\0\6\65\1\66\6\65\3\0\3\65"
+ "\12\0\1\67\43\0\1\70\1\71\1\72\1\73\2\74"
+ "\1\0\1\75\3\0\1\75\1\17\1\20\1\21\1\22"
+ "\7\0\15\17\3\0\3\17\3\0\1\76\1\0\1\77"
+ "\2\100\1\0\1\101\3\0\1\101\3\20\1\22\7\0"
+ "\15\20\3\0\3\20\2\0\1\70\1\102\1\72\1\73"
+ "\2\100\1\0\1\101\3\0\1\101\1\21\1\20\1\21"
+ "\1\22\7\0\15\21\3\0\3\21\3\0\1\103\1\0"
+ "\1\77\2\74\1\0\1\75\3\0\1\75\4\22\7\0"
+ "\15\22\3\0\3\22\26\0\1\104\73\0\1\105\16\0"
+ "\1\64\4\0\4\65\7\0\15\65\3\0\3\65\16\0"
+ "\4\30\7\0\15\30\3\0\3\30\27\0\1\106\42\0"
+ "\4\32\7\0\15\32\3\0\3\32\27\0\1\107\42\0"
+ "\4\36\7\0\15\36\3\0\3\36\24\0\1\26\45\0"
+ "\4\36\7\0\2\36\1\110\12\36\3\0\3\36\2\0"
+ "\1\111\67\0\4\43\7\0\15\43\3\0\3\43\26\0"
+ "\1\112\43\0\4\45\7\0\15\45\3\0\3\45\26\0"
+ "\1\113\37\0\1\114\57\0\4\50\7\0\15\50\3\0"
+ "\3\50\11\0\1\115\4\0\4\65\7\0\15\65\3\0"
+ "\3\65\16\0\4\52\7\0\15\52\3\0\3\52\47\0"
+ "\1\114\6\0\1\116\63\0\1\117\57\0\4\60\7\0"
+ "\15\60\3\0\3\60\26\0\1\120\43\0\4\65\7\0"
+ "\15\65\3\0\3\65\14\0\1\34\1\0\4\121\1\0"
+ "\3\122\3\0\15\121\3\0\3\121\14\0\1\34\1\0"
+ "\4\121\1\0\3\122\3\0\3\121\1\123\11\121\3\0"
+ "\3\121\16\0\1\124\1\0\1\124\10\0\15\124\3\0"
+ "\3\124\16\0\1\125\1\126\1\127\1\130\7\0\15\125"
+ "\3\0\3\125\16\0\1\131\1\0\1\131\10\0\15\131"
+ "\3\0\3\131\16\0\1\132\1\133\1\132\1\133\7\0"
+ "\15\132\3\0\3\132\16\0\1\134\2\135\1\136\7\0"
+ "\15\134\3\0\3\134\16\0\1\75\2\137\10\0\15\75"
+ "\3\0\3\75\16\0\1\140\2\141\1\142\7\0\15\140"
+ "\3\0\3\140\16\0\4\133\7\0\15\133\3\0\3\133"
+ "\16\0\1\143\2\144\1\145\7\0\15\143\3\0\3\143"
+ "\16\0\1\146\2\147\1\150\7\0\15\146\3\0\3\146"
+ "\16\0\1\151\1\141\1\152\1\142\7\0\15\151\3\0"
+ "\3\151\16\0\1\153\2\126\1\130\7\0\15\153\3\0"
+ "\3\153\30\0\1\154\1\155\64\0\1\156\27\0\4\36"
+ "\7\0\2\36\1\157\12\36\3\0\3\36\2\0\1\160"
+ "\101\0\1\161\1\162\40\0\4\65\7\0\6\65\1\163"
+ "\6\65\3\0\3\65\2\0\1\164\63\0\1\165\71\0"
+ "\1\166\1\167\34\0\1\170\1\0\1\34\1\0\4\121"
+ "\1\0\3\122\3\0\15\121\3\0\3\121\16\0\4\171"
+ "\1\0\3\122\3\0\15\171\3\0\3\171\12\0\1\170"
+ "\1\0\1\34\1\0\4\121\1\0\3\122\3\0\10\121"
+ "\1\172\4\121\3\0\3\121\2\0\1\70\13\0\1\124"
+ "\1\0\1\124\10\0\15\124\3\0\3\124\3\0\1\173"
+ "\1\0\1\77\2\174\6\0\1\125\1\126\1\127\1\130"
+ "\7\0\15\125\3\0\3\125\3\0\1\175\1\0\1\77"
+ "\2\176\1\0\1\177\3\0\1\177\3\126\1\130\7\0"
+ "\15\126\3\0\3\126\3\0\1\200\1\0\1\77\2\176"
+ "\1\0\1\177\3\0\1\177\1\127\1\126\1\127\1\130"
+ "\7\0\15\127\3\0\3\127\3\0\1\201\1\0\1\77"
+ "\2\174\6\0\4\130\7\0\15\130\3\0\3\130\3\0"
+ "\1\202\2\0\1\202\7\0\1\132\1\133\1\132\1\133"
+ "\7\0\15\132\3\0\3\132\3\0\1\202\2\0\1\202"
+ "\7\0\4\133\7\0\15\133\3\0\3\133\3\0\1\174"
+ "\1\0\1\77\2\174\6\0\1\134\2\135\1\136\7\0"
+ "\15\134\3\0\3\134\3\0\1\176\1\0\1\77\2\176"
+ "\1\0\1\177\3\0\1\177\3\135\1\136\7\0\15\135"
+ "\3\0\3\135\3\0\1\174\1\0\1\77\2\174\6\0"
+ "\4\136\7\0\15\136\3\0\3\136\3\0\1\177\2\0"
+ "\2\177\1\0\1\177\3\0\1\177\3\137\10\0\15\137"
+ "\3\0\3\137\3\0\1\103\1\0\1\77\2\74\1\0"
+ "\1\75\3\0\1\75\1\140\2\141\1\142\7\0\15\140"
+ "\3\0\3\140\3\0\1\76\1\0\1\77\2\100\1\0"
+ "\1\101\3\0\1\101\3\141\1\142\7\0\15\141\3\0"
+ "\3\141\3\0\1\103\1\0\1\77\2\74\1\0\1\75"
+ "\3\0\1\75\4\142\7\0\15\142\3\0\3\142\3\0"
+ "\1\74\1\0\1\77\2\74\1\0\1\75\3\0\1\75"
+ "\1\143\2\144\1\145\7\0\15\143\3\0\3\143\3\0"
+ "\1\100\1\0\1\77\2\100\1\0\1\101\3\0\1\101"
+ "\3\144\1\145\7\0\15\144\3\0\3\144\3\0\1\74"
+ "\1\0\1\77\2\74\1\0\1\75\3\0\1\75\4\145"
+ "\7\0\15\145\3\0\3\145\3\0\1\75\2\0\2\75"
+ "\1\0\1\75\3\0\1\75\1\146\2\147\1\150\7\0"
+ "\15\146\3\0\3\146\3\0\1\101\2\0\2\101\1\0"
+ "\1\101\3\0\1\101\3\147\1\150\7\0\15\147\3\0"
+ "\3\147\3\0\1\75\2\0\2\75\1\0\1\75\3\0"
+ "\1\75\4\150\7\0\15\150\3\0\3\150\3\0\1\203"
+ "\1\0\1\77\2\74\1\0\1\75\3\0\1\75\1\151"
+ "\1\141\1\152\1\142\7\0\15\151\3\0\3\151\3\0"
+ "\1\204\1\0\1\77\2\100\1\0\1\101\3\0\1\101"
+ "\1\152\1\141\1\152\1\142\7\0\15\152\3\0\3\152"
+ "\3\0\1\201\1\0\1\77\2\174\6\0\1\153\2\126"
+ "\1\130\7\0\15\153\3\0\3\153\31\0\1\155\54\0"
+ "\1\205\64\0\1\206\26\0\4\36\7\0\15\36\3\0"
+ "\1\36\1\207\1\36\31\0\1\162\54\0\1\210\35\0"
+ "\1\34\1\0\4\121\1\0\3\122\3\0\3\121\1\211"
+ "\11\121\3\0\3\121\2\0\1\212\102\0\1\167\54\0"
+ "\1\213\34\0\1\214\52\0\1\170\3\0\4\171\7\0"
+ "\15\171\3\0\3\171\12\0\1\170\1\0\1\215\1\0"
+ "\4\121\1\0\3\122\3\0\15\121\3\0\3\121\16\0"
+ "\1\216\1\130\1\216\1\130\7\0\15\216\3\0\3\216"
+ "\16\0\4\136\7\0\15\136\3\0\3\136\16\0\4\142"
+ "\7\0\15\142\3\0\3\142\16\0\4\145\7\0\15\145"
+ "\3\0\3\145\16\0\4\150\7\0\15\150\3\0\3\150"
+ "\16\0\1\217\1\142\1\217\1\142\7\0\15\217\3\0"
+ "\3\217\16\0\4\130\7\0\15\130\3\0\3\130\16\0"
+ "\4\220\7\0\15\220\3\0\3\220\33\0\1\221\61\0"
+ "\1\222\30\0\4\36\6\0\1\223\15\36\3\0\2\36"
+ "\1\224\33\0\1\225\32\0\1\170\1\0\1\34\1\0"
+ "\4\121\1\0\3\122\3\0\10\121\1\226\4\121\3\0"
+ "\3\121\2\0\1\227\104\0\1\230\36\0\4\231\7\0"
+ "\15\231\3\0\3\231\3\0\1\173\1\0\1\77\2\174"
+ "\6\0\1\216\1\130\1\216\1\130\7\0\15\216\3\0"
+ "\3\216\3\0\1\203\1\0\1\77\2\74\1\0\1\75"
+ "\3\0\1\75\1\217\1\142\1\217\1\142\7\0\15\217"
+ "\3\0\3\217\3\0\1\202\2\0\1\202\7\0\4\220"
+ "\7\0\15\220\3\0\3\220\34\0\1\232\55\0\1\233"
+ "\26\0\1\234\60\0\4\36\6\0\1\223\15\36\3\0"
+ "\3\36\34\0\1\235\31\0\1\170\1\0\1\114\1\0"
+ "\4\121\1\0\3\122\3\0\15\121\3\0\3\121\34\0"
+ "\1\236\32\0\1\237\2\0\4\231\7\0\15\231\3\0"
+ "\3\231\35\0\1\240\62\0\1\241\20\0\1\242\77\0"
+ "\1\243\53\0\1\244\32\0\1\34\1\0\4\171\1\0"
+ "\3\122\3\0\15\171\3\0\3\171\36\0\1\245\53\0"
+ "\1\246\33\0\4\247\7\0\15\247\3\0\3\247\36\0"
+ "\1\250\53\0\1\251\54\0\1\252\61\0\1\253\11\0"
+ "\1\254\12\0\4\247\7\0\15\247\3\0\3\247\37\0"
+ "\1\255\53\0\1\256\54\0\1\257\22\0\1\13\62\0"
+ "\4\260\7\0\15\260\3\0\3\260\40\0\1\261\53\0"
+ "\1\262\43\0\1\263\26\0\2\260\1\0\2\260\1\0"
+ "\2\260\2\0\5\260\7\0\15\260\3\0\4\260\27\0"
+ "\1\264\53\0\1\265\24\0";
"\7\13\1\14\4\13\1\15\1\13\1\16\1\17\2\13"
+ "\3\20\1\21\2\13\16\20\1\22\2\13\1\23\1\24"
+ "\1\25\14\26\1\27\1\26\1\30\3\26\3\27\1\26"
+ "\1\31\1\26\16\27\3\26\1\27\1\26\1\27\14\26"
+ "\1\32\1\26\1\30\3\26\3\32\1\26\1\33\1\26"
+ "\16\32\3\26\1\32\1\26\1\32\1\34\2\26\1\35"
+ "\10\34\1\36\1\34\1\37\3\34\3\36\1\34\1\40"
+ "\1\34\5\36\1\41\10\36\3\34\1\36\1\34\1\36"
+ "\7\34\1\42\4\34\1\43\1\34\1\37\3\34\3\43"
+ "\1\44\2\34\16\43\3\34\1\43\1\34\1\43\14\34"
+ "\1\45\1\34\1\37\3\34\3\45\1\44\2\34\16\45"
+ "\3\34\1\45\1\34\1\45\14\34\1\45\1\34\1\37"
+ "\3\34\3\45\1\46\2\34\16\45\3\34\1\45\1\34"
+ "\1\45\14\34\1\47\1\34\1\37\1\50\2\34\3\47"
+ "\3\34\16\47\3\34\1\47\1\34\1\47\14\34\1\51"
+ "\1\34\1\52\3\34\3\51\3\34\16\51\2\34\1\53"
+ "\1\51\1\34\1\51\7\54\1\55\4\54\1\56\1\54"
+ "\1\57\1\60\2\54\3\56\1\61\2\54\16\56\1\54"
+ "\1\62\1\54\1\56\1\54\1\56\63\0\1\63\54\0"
+ "\1\64\1\65\1\66\1\64\1\15\4\0\1\67\3\15"
+ "\2\0\1\65\16\15\3\0\1\15\1\0\1\25\13\0"
+ "\1\70\1\71\5\0\3\71\3\0\11\71\1\72\4\71"
+ "\3\0\1\71\1\0\1\71\17\0\1\73\42\0\1\74"
+ "\1\75\1\76\1\77\1\100\1\76\1\15\4\0\1\101"
+ "\3\20\2\0\1\77\16\20\3\0\1\23\1\0\1\25"
+ "\25\0\1\102\74\0\1\103\13\0\1\74\1\75\1\64"
+ "\1\65\1\104\1\64\1\15\4\0\1\101\3\23\2\0"
+ "\1\65\16\23\3\0\1\23\1\0\1\25\10\0\1\76"
+ "\1\77\1\105\1\76\1\25\4\0\1\67\3\25\2\0"
+ "\1\77\16\25\3\0\1\25\1\0\1\25\14\0\1\27"
+ "\5\0\3\27\3\0\16\27\3\0\1\27\1\0\1\27"
+ "\13\0\1\70\1\71\5\0\3\71\3\0\16\71\3\0"
+ "\1\71\1\0\1\71\26\0\1\106\41\0\1\32\5\0"
+ "\3\32\3\0\16\32\3\0\1\32\1\0\1\32\26\0"
+ "\1\107\27\0\1\26\65\0\1\36\5\0\3\36\3\0"
+ "\16\36\3\0\1\36\1\0\1\36\14\0\1\36\5\0"
+ "\3\36\3\0\13\36\1\110\2\36\3\0\1\36\1\0"
+ "\1\36\7\0\1\111\60\0\1\43\5\0\3\43\3\0"
+ "\16\43\3\0\1\43\1\0\1\43\25\0\1\112\42\0"
+ "\1\45\5\0\3\45\3\0\16\45\3\0\1\45\1\0"
+ "\1\45\25\0\1\113\42\0\1\47\5\0\3\47\3\0"
+ "\16\47\3\0\1\47\1\0\1\47\17\0\1\114\50\0"
+ "\1\51\5\0\3\51\3\0\16\51\3\0\1\51\1\0"
+ "\1\51\13\0\1\115\1\71\5\0\3\71\3\0\16\71"
+ "\3\0\1\71\1\0\1\71\50\0\1\114\12\0\1\116"
+ "\60\0\1\56\5\0\3\56\3\0\16\56\3\0\1\56"
+ "\1\0\1\56\17\0\1\117\61\0\1\120\42\0\1\121"
+ "\5\0\3\122\3\0\16\122\3\0\1\121\1\0\1\123"
+ "\14\0\1\124\5\0\3\125\3\0\16\125\3\0\1\124"
+ "\1\0\1\126\14\0\1\127\5\0\3\130\3\0\16\130"
+ "\3\0\1\127\1\0\1\131\14\0\1\132\5\0\3\132"
+ "\3\0\16\132\3\0\1\132\1\0\1\132\14\0\1\71"
+ "\5\0\3\71\3\0\16\71\3\0\1\71\1\0\1\71"
+ "\1\0\3\133\10\0\1\134\3\0\1\34\1\0\3\134"
+ "\3\0\16\134\3\0\1\134\1\0\1\134\1\0\3\133"
+ "\10\0\1\134\3\0\1\34\1\0\3\134\3\0\2\134"
+ "\1\135\13\134\3\0\1\134\1\0\1\134\22\0\3\136"
+ "\3\0\16\136\3\0\1\136\24\0\3\137\3\0\16\137"
+ "\3\0\1\137\16\0\1\140\5\0\3\76\3\0\16\76"
+ "\3\0\1\140\16\0\1\141\5\0\3\142\3\0\16\142"
+ "\3\0\1\141\1\0\1\143\14\0\1\144\5\0\3\145"
+ "\3\0\16\145\3\0\1\146\1\0\1\147\14\0\1\132"
+ "\5\0\3\150\3\0\16\150\3\0\1\150\1\0\1\132"
+ "\15\0\1\151\5\0\1\152\54\0\1\153\43\0\1\127"
+ "\5\0\3\154\3\0\16\154\3\0\1\155\1\0\1\131"
+ "\14\0\1\144\5\0\3\156\3\0\16\156\3\0\1\144"
+ "\1\0\1\147\14\0\1\36\5\0\3\36\3\0\13\36"
+ "\1\157\2\36\3\0\1\36\1\0\1\36\7\0\1\160"
+ "\61\0\1\161\5\0\1\162\44\0\1\71\5\0\3\71"
+ "\3\0\11\71\1\163\4\71\3\0\1\71\1\0\1\71"
+ "\7\0\1\164\63\0\1\165\51\0\1\166\5\0\1\167"
+ "\40\0\4\64\1\121\5\0\3\121\2\0\1\64\16\121"
+ "\3\0\1\121\1\0\1\123\10\0\4\76\1\121\5\0"
+ "\3\122\2\0\1\76\16\122\3\0\1\121\1\0\1\123"
+ "\10\0\4\76\1\123\5\0\3\123\2\0\1\76\16\123"
+ "\3\0\1\123\1\0\1\123\10\0\1\64\2\65\1\64"
+ "\1\124\4\0\1\67\3\124\2\0\1\65\16\124\3\0"
+ "\1\124\1\0\1\126\10\0\1\76\2\77\1\76\1\124"
+ "\4\0\1\67\3\125\2\0\1\77\16\125\3\0\1\124"
+ "\1\0\1\126\10\0\1\76\2\77\1\76\1\126\4\0"
+ "\1\67\3\126\2\0\1\77\16\126\3\0\1\126\1\0"
+ "\1\126\10\0\1\64\1\65\1\66\1\64\1\127\4\0"
+ "\1\67\3\127\2\0\1\65\16\127\3\0\1\127\1\0"
+ "\1\131\10\0\1\76\1\77\1\105\1\76\1\127\4\0"
+ "\1\67\3\130\2\0\1\77\16\130\3\0\1\127\1\0"
+ "\1\131\10\0\1\76\1\77\1\105\1\76\1\131\4\0"
+ "\1\67\3\131\2\0\1\77\16\131\3\0\1\131\1\0"
+ "\1\131\11\0\2\170\1\0\1\132\5\0\3\132\3\0"
+ "\16\132\3\0\1\132\1\0\1\132\1\0\3\133\10\0"
+ "\1\171\5\0\3\171\3\0\16\171\3\0\1\171\1\0"
+ "\1\171\1\0\3\133\10\0\1\134\2\0\1\172\1\34"
+ "\1\0\3\134\3\0\16\134\3\0\1\134\1\0\1\134"
+ "\1\0\3\133\10\0\1\134\2\0\1\172\1\34\1\0"
+ "\3\134\3\0\3\134\1\173\12\134\3\0\1\134\1\0"
+ "\1\134\7\0\1\75\12\0\3\137\3\0\16\137\3\0"
+ "\1\137\12\0\4\174\1\140\5\0\3\140\2\0\1\174"
+ "\16\140\3\0\1\140\12\0\1\174\2\175\1\174\1\141"
+ "\4\0\1\67\3\141\2\0\1\175\16\141\3\0\1\141"
+ "\1\0\1\143\11\0\2\176\1\0\1\141\4\0\1\67"
+ "\3\142\2\0\1\176\16\142\3\0\1\141\1\0\1\143"
+ "\11\0\2\176\1\0\1\143\4\0\1\67\3\143\2\0"
+ "\1\176\16\143\3\0\1\143\1\0\1\143\10\0\1\174"
+ "\1\175\1\177\1\174\1\144\4\0\1\67\3\144\2\0"
+ "\1\175\16\144\3\0\1\144\1\0\1\147\11\0\1\176"
+ "\1\200\1\0\1\144\4\0\1\67\3\145\2\0\1\176"
+ "\16\145\3\0\1\146\1\0\1\147\10\0\1\174\1\175"
+ "\1\201\1\174\1\144\4\0\1\67\3\146\2\0\1\175"
+ "\16\146\3\0\1\146\1\0\1\147\11\0\1\176\1\202"
+ "\1\0\1\147\4\0\1\67\3\147\2\0\1\176\16\147"
+ "\3\0\1\147\1\0\1\147\11\0\2\170\1\0\1\132"
+ "\5\0\3\150\3\0\16\150\3\0\1\150\1\0\1\132"
+ "\23\0\1\152\60\0\1\203\61\0\1\204\25\0\1\76"
+ "\1\77\1\205\1\76\1\127\4\0\1\67\3\154\2\0"
+ "\1\77\16\154\3\0\1\155\1\0\1\131\10\0\1\64"
+ "\1\65\1\206\1\64\1\127\4\0\1\67\3\155\2\0"
+ "\1\65\16\155\3\0\1\155\1\0\1\131\11\0\1\176"
+ "\1\202\1\0\1\144\4\0\1\67\3\156\2\0\1\176"
+ "\16\156\3\0\1\144\1\0\1\147\14\0\1\36\5\0"
+ "\3\36\3\0\10\36\1\207\5\36\3\0\1\36\1\0"
+ "\1\36\23\0\1\162\60\0\1\210\24\0\3\133\10\0"
+ "\1\134\3\0\1\34\1\0\3\134\3\0\2\134\1\211"
+ "\13\134\3\0\1\134\1\0\1\134\7\0\1\212\67\0"
+ "\1\167\60\0\1\213\37\0\1\214\5\0\3\214\3\0"
+ "\16\214\3\0\1\214\1\0\1\214\14\0\1\171\2\0"
+ "\1\172\2\0\3\171\3\0\16\171\3\0\1\171\1\0"
+ "\1\171\4\0\1\215\50\0\3\133\10\0\1\134\2\0"
+ "\1\172\1\216\1\0\3\134\3\0\16\134\3\0\1\134"
+ "\1\0\1\134\14\0\1\123\5\0\3\123\3\0\16\123"
+ "\3\0\1\123\1\0\1\123\14\0\1\126\5\0\3\126"
+ "\3\0\16\126\3\0\1\126\1\0\1\126\14\0\1\143"
+ "\5\0\3\143\3\0\16\143\3\0\1\143\1\0\1\143"
+ "\14\0\1\131\5\0\3\131\3\0\16\131\3\0\1\131"
+ "\1\0\1\131\14\0\1\147\5\0\3\217\3\0\16\217"
+ "\3\0\1\217\1\0\1\147\14\0\1\131\5\0\3\220"
+ "\3\0\16\220\3\0\1\220\1\0\1\131\14\0\1\147"
+ "\5\0\3\147\3\0\16\147\3\0\1\147\1\0\1\147"
+ "\43\0\1\221\43\0\1\222\34\0\1\36\1\223\4\0"
+ "\3\36\3\0\12\36\1\224\3\36\3\0\1\36\1\0"
+ "\1\36\43\0\1\225\11\0\3\133\10\0\1\134\2\0"
+ "\1\172\1\34\1\0\3\134\3\0\3\134\1\226\12\134"
+ "\3\0\1\134\1\0\1\134\7\0\1\227\107\0\1\230"
+ "\21\0\2\170\1\0\1\214\5\0\3\214\3\0\16\214"
+ "\3\0\1\214\1\0\1\214\14\0\1\231\5\0\3\231"
+ "\3\0\16\231\3\0\1\231\1\0\1\231\11\0\1\176"
+ "\1\200\1\0\1\147\4\0\1\67\3\217\2\0\1\176"
+ "\16\217\3\0\1\217\1\0\1\147\10\0\1\76\1\77"
+ "\1\205\1\76\1\131\4\0\1\67\3\220\2\0\1\77"
+ "\16\220\3\0\1\220\1\0\1\131\32\0\1\232\60\0"
+ "\1\233\27\0\1\234\54\0\1\36\1\223\4\0\3\36"
+ "\3\0\16\36\3\0\1\36\1\0\1\36\32\0\1\235"
+ "\22\0\3\133\10\0\1\134\2\0\1\172\1\114\1\0"
+ "\3\134\3\0\16\134\3\0\1\134\1\0\1\134\32\0"
+ "\1\236\25\0\1\237\7\0\1\231\5\0\3\231\3\0"
+ "\16\231\3\0\1\231\1\0\1\231\34\0\1\240\50\0"
+ "\1\241\35\0\1\242\74\0\1\243\53\0\1\244\20\0"
+ "\3\133\10\0\1\171\3\0\1\34\1\0\3\171\3\0"
+ "\16\171\3\0\1\171\1\0\1\171\37\0\1\245\53\0"
+ "\1\246\30\0\1\247\5\0\3\247\3\0\16\247\3\0"
+ "\1\247\1\0\1\247\37\0\1\250\53\0\1\251\55\0"
+ "\1\252\56\0\1\253\21\0\1\254\1\0\1\247\5\0"
+ "\3\247\3\0\16\247\3\0\1\247\1\0\1\247\41\0"
+ "\1\255\53\0\1\256\57\0\1\257\35\0\1\13\40\0"
+ "\1\260\5\0\3\260\3\0\16\260\3\0\1\260\1\0"
+ "\1\260\45\0\1\261\53\0\1\262\23\0\1\263\43\0"
+ "\2\260\1\0\5\260\2\0\1\260\2\0\3\260\2\0"
+ "\17\260\3\0\1\260\1\0\1\260\15\0\1\264\53\0"
+ "\1\265\36\0";
private static int[] zzUnpackTrans() {
int[] result = new int[6908];
@ -320,30 +400,34 @@ class WikipediaTokenizerImpl {
return j;
}
/* error codes */
/** Error code for "Unknown internal scanner error". */
private static final int ZZ_UNKNOWN_ERROR = 0;
/** Error code for "could not match input". */
private static final int ZZ_NO_MATCH = 1;
/** Error code for "pushback value was too large". */
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String[] ZZ_ERROR_MSG = {
/**
* Error messages for {@link #ZZ_UNKNOWN_ERROR}, {@link #ZZ_NO_MATCH}, and {@link
* #ZZ_PUSHBACK_2BIG} respectively.
*/
private static final String ZZ_ERROR_MSG[] = {
"Unknown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
/** ZZ_ATTRIBUTE[aState] contains the attributes of state <code>aState</code> */
/** ZZ_ATTRIBUTE[aState] contains the attributes of state {@code aState} */
private static final int[] ZZ_ATTRIBUTE = zzUnpackAttribute();
private static final String ZZ_ATTRIBUTE_PACKED_0 =
"\12\0\1\11\7\1\1\11\2\1\1\11\5\1\1\11"
+ "\3\1\1\11\13\1\1\11\5\1\2\11\3\0\1\11"
+ "\14\0\2\1\2\11\1\1\1\0\2\1\1\11\1\0"
+ "\1\1\1\0\1\1\3\0\7\1\2\0\1\1\1\0"
+ "\15\1\3\0\1\1\1\11\3\0\1\1\1\11\5\0"
+ "\1\1\4\0\1\1\2\0\2\1\2\0\1\1\5\0"
+ "\1\11\3\1\3\0\1\1\2\0\1\11\30\0\1\1"
+ "\2\0\3\11";
"\12\0\1\11\10\1\1\11\1\1\1\11\5\1\1\11"
+ "\3\1\1\11\13\1\1\11\5\1\2\11\7\0\1\11"
+ "\6\0\2\1\2\0\2\11\1\1\1\0\2\1\1\11"
+ "\1\0\1\1\1\0\12\1\4\0\4\1\2\0\5\1"
+ "\3\0\4\1\1\11\3\0\1\1\1\11\12\0\2\1"
+ "\3\0\3\1\4\0\1\1\1\0\1\11\2\1\3\0"
+ "\1\1\2\0\1\11\30\0\1\1\2\0\3\11";
private static int[] zzUnpackAttribute() {
int[] result = new int[181];
@ -365,57 +449,67 @@ class WikipediaTokenizerImpl {
return j;
}
/** the input device */
/** Input device. */
private java.io.Reader zzReader;
/** the current state of the DFA */
/** Current state of the DFA. */
private int zzState;
/** the current lexical state */
/** Current lexical state. */
private int zzLexicalState = YYINITIAL;
/**
* this buffer contains the current text to be matched and is the source of the yytext() string
* This buffer contains the current text to be matched and is the source of the {@link #yytext()}
* string.
*/
private char[] zzBuffer = new char[ZZ_BUFFERSIZE];
private char zzBuffer[] = new char[ZZ_BUFFERSIZE];
/** the textposition at the last accepting state */
/** Text position at the last accepting state. */
private int zzMarkedPos;
/** the current text position in the buffer */
/** Current text position in the buffer. */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
/** Marks the beginning of the {@link #yytext()} string in the buffer. */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read from input */
/** Marks the last character in the buffer, that has been read from input. */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/** the number of characters from the last newline up to the start of the matched text */
private int yycolumn;
/** zzAtBOL == true iff the scanner is currently at the beginning of a line */
private boolean zzAtBOL = true;
/** zzAtEOF == true iff the scanner is at the EOF */
/**
* Whether the scanner is at the end of file.
*
* @see #yyatEOF
*/
private boolean zzAtEOF;
/** denotes if the user-EOF-code has already been executed */
private boolean zzEOFDone;
/**
* The number of occupied positions in zzBuffer beyond zzEndRead. When a lead/high surrogate has
* been read from the input stream into the final zzBuffer position, this will have a value of 1;
* otherwise, it will have a value of 0.
* The number of occupied positions in {@link #zzBuffer} beyond {@link #zzEndRead}.
*
* <p>When a lead/high surrogate has been read from the input stream into the final {@link
* #zzBuffer} position, this will have a value of 1; otherwise, it will have a value of 0.
*/
private int zzFinalHighSurrogate = 0;
/** Number of newlines encountered up to the start of the matched text. */
@SuppressWarnings("unused")
private int yyline;
/** Number of characters from the last newline up to the start of the matched text. */
@SuppressWarnings("unused")
private int yycolumn;
/** Number of characters up to the start of the matched text. */
private long yychar;
/** Whether the scanner is currently at the beginning of a line. */
@SuppressWarnings("unused")
private boolean zzAtBOL = true;
/** Whether the user-EOF-code has already been executed. */
@SuppressWarnings("unused")
private boolean zzEOFDone;
/* user code: */
public static final int ALPHANUM = WikipediaTokenizer.ALPHANUM_ID;
@ -459,7 +553,8 @@ class WikipediaTokenizerImpl {
}
public final int yychar() {
return yychar;
// jflex supports > 2GB docs but not lucene
return (int) yychar;
}
public final int getPositionIncrement() {
@ -494,29 +589,18 @@ class WikipediaTokenizerImpl {
this.zzReader = in;
}
/**
* Unpacks the compressed character translation table.
*
* @param packed the packed character translation table
* @return the unpacked character translation table
*/
private static char[] zzUnpackCMap(String packed) {
char[] map = new char[0x110000];
int i = 0; /* index in packed string */
int j = 0; /* index in unpacked array */
while (i < 262) {
int count = packed.charAt(i++);
char value = packed.charAt(i++);
do map[j++] = value;
while (--count > 0);
}
return map;
/** Translates raw input code points to DFA table row */
private static int zzCMap(int input) {
int offset = input & 255;
return offset == input
? ZZ_CMAP_BLOCKS[offset]
: ZZ_CMAP_BLOCKS[ZZ_CMAP_TOP[input >> 8] | offset];
}
/**
* Refills the input buffer.
*
* @return <code>false</code>, iff there was new input.
* @return {@code false} iff there was new input.
* @exception java.io.IOException if any I/O-Error occurs
*/
private boolean zzRefill() throws java.io.IOException {
@ -537,7 +621,7 @@ class WikipediaTokenizerImpl {
/* is the buffer big enough? */
if (zzCurrentPos >= zzBuffer.length - zzFinalHighSurrogate) {
/* if not: blow it up */
char[] newBuffer = new char[zzBuffer.length * 2];
char newBuffer[] = new char[zzBuffer.length * 2];
System.arraycopy(zzBuffer, 0, newBuffer, 0, zzBuffer.length);
zzBuffer = newBuffer;
zzEndRead += zzFinalHighSurrogate;
@ -551,17 +635,21 @@ class WikipediaTokenizerImpl {
/* not supposed to occur according to specification of java.io.Reader */
if (numRead == 0) {
throw new java.io.IOException(
"Reader returned 0 characters. See JFlex examples for workaround.");
"Reader returned 0 characters. See JFlex examples/zero-reader for a workaround.");
}
if (numRead > 0) {
zzEndRead += numRead;
/* If numRead == requested, we might have requested to few chars to
encode a full Unicode character. We assume that a Reader would
otherwise never return half characters. */
if (numRead == requested) {
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
if (Character.isHighSurrogate(zzBuffer[zzEndRead - 1])) {
if (numRead == requested) { // We requested too few chars to encode a full Unicode character
--zzEndRead;
zzFinalHighSurrogate = 1;
} else { // There is room in the buffer for at least one more char
int c = zzReader.read(); // Expecting to read a paired low surrogate char
if (c == -1) {
return true;
} else {
zzBuffer[zzEndRead++] = (char) c;
}
}
}
/* potentially more input available */
@ -572,44 +660,76 @@ class WikipediaTokenizerImpl {
return true;
}
/** Closes the input stream. */
/**
* Closes the input reader.
*
* @throws java.io.IOException if the reader could not be closed.
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
zzAtEOF = true; // indicate end of file
zzEndRead = zzStartRead; // invalidate buffer
if (zzReader != null) zzReader.close();
if (zzReader != null) {
zzReader.close();
}
}
/**
* Resets the scanner to read from a new input stream. Does not close the old reader.
* Resets the scanner to read from a new input stream.
*
* <p>Does not close the old reader.
*
* <p>All internal variables are reset, the old input stream <b>cannot</b> be reused (internal
* buffer is discarded and lost). Lexical state is set to <code>ZZ_INITIAL</code>.
* buffer is discarded and lost). Lexical state is set to {@code ZZ_INITIAL}.
*
* <p>Internal scan buffer is resized down to its initial length, if it has grown.
*
* @param reader the new input stream
* @param reader The new input stream.
*/
public final void yyreset(java.io.Reader reader) {
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
zzEOFDone = false;
zzEndRead = zzStartRead = 0;
zzCurrentPos = zzMarkedPos = 0;
zzFinalHighSurrogate = 0;
yyline = yychar = yycolumn = 0;
yyResetPosition();
zzLexicalState = YYINITIAL;
if (zzBuffer.length > ZZ_BUFFERSIZE) zzBuffer = new char[ZZ_BUFFERSIZE];
if (zzBuffer.length > ZZ_BUFFERSIZE) {
zzBuffer = new char[ZZ_BUFFERSIZE];
}
}
/** Returns the current lexical state. */
/** Resets the input position. */
private final void yyResetPosition() {
zzAtBOL = true;
zzAtEOF = false;
zzCurrentPos = 0;
zzMarkedPos = 0;
zzStartRead = 0;
zzEndRead = 0;
zzFinalHighSurrogate = 0;
yyline = 0;
yycolumn = 0;
yychar = 0L;
}
/**
* Returns whether the scanner has reached the end of the reader it reads from.
*
* @return whether the scanner has reached EOF.
*/
public final boolean yyatEOF() {
return zzAtEOF;
}
/**
* Returns the current lexical state.
*
* @return the current lexical state.
*/
public final int yystate() {
return zzLexicalState;
}
/**
* Enters a new lexical state
* Enters a new lexical state.
*
* @param newState the new lexical state
*/
@ -617,41 +737,51 @@ class WikipediaTokenizerImpl {
zzLexicalState = newState;
}
/** Returns the text matched by the current regular expression. */
/**
* Returns the text matched by the current regular expression.
*
* @return the matched text.
*/
public final String yytext() {
return new String(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
}
/**
* Returns the character at position <code>pos</code> from the matched text.
* Returns the character at the given position from the matched text.
*
* <p>It is equivalent to yytext().charAt(pos), but faster
* <p>It is equivalent to {@code yytext().charAt(pos)}, but faster.
*
* @param pos the position of the character to fetch. A value from 0 to yylength()-1.
* @return the character at position pos
* @param position the position of the character to fetch. A value from 0 to {@code yylength()-1}.
* @return the character at {@code position}.
*/
public final char yycharat(int pos) {
return zzBuffer[zzStartRead + pos];
public final char yycharat(int position) {
return zzBuffer[zzStartRead + position];
}
/** Returns the length of the matched text region. */
/**
* How many characters were matched.
*
* @return the length of the matched text region.
*/
public final int yylength() {
return zzMarkedPos - zzStartRead;
}
/**
* Reports an error that occured while scanning.
* Reports an error that occurred while scanning.
*
* <p>In a wellformed scanner (no or only correct usage of yypushback(int) and a match-all
* fallback rule) this method will only be called with things that "Can't Possibly Happen". If
* this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty
* <p>In a well-formed scanner (no or only correct usage of {@code yypushback(int)} and a
* match-all fallback rule) this method will only be called with things that "Can't Possibly
* Happen".
*
* <p>If this method is called, something is seriously wrong (e.g. a JFlex bug producing a faulty
* scanner etc.).
*
* <p>Usual syntax/scanner level error handling should be done in error fallback rules.
*
* @param errorCode the code of the errormessage to display
* @param errorCode the code of the error message to display.
*/
private void zzScanError(int errorCode) {
private static void zzScanError(int errorCode) {
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
@ -665,10 +795,10 @@ class WikipediaTokenizerImpl {
/**
* Pushes the specified amount of characters back into the input stream.
*
* <p>They will be read again by then next call of the scanning method
* <p>They will be read again by then next call of the scanning method.
*
* @param number the number of characters to be read again. This number must not be greater than
* yylength()!
* {@link #yylength()}.
*/
public void yypushback(int number) {
if (number > yylength()) zzScanError(ZZ_PUSHBACK_2BIG);
@ -680,8 +810,8 @@ class WikipediaTokenizerImpl {
* Resumes scanning until the next regular expression is matched, the end of input is encountered
* or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
* @return the next token.
* @exception java.io.IOException if any I/O-Error occurs.
*/
public int getNextToken() throws java.io.IOException {
int zzInput;
@ -692,7 +822,6 @@ class WikipediaTokenizerImpl {
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char[] zzBufferL = zzBuffer;
char[] zzCMapL = ZZ_CMAP;
int[] zzTransL = ZZ_TRANS;
int[] zzRowMapL = ZZ_ROWMAP;
@ -743,7 +872,7 @@ class WikipediaTokenizerImpl {
zzCurrentPosL += Character.charCount(zzInput);
}
}
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]];
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMap(zzInput)];
if (zzNext == -1) break zzForAction;
zzState = zzNext;
@ -783,19 +912,19 @@ class WikipediaTokenizerImpl {
break;
case 3:
{
numWikiTokensSeen = 0;
positionInc = 1;
return CJ;
currentTokType = EXTERNAL_LINK_URL;
yybegin(EXTERNAL_LINK_STATE); /* Break so we don't hit fall-through warning: */
break;
}
// fall through
case 49:
break;
case 4:
{
numWikiTokensSeen = 0;
positionInc = 1;
currentTokType = EXTERNAL_LINK_URL;
yybegin(EXTERNAL_LINK_STATE); /* Break so we don't hit fall-through warning: */
break;
return CJ;
}
// fall through
case 50:
@ -900,20 +1029,20 @@ class WikipediaTokenizerImpl {
break;
case 15:
{
currentTokType = SUB_HEADING;
numWikiTokensSeen = 0;
yybegin(STRING); /* Break so we don't hit fall-through warning: */
break;
currentTokType = HEADING;
yybegin(DOUBLE_EQUALS_STATE);
numWikiTokensSeen++;
return currentTokType;
}
// fall through
case 61:
break;
case 16:
{
currentTokType = HEADING;
yybegin(DOUBLE_EQUALS_STATE);
numWikiTokensSeen++;
return currentTokType;
currentTokType = SUB_HEADING;
numWikiTokensSeen = 0;
yybegin(STRING); /* Break so we don't hit fall-through warning: */
break;
}
// fall through
case 62:
@ -1079,7 +1208,7 @@ class WikipediaTokenizerImpl {
case 33:
{
positionInc = 1;
return APOSTROPHE;
return NUM;
}
// fall through
case 79:
@ -1087,7 +1216,7 @@ class WikipediaTokenizerImpl {
case 34:
{
positionInc = 1;
return HOST;
return COMPANY;
}
// fall through
case 80:
@ -1095,7 +1224,7 @@ class WikipediaTokenizerImpl {
case 35:
{
positionInc = 1;
return NUM;
return APOSTROPHE;
}
// fall through
case 81:
@ -1103,7 +1232,7 @@ class WikipediaTokenizerImpl {
case 36:
{
positionInc = 1;
return COMPANY;
return HOST;
}
// fall through
case 82:

View File

@ -22,7 +22,6 @@ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
/**
* JFlex-generated tokenizer that is aware of Wikipedia syntax.
*/
@SuppressWarnings({"unused","fallthrough"})
%%
%class WikipediaTokenizerImpl
@ -76,7 +75,8 @@ public final int getNumWikiTokensSeen(){
public final int yychar()
{
return yychar;
// jflex supports > 2GB docs but not lucene
return (int) yychar;
}
public final int getPositionIncrement(){

View File

@ -1,6 +1,6 @@
{
"gradle/generation/jflex/skeleton.disable.buffer.expansion.txt": "1424f4df33c977bb150d7377c3bd61f819113091",
"gradle/generation/jflex/skeleton.disable.buffer.expansion.txt": "6e43a3a64a9b5eb82ec5b4bc21f95aff5a2a061e",
"lucene/core/src/data/jflex/UnicodeEmojiProperties.jflex": "704643e507c77a66142dd5b1c84ac4273559371a",
"lucene/core/src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.java": "dd169c562d18ab106f4a056ca8860c62b0e53475",
"lucene/core/src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex": "6158aeb8dd11cd9100623608b2dcce51b2df9d0b"
"lucene/core/src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.java": "2c3b6b015664f8eaf013a7102f608c445789a5d2",
"lucene/core/src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex": "5338adebbc717897a5d261d34b272dce9f53f422"
}

View File

@ -37,10 +37,9 @@ import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
* <li>&lt;EMOJI&gt;: A sequence of Emoji characters</li>
* </ul>
*/
@SuppressWarnings({"unused","fallthrough"})
%%
%unicode 9.0
%unicode 9
%integer
%final
%public
@ -146,7 +145,8 @@ ComplexContextEx = \p{LB:Complex_Context}
/** Character count processed so far */
public final int yychar()
{
return yychar;
// jflex supports > 2GB docs but not lucene
return (int) yychar;
}
/**