-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
[BUGS#1236] fix: make CalcMatchStatistics ignores threshold #871
[BUGS#1236] fix: make CalcMatchStatistics ignores threshold #871
Conversation
❌ Run Gradle test failed: |
1 similar comment
❌ Run Gradle test failed: |
Signed-off-by: Hiroshi Miura <[email protected]>
29fe93f
to
afaa222
Compare
test file test/data/tmx/test-match-stat-en-ca.tmx seems too big. |
❌ Run Gradle test failed: |
afaa222
to
d5d0fab
Compare
d5d0fab
to
31b1caf
Compare
- When changing threshold, the stats result is changed. Signed-off-by: Hiroshi Miura <[email protected]>
Signed-off-by: Hiroshi Miura <[email protected]>
31b1caf
to
9564e09
Compare
❌ Run Gradle test failed: |
Signed-off-by: Hiroshi Miura <[email protected]>
If the goal is "not change statistics" the implementation is wrong.
So, if the goal is to be conservative, the correct implementation is not to remove threshold but to apply threshold = 30 in statistics even if changed in the UI, while keeping configurable threshold for matches pane Personally I would prefer that threshold also applies on statistics: if statistics considers that a segment is 70% match but it does not appear in the matches pane, how could I say to the translator that I will not pay for this segment? |
The fuzzy match threshold has nothing to do with the statistics. It here only to set which matches are relevant in the match pane. |
Thanks for giving me a good point.
When it is default 30%, a table will be
|
Do not make any change to the categories. The threshold is only a convenience setting for the user to display only some matches above a given setting. It has NOTHING to do withe the statistics. |
Current logic to give category is to compare with fixed values. No match is not means "<=30%" but "<50%", see private int getRowByPercent(int percent) {
if (percent == Statistics.PERCENT_EXACT_MATCH) {
// exact match
return BASE_FOR_PERCENTS;
} else if (percent >= 95) {
return BASE_FOR_PERCENTS + 1;
} else if (percent >= 85) {
return BASE_FOR_PERCENTS + 2;
} else if (percent >= 75) {
return BASE_FOR_PERCENTS + 3;
} else if (percent >= 50) {
return BASE_FOR_PERCENTS + 4;
} else {
return BASE_FOR_PERCENTS + 5;
}
} |
revert variable meaning from ignoreThreshold to applyThreshold Signed-off-by: Hiroshi Miura <[email protected]>
Change variable name "ignoreThreshold" to "applyThreshold" |
❌ Run Gradle test failed: |
Yes. That's what I wrote. The threshold is a display threshold. It has absolutely nothing to do with the stats. |
Signed-off-by: Hiroshi Miura <[email protected]>
❌ Run Gradle test failed: |
Yes but the problem is that before the call to |
Signed-off-by: Hiroshi Miura <[email protected]>
@brandelune could you confirm the fix behave as same as what you claimed? |
Ok. I'm not seeing any difference in the stats between a 30% threshold and a 70% threshold on a relatively complex project with 50 000 words in 8000 segments. And the stats display is properly updated once the setting is modified. Thank you Hiroshi. |
Good news. It has been already tested in unit test, but thank you for double check. |
* feat: add unit test for ClacMatchStatistics class Signed-off-by: Hiroshi Miura <[email protected]> * [BUGS#1236] reproduce bug - When changing threshold, the stats result is changed. Signed-off-by: Hiroshi Miura <[email protected]> * [BUGS#1236] fix: ignore threshold when show statistics Signed-off-by: Hiroshi Miura <[email protected]> * style: apply spotless Signed-off-by: Hiroshi Miura <[email protected]> * refactor: variable applyThreshold revert variable meaning from ignoreThreshold to applyThreshold Signed-off-by: Hiroshi Miura <[email protected]> * chore: suppress checkstyle error in FindMatches class Signed-off-by: Hiroshi Miura <[email protected]> * refactor: revert ignore to apply Signed-off-by: Hiroshi Miura <[email protected]> --------- Signed-off-by: Hiroshi Miura <[email protected]> (cherry picked from commit 27e7355) Signed-off-by: Hiroshi Miura <[email protected]>
Pull request type
Which ticket is resolved?
What does this PR change?
ignoreThreshold
constructor boolean forFindMatches
class.Other information