def __init__(self,
                 nlp,
                 rules: Dict,
                 extractor_name: str) -> None:
        """
        Initialize the extractor, storing the rule information and construct spacy rules
        Args:
            nlp
            rules (Dict): spacy rules
            extractor_name: str

        Returns:
        """

        Extractor.__init__(self,
                           input_type=InputType.TEXT,
                           category="spacy_rule_extractor",
                           name=extractor_name)
        self._rules = rules["rules"]
        self._nlp = copy.deepcopy(nlp)
        self._tokenizer = Tokenizer(self._nlp)
        self._matcher = Matcher(self._nlp.vocab)
        self._field_name = rules["field_name"] if "field_name" in rules else extractor_name
        self._rule_lst = {}
        self._hash_map = {}
        for idx, a_rule in enumerate(self._rules):
            this_rule = Rule(a_rule, self._nlp)
            self._rule_lst[this_rule.identifier + "rule_id##" + str(idx)] = this_rule
def __init__ ( self , nlp , rules : Dict , extractor_name : str ) -> None : Extractor . __init__ ( self , input_type = InputType . TEXT , category = "spacy_rule_extractor" , name = extractor_name ) self . _rules = rules [ "rules" ] self . _nlp = copy . deepcopy ( nlp ) self . _tokenizer = Tokenizer ( self . _nlp ) self . _matcher = Matcher ( self . _nlp . vocab ) self . _field_name = rules [ "field_name" ] if "field_name" in rules else extractor_name self . _rule_lst = { } self . _hash_map = { } for idx , a_rule in enumerate ( self . _rules ) : this_rule = Rule ( a_rule , self . _nlp ) self . _rule_lst [ this_rule . identifier + "rule_id##" + str ( idx ) ] = this_rule
Initialize the extractor, storing the rule information and construct spacy rules
        Args:
            nlp
            rules (Dict): spacy rules
            extractor_name: str

        Returns: