class_docstr: Set token-level attributes for tokens matched by Matcher patterns.
  Additionally supports importing patterns from tag maps and morph rules.
  
  DOCS: https://spacy.io/api/attributeruler
class_docstr_tok: ["Set","token-level","attributes","for","tokens","matched","by","Matcher","patterns",".","Additionally","supports","importing","patterns","from","tag","maps","and","morph","rules",".","DOCS",":","https",":","\/\/spacy.io\/api\/attributeruler"]
docstr: Add Matcher patterns for tokens that should be modified with the
  provided attributes. The token at the specified index within the
  matched span will be assigned the attributes.
  
  patterns (Iterable[List[Dict]]): A list of Matcher patterns.
  attrs (Dict): The attributes to assign to the target token in the
      matched span.
  index (int): The index of the token in the matched span to modify. May
      be negative to index from the end of the span. Defaults to 0.
  
  DOCS: https://spacy.io/api/attributeruler#add
docstr_tok: ["Add","Matcher","patterns","for","tokens","that","should","be","modified","with","the","provided","attributes",".","The","token","at","the","specified","index","within","the","matched","span","will","be","assigned","the","attributes",".","patterns","(","Iterable","[","List","[","Dict","]","]",")",":","A","list","of","Matcher","patterns",".","attrs","(","Dict",")",":","The","attributes","to","assign","to","the","target","token","in","the","matched","span",".","index","(","int",")",":","The","index","of","the","token","in","the","matched","span","to","modify",".","May","be","negative","to","index","from","the","end","of","the","span",".","Defaults","to","0",".","DOCS",":","https",":","\/\/spacy.io\/api\/attributeruler","#","add"]
code: def add(
      self,
      patterns: Iterable[MatcherPatternType],
      attrs: Dict,
      index: int = 0,
  ) -> None:
      """Add Matcher patterns for tokens that should be modified with the
      provided attributes. The token at the specified index within the
      matched span will be assigned the attributes.
  
      patterns (Iterable[List[Dict]]): A list of Matcher patterns.
      attrs (Dict): The attributes to assign to the target token in the
          matched span.
      index (int): The index of the token in the matched span to modify. May
          be negative to index from the end of the span. Defaults to 0.
  
      DOCS: https://spacy.io/api/attributeruler#add
      """
      # We need to make a string here, because otherwise the ID we pass back
      # will be interpreted as the hash of a string, rather than an ordinal.
      key = str(len(self.attrs))
      self.matcher.add(self.vocab.strings.add(key), patterns)  # type: ignore[arg-type]
      self._attrs_unnormed.append(attrs)
      attrs = normalize_token_attrs(self.vocab, attrs)
      self.attrs.append(attrs)
      self.indices.append(index)
  
imports: from pathlib import Path
  from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union
  import srsly
  from ..None import util
  from ..errors import Errors
  from ..language import Language
  from ..matcher import Matcher
  from ..scorer import Scorer
  from ..symbols import IDS
  from ..tokens import Doc, Span
  from ..tokens._retokenize import normalize_token_attrs, set_token_attrs
  from ..training import Example
  from ..util import SimpleFrozenList, registry
  from ..vocab import Vocab
  from .pipe import Pipe
label_desc: Use image node_id 9 for calling the AttributeRuler obj's underlying member method code with example usage: obj.add(patterns, attrs, index) without return types