mozilla-b2g/gaia — pull request #10838 by janjongboom (2013-07-08 12:31:52+00:00)
Title: Bug 803189 - Allow profane words in dictionary but dont suggest them

Fix for [#887777](https://bugzilla.mozilla.org/show_bug.cgi?id=887777) and [#803189](https://bugzilla.mozilla.org/show_bug.cgi?id=803189). This patch adds words that are considered profane to the dictionaries in Gaia.

To prevent profane words showing up in the suggestion list we'll only suggest a word if the input matches the output. This means that it will be possible to type a word like `penis`, whereas it currently gets changed into `Peninsula`.

As to be seen in the code I do the checking right before calling `addWord`. This basically means that on profane words we'll have less than 3 suggestions. I think this would be the right thing to do because they already have a frequency of 0 so the words that would be suggested otherwise don't make any sense anyway.

Also there are a nice bunch of tests.