Skip to content

Commit

Permalink
gssml arg "transcribe" -> "parser_transcribe" for compat w. icespeak
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinbjornt committed Sep 13, 2023
1 parent 98b6974 commit fed7f64
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions queries/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def query_person(query: Query, session: Session, name: str) -> AnswerTuple:
return dict(answer=""), "", ""
answer = title
voice_answer = (
f"{gssml(name, type='person')} er {gssml(answer, type='generic')}."
f"{gssml(name, type='person')} er {gssml(answer, type='parser_transcribe')}."
)
# Set the context for a subsequent query
query.set_context({"person_name": name})
Expand Down Expand Up @@ -639,7 +639,7 @@ def query_title(query: Query, session: Session, title: str) -> AnswerTuple:
response = make_response_list(rd)
answer: str
voice_answer: str
voice_title = gssml(title, type="generic")
voice_title = gssml(title, type="parser_transcribe")
if response and title and "answer" in response[0]:
first_response = response[0]
# Return 'Seðlabankastjóri er Már Guðmundsson.'
Expand Down
2 changes: 1 addition & 1 deletion queries/ja.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def _answer_name4phonenum_query(q: Query, result: Result) -> AnswerTuple:
).strip()
voice = ans_templ.format(
n=name,
o=f", {gssml(occup, type='generic')}" if occup else "",
o=f", {gssml(occup, type='parser_transcribe')}" if occup else "",
f=f", {vfull_addr}" if vfull_addr else "",
).strip()

Expand Down
4 changes: 2 additions & 2 deletions queries/news.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def top_news_answer() -> Optional[AnswerTuple]:
news = "".join(items).strip()
voice_news = ""
for item in items:
# TODO: Transcribing the news using 'generic'
# TODO: Transcribing the news using 'parser_transcribe'
# costs 6 seconds when not cached,
# this is too costly at the moment
# voice_news += gssml(item, type="generic")
# voice_news += gssml(item, type="parser_transcribe")
voice_news += item
# Add a pause between individual news items
voice_news += gssml(type="vbreak", time="1s")
Expand Down
2 changes: 1 addition & 1 deletion queries/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def sentence(state: QueryStateDict, result: Result) -> None:
unit_to = result.unit_to
response = dict(answer=answer)
voice_answer = "{0} {1} {2}.".format(result.desc, verb, answer).capitalize()
voice_answer = gssml(voice_answer, type="generic")
voice_answer = gssml(voice_answer, type="parser_transcribe")
# Store the resulting quantity in the query context
q.set_context(
{
Expand Down

0 comments on commit fed7f64

Please sign in to comment.