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: Create the AttributeRuler. After creation, you can add patterns
  with the `.initialize()` or `.add_patterns()` methods, or load patterns
  with `.from_bytes()` or `.from_disk()`. Loading patterns will remove
  any patterns you've added previously.
  
  vocab (Vocab): The vocab.
  name (str): The pipe name. Defaults to "attribute_ruler".
  scorer (Optional[Callable]): The scoring method. Defaults to
      Scorer.score_token_attr for the attributes "tag", "pos", "morph" and
      "lemma" and Scorer.score_token_attr_per_feat for the attribute
      "morph".
  
  RETURNS (AttributeRuler): The AttributeRuler component.
  
  DOCS: https://spacy.io/api/attributeruler#init
docstr_tok: ["Create","the","AttributeRuler",".","After","creation",",","you","can","add","patterns","with","the","`",".initialize","(",")","`","or","`",".add_patterns","(",")","`","methods",",","or","load","patterns","with","`",".from_bytes","(",")","`","or","`",".from_disk","(",")","`",".","Loading","patterns","will","remove","any","patterns","you","'ve","added","previously",".","vocab","(","Vocab",")",":","The","vocab",".","name","(","str",")",":","The","pipe","name",".","Defaults","to","``","attribute_ruler","''",".","scorer","(","Optional","[","Callable","]",")",":","The","scoring","method",".","Defaults","to","Scorer.score_token_attr","for","the","attributes","``","tag","''",",","``","pos","''",",","``","morph","''","and","``","lemma","''","and","Scorer.score_token_attr_per_feat","for","the","attribute","``","morph","''",".","RETURNS","(","AttributeRuler",")",":","The","AttributeRuler","component",".","DOCS",":","https",":","\/\/spacy.io\/api\/attributeruler","#","init"]
code: def __init__(
      self,
      vocab: Vocab,
      name: str = "attribute_ruler",
      *,
      validate: bool = False,
      scorer: Optional[Callable] = attribute_ruler_score,
  ) -> None:
      """Create the AttributeRuler. After creation, you can add patterns
      with the `.initialize()` or `.add_patterns()` methods, or load patterns
      with `.from_bytes()` or `.from_disk()`. Loading patterns will remove
      any patterns you've added previously.
  
      vocab (Vocab): The vocab.
      name (str): The pipe name. Defaults to "attribute_ruler".
      scorer (Optional[Callable]): The scoring method. Defaults to
          Scorer.score_token_attr for the attributes "tag", "pos", "morph" and
          "lemma" and Scorer.score_token_attr_per_feat for the attribute
          "morph".
  
      RETURNS (AttributeRuler): The AttributeRuler component.
  
      DOCS: https://spacy.io/api/attributeruler#init
      """
      self.name = name
      self.vocab = vocab
      self.matcher = Matcher(self.vocab, validate=validate)
      self.validate = validate
      self.attrs: List[Dict] = []
      self._attrs_unnormed: List[Dict] = []  # store for reference
      self.indices: List[int] = []
      self.scorer = scorer
  
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 1 to create a new AttributeRuler object from inherited base classes: Pipe with example: obj = AttributeRuler(vocab, name)