Many synonyms are context specific. For example "force" is a synonym for "drive" in the context of urging or inspiring, but not in the context of journeying by vehicle.
Other synonyms seem to work across all contexts, for example "sea" and "ocean".
How can I get a list of all synonyms that work across all contexts?
Reflecting on TimLymington's comment, is there some measure of synonym distance?
Consider some of the words that thesaurus.com offer as synonyms for sea: expanse, lake, ocean, pond, surf, abundance and blue. Intuitively, I'm confident I can replace sea with ocean more often than with blue. So I could say ocean has a shorter synonym distance from sea than blue.
How can I measure this distance? And, back to my question of a list, how can I get a list of all synonyms with distances?
(n.b. same question on Open Data stackexchange)