diff --git a/python/py_src/sudachipy/sudachipy.pyi b/python/py_src/sudachipy/sudachipy.pyi index 0b1c4fc2..ca39a95c 100644 --- a/python/py_src/sudachipy/sudachipy.pyi +++ b/python/py_src/sudachipy/sudachipy.pyi @@ -47,7 +47,9 @@ class SplitMode: Unit to split text. A == short mode + B == middle mode + C == long mode """ @@ -205,6 +207,9 @@ class Morpheme: def get_word_info(self) -> WordInfo: """ Returns the word info. + + ..deprecated:: v0.6.0 + Users should not touch the raw WordInfo. """ ... @@ -293,6 +298,7 @@ class Morpheme: class MorphemeList: """ A list of morphemes. + An object can not be instantiated manually. Use Tokenizer.tokenize("") to create an empty morpheme list. """ @@ -303,6 +309,9 @@ class MorphemeList: def empty(cls, dict: Dictionary) -> MorphemeList: """ Returns an empty morpheme list with dictionary. + + .. deprecated:: + Use Tokenizer.tokenize("") if you need. """ ... diff --git a/python/src/build.rs b/python/src/build.rs index 2b2ce94f..b37ed807 100644 --- a/python/src/build.rs +++ b/python/src/build.rs @@ -65,7 +65,7 @@ fn create_file(p: &Path) -> std::io::Result { /// :param output: Path to output built dictionray. /// :param description: A description text to embed in the dictionary. /// :return: A build report, list of (part, size, time). -/// +/// /// :type matrix: pathlib.Path | str | bytes /// :type lex: list[pathlib.Path | str | bytes] /// :type output: pathlib.Path | str @@ -106,7 +106,7 @@ fn build_system_dic<'p>( /// :param output: Path to output built dictionray. /// :param description: A description text to embed in the dictionary. /// :return: A build report, list of (part, size, time). -/// +/// /// :type system: pathlib.Path | str /// :type lex: list[pathlib.Path | str | bytes] /// :type output: pathlib.Path | str diff --git a/python/src/dictionary.rs b/python/src/dictionary.rs index 2b5c849b..22241f95 100644 --- a/python/src/dictionary.rs +++ b/python/src/dictionary.rs @@ -87,7 +87,7 @@ impl PyDicData { /// :param config_path: path to the configuration JSON file, config json as a string, or a [sudachipy.Config] object. /// :param config: alias to config_path, only one of them can be specified at the same time. /// :param resource_dir: path to the resource directory folder. -/// :param dict: type of pre-packaged dictionary, referring to sudachidict_ packages on PyPI: https://pypi.org/search/?q=sudachidict. +/// :param dict: type of pre-packaged dictionary, referring to sudachidict_ packages on PyPI: https://pypi.org/search/?q=sudachidict. /// Also, can be an _absolute_ path to a compiled dictionary file. /// :param dict_type: deprecated alias to dict. /// @@ -114,7 +114,7 @@ impl PyDictionary { /// :param config_path: path to the configuration JSON file, config json as a string, or a [sudachipy.Config] object. /// :param config: alias to config_path, only one of them can be specified at the same time. /// :param resource_dir: path to the resource directory folder. - /// :param dict: type of pre-packaged dictionary, referring to sudachidict_ packages on PyPI: https://pypi.org/search/?q=sudachidict. + /// :param dict: type of pre-packaged dictionary, referring to sudachidict_ packages on PyPI: https://pypi.org/search/?q=sudachidict. /// Also, can be an _absolute_ path to a compiled dictionary file. /// :param dict_type: deprecated alias to dict. /// diff --git a/python/src/morpheme.rs b/python/src/morpheme.rs index 522d8ecd..b164911d 100644 --- a/python/src/morpheme.rs +++ b/python/src/morpheme.rs @@ -93,6 +93,9 @@ impl PyMorphemeListWrapper { #[pymethods] impl PyMorphemeListWrapper { /// Returns an empty morpheme list with dictionary. + /// + /// .. deprecated:: 0.6.0 + /// Use Tokenizer.tokenize("") if you need. #[classmethod] #[pyo3(text_signature = "(dict: Dictionary) -> MorphemeList")] fn empty(_cls: &PyType, py: Python, dict: &PyDictionary) -> PyResult { @@ -439,6 +442,9 @@ impl PyMorpheme { } /// Returns the word info. + /// + /// ..deprecated:: v0.6.0 + /// Users should not touch the raw WordInfo. #[pyo3(text_signature = "(self, /) -> WordInfo")] fn get_word_info(&self, py: Python) -> PyResult { let cat = PyModule::import(py, "builtins")?.getattr("DeprecationWarning")?; diff --git a/python/src/tokenizer.rs b/python/src/tokenizer.rs index c14f7076..d96763de 100644 --- a/python/src/tokenizer.rs +++ b/python/src/tokenizer.rs @@ -32,7 +32,9 @@ use crate::morpheme::{PyMorphemeListWrapper, PyProjector}; /// Unit to split text. /// /// A == short mode +/// /// B == middle mode +/// /// C == long mode /// /// :param mode: string representation of the split mode. One of [A,B,C] in captital or lower case.