找到一个单词的词根
我需要建立一个 php 字典,它将找到一个单词的根词。 前任。搜索“汽车”,它会告诉你“汽车是汽车的复数” 或者“take”,它是“take的过去式”
我正在考虑使用Wordnet,但它看起来很复杂。
有什么建议吗?我绝望的
问候;
I need to build a php dictionary, which will find the root word of a word.
Ex. search "cars", it will tell "Cars is plural of car"
Or "took", it's "the past tense of take"
I am considering using Wordnet, but it seems complicated.
Any suggestion? m desperated
Regards;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,由于建议的词干分析器不适合您,您可以从这里选择一些更适合您的词干分析器:
http:// /snowball.tartarus.org/
这里还有一些有趣的库: http://sourceforge.net /projects/nlp/
还链接到 StackOverflow 上的类似问题:
使用 PHP 的 NLP 编程工具?
使用 PHP 进行文本挖掘
更新:
如何进行词词干提取或词形还原?
http://www.reddit.com/r/programming/comments/8e5d3/how_do_i_programatically_do_stemming_eg_eating_to/
http://www.nltk.org/
Wordnet 词形还原器:http://wordnet.princeton.edu/wordnet/download/
Well, since suggested stemmer does not work correctly for you, you can choose some, that suits you better from here:
http://snowball.tartarus.org/
Here is also some interesting library: http://sourceforge.net/projects/nlp/
Also links to similiar questions on StackOverflow:
NLP programming tools using PHP?
Text mining with PHP
UPDATE:
How do I do word Stemming or Lemmatization?
http://www.reddit.com/r/programming/comments/8e5d3/how_do_i_programatically_do_stemming_eg_eating_to/
http://www.nltk.org/
Wordnet lemmatizer: http://wordnet.princeton.edu/wordnet/download/
好吧,这是一个可以进行词干提取的扩展(我相信这就是您想要的):
http://pecl.php.net/package/stem
它不做任何语法分析然而,工作的内容。
这是仅 php 版本: http://www.chuggnutt.com/stemmer.php
Well, here is an extension that does word stemming (I beleive this is around what you want):
http://pecl.php.net/package/stem
It doesn't do any grammatical analysis of the work, however.
Here is php-only version: http://www.chuggnutt.com/stemmer.php
您可以在这里尝试免费的 Lemmatizer API: http://twinword.com/lemmatizer.php
向下滚动到找到词形还原端点。
这将使您能够将“狗”变为“狗”,将“能力”变为“能力”。
如果您传入一个名为“text”的 POST 或 GET 参数以及一个类似“walked plant”的字符串:
您会得到如下响应:
You can try the free Lemmatizer API here: http://twinword.com/lemmatizer.php
Scroll down to find the Lemmatizer endpoint.
This will allow you to get "dogs" to "dog", "abilities" to "ability".
If you pass in a POST or GET parameter called "text" with a string like "walked plants":
You get a response like this: