-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Allow load custom HMM model #48
Comments
Ref #23 |
API-wise, Jieba should expose a However, unlike in the PR, it might be better to go further and take the HmmModel ownership/reference out of the Jieba struct entirely. The reason for this is looking around at a few (very random, possibly not represenative) real-world usages, people seem to be confused about whether or not to set hmm to true or false and what the effect of this choice is. In fact, it feels like people just think of "Jieba" as a segmentation method, not "Jieba with hmm" or "Jieba with additional dictionaries" or "Jieba with the default hmm dictionary." Semantically, it might be clearer for the non-expert user of Jieba, if the API encoded how these options are used. For example, let's assume the HmmModel was removed from Jieba's construction. You could imagine
And then the calling code would pass in an As a variant of the above, you could consider doing
But you'd have to annotate the hmm_xxx for each of the variants of Cut. Lastly, you could imagine doing a hybrid where there is a
Then
And you could have a
The last one with the proxy pattern feels the "cleanest". Both seem better than passing a weird "true/false" to |
No description provided.
The text was updated successfully, but these errors were encountered: