为什么 Porter Stemmer 会产生一个可以再次词干的字符串?
stem('apples')='apple'
stem('apple')='appl'
stem('appl')='appl'
isn't this a flaw in the stemming algorithm?
(this is using the Porter Stemming Algorithm)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这看起来更像是您正在使用的算法实现中的一个错误。
当我按照原始算法中的步骤(来自您链接到的页面)时,“apples”最后的“s”在步骤 1a 中被删除,“e”在步骤 5a 中被删除,因此“apples”的词干也是“appl”。
That looks more like a bug in the implementation of the algorithm you're using.
When I follow the steps in the original algorithm (from the page you linked to), the final "s" from "apples" is removed in step 1a, and the "e" in step 5a, so the stem of "apples" is also "appl".
我在这里找到了带有字典支持的波特词干算法的实现 http://preciselyconcise.com/apis_and_installations/smart_stemmer。 php.
这个 API 使用起来非常简单,而且词干词的拼写错误也得到了纠正。我建议您使用这个词干分析器,因为这个 API 具有自动更正词干词的选项。
I found an implementation of porter stemming algorithm with a dictionary support here http://preciselyconcise.com/apis_and_installations/smart_stemmer.php.
This API was really simple to use and the stemmed words were corrected for mistakes in spelling. I would suggest you using this stemmer since this API has an auto correct option of the stemmed words.