diff --git a/crates/voicevox_core_python_api/python/test/test_asyncio_user_dict_manipulate.py b/crates/voicevox_core_python_api/python/test/test_asyncio_user_dict_manipulate.py index ab63268a8..5fd30d9cc 100644 --- a/crates/voicevox_core_python_api/python/test/test_asyncio_user_dict_manipulate.py +++ b/crates/voicevox_core_python_api/python/test/test_asyncio_user_dict_manipulate.py @@ -27,8 +27,8 @@ async def test_user_dict_load() -> None: ) ) assert isinstance(uuid_a, UUID) - assert dict_a.words()[uuid_a].surface == "hoge" - assert dict_a.words()[uuid_a].pronunciation == "ホゲ" + assert dict_a.to_dict()[uuid_a].surface == "hoge" + assert dict_a.to_dict()[uuid_a].pronunciation == "ホゲ" # 単語の更新 dict_a.update_word( @@ -39,8 +39,8 @@ async def test_user_dict_load() -> None: ), ) - assert dict_a.words()[uuid_a].surface == "fuga" - assert dict_a.words()[uuid_a].pronunciation == "フガ" + assert dict_a.to_dict()[uuid_a].surface == "fuga" + assert dict_a.to_dict()[uuid_a].pronunciation == "フガ" # ユーザー辞書のインポート dict_b = voicevox_core.asyncio.UserDict() @@ -52,7 +52,7 @@ async def test_user_dict_load() -> None: ) dict_a.import_dict(dict_b) - assert uuid_b in dict_a.words() + assert uuid_b in dict_a.to_dict() # ユーザー辞書のエクスポート dict_c = voicevox_core.asyncio.UserDict() @@ -66,13 +66,13 @@ async def test_user_dict_load() -> None: os.close(temp_path_fd) await dict_c.save(temp_path) await dict_a.load(temp_path) - assert uuid_a in dict_a.words() - assert uuid_c in dict_a.words() + assert uuid_a in dict_a.to_dict() + assert uuid_c in dict_a.to_dict() # 単語の削除 dict_a.remove_word(uuid_a) - assert uuid_a not in dict_a.words() - assert uuid_c in dict_a.words() + assert uuid_a not in dict_a.to_dict() + assert uuid_c in dict_a.to_dict() # 単語のバリデーション with pytest.raises(pydantic.ValidationError): diff --git a/crates/voicevox_core_python_api/python/test/test_blocking_user_dict_manipulate.py b/crates/voicevox_core_python_api/python/test/test_blocking_user_dict_manipulate.py index 44afccfe2..968393f40 100644 --- a/crates/voicevox_core_python_api/python/test/test_blocking_user_dict_manipulate.py +++ b/crates/voicevox_core_python_api/python/test/test_blocking_user_dict_manipulate.py @@ -26,8 +26,8 @@ def test_user_dict_load() -> None: ) ) assert isinstance(uuid_a, UUID) - assert dict_a.words()[uuid_a].surface == "hoge" - assert dict_a.words()[uuid_a].pronunciation == "ホゲ" + assert dict_a.to_dict()[uuid_a].surface == "hoge" + assert dict_a.to_dict()[uuid_a].pronunciation == "ホゲ" # 単語の更新 dict_a.update_word( @@ -38,8 +38,8 @@ def test_user_dict_load() -> None: ), ) - assert dict_a.words()[uuid_a].surface == "fuga" - assert dict_a.words()[uuid_a].pronunciation == "フガ" + assert dict_a.to_dict()[uuid_a].surface == "fuga" + assert dict_a.to_dict()[uuid_a].pronunciation == "フガ" # ユーザー辞書のインポート dict_b = voicevox_core.blocking.UserDict() @@ -51,7 +51,7 @@ def test_user_dict_load() -> None: ) dict_a.import_dict(dict_b) - assert uuid_b in dict_a.words() + assert uuid_b in dict_a.to_dict() # ユーザー辞書のエクスポート dict_c = voicevox_core.blocking.UserDict() @@ -65,13 +65,13 @@ def test_user_dict_load() -> None: os.close(temp_path_fd) dict_c.save(temp_path) dict_a.load(temp_path) - assert uuid_a in dict_a.words() - assert uuid_c in dict_a.words() + assert uuid_a in dict_a.to_dict() + assert uuid_c in dict_a.to_dict() # 単語の削除 dict_a.remove_word(uuid_a) - assert uuid_a not in dict_a.words() - assert uuid_c in dict_a.words() + assert uuid_a not in dict_a.to_dict() + assert uuid_c in dict_a.to_dict() # 単語のバリデーション with pytest.raises(pydantic.ValidationError): diff --git a/crates/voicevox_core_python_api/python/voicevox_core/_rust/asyncio.pyi b/crates/voicevox_core_python_api/python/voicevox_core/_rust/asyncio.pyi index 284f7aadd..ec4070e88 100644 --- a/crates/voicevox_core_python_api/python/voicevox_core/_rust/asyncio.pyi +++ b/crates/voicevox_core_python_api/python/voicevox_core/_rust/asyncio.pyi @@ -434,8 +434,8 @@ class Synthesizer: class UserDict: """ユーザー辞書。""" - def words(self) -> dict[UUID, UserDictWord]: - """このオプジェクトの :class:`dict` としての表現。""" + def to_dict(self) -> dict[UUID, UserDictWord]: + """このオプジェクトを :class:`dict` に変換する。""" ... def __init__(self) -> None: ... async def load(self, path: str | PathLike[str]) -> None: diff --git a/crates/voicevox_core_python_api/python/voicevox_core/_rust/blocking.pyi b/crates/voicevox_core_python_api/python/voicevox_core/_rust/blocking.pyi index d1f7ca1d0..d6484dc51 100644 --- a/crates/voicevox_core_python_api/python/voicevox_core/_rust/blocking.pyi +++ b/crates/voicevox_core_python_api/python/voicevox_core/_rust/blocking.pyi @@ -446,8 +446,8 @@ class Synthesizer: class UserDict: """ユーザー辞書。""" - def words(self) -> dict[UUID, UserDictWord]: - """このオプジェクトの :class:`dict` としての表現。""" + def to_dict(self) -> dict[UUID, UserDictWord]: + """このオプジェクトを :class:`dict` に変換する。""" ... def __init__(self) -> None: ... def load(self, path: str | PathLike[str]) -> None: diff --git a/crates/voicevox_core_python_api/src/lib.rs b/crates/voicevox_core_python_api/src/lib.rs index 049cf885f..26d580285 100644 --- a/crates/voicevox_core_python_api/src/lib.rs +++ b/crates/voicevox_core_python_api/src/lib.rs @@ -862,7 +862,7 @@ mod blocking { Ok(()) } - fn words<'py>(&self, py: Python<'py>) -> PyResult<&'py PyDict> { + fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<&'py PyDict> { let words = self.dict.with_words(|words| { words .iter() @@ -1518,7 +1518,7 @@ mod asyncio { Ok(()) } - fn words<'py>(&self, py: Python<'py>) -> PyResult<&'py PyDict> { + fn to_dict<'py>(&self, py: Python<'py>) -> PyResult<&'py PyDict> { let words = self.dict.with_words(|words| { words .iter()