You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/02/15 19:50:38 UTC

[GitHub] [lucene-solr] donnerpeter opened a new pull request #2375: LUCENE-9775: Hunspell: make FORCEUCASE work when the first compound w…

donnerpeter opened a new pull request #2375:
URL: https://github.com/apache/lucene-solr/pull/2375


   …ord is inherently title-case
   
   <!--
   _(If you are a project committer then you may remove some/all of the following template.)_
   
   Before creating a pull request, please file an issue in the ASF Jira system for Lucene or Solr:
   
   * https://issues.apache.org/jira/projects/LUCENE
   * https://issues.apache.org/jira/projects/SOLR
   
   You will need to create an account in Jira in order to create an issue.
   
   The title of the PR should reference the Jira issue number in the form:
   
   * LUCENE-####: <short description of problem or changes>
   * SOLR-####: <short description of problem or changes>
   
   LUCENE and SOLR must be fully capitalized. A short description helps people scanning pull requests for items they can work on.
   
   Properly referencing the issue in the title ensures that Jira is correctly updated with code review comments and commits. -->
   
   
   # Description
   
   Now it wouldn't work for Dutch `Jupiter`+`straat`=`Jupiterstraat`
   
   # Solution
   
   When the case is non-varied, check the first letter of the whole compound. Make sure the `CharsRef` still holds it.
   
   # Tests
   
   `forceucase` expanded
   
   # Checklist
   
   Please review the following and check all that apply:
   
   - [x] I have reviewed the guidelines for [How to Contribute](https://wiki.apache.org/solr/HowToContribute) and my code conforms to the standards described there to the best of my ability.
   - [x] I have created a Jira issue and added the issue ID to my pull request title.
   - [x] I have given Solr maintainers [access](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork) to contribute to my PR branch. (optional but recommended)
   - [x] I have developed this patch against the `master` branch.
   - [x] I have run `./gradlew check`.
   - [x] I have added tests for my changes.
   - [ ] I have added documentation for the [Ref Guide](https://github.com/apache/lucene-solr/tree/master/solr/solr-ref-guide) (for Solr changes only).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] donnerpeter commented on a change in pull request #2375: LUCENE-9775: Hunspell: make FORCEUCASE work when the first compound w…

Posted by GitBox <gi...@apache.org>.
donnerpeter commented on a change in pull request #2375:
URL: https://github.com/apache/lucene-solr/pull/2375#discussion_r576396376



##########
File path: lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Hunspell.java
##########
@@ -240,8 +244,9 @@ private boolean checkCompoundsAfter(WordCase originalCase, CompoundPart prev) {
     return checkCompounds(tail, originalCase, prev);
   }
 
-  private boolean hasForceUCaseProblem(Root<?> root, WordCase originalCase) {
+  private boolean hasForceUCaseProblem(Root<?> root, WordCase originalCase, char[] wordChars) {
     if (originalCase == WordCase.TITLE || originalCase == WordCase.UPPER) return false;
+    if (originalCase == null && Character.isUpperCase(wordChars[0])) return false;

Review comment:
       Main change




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] donnerpeter commented on a change in pull request #2375: LUCENE-9775: Hunspell: make FORCEUCASE work when the first compound w…

Posted by GitBox <gi...@apache.org>.
donnerpeter commented on a change in pull request #2375:
URL: https://github.com/apache/lucene-solr/pull/2375#discussion_r576396291



##########
File path: lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/CheckCompoundPattern.java
##########
@@ -94,7 +94,7 @@ private boolean hasAllFlags(Root<?> root, char[] flags) {
   CharsRef expandReplacement(CharsRef word, int breakPos) {
     if (replacement != null && charsMatch(word, breakPos, replacement)) {
       return new CharsRef(
-          word.subSequence(0, breakPos)
+          new String(word.chars, 0, word.offset + breakPos)

Review comment:
       Include all compounds parts from the very beginning for the case check to work later




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


[GitHub] [lucene-solr] dweiss merged pull request #2375: LUCENE-9775: Hunspell: make FORCEUCASE work when the first compound w…

Posted by GitBox <gi...@apache.org>.
dweiss merged pull request #2375:
URL: https://github.com/apache/lucene-solr/pull/2375


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org