A simple JAVA library that implements some of the most common text filters available out there.
1.6K
FTextLib is a simple JAVA library that implements some of the most common text filters available out there.
Download the jar file into your project's folder and import it into your project's path. Once you've done that, that's how you use in your code:
import org.krauss.ftextlib.def.EFilter;
import org.krauss.ftextlib.factory.FilterFactory;
Then using the FilterFactory class, you can create a filter and apply it straight away like this:
//FilterFactory.getFilter(EFilter filter)
Filter filter = FilterFactory.getFilter(EFilter.REVERSE);
//filter.applyFilter(String text);
filter.applyFilter("Hell of world!");
//Output:
"lleH fo !dlrow"
The static method getFilter() takes one argument filter, which is an EFilter Enum and returns an object Filter that has the method applyFilter().
The method applyFilter() takes one argument text and returns a String which is the text already processed.
| Filter | Enum | Description |
|---|---|---|
| First Upper | EFilter.FIRST_UPPER | Turns upper case all first letters |
| No Space | EFilter.NO_SPACE | Removes all the blank space |
| No Vowel | EFilter.NO_VOWEL | Removes all the vowels |
| ROT13 | EFilter.ROT13 | Replaces a letter with its 13th succeeding one it in the alphabet |
| ATBASH | EFilter.ATBASH | Replaces 'a' with 'z', 'b' with 'y', 'c' with 'x' and so on |
| Pig Latim | EFilter.PIG_LATIM | Appends an 'ay' at the end of the word if it starts with a vowel |
| Opish | EFilter.OPISH | Adds 'op' after every consonant |
| Reverse | EFilter.REVERSE | Reverses each word |
| All Underscore | EFilter.ALL_UNDERSCORE | Replaces all blank space by a _ (underscore) |
| Carioca Accent | EFilter.CARIOCA_ACCENT | Replaces portuguese words ending in '[aeiou]s' with '[aeiou]ix' |
If you just want to see how this library works, download our image available on Docker Hub following the instructions below:
Once you have Docker CE installed an running, from your Linux terminal or Windows cmd, type:
$ docker pull jrkrauss/ftextlib:latest
$ docker run -it jrkrauss/ftextlib:latest
Content type
Image
Digest
Size
254.4 MB
Last updated
about 6 years ago
docker pull jrkrauss/ftextlib