presidio-analyzer/analyzer/matcher.py
def __analyze_field_type(self, doc, field_type_string_filter, results):
        """Analyze specific field type (NER/Pattern)

        Args:
          doc: spacy document to analyze
          field_type_string_filter: field type descriptor
          results: array containing the created results
        """

        current_field = field_factory.FieldFactory.create(
            field_type_string_filter)

        if current_field is None:
            return

        # Check for ner field
        analyze_start_time = datetime.datetime.now()
        if isinstance(current_field, type(ner.Ner())):
            current_field.name = field_type_string_filter
            self.__check_ner(doc, results, current_field)
        else:
            self.__check_pattern(doc, results, current_field)

        analyze_time = datetime.datetime.now() - analyze_start_time
        self.logger.debug('--- analyze_time[{}]: {}.{} seconds'.format(
            field_type_string_filter, analyze_time.seconds,
            analyze_time.microseconds))
Analyze specific field type (NER/Pattern)

        Args:
          doc: spacy document to analyze
          field_type_string_filter: field type descriptor
          results: array containing the created results
        
Analyze specific field type (NER/Pattern)
Analyze specific field type ( NER / Pattern )
def __analyze_field_type(self, doc, field_type_string_filter, results):
        current_field = field_factory.FieldFactory.create(
            field_type_string_filter)
        if current_field is None:
            return
        analyze_start_time = datetime.datetime.now()
        if isinstance(current_field, type(ner.Ner())):
            current_field.name = field_type_string_filter
            self.__check_ner(doc, results, current_field)
        else:
            self.__check_pattern(doc, results, current_field)
        analyze_time = datetime.datetime.now() - analyze_start_time
        self.logger.debug('--- analyze_time[{}]: {}.{} seconds'.format(
            field_type_string_filter, analyze_time.seconds,
            analyze_time.microseconds))
def __analyze_field_type ( self , doc , field_type_string_filter , results ) : current_field = field_factory . FieldFactory . create ( field_type_string_filter ) if current_field is None : return analyze_start_time = datetime . datetime . now ( ) if isinstance ( current_field , type ( ner . Ner ( ) ) ) : current_field . name = field_type_string_filter self . __check_ner ( doc , results , current_field ) else : self . __check_pattern ( doc , results , current_field ) analyze_time = datetime . datetime . now ( ) - analyze_start_time self . logger . debug ( '--- analyze_time[{}]: {}.{} seconds' . format ( field_type_string_filter , analyze_time . seconds , analyze_time . microseconds ) )
Analyze specific field type (NER/Pattern)
Analyze specific field type ( NER / Pattern )
"""Analyze specific field type (NER/Pattern)

        Args:
          doc: spacy document to analyze
          field_type_string_filter: field type descriptor
          results: array containing the created results
        """ # Check for ner field
self
doc
spacy document to analyze
spacy document to analyze
field_type_string_filter
field type descriptor
field type descriptor
results
array containing the created results
array containing the created results