【发布时间】:2015-01-18 17:13:21
【问题描述】:
我正在尝试将文本中的名词单词更改为“名词”。 我遇到了麻烦。这是我目前所拥有的。
def noun(file):
for word in file:
for ch in word:
if ch[-1:-3] == "ion" or ch[-1:-3] == "ism" or ch[-1:-3] == "ity":
word = "noun"
if file(word-1) == "the" and (file(word+1)=="of" or file(word+1) == "on"
word = "noun"
# words that appear after the
return outfile
有什么想法吗?
【问题讨论】:
-
“我遇到了麻烦”并不能很好地描述您的问题。究竟是什么问题?