A sort of ruby version of the RegexParser module in the NLTK