Because we want to keep it as simple as possible, we made the decision that languagesToBeUsed would be renamed to dictionaries and that it would now only be accessible internally.
To solve the problems that this brings, two new static methods were added to SimpleSpellChecker, which would be:
containsLanguage(String): which, as its name suggests, is responsible for checking if the language passed to it exists within the registered dictionaries
removeLanguage(String): which is responsible for removing a language from the dictionary.
Why was this decision made?
All this is because by leaving this variable in public access, mutating it in an unexpected way outside the package could cause unexpected errors.
Description
Because we want to keep it as simple as possible, we made the decision that
languagesToBeUsed
would be renamed todictionaries
and that it would now only be accessibleinternally
.To solve the problems that this brings, two new static methods were added to
SimpleSpellChecker
, which would be:Why was this decision made?
All this is because by leaving this variable in public access, mutating it in an unexpected way outside the package could cause unexpected errors.