|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
from senpy.plugins import SentimentPlugin
|
|
|
|
|
from senpy.models import Response
|
|
|
|
|
from senpy.models import Response, Entry
|
|
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
|
|
|
|
@ -13,5 +13,12 @@ class ExamplePlugin(SentimentPlugin):
|
|
|
|
|
% self._info.get('custom_attribute'))
|
|
|
|
|
|
|
|
|
|
def analyse(self, *args, **kwargs):
|
|
|
|
|
logger.warn('Analysing with the example')
|
|
|
|
|
return Response()
|
|
|
|
|
logger.warn('Analysing with the example.')
|
|
|
|
|
logger.warn('The answer to this response is: %s.' % kwargs['parameter'])
|
|
|
|
|
resp = Response()
|
|
|
|
|
ent = Entry(kwargs['input'])
|
|
|
|
|
ent['example:reversed'] = kwargs['input'][::-1]
|
|
|
|
|
ent['example:the_answer'] = kwargs['parameter']
|
|
|
|
|
resp.entries.append(ent)
|
|
|
|
|
|
|
|
|
|
return resp
|
|
|
|
|