|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.tumba.cage.DefaultWordFinder pt.tumba.cage.TeXWordFinder
public class TeXWordFinder
A word finder for TeX and LaTeX documents, which searches text for sequences of letters, but ignores any commands and environments as well as Math environments.
DefaultWordFinder
Field Summary | |
---|---|
static int |
REG_EXPR
Constant value specifying regular expressions on user defined ignores. |
static int |
STRING_EXPR
Constant value specifying strings on user defined ignores. |
Constructor Summary | |
---|---|
TeXWordFinder()
Constructor for TexWordFinder. |
|
TeXWordFinder(java.lang.String inText)
Constructor for TeXWordFinder. |
Method Summary | |
---|---|
void |
addUserDefinedIgnores(java.util.Collection expressions,
int regex)
This method is used to import a user defined set of either strings or regular expressions to ignore. |
java.lang.String |
currentSegment()
Returns the current text segment from the input. |
java.lang.String |
next()
This method scans the text from the end of the last word, and returns a String corresponding to the next word. |
void |
setIgnoreComments(boolean ignore)
Allows one to indicate if TeX comments should be ignored. |
Methods inherited from class pt.tumba.cage.DefaultWordFinder |
---|
current, currentNGram, currentWordGram, getText, hasNext, lookAhead, nextSegment, replace, replaceBigram, replaceSegment, setText, splitNGrams, splitSegments, splitWordGrams, splitWords, startsSentence, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int STRING_EXPR
public static final int REG_EXPR
Constructor Detail |
---|
public TeXWordFinder(java.lang.String inText)
inText
- A String with the input text to tokenize.public TeXWordFinder()
Method Detail |
---|
public java.lang.String currentSegment()
currentSegment
in class DefaultWordFinder
public java.lang.String next()
next
in class DefaultWordFinder
public void addUserDefinedIgnores(java.util.Collection expressions, int regex)
expressions
- a collection of of Objects whose toString() value
should be the expression. Typically String objects.regex
- is an integer specifying the type of expression to
use. e.g. REG_EXPR, STRING_EXPR.public void setIgnoreComments(boolean ignore)
ignore
- true if TeX comments should be ignored and false otherwise.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |