-
lang3
Word counter
This is an example of how to count the words of a String paragraph, using the org.apache.commons.lang3.StringUtils class. This class provides…
Read More » -
lang3
Array reverse order
With this example we are going to demonstrate how to reverse the order of an array. We are using the…
Read More » -
lang3
Check empty string
In this example we shall show you how to check if a String is empty. We are using the org.apache.commons.lang3.StringUtils class,…
Read More » -
codec
Decode Base64
This is an example of how to decode Strings with the Base64 algorithm. We are using the org.apache.commons.codec.binary.Base64 class that provides…
Read More » -
io
Move Directory
With this example we are going to demonstrate how to move a Directory. We are using the org.apache.commons.io.FileUtils class that…
Read More » -
io
Get directory size
In this example we shall show you how to get the size of a directory. We are using the org.apache.commons.io.FileUtils class…
Read More » -
io
Get content of a file line by line
This is an example of how to get the content of a file, line by line. We will make use…
Read More » -
io
Get content of a File
With this example we are going to demonstrate how to get the content of a File. We will make use…
Read More » -
lucene
Search Lucene Index
package com.javacodegeeks.lucene; import java.io.File; import org.apache.lucene.analysis.SimpleAnalyzer; import org.apache.lucene.document.Document; import org.apache.lucene.queryParser.QueryParser; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.search.ScoreDoc; import org.apache.lucene.search.TopDocs; import org.apache.lucene.store.Directory;…
Read More » -
lucene
Did you mean feature with Apache Lucene Spell-Checker
package com.javacodegeeks.lucene.spellcheck; import java.io.File; import org.apache.lucene.search.spell.PlainTextDictionary; import org.apache.lucene.search.spell.SpellChecker; import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; public class SimpleSuggestionService { public static void main(String[]…
Read More »