Skip to content
Snippets Groups Projects
Commit 131c9676 authored by Michal Pogoda's avatar Michal Pogoda
Browse files

Added script for pickling dictionaries

parent 6509dd4e
No related branches found
No related tags found
No related merge requests found
Pipeline #3801 failed
from symspellpy.symspellpy import SymSpell
import argparse
from pathlib import Path
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--input_dir', type=Path, required=True, help='Path to folder with raw dictionaries')
parser.add_argument('--output', type=Path, required=True, help='Path to folder with pickles')
args = parser.parse_args()
args.output.mkdir(exist_ok=True)
for path in args.input_dir.glob("*.txt"):
symspell = SymSpell()
symspell.load_dictionary(path, 0, 1)
symspell.save_pickle(args.output / path.name)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment