How to know if two words have the same base?

心已入冬 提交于 2019-12-03 07:10:20

问题


I want to know, in several languages, if two words are:

  • either the same word,
  • or the grammatical variants of the same word.

For example:

  • had and has has the same base: in both cases, it's the verb have,
  • city and cities has the same base.
  • went and gone has the same base.

Is there a way to use the Microsoft Word API to not just spell check text, but also normalize a word to a base or, at least, determine if two words have the same base?

If not, what are the (free or paid) libraries (not web services) which allow me to do it (again, in several languages)?


回答1:


Inflector.NET is an open source library that you can use to normalize the inflection of English nouns. Available at: https://github.com/davidarkemp/Inflector/tree/master/Inflector




回答2:


Snowball is a stemming API that can handle various natural languages and there are Snowball implementations for various programming languages.

http://snowball.tartarus.org/



来源:https://stackoverflow.com/questions/8856347/how-to-know-if-two-words-have-the-same-base

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