Important changes to the Firefox 4 spell checker

Update: We had to pull these changes out of Firefox 4 because of some regressions that they caused.  We will revisit this issue after Firefox 4, and will hopefully deliver this set of fixes in the next version of Firefox.

I landed a patch today which changes the Firefox 4 built-in spell checker in two important ways:

  • Firefox 4 will be able to correctly spell check words containing hyphens, such as the English word "scot-free".
  • Firefox 4 will be able to correctly spell check words up to 130 letters long.

Here is the slightly longer version of what changed.  Before this change, when Firefox saw a word such as "scot-free", it would break it into two words, "scot" and "free", and pass each of them to Hunspell (which is the spell checking engine we use) to see if they are correctly spelled or not.  So, even though the word was correctly spelled, Hunspell would not have any way to know that, because all it saw was Firefox asking it whether "scot" is correctly spelled, and whether "free" is correctly spelled.  The result was that "scot" was underlined as incorrectly spelled.

After this change, Firefox would pass the entire word, "scot-free" to Hunspell, which would enable Hunspell to recognize the whole word, and make the correct decision about its spelling.  This is especially important for the languages which use the hyphen character as part of the non-compound words frequently.

Also, previously, Firefox would automatically mark any word with more than 64 letters as being incorrectly spelled.  This is a problem for languages which tend to have words much longer than that, such as German and Swedish, to name a few.  The new limit is 130 letters.  This new limit might also not be enough for some words in some languages.  We plan to remove this limit entirely in future Firefox versions.

If you’re a localizer, or a dictionary author, there shouldn’t be any need for you to change the dictionary files for your language.  However, it would be great if you can test Firefox 4 nightlies starting from tomorrow with your languages to verify that it correctly recognizes long words in your language, or those words which have a hyphen in them (and are not compound words).  Keep in mind that these changes will only affect your language if the dictionary is capable of recognizing those words.  If you see any issues with this, please file a bug to let us know.

For the gory details, the curious reader can read bug 355178.

Posted in Blog Tagged with: , ,
10 comments on “Important changes to the Firefox 4 spell checker
  1. Visitor says:

    Are the foreign versions of Fx4 going to include their corresponding dictionaries by default?

    The other day I heard “spell checking” as a reason for switching to some other browser, then I remembered Firefox doesn’t ship with dictionaries by default.

    The feature might as well not exist if it’s going to ship in that indiscoverable state.

  2. Ehsan Akhgari says:

    Some of the localized versions of Firefox ship with the appropriate dictionaries by default, and some others don’t.  It depends on whether the localization team decides that there is a high quality dictionary available that they could ship, given the licensing considerations.  There are also a lot of dictionaries available here for many different languages.

  3. [...] See the rest here: Important changes to the Firefox 4 spell checker | Ehsan Akhgari [...]

  4. Tomer Cohen says:

    Please make it possible to check spelling in multiple dictionaries. I’m tired of switching dictionaries…

  5. Dwayne says:

    Nope, mostly the decision about whether to include a spell checker boilds down to licensing. Since the spell checker needs to be tri-licensed many dictionaries can’t be packaged by default. There are ways around this if dictionaries are a priority.

  6. [...] View original post here: Important changes to the Firefox 4 spell checker | Ehsan Akhgari [...]

  7. Gen Kanai says:

    Just a note to thank you for fixing this bug. It’s an old but I’m glad it was fixed and not forgotten!

  8. [...] Important changes to the Firefox 4 spell checker | Ehsan Akhgari [...]

  9. Visitor says:

    Any chance of packed dictionary support? Having to alter every dictionary package to force extractions is a pain.


  10. Visitor says:

    “etc.” is a correctly-spelled word, but is marked as incorrect because Firefox never considers the full-stop (period to you Americans :) ) as a part of the word when sometimes it is.

    Has this been addressed too?