可以使用Python中的inflect模块来将单数词转换成复数形式。使用前需要先安装该模块,可以通过以下命令安装:
pip install inflect
然后,可以按照以下示例代码来将列表中的单数词转换成复数形式:
import inflect
# 初始化inflect对象
p = inflect.engine()
# 需要转换的单数词列表
words = ['cat', 'book', 'table', 'person']
# 将单数词转换成复数形式
plural_words = [p.plural(word) for word in words]
print(plural_words)
输出结果为:
['cats', 'books', 'tables', 'people']
其中,inflect.engine()函数用于初始化inflect对象,p.plural()函数用于将单数词转换成复数形式。