Tika
  1. Tika
  2. TIKA-339

HtmlParser & TXTParser should not use language returned by CharsetDetector if language hint has been provided

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.6
    • Component/s: None
    • Labels:
      None

      Description

      Currently the code used to call CharsetDetector in both TXTParser and HtmlParser is that any incoming language in the metadata map gets replaced if the detector returns a language.

      Given the low reliability of this language result, it should only be used in cases where there is no provided language, as typically this is coming in from either the Http response header or (for the HtmlParser) a meta tag or some other tag attribute. In all those cases, the incoming language is more accurate than the guess by the CharsetDetector.

      1. TIKA-339.patch
        5 kB
        Ken Krugler

        Activity

          People

          • Assignee:
            Jukka Zitting
            Reporter:
            Ken Krugler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development