Skip to content

Commit

Permalink
modified
Browse files Browse the repository at this point in the history
  • Loading branch information
sailajakommineni committed Nov 28, 2023
1 parent 0ef0262 commit 887a3e3
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/spellcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
with open(file_path, 'r', encoding='utf-8') as file:
text = file.read()
# Check for grammar errors
matches = tool.check(text)
Expand All @@ -63,12 +62,12 @@ jobs:
line_number = text.count('\n', 0, match.offset) + 1
print(f"Grammar error at line {line_number}: {match.message}")
# Correct the grammar error
corrected_text = language_tool_python.correct(text, matches)
# Correct the grammar error
corrected_text = language_tool_python.correct(text, matches)
# Write the corrected text back to the file
with open(file_path, 'w', encoding='utf-8') as file:
file.write(corrected_text)
# Write the corrected text back to the file
with open(file_path, 'w', encoding='utf-8') as file:
file.write(corrected_text)
print("Grammar errors corrected successfully.")
else:
Expand Down

0 comments on commit 887a3e3

Please sign in to comment.