Skip to content

Commit

Permalink
correct documentation strings
Browse files Browse the repository at this point in the history
  • Loading branch information
eiennohito committed Dec 14, 2023
1 parent f10d9ab commit 1e5ad9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions python/py_src/sudachipy/sudachipy.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,15 @@ class Morpheme:

def surface(self) -> str:
"""
Returns the projected string for the given morpheme (by default surface).
See Config.projection
Returns the substring of input text corresponding to the morpheme, or a projection if one is configured.
See `Config.projection`.
"""
...

def raw_surface(self) -> str:
"""
Returns the surface string no matter the value of Config.projection
Returns the substring of input text corresponding to the morpheme regardless the configured projection.
See `Config.projection`.
"""
...

Expand Down
4 changes: 2 additions & 2 deletions python/src/morpheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl PyMorpheme {
self.morph(py).end_c()
}

/// Returns the substring of input text corresponding to the morpheme
/// Returns the substring of input text corresponding to the morpheme, or a projection if one is configured
#[pyo3(text_signature = "($self) -> str")]
fn surface<'py>(&'py self, py: Python<'py>) -> &'py PyString {
let list = self.list(py);
Expand All @@ -302,7 +302,7 @@ impl PyMorpheme {
}
}

/// Returns the substring of input text corresponding to the morpheme
/// Returns the substring of input text corresponding to the morpheme regardless the configured projection
#[pyo3(text_signature = "($self) -> str")]
fn raw_surface<'py>(&'py self, py: Python<'py>) -> &'py PyString {
PyString::new(py, self.morph(py).surface().deref())
Expand Down

0 comments on commit 1e5ad9a

Please sign in to comment.