def tokenize_to_spacy_doc(self, text: str) -> Doc:
        """
        Tokenize the given text, returning a spacy doc. Used for spacy rule extractor

        Args:
            text (string):

        Returns: Doc

        """
        if not self.keep_multi_space:
            text = re.sub(' +', ' ', text)
        doc = self.nlp(text, disable=['parser'])
        for a_token in doc:
            self.custom_token(a_token)

        return doc
Tokenize the given text, returning a spacy doc. Used for spacy rule extractor

        Args:
            text (string):

        Returns: Doc