Repository: barrust/pyspellchecker

Issue:
load_words is not prioritized
Looks like the functionality load_words is not prioritized in the spellchecking.

```
from spellchecker import SpellChecker

known_words = ['covid', 'Covid19']

spell = SpellChecker(language='en')
spell.word_frequency.load_words(known_words)


word = 'coved'
misspelled = spell.unknown(word)
print(spell.correction(allwords))
```

the output of this is `loved`

Discussion:

Patch:
diff --git a/spellchecker/spellchecker.py b/spellchecker/spellchecker.py
index 760b9c2..7c2fb8e 100644
--- a/spellchecker/spellchecker.py
+++ b/spellchecker/spellchecker.py
@@ -471,13 +471,14 @@ class WordFrequency(object):
         self._dictionary.update([word if self._case_sensitive else word.lower() for word in words])
         self._update_dictionary()
 
-    def add(self, word: KeyT) -> None:
+    def add(self, word: KeyT, val: int = 1) -> None:
         """Add a word to the word frequency list
 
         Args:
-            word (str): The word to add"""
+            word (str): The word to add
+            val (int): The number of times to insert the word"""
         word = ensure_unicode(word)
-        self.load_words([word])
+        self.load_json({word if self._case_sensitive else word.lower(): val})
 
     def remove_words(self, words: typing.Iterable[KeyT]) -> None:
         """Remove a list of words from the word frequency list


Test patch:
diff --git a/tests/spellchecker_test.py b/tests/spellchecker_test.py
index 2e3ee57..e9db470 100644
--- a/tests/spellchecker_test.py
+++ b/tests/spellchecker_test.py
@@ -269,6 +269,13 @@ class TestSpellChecker(unittest.TestCase):
         spell.word_frequency.add("appt")
         self.assertEqual(spell["appt"], 1)
 
+    def test_add_word_priority(self):
+        """test adding a word with larger priority"""
+        spell = SpellChecker()
+        self.assertEqual(spell["appt"], 0)
+        spell.word_frequency.add("appt", 5000)
+        self.assertEqual(spell["appt"], 5000)
+
     def test_checking_odd_word(self):
         """test checking a word that is really a number"""
         spell = SpellChecker()
@@ -334,7 +341,7 @@ class TestSpellChecker(unittest.TestCase):
     def test_large_words(self):
         """test checking for words that are clearly larger than the largest dictionary word"""
         spell = SpellChecker(language=None, distance=2)
-        spell.word_frequency.add("Bob")
+        spell.word_frequency.add("Bob", 1)
 
         words = ["Bb", "bb", "BB"]
         self.assertEqual(spell.unknown(words), {"bb"})