Skip to content
This repository has been archived by the owner on Apr 20, 2024. It is now read-only.

Commit

Permalink
feat(v1): Added ABNF Grammars field in Speech Adaptation (#474)
Browse files Browse the repository at this point in the history
* feat: Added ABNF Grammars field in Speech Adaptation
    * Added a new field to Speech Adaptation to specify ABNF grammar
      definitions

PiperOrigin-RevId: 499896786

Source-Link: googleapis/googleapis@ba57145

Source-Link: https://github.com/googleapis/googleapis-gen/commit/f5d8be29056311c30de930fc099baccfbd0eabeb
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjVkOGJlMjkwNTYzMTFjMzBkZTkzMGZjMDk5YmFjY2ZiZDBlYWJlYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jan 5, 2023
1 parent 23f2634 commit ca28974
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
25 changes: 25 additions & 0 deletions google/cloud/speech_v1/types/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,28 @@ class SpeechAdaptation(proto.Message):
of its fields, giving it a unique ``custom_class_id``. Refer
to the inline defined class in phrase hints by its
``custom_class_id``.
abnf_grammar (google.cloud.speech_v1.types.SpeechAdaptation.ABNFGrammar):
Augmented Backus-Naur form (ABNF) is a
standardized grammar notation comprised by a set
of derivation rules. See specifications:
https://www.w3.org/TR/speech-grammar
"""

class ABNFGrammar(proto.Message):
r"""
Attributes:
abnf_strings (MutableSequence[str]):
All declarations and rules of an ABNF grammar
broken up into multiple strings that will end up
concatenated.
"""

abnf_strings: MutableSequence[str] = proto.RepeatedField(
proto.STRING,
number=1,
)

phrase_sets: MutableSequence["PhraseSet"] = proto.RepeatedField(
proto.MESSAGE,
number=1,
Expand All @@ -200,6 +220,11 @@ class SpeechAdaptation(proto.Message):
number=3,
message="CustomClass",
)
abnf_grammar: ABNFGrammar = proto.Field(
proto.MESSAGE,
number=4,
message=ABNFGrammar,
)


__all__ = tuple(sorted(__protobuf__.manifest))
25 changes: 25 additions & 0 deletions google/cloud/speech_v1p1beta1/types/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,28 @@ class SpeechAdaptation(proto.Message):
of its fields, giving it a unique ``custom_class_id``. Refer
to the inline defined class in phrase hints by its
``custom_class_id``.
abnf_grammar (google.cloud.speech_v1p1beta1.types.SpeechAdaptation.ABNFGrammar):
Augmented Backus-Naur form (ABNF) is a
standardized grammar notation comprised by a set
of derivation rules. See specifications:
https://www.w3.org/TR/speech-grammar
"""

class ABNFGrammar(proto.Message):
r"""
Attributes:
abnf_strings (MutableSequence[str]):
All declarations and rules of an ABNF grammar
broken up into multiple strings that will end up
concatenated.
"""

abnf_strings: MutableSequence[str] = proto.RepeatedField(
proto.STRING,
number=1,
)

phrase_sets: MutableSequence["PhraseSet"] = proto.RepeatedField(
proto.MESSAGE,
number=1,
Expand All @@ -201,6 +221,11 @@ class SpeechAdaptation(proto.Message):
number=3,
message="CustomClass",
)
abnf_grammar: ABNFGrammar = proto.Field(
proto.MESSAGE,
number=4,
message=ABNFGrammar,
)


class TranscriptNormalization(proto.Message):
Expand Down

0 comments on commit ca28974

Please sign in to comment.