Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sai-prasanna/lmproof
Browse files Browse the repository at this point in the history
  • Loading branch information
sai-prasanna committed Mar 6, 2020
2 parents 020d2a4 + 1086f52 commit 11d4b34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lmproof/candidate_generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def load(cls, language: str) -> "SpellCorrectGenerator":
/ "resources"
/ "frequency_dictionary_en_82_765.txt"
)
sym_spell.create_dictionary(str(dict_path))
sym_spell.load_dictionary(str(dict_path), term_index=0, count_index=1)
spacy_model = spacy.load("en_core_web_sm", disable=["parser", "ner"])
else:
raise RuntimeError(f"The language {language} is currently not language.")
Expand Down Expand Up @@ -127,7 +127,7 @@ def _edits(
elif replaced_token.is_upper:
substitute = substitute.upper()

if token_idx == 0 and substitute == "" and len(tokenized_sentence) >= 1:
if token_idx == 0 and substitute == "" and len(tokenized_sentence) > 1:
candidate = Edit(
Span(replaced_token.idx, tokenized_sentence[1].idx + 1),
tokenized_sentence[1].text[0].upper(),
Expand Down

0 comments on commit 11d4b34

Please sign in to comment.