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/01/26 12:49:44 UTC

[GitHub] [lucene-solr] donnerpeter opened a new pull request #2249: LUCENE-9700: Hunspell: support words with trailing dots

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


   <!--
   _(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
   
   Hunspell/C++ has some special treatment for abbreviations
   
   # Solution
   
   Mimic the same behavior: remove all trailing dots and stem the word without any dots or with just one dot.
   
   # Tests
   
   From Hunspell repo: `base` taken as is, `keepcase` merged into the existing same-named test.
   
   # 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] dweiss commented on a change in pull request #2249: LUCENE-9700: Hunspell: support words with trailing dots

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



##########
File path: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/base.good
##########
@@ -0,0 +1,27 @@
+created
+uncreate
+uncreated
+imply
+implied
+unnatural
+conveyed
+sawyer
+NASA
+FAQs
+can't
+doesn't
+won't
+Created
+Hello
+HELLO
+NASA
+etc.
+etc
+HELLO
+lip.
+text.
+NASA.
+Text.
+TEXT.

Review comment:
       Yeah, I was just wondering how English-centric this is.
   
   > And dots in some languages are considered to be word parts.
   
   Can you give me an example? Interesting!




----------------------------------------------------------------
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 #2249: LUCENE-9700: Hunspell: support words with trailing dots

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



##########
File path: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/base.good
##########
@@ -0,0 +1,27 @@
+created
+uncreate
+uncreated
+imply
+implied
+unnatural
+conveyed
+sawyer
+NASA
+FAQs
+can't
+doesn't
+won't
+Created
+Hello
+HELLO
+NASA
+etc.
+etc
+HELLO
+lip.
+text.
+NASA.
+Text.
+TEXT.

Review comment:
       French, see https://github.com/wooorm/dictionaries/blob/main/dictionaries/fr/index.aff#L13. I'm not sure why that is, but it is :)
   
   For now, I'm leaving `WORDCHARS` treatment out of Lucene's Hunspell as it only affects tokenizer, and my understanding is that Lucene tokenizes itself somehow. I wonder if this is indeed right.




----------------------------------------------------------------
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 commented on a change in pull request #2249: LUCENE-9700: Hunspell: support words with trailing dots

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



##########
File path: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/base.good
##########
@@ -0,0 +1,27 @@
+created
+uncreate
+uncreated
+imply
+implied
+unnatural
+conveyed
+sawyer
+NASA
+FAQs
+can't
+doesn't
+won't
+Created
+Hello
+HELLO
+NASA
+etc.
+etc
+HELLO
+lip.
+text.
+NASA.
+Text.
+TEXT.

Review comment:
       What happens with a word ending in ellipsis (...)? Should we add a test check for this here too? I also wonder if hunspell handles the ellipsis glyph (unicode character) somehow or it's treated as a character (just curiosity)?




----------------------------------------------------------------
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 #2249: LUCENE-9700: Hunspell: support words with trailing dots

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



##########
File path: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/base.good
##########
@@ -0,0 +1,27 @@
+created
+uncreate
+uncreated
+imply
+implied
+unnatural
+conveyed
+sawyer
+NASA
+FAQs
+can't
+doesn't
+won't
+Created
+Hello
+HELLO
+NASA
+etc.
+etc
+HELLO
+lip.
+text.
+NASA.
+Text.
+TEXT.

Review comment:
       I'll add a test with `...`. AFAIU Hunspell's code has no special treatment for ellipsis glyph, but it shouldn't be an issue as it should be ignored by tokenizer. And dots in some languages are considered to be word parts.




----------------------------------------------------------------
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 commented on a change in pull request #2249: LUCENE-9700: Hunspell: support words with trailing dots

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



##########
File path: lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/SpellChecker.java
##########
@@ -67,6 +75,14 @@ public boolean spell(String word) {
     return false;
   }
 
+  private boolean removeTrailingDots(String word) {

Review comment:
       Should it be called spellWithTrailingDots() or something? Right now it reads as if it had side effects... Maybe I'm paranoid though. 




----------------------------------------------------------------
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 #2249: LUCENE-9700: Hunspell: support words with trailing dots

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


   


----------------------------------------------------------------
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 commented on a change in pull request #2249: LUCENE-9700: Hunspell: support words with trailing dots

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



##########
File path: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/base.good
##########
@@ -0,0 +1,27 @@
+created
+uncreate
+uncreated
+imply
+implied
+unnatural
+conveyed
+sawyer
+NASA
+FAQs
+can't
+doesn't
+won't
+Created
+Hello
+HELLO
+NASA
+etc.
+etc
+HELLO
+lip.
+text.
+NASA.
+Text.
+TEXT.

Review comment:
       Let's ask folks who speak French - @jpountz would you know of a word with dots inside? Bag.uette? :)
   
   Lucene tokenizers are indeed completely independent. A normalization filter can handle odd glyphs and normalize them into something more palatable.




----------------------------------------------------------------
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] jpountz commented on a change in pull request #2249: LUCENE-9700: Hunspell: support words with trailing dots

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



##########
File path: lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/base.good
##########
@@ -0,0 +1,27 @@
+created
+uncreate
+uncreated
+imply
+implied
+unnatural
+conveyed
+sawyer
+NASA
+FAQs
+can't
+doesn't
+won't
+Created
+Hello
+HELLO
+NASA
+etc.
+etc
+HELLO
+lip.
+text.
+NASA.
+Text.
+TEXT.

Review comment:
       I can't think of any French word that contains a dot besides acronyms, but these are not specific to French.




----------------------------------------------------------------
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