|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.data.processing.PhraseMatcher
public abstract class PhraseMatcher
General phrase matcher. This one I've tried to make Unicode compatible. I just hope the reader will yield the right characters.
Version History
EPG - Initial - 6 JUL 09
Field Summary | |
---|---|
static int |
MAX_PHRASE_SIZE_IN_BYTES
|
protected char[] |
phraseBuffer
|
protected int |
phraseBufferLength
|
Constructor Summary | |
---|---|
PhraseMatcher()
|
Method Summary | |
---|---|
protected abstract void |
declarations()
All declarations should be put here, so they are done with any initialization. |
void |
declare(java.lang.String phrase,
int id,
boolean caseSensitive)
Declare a phrase. |
void |
init()
Reinitialize the processor. |
protected abstract void |
match(int id,
char[] phrase,
int len,
java.io.Writer out)
This method will be called when a phrase is matched. |
void |
process(java.lang.String docId,
java.io.Reader input,
java.io.Writer output)
Process the reader. |
protected abstract void |
start(java.lang.String docId)
Start on a specific document. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_PHRASE_SIZE_IN_BYTES
protected char[] phraseBuffer
protected int phraseBufferLength
Constructor Detail |
---|
public PhraseMatcher() throws java.lang.Throwable
java.lang.Throwable
Method Detail |
---|
protected abstract void declarations() throws java.lang.Throwable
java.lang.Throwable
protected abstract void start(java.lang.String docId) throws java.lang.Throwable
docId
- The id for the document, data, or whatever. The implementation may choose to ignore it.
java.lang.Throwable
protected abstract void match(int id, char[] phrase, int len, java.io.Writer out) throws java.lang.Throwable
id
- The defined id.phrase
- The phrase data as it exactly appears in the stream.len
- The number of valid characters in the phraseBuffer. The offset is always 0.out
- Writer to write the processed data. If null, then the caller asked not to write anything, but it is up to the implementation.
java.lang.Throwable
public void declare(java.lang.String phrase, int id, boolean caseSensitive) throws java.lang.Throwable
phrase
- The phrase.id
- The phrase id. This can be a duplicate. It must be MINIMUM_ID or higher.caseSensitive
- if true, the phrase will be case sensitive.
java.lang.Throwable
public void process(java.lang.String docId, java.io.Reader input, java.io.Writer output) throws java.lang.Throwable
docId
- The id for the document, data, or whatever. This may be echoed into the entries, depending on the specific implementation.input
- The input reader.output
- The output writer. Set to null if this is a read only process.
java.lang.Throwable
public void init() throws java.lang.Throwable
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |