Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4452

Hunspell stemmer should not merge duplicate dictionary entries




      Hunspell dictionaries are on the form


      Each word is listed once with is base form, and the flags after the / define allowed prefixes and suffixes.

      In HunspellDictionary's parsing logic, if the same base word should appear multiple times in the file, the flags from the duplicate entry are added to the flags from the existing entry.

      However, HunSpellStemFilterFactory allows for a comma-separated list of dictionary files to be passed in, the idea being that you can have your own custom extensions and not need to modify the "standard" ones which may change upstream once in a while. This feature now works only for NEW words, not for overriding existing entries from the first dictionary.

      Would like to change this behavior, so that the last line read overwrites any previous one. This will both fix the custom dictionary issue and also fix unintentional wrong original dictionaries, where someone added a word definition at the end without realizing there was another already.

      For the en_UK.dic there are no duplicates. For en_US.dic there is one duplicate, so I argue this behavior is a bug and not a feature dictionary authors depend upon.


        1. SOLR-4452.patch
          4 kB
          Jan Høydahl
        2. SOLR-4452.patch
          0.7 kB
          Jan Høydahl
        3. SOLR-4452-caseinsensitivemerge.patch
          2 kB
          Jan Høydahl
        4. SOLR-4452-caseinsensitive-nomerge.patch
          3 kB
          Jan Høydahl



            • Assignee:
              janhoy Jan Høydahl
              janhoy Jan Høydahl
            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: