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:
14
transcript_processing/outputs.py
Normal file
14
transcript_processing/outputs.py
Normal 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
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user