Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6468

Empty kuromoji user dictionary -> NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.3, 6.0
    • None
    • None
    • New

    Description

      Kuromoji user dictionary takes Reader and allows for comments and other lines to be ignored. But if its "empty" in the sense of no actual entries, the returned FST will be null, and it will throw a confusing NPE.

      JapaneseTokenizer and JapaneseAnalyzer apis already treat null UserDictionary as having none at all, so I think the best fix is to fix the UserDictionary api from UserDictionary(Reader) to UserDictionary.open(Reader) or similar, and return null if the FST is empty.

      Attachments

        1. LUCENE-6468.patch
          4 kB
          Jun Ohtani

        Activity

          People

            cm Christian Moen
            rcmuir Robert Muir
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: