updated tests to current format of converters, updated static/not-static decorators on base class to match its children, added GoogleConverter, moved one or two methods to the base class because they all work the same.

This commit is contained in:
2019-03-07 02:30:48 -05:00
parent 6333f55c87
commit d30ecad583
16 changed files with 346 additions and 46 deletions

View File

@@ -0,0 +1,14 @@
import json
def universal_transcript(self, pretty=False):
return json.dumps(self.converted_words, indent=4 if pretty else None)
def viral_overlay(self, pretty=False):
return json.dumps([{
'start': word['start'],
'stop': word['end'],
'text': word['word'].title() if word['always_capitalized'] else word['word']}
for word in self.converted_words], indent=4 if pretty else None
)