Natural language processing (NLP) with functional programming