Package org.jtr.transliterate

Performs Perl 5-style transliterations on a given string.


Class Summary
CharacterList Holds an ordered list of characters and character ranges.
CharacterParser Simple parser for characters and character ranges.
CharacterReplacer Main class for performing the transliteration operation.
Perl5Parser A utility class for providing Perl 5 syntactic sugar on top of the CharacterParser class.

Exception Summary
CharacterParseException Exception thrown by the CharacterParser when a parse error occurs.

Package org.jtr.transliterate Description

Performs Perl 5-style transliterations on a given string. Most Perl 5 features are supported, including complements, squashing of duplicate replacement characters, and deletion of characters found in the search list, but with no equivalent in the replacement list. Patterns are compiled for speed, and runtime performance is fast.

A simple example:

String aInput = "This is a test, 123.";
CharacterReplacer cReplacer = Perl5Parser.makeReplacer( "tr/a-zA-Z0-9/_/s" );
String aResult = cReplacer.doReplacement( aInput );
int nMatches = cReplacer.getMatches();

And remember, its spelled j-t-r, but pronounced "jitter" ;-)

Nicholas Cull