Skip to content

Commit

Permalink
Minor Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MitchellShibilski-Unkel committed May 8, 2024
1 parent c638371 commit 0d928c9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion PyGrammar/PyGrammar.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import nltk
import re
import random
import language_tool_python as lang


Expand All @@ -16,6 +18,7 @@ def getPartsOfSpeech(self):
return POS

def correct(self):
self.lang.enable_spellchecking()
getPOS = self.getPartsOfSpeech()

sentences: list = self.text.split(".")
Expand All @@ -34,4 +37,6 @@ def correct(self):

correctedText = str(re.sub(r'\b(\w+)\s+\1\b', r'\1', correctedText))

return self.lang.correct(correctedText.replace(" .", ".").replace("\'", ""))
correctedText.replace(" .", ".").replace("\'", "")

return self.lang.correct(correctedText)
Binary file added PyGrammar/__pycache__/PyGrammar.cpython-310.pyc
Binary file not shown.
Binary file added PyGrammar/__pycache__/__init__.cpython-310.pyc
Binary file not shown.

0 comments on commit 0d928c9

Please sign in to comment.