php 脚本查找同义词
我正在编写一个 php 脚本来比较 2 个字符串的相似度。目前这工作得很好,但我想做的是当一个是第一个同义词时匹配单词。
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能想要尝试寻找同义词库服务,该服务允许您查询单词的同义词并让它返回同义词的 XML 列表。
这里有一些东西值得一看:http://nbii-thesaurus.ornl.gov/thesaurus/
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/
我不知道这对你是否有帮助,但不久前我一直在为 Google 搜索开发一个 PHP (CodeIgniter) 库,它通过在搜索中使用 ~ 来获取相关术语。
也许你可以挖掘源代码 codeigniter-googlesearch-api
正式上不是同义词,但根据您想要的应用程序,它可能很有用(例如用于 SEO 目的)。
附带说明一下,如果您在 Google 中输入 ~term,那么相关的术语就会以粗体显示。例如,尝试一下〜投资。
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.