-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make user phrase scores fairer via rewriting #119
Conversation
This fixes #118. To avoid single-syllable user unigrams dominating the grid walk when there are competing multi-syllable unigrams, we assign a fairer score to such user unigrams instead of the default value of 0.
6a1e9ad
to
3f9392c
Compare
allUnigrams.insert(allUnigrams.begin(), userUnigrams.begin(), userUnigrams.end()); | ||
// This relies on the fact that we always use the default separator. | ||
bool isKeyMultiSyllable = key.find(Formosa::Gramambular2::ReadingGrid::kDefaultSeparator) != std::string::npos; | ||
if (isKeyMultiSyllable || allUnigrams.empty()) { |
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.
I guess we may need to comment on why multi syllables phrases should be always in the front without scoring. I cannot understand its purpose when I read the code.
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.
Clarified the motivation in 4d9db9c. PTAL.
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.
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.
Or even better, introducing a new feature of having -inf
in the file and the code.
Look good :) |
This carries over the following changes: - openvanilla/fcitx5-mcbopomofo#119 - openvanilla/fcitx5-mcbopomofo#120 - openvanilla/fcitx5-mcbopomofo#121
This fixes #118. To avoid single-syllable user unigrams dominating the grid walk when there are competing multi-syllable unigrams, we assign a fairer score to such user unigrams instead of the default value of 0.