class_docstr: Uses languagetool to determine if two sentences have the same number of
  grammatical erors. (https://languagetool.org/)
  
  Args:
      grammar_error_threshold (int): the number of additional errors permitted in `x_adv`
          relative to `x`
      compare_against_original (bool): If `True`, compare against the original text.
          Otherwise, compare against the most recent text.
      language: language to use for languagetool (available choices: https://dev.languagetool.org/languages)
code: def __init__(
      self,
      grammar_error_threshold=0,
      compare_against_original=True,
      language="en-US",
  ):
      super().__init__(compare_against_original)
      self.lang_tool = language_tool_python.LanguageTool(language)
      self.grammar_error_threshold = grammar_error_threshold
      self.grammar_error_cache = {}
  
file_path: TextAttack/textattack/constraints/grammaticality/language_tool.py
imports: import language_tool_python
  from textattack.constraints import Constraint
label_desc: Use image node_id 1 to create a new LanguageTool object from inherited base classes: Constraint with example: obj = LanguageTool(grammar_error_threshold, compare_against_original, language)