Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use unicode #1453

Merged
merged 1 commit into from
Apr 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions speech/cloud-client/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def transcribe_file(speech_file):
# them to get the transcripts for the entire audio file.
for result in response.results:
# The first alternative is the most likely one for this portion.
print('Transcript: {}'.format(result.alternatives[0].transcript))
print(u'Transcript: {}'.format(result.alternatives[0].transcript))
# [END migration_sync_response]
# [END def_transcribe_file]

Expand All @@ -81,7 +81,7 @@ def transcribe_gcs(gcs_uri):
# them to get the transcripts for the entire audio file.
for result in response.results:
# The first alternative is the most likely one for this portion.
print('Transcript: {}'.format(result.alternatives[0].transcript))
print(u'Transcript: {}'.format(result.alternatives[0].transcript))
# [END def_transcribe_gcs]


Expand Down
4 changes: 2 additions & 2 deletions speech/cloud-client/transcribe_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def transcribe_file(speech_file):
# them to get the transcripts for the entire audio file.
for result in response.results:
# The first alternative is the most likely one for this portion.
print('Transcript: {}'.format(result.alternatives[0].transcript))
print(u'Transcript: {}'.format(result.alternatives[0].transcript))
print('Confidence: {}'.format(result.alternatives[0].confidence))
# [END migration_async_response]
# [END def_transcribe_file]
Expand Down Expand Up @@ -84,7 +84,7 @@ def transcribe_gcs(gcs_uri):
# them to get the transcripts for the entire audio file.
for result in response.results:
# The first alternative is the most likely one for this portion.
print('Transcript: {}'.format(result.alternatives[0].transcript))
print(u'Transcript: {}'.format(result.alternatives[0].transcript))
print('Confidence: {}'.format(result.alternatives[0].confidence))
# [END def_transcribe_gcs]

Expand Down
4 changes: 2 additions & 2 deletions speech/cloud-client/transcribe_model_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def transcribe_model_selection(speech_file, model):
alternative = result.alternatives[0]
print('-' * 20)
print('First alternative of result {}'.format(i))
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))
# [END speech_transcribe_model_selection]


Expand Down Expand Up @@ -79,7 +79,7 @@ def transcribe_model_selection_gcs(gcs_uri, model):
alternative = result.alternatives[0]
print('-' * 20)
print('First alternative of result {}'.format(i))
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))
# [END speech_transcribe_model_selection_gcs]


Expand Down
2 changes: 1 addition & 1 deletion speech/cloud-client/transcribe_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def transcribe_streaming(stream_file):
# The alternatives are ordered from most likely to least.
for alternative in alternatives:
print('Confidence: {}'.format(alternative.confidence))
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))
# [END migration_streaming_response]
# [END def_transcribe_streaming]

Expand Down
4 changes: 2 additions & 2 deletions speech/cloud-client/transcribe_word_time_offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def transcribe_file_with_word_time_offsets(speech_file):

for result in response.results:
alternative = result.alternatives[0]
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))

for word_info in alternative.words:
word = word_info.word
Expand Down Expand Up @@ -83,7 +83,7 @@ def transcribe_gcs_with_word_time_offsets(gcs_uri):

for result in result.results:
alternative = result.alternatives[0]
print('Transcript: {}'.format(alternative.transcript))
print(u'Transcript: {}'.format(alternative.transcript))
print('Confidence: {}'.format(alternative.confidence))

for word_info in alternative.words:
Expand Down