porter stemming algorithm implementation question?

我怕爱的太早我们不能终老 提交于 2019-12-11 05:36:20

问题


I am trying to implement porter stemming algorithm but i am stuck at this point:

Step 1b

(m>0) EED -> EE                    feed      ->  feed
                                   agreed    ->  agree
(*v*) ED  ->                       plastered ->  plaster
                                   bled      ->  bled
(*v*) ING ->                       motoring  ->  motor
                                   sing      ->  sing

Isn't the m of feed equal 1? feed >> [c]vvc[] >>[c]vc[].

If it was so why didn't he convert feed to fee i know it is wrong ,can any one clear that up?

you can check the original algorithim here http://tartarus.org/~martin/PorterStemmer/def.txt

thanks


回答1:


m of 'feed' is indeed 1. Yet, you need to re-read the document carefully. The m in the condition refers to the measure of the stem, that is you need to calculate in after the replacement. In your case to check if feed -> fee is valid, you calculate m(fee) = 0, hence you don't do the replacement.

Also thanks for the algorithm! It was interesting!



来源:https://stackoverflow.com/questions/4522459/porter-stemming-algorithm-implementation-question

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!