My undergraduate research used Stanford Parser for getting word tags in a sentence before calculating its similarity with another sentence. Stanford Parser results are good, but it fails in some sentences. If you need a better alternative than this (for JVM languages), I would recommend NLP4J [1].