-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
fix: Glossary sort order: Change src length sort condition and use Language Dependent sorter #1154
fix: Glossary sort order: Change src length sort condition and use Language Dependent sorter #1154
Conversation
- Add sort test cases with locales - GlossarySearcher ctor accept src and target language - use startsWith instead of contains for src length sort detection - fix target term length sort argument. Signed-off-by: Hiroshi Miura <[email protected]>
- Use GlossarySearcher#search - Drop duplicated search in GlossarySearcher Signed-off-by: Hiroshi Miura <[email protected]>
- Move test cases to GlossarySearcherTest.java Signed-off-by: Hiroshi Miura <[email protected]>
❌ Unit Tests, Quality checks, and Acceptance Tests failed. Please look a Gradle Scan page for details: |
Signed-off-by: Hiroshi Miura <[email protected]>
if (c == 0 && Preferences.isPreferenceDefault(Preferences.GLOSSARY_SORT_BY_SRC_LENGTH, true) | ||
&& (o2.getSrcText().contains(o1.getSrcText()) | ||
|| o1.getSrcText().contains(o2.getSrcText()))) { | ||
&& (o2.getSrcText().startsWith(o1.getSrcText()) | ||
|| o1.getSrcText().startsWith(o2.getSrcText()))) { |
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.
In org.omegat.gui.preferences.view.GlossaryPreferencesController#initFromPrefs
, the default value of Preferences.GLOSSARY_SORT_BY_SRC_LENGTH
is false
but here is true
.
panel.sortBySrcTextLengthCheckBox.setSelected(Preferences.isPreferenceDefault(
Preferences.GLOSSARY_SORT_BY_SRC_LENGTH, false));
It should be false
for consistency.
and update preference explanation
I think this is a clearer description.
@@ -2768,7 +2768,7 @@ PREFS_GLOSSARY_STEMMING=Use &stemming | |||
PREFS_GLOSSARY_REPLACE_ON_INSERT=Replace matches when inserting source text | |||
PREFS_GLOSSARY_REQUIRE_SIMILAR_CASE=&Ignore matches with very different case (e.g. FOO vs foo) | |||
PREFS_GLOSSARY_MERGE_ALTERNATE_DEFINITIONS=Merge alternate definitions of the same term | |||
PREFS_GLOSSARY_SORT_BY_SRC_LENGTH=Sort by Source Term Length | |||
PREFS_GLOSSARY_SORT_BY_SRC_LENGTH=Sort by Source Term Length when two or more terms start with the same characters |
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 tried to reword the description a little.
Pull request type
Which ticket is resolved?
What does this PR change?
Other information