How to use the presidio-analyzer.analyzer.pattern_recognizer.PatternRecognizer.build_regex_explanation function in presidio-analyzer

To help you get started, we’ve selected a few presidio-analyzer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / presidio / presidio-analyzer / analyzer / pattern_recognizer.py View on Github external
pattern.name,
                              match_time.seconds,
                              match_time.microseconds)

            for match in matches:
                start, end = match.span()
                current_match = text[start:end]

                # Skip empty results
                if current_match == '':
                    continue

                score = pattern.score

                validation_result = self.validate_result(current_match)
                description = PatternRecognizer.build_regex_explanation(
                    self.name,
                    pattern.name,
                    pattern.regex,
                    score,
                    validation_result
                )
                pattern_result = RecognizerResult(
                    self.supported_entities[0],
                    start,
                    end,
                    score,
                    description)

                if validation_result is not None:
                    if validation_result:
                        pattern_result.score = EntityRecognizer.MAX_SCORE

presidio-analyzer

Presidio Analyzer package

MIT
Latest version published 2 months ago

Package Health Score

97 / 100
Full package analysis

Similar packages