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

Python compatibility #77

Merged
Merged
Changes from 1 commit
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
10 changes: 7 additions & 3 deletions python/src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,17 @@ impl PyTokenizer {
}

/// Break text into morphemes
#[pyo3(text_signature = "($self, text, /, mode, enable_debug)")]
#[args(text, mode = "None", enable_debug = "None")]
///
/// This ignores the logger provided
#[pyo3(text_signature = "($self, text, /, mode, logger, enable_debug)")]
#[args(text, mode = "None", logger = "None", enable_debug = "None")]
#[allow(unused_variables)]
fn tokenize(
&self,
text: &str,
mode: Option<PySplitMode>,
enable_debug: Option<bool>, // want to take logger instead of debug flag
logger: Option<PyObject>,
enable_debug: Option<bool>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it is a bad idea to expose enable_debug here.

Current implementation of debug output is a placeholder, we should not expose it to Python.

) -> PyResult<PyMorphemeListWrapper> {
let mode: Mode = match mode {
Some(m) => m.into(),
Expand Down