Programming Language Techniques for Natural Language Applications