Skip to content

Commit e002a32

Browse files
committed
Add pyo3 signature
1 parent 2028d36 commit e002a32

File tree

5 files changed

+2
-4
lines changed

5 files changed

+2
-4
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name = "nlpo3"
33
version = "1.4.0"
44
edition = "2018"
55
license = "Apache-2.0"
6-
license-file = "LICENSE"
76
authors = ["Thanathip Suntorntip Gorlph"]
87
description = "Thai natural language processing library, with Python and Node bindings"
98
homepage = "https://github.com/PyThaiNLP/nlpo3/"

nlpo3-cli/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name = "nlpo3-cli"
33
version = "0.2.1-dev"
44
edition = "2018"
55
license = "Apache-2.0"
6-
license-file = "LICENSE"
76
authors = ["Vee Satayamas <5ssgdxltv@relay.firefox.com>"]
87
description = "Command line interface for nlpO3, a Thai natural language processing library"
98
documentation = "https://github.com/PyThaiNLP/nlpo3/tree/main/nlpo3-cli/README.md"

nlpo3-nodejs/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name = "nlpo3-nodejs"
33
version = "1.0.0"
44
edition = "2018"
55
license = "Apache-2.0"
6-
license-file = "LICENSE"
76
authors = ["Thanathip Suntorntip Gorlph"]
87
description = "Node binding for nlpO3 Thai language processing library"
98
documentation = "https://github.com/PyThaiNLP/nlpo3/tree/main/nlpo3-nodejs/README.md"

nlpo3-python/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name = "nlpo3-python"
33
version = "1.3.1-dev"
44
edition = "2018"
55
license = "Apache-2.0"
6-
license-file = "LICENSE"
76
authors = ["Thanathip Suntorntip Gorlph"]
87
description = "Python binding for nlpO3 Thai language processing library"
98
exclude = ["notebooks"]

nlpo3-python/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ lazy_static! {
3131
/// returns list of valid utf-8 bytes list
3232
/// signature: (text: str, dict_name: str, safe: boolean = false, parallel: boolean = false) -> List[List[u8]]
3333
#[pyfunction]
34+
#[pyo3(signature = (text, dict_name, safe=false, parallel=false))]
3435
fn segment(text: &PyString, dict_name: &str, safe: bool, parallel: bool) -> PyResult<Vec<String>> {
3536
if let Some(loaded_dict) = DICT_COLLECTION.lock().unwrap().get(dict_name) {
3637
let result = loaded_dict.segment_to_string(text.to_str()?, safe, parallel);
@@ -48,6 +49,7 @@ fn segment(text: &PyString, dict_name: &str, safe: bool, parallel: bool) -> PyRe
4849
/// returns a tuple of string of loading result and a boolean
4950
/// signature: (file_path: str, dict_name: str) -> (str, boolean)
5051
#[pyfunction]
52+
#[pyo3(signature = (file_path, dict_name))]
5153
fn load_dict(file_path: &str, dict_name: &str) -> PyResult<(String, bool)> {
5254
let mut dict_col_lock = DICT_COLLECTION.lock().unwrap();
5355
if dict_col_lock.get(dict_name).is_some() {

0 commit comments

Comments
 (0)