Sign inSign up

jrkrauss/ftextlib

By jrkrauss

•Updated about 6 years ago

A simple JAVA library that implements some of the most common text filters available out there.

Image
0

1.6K

jrkrauss/ftextlib repository overview

⁠FTextLib :capital_abcd: :arrow_right: :symbols:

⁠1. What is it?

FTextLib is a simple JAVA library that implements some of the most common text filters available out there.

⁠2. How to use?

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.

⁠Filters available:
FilterEnumDescription
First UpperEFilter.FIRST_UPPERTurns upper case all first letters
No SpaceEFilter.NO_SPACERemoves all the blank space
No VowelEFilter.NO_VOWELRemoves all the vowels
ROT13EFilter.ROT13Replaces a letter with its 13th succeeding one it in the alphabet
ATBASHEFilter.ATBASHReplaces 'a' with 'z', 'b' with 'y', 'c' with 'x' and so on
Pig LatimEFilter.PIG_LATIMAppends an 'ay' at the end of the word if it starts with a vowel
OpishEFilter.OPISHAdds 'op' after every consonant
ReverseEFilter.REVERSEReverses each word
All UnderscoreEFilter.ALL_UNDERSCOREReplaces all blank space by a _ (underscore)
Carioca AccentEFilter.CARIOCA_ACCENTReplaces portuguese words ending in '[aeiou]s' with '[aeiou]ix'
⁠3. Docker Usage :whale:

If you just want to see how this library works, download our image available on Docker Hub following the instructions below:

⁠Download the image :cd:

Once you have Docker CE⁠ installed an running, from your Linux terminal or Windows cmd, type:

$ docker pull jrkrauss/ftextlib:latest
⁠Create the container and run/ship it :ship:
$ docker run -it jrkrauss/ftextlib:latest

Tag summary

Content type

Image

Digest

Size

254.4 MB

Last updated

about 6 years ago

docker pull jrkrauss/ftextlib