使用After Deadline拼写检查器似乎返回空列表

时间:2018-07-19 00:50:07

标签: python nlp

我正在尝试使用AfterTheDeadline API读取程序的某些输出。这是我的测试人员代码:

ATD.setDefaultKey('qg2324242424')
errors = list(ATD.checkDocument("Looking too the wter. Fixing your writing typoss."))
print(errors)
for error in errors:
    print("%s error for: %s **%s**" % (error.type, error.precontext, error.string))
    print("some suggestions: %s" % (", ".join(error.suggestions),))

我将list()放在ATD.checkDocument之前,因为否则它只会返回一个生成器对象。错误只是一个空列表,因此for循环不返回任何内容。我正在使用Miguel Ventura's python 3+ version运行我的代码。任何有关如何获得预期输出的帮助将不胜感激。

0 个答案:

没有答案