File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ def correct(text: str, matches: List[Match]) -> str:
112112 :rtype: str
113113 """
114114 ltext = list (text )
115- if len (matches ):
115+ if len (matches ): # some suggestions available, we'll use first/best
116116 matches = [match for match in matches if match .replacements ]
117117 if matches :
118118 errors = [ltext [match .offset :match .offset + match .errorLength ]
@@ -127,9 +127,9 @@ def correct(text: str, matches: List[Match]) -> str:
127127 ltext [frompos :topos ] = list (repl )
128128 correct_offset += len (repl ) - len (errors [n ])
129129 return '' .join (ltext )
130- else :
130+ else : # no suggestions for given language, i.e. gibberish submit
131131 return str ()
132- else :
132+ else : # Correct string submit
133133 return None
134134
135135
You can’t perform that action at this time.
0 commit comments