pepper.knowledge.wolfram module

Query the Wolfram Alpha API using Natural Language.

class pepper.knowledge.wolfram.Wolfram[source]
API_QUERY = u'http://www.wolframalpha.com/queryrecognizer/query.jsp?&appid={}&mode=Voice&i={}'
API_SPOKEN = u'https://api.wolframalpha.com/v1/spoken?appid={}&i={}'
ERRORS = ['Wolfram Alpha did not understand your input', 'No spoken result available', 'Information about']
TOO_BROAD = 'Information about '
is_query(query)[source]
query(query)[source]

Get spoken result from WolframAlpha query

Parameters:query (str) – Question to ask the WolframAlpha Engine
Returns:result – Answer to Question or None if no answer could be found
Return type:str or None