Python - 生成单数名词的复数名词

标签 python nlp

我如何使用 NLTK 模块来同时编写名词的单数和复数形式,或者告诉它在 txt 文件中搜索单词时不区分单数和复数?我可以使用 NLTK 使程序不区分大小写吗?

最佳答案

你可以使用pattern.en来做到这一点,对NLTK不太了解

>>> from pattern.en import pluralize, singularize
>>>  
>>> print pluralize('child') #children
>>> print singularize('wolves') #wolf

参见 more

关于Python - 生成单数名词的复数名词,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32404666/

相关文章:

python - 我如何将 nuitka 与 virtualenv 一起使用

python - 为什么我的 pandas + numba 代码比 pandas + 纯 python 代码工作得更差?

sorting - 解决文本的两个字符列争夺的方法

android - 质量检查系统词库

nlp - 我可以将 String Document <Type> 反转回字符串吗? (文本分析.jl)

algorithm - 尝试单词之间的关联

python - selenium.common.exceptions.WebDriverException : Message: 'chromedriver' executable needs to be in PATH

python - 您将如何解决这个 GPS/定位问题并对其进行扩展?您会使用数据库吗? R树?

python flask上传文件但不保存使用

python - 获取选定的特征名称 TFIDF Vectorizer