Not sure if this is exactly what you looking for but try ARTHA,
it's downloadable offline opensource thesaurus and dictionary, not sure if checks grammar too.