|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.writersforge.catalan.transform.BaseNodeProcessor
org.writersforge.catalan.transform.text.TextProcessor
org.writersforge.catalan.transform.text.Normalizer
A text processor which cleans up the input text content according to its set of configurable rules. It is primarily used to shrink whitespace. This processor accepts only String input, and produces only String output.
| Constructor Summary | |
Normalizer()
Creates a new instance of Normalizer. |
|
Normalizer(org.writersforge.bellows.Datum xml)
Creates a new instance of Normalizer from the XML spec. |
|
| Method Summary | |
void |
addExclusion(java.lang.String startToken,
java.lang.String endToken)
Adds an exclusion region, for example quoted data that should not be normalized. |
protected java.util.List |
processText(java.lang.String text)
Processes the text node. |
void |
setNormalizeTokens(java.lang.String[] tokens)
Assigns a new set of tokens to normalize. |
void |
setResolver(java.lang.String resolver)
Assigns the text that the processor substitutes for normalized text. |
java.lang.String |
toString()
Convert this object to a String value. |
| Methods inherited from class org.writersforge.catalan.transform.text.TextProcessor |
processNode |
| Methods inherited from class org.writersforge.catalan.transform.BaseNodeProcessor |
addLeftover, end, getLeftovers, getNodes, start |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Normalizer(org.writersforge.bellows.Datum xml)
xml - XML initializing specpublic Normalizer()
| Method Detail |
public void setNormalizeTokens(java.lang.String[] tokens)
tokens - an array of the new normalization tokenssetResolver(String)public void setResolver(java.lang.String resolver)
resolver - the text to insert in place of normalized text
public void addExclusion(java.lang.String startToken,
java.lang.String endToken)
Normalizer normalizer = new Normalizer ();
normalizer.addExclusion ("'", "'");
normalizer.addExclusion ("\"", "\"");
startToken - the token which starts the exclusion regionendToken - the token which ends the exclusion regionprotected java.util.List processText(java.lang.String text)
processText in class TextProcessortext - the text to process
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||