2018-01-01 12:13:17 +00:00
|
|
|
from senpy.plugins import SentimentPlugin
|
|
|
|
|
|
|
|
|
2018-01-02 10:56:55 +00:00
|
|
|
class DummyNoInfo(SentimentPlugin):
|
2018-01-01 12:13:17 +00:00
|
|
|
|
|
|
|
description = 'This is a dummy self-contained plugin'
|
|
|
|
author = '@balkian'
|
|
|
|
version = '0.1'
|
|
|
|
|
|
|
|
def analyse_entry(self, entry, params):
|
|
|
|
entry['nif:isString'] = entry['nif:isString'][::-1]
|
|
|
|
entry.reversed = entry.get('reversed', 0) + 1
|
|
|
|
yield entry
|
|
|
|
|
|
|
|
test_cases = [{
|
|
|
|
"entry": {
|
|
|
|
"nif:isString": "Hello world!"
|
|
|
|
},
|
|
|
|
"expected": [{
|
|
|
|
"nif:isString": "!dlrow olleH"
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2018-01-02 10:56:55 +00:00
|
|
|
d = DummyNoInfo()
|
2018-01-01 12:13:17 +00:00
|
|
|
d.test()
|