A simple implementation of Word Filtering in java