Foundations of Computational Linguistics