def summary(query, sentences=0, chars=0):
"""Returns a plain text summary from the query's page."""
try:
return wikipedia.summary(query, sentences, chars)
except wikipedia.exceptions.PageError:
return "No page matches, try another item."
except wikipedia.exceptions.DisambiguationError as error:
return error.options[:5]
评论列表
文章目录