Skip to content

Commit f8961ad

Browse files
committed
LanguageTool.check(): return only error elements.
1 parent 18b6ace commit f8961ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎language_tool/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def check(self, text: str, srctext=None) -> [Match]:
236236
"""Match text against enabled rules.
237237
"""
238238
root = self._get_root(self._url, self._encode(text, srctext))
239-
return [Match(e.attrib, text) for e in root]
239+
return [Match(e.attrib, text) for e in root if e.tag == "error"]
240240

241241
def _check_api(self, text: str, srctext=None) -> bytes:
242242
"""Match text against enabled rules (result in XML format).

0 commit comments

Comments
 (0)