### Install symspellpy using pip Source: https://github.com/mammothb/symspellpy/blob/master/INSTALL.rst Install the symspellpy library and its dependencies using pip. This command ensures you get the latest official release. ```bash python -m pip install -U symspellpy ``` -------------------------------- ### Initialize SymSpell with different distance algorithms Source: https://github.com/mammothb/symspellpy/blob/master/tests/benchmarks.ipynb Initializes SymSpell instances with Damerau-OSA and Levenshtein distance algorithms, both in their standard and fast variants. Dictionaries are loaded for each instance. ```python bigram_path = importlib.resources.files("symspellpy") / "frequency_bigramdictionary_en_243_342.txt" dictionary_path = importlib.resources.files("symspellpy") / "frequency_dictionary_en_82_765.txt" sym_spell_damerau_osa = SymSpell(distance_comparer=EditDistance(DistanceAlgorithm.DAMERAU_OSA)) sym_spell_damerau_osa.load_bigram_dictionary(bigram_path, 0, 2) sym_spell_damerau_osa.load_dictionary(dictionary_path, 0, 1) sym_spell_damerau_osa_fast = SymSpell(distance_comparer=EditDistance(DistanceAlgorithm.DAMERAU_OSA_FAST)) sym_spell_damerau_osa_fast.load_bigram_dictionary(bigram_path, 0, 2) sym_spell_damerau_osa_fast.load_dictionary(dictionary_path, 0, 1) sym_spell_levenshtein = SymSpell(distance_comparer=EditDistance(DistanceAlgorithm.LEVENSHTEIN)) sym_spell_levenshtein.load_bigram_dictionary(bigram_path, 0, 2) sym_spell_levenshtein.load_dictionary(dictionary_path, 0, 1) sym_spell_levenshtein_fast = SymSpell(distance_comparer=EditDistance(DistanceAlgorithm.LEVENSHTEIN_FAST)) sym_spell_levenshtein_fast.load_bigram_dictionary(bigram_path, 0, 2) sym_spell_levenshtein_fast.load_dictionary(dictionary_path, 0, 1) ```