-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add morpheme_list #65
Add morpheme_list #65
Conversation
Maybe it's better to let |
Also, I didn't understand the comment about |
I'm wondering if we can reuse code in python bind part like: // rust side
struct Morpheme<T> {
list: T,
index: usize,
}
impl <T> Morpheme where T: Deref, <T as Deref>::Target: MorphemeListTrait {
///
}
// python side
impl MorphemeListTrait for PyMorphemeList { /// }
struct PyMorpheme {
inner: Morpheme<Arc<PyMorphemeList>>
} |
I believe that Pyo3 does not allow to expose methods from trait implementations to Python, so that part can't go away. Also, lazy loading WordInfo will require having mutable references to everything, which is not a good thing. |
Yes, anyway we need to write code to expose functions.
I faced problems around this and remove WordInfo field. |
I changed the type of |
It's OK to have the String there internally. In the memory reuse case we will swap it with the Utf8InputText buffer. |
python/src/dictionary.rs
Outdated
pub struct PyDictionary { | ||
dictionary: Arc<JapaneseDictionary>, | ||
pub dictionary: Arc<JapaneseDictionary>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you probably meant pub(super)
#55
Replace
Vec<Morpheme>
byMorphemeList
.