presidio-analyzer/analyzer/matcher.py
def __context_to_keywords(self, context):
        """Convert context text to relevant keywords

        Args:
           context: words prefix of specified pattern
        """

        nlp_context = self.nlp(context)

        # Remove punctuation, stop words and take lemma form and remove
        # duplicates
        keywords = list(
            filter(
                lambda k: not self.nlp.vocab[k.text].is_stop and not k.is_punct and k.lemma_ != '-PRON-' and k.lemma_ != 'be',  # noqa: E501
                nlp_context))
        keywords = list(set(map(lambda k: k.lemma_.lower(), keywords)))

        return keywords
Convert context text to relevant keywords

        Args:
           context: words prefix of specified pattern
        
Convert context text to relevant keywords
Convert context text to relevant keywords
def __context_to_keywords(self, context):
        nlp_context = self.nlp(context)
        keywords = list(
            filter(
                lambda k: not self.nlp.vocab[k.text].is_stop and not k.is_punct and k.lemma_ != '-PRON-' and k.lemma_ != 'be',  
                nlp_context))
        keywords = list(set(map(lambda k: k.lemma_.lower(), keywords)))
        return keywords
def __context_to_keywords ( self , context ) : nlp_context = self . nlp ( context ) keywords = list ( filter ( lambda k : not self . nlp . vocab [ k . text ] . is_stop and not k . is_punct and k . lemma_ != '-PRON-' and k . lemma_ != 'be' , nlp_context ) ) keywords = list ( set ( map ( lambda k : k . lemma_ . lower ( ) , keywords ) ) ) return keywords
Convert context text to relevant keywords
Convert context text to relevant keywords
"""Convert context text to relevant keywords

        Args:
           context: words prefix of specified pattern
        """ # Remove punctuation, stop words and take lemma form and remove # duplicates # noqa: E501
self
context
words prefix of specified pattern
words prefix of specified pattern