Skip to content

Commit

Permalink
Refactor LanguageTool.py
Browse files Browse the repository at this point in the history
  • Loading branch information
gtarawneh committed Sep 21, 2016
1 parent 23ed690 commit 31fc287
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions LanguageTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def run(self, edit, applyFix):
v.replace(edit, r, suggestions[0])
nextCaretPos = r.a + len(suggestions[0])
else:

# ignore problem:
if p[2] == "Possible Typo":
# if this is a typo then include all identical typos in the
Expand All @@ -172,15 +171,12 @@ def run(self, edit, applyFix):
else:
# otherwise select just this one problem
ignoreProbs = [p]

for p2 in ignoreProbs:
ignoreProblem(p2, v, self, edit)

# after either fixing or ignoring:
moveCaret(v, nextCaretPos, nextCaretPos) # move caret to end of region
v.run_command("goto_next_language_problem")
return

# if no problems are selected:
setStatusBar('no language problem selected')

Expand Down Expand Up @@ -222,7 +218,6 @@ def preprocessText(str):
# replace all such occurrences with "\n!\n".
while "\n\n" in str:
str = str.replace("\n\n", "\n!\n")

return str

class LanguageToolCommand(sublime_plugin.TextCommand):
Expand All @@ -244,7 +239,6 @@ def run(self, edit):
setStatusBar('could not parse server response (may be due to quota if using http://languagetool.org)')
return
for match in matches:
# category, message, replacements = [child.attrib[x] for x in fields_str]
category = match['rule']['category']['name']
message = match['message']
replacements = [r['value'] for r in match['replacements']]
Expand Down

0 comments on commit 31fc287

Please sign in to comment.