Question

Im writing a php script to compare the similarity of 2 strings. This works pretty good at the moment, but what I would like to do is match words when one is a synonym of the first.

Any thoughts?

Was it helpful?

Solution

You might want to try looking for a thesaurus service that allows you to query the synonyms for a word and have it return an XML list of synonyms.

Here is something to look at: http://nbii-thesaurus.ornl.gov/thesaurus/

OTHER TIPS

I don't know if this would be helpful for you but time ago I have been working on a PHP (CodeIgniter) library for Google Search that gets related terms by using the ~ on searches.

Maybe you can digg on the source code codeigniter-googlesearch-api

Formally aren't synonymous but depending on the application that you have in mind it could be useful (for example for SEO purposes).

As a side note, if you put ~term in Google, then it will bold you the terms that are related. Try it with ~investment for example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top