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

Fix: Pythonドキュメント周りの色々を修正 #570

Merged
merged 5 commits into from
Aug 23, 2023
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
40 changes: 38 additions & 2 deletions crates/voicevox_core_python_api/python/voicevox_core/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,28 +166,64 @@ class AudioQuery:


class UserDictWordType(str, Enum):
"""ユーザー辞書の単語の品詞。"""

PROPER_NOUN = "PROPER_NOUN"
"""固有名詞。"""

COMMON_NOUN = "COMMON_NOUN"
"""一般名詞。"""

VERB = "VERB"
"""動詞。"""

ADJECTIVE = "ADJECTIVE"
"""形容詞。"""

SUFFIX = "SUFFIX"
"""語尾。"""


@pydantic.dataclasses.dataclass
class UserDictWord:
"""ユーザー辞書の単語。"""

surface: str
"""言葉の表層形。"""

pronunciation: str
"""
言葉の発音。

カタカナで表記する。
"""

accent_type: int = dataclasses.field(default=0)
"""
アクセント型。

音が下がる場所を指す。
"""

word_type: UserDictWordType = dataclasses.field(
default=UserDictWordType.COMMON_NOUN
)
"""品詞。"""

priority: int = dataclasses.field(default=5)
"""
単語の優先度。

0から10までの整数。
数字が大きいほど優先度が高くなる。
1から9までの値を指定することを推奨する。
"""

@pydantic.validator("pronunciation")
def validate_pronunciation(cls, v):
def _validate_pronunciation(cls, v):
_validate_pronunciation(v)
return v

@pydantic.validator("surface")
def validate_surface(cls, v):
def _validate_surface(cls, v):
return _to_zenkaku(v)
Loading