src/license_expression/_pyahocorasick.py
def add(self, tokens_string, value=None):
        """
        Add a new tokens_string and its associated value to the trie. If the
        tokens_string already exists in the Trie, its value is replaced with the
        provided value, typically a Token object. If a value is not provided,
        the tokens_string is used as value.

        A tokens_string is any string. It will be tokenized when added
        to the Trie.
        """
        if self._converted:
            raise Exception('This Trie has been converted to an Aho-Corasick '
                            'automaton and cannot be modified.')

        if not tokens_string or not isinstance(tokens_string, str):
            return

        tokens = [t for t in get_tokens(tokens_string) if t.strip()]

        # we keep track of the set of tokens added to the trie to build the
        # automaton these are needed to created the first level children failure
        # links

        self._known_tokens.update(tokens)

        node = self.root
        for token in tokens:
            try:
                node = node.children[token]
            except KeyError:
                child = TrieNode(token)
                node.children[token] = child
                node = child

        node.output = (tokens_string, value or tokens_string)

        Add a new tokens_string and its associated value to the trie. If the
        tokens_string already exists in the Trie, its value is replaced with the
        provided value, typically a Token object. If a value is not provided,
        the tokens_string is used as value.

        A tokens_string is any string. It will be tokenized when added
        to the Trie.
        
Add a new tokens_string and its associated value to the trie. If the
tokens_string already exists in the Trie, its value is replaced with the
provided value, typically a Token object. If a value is not provided,
the tokens_string is used as value.

A tokens_string is any string. It will be tokenized when added
to the Trie.
Add a new tokens_string and its associated value to the trie . If the tokens_string already exists in the Trie its value is replaced with the provided value typically a Token object . If a value is not provided the tokens_string is used as value . A tokens_string is any string . It will be tokenized when added to the Trie .
def add(self, tokens_string, value=None):
        if self._converted:
            raise Exception('This Trie has been converted to an Aho-Corasick '
                            'automaton and cannot be modified.')
        if not tokens_string or not isinstance(tokens_string, str):
            return
        tokens = [t for t in get_tokens(tokens_string) if t.strip()]
        self._known_tokens.update(tokens)
        node = self.root
        for token in tokens:
            try:
                node = node.children[token]
            except KeyError:
                child = TrieNode(token)
                node.children[token] = child
                node = child
        node.output = (tokens_string, value or tokens_string)
def add ( self , tokens_string , value = None ) : if self . _converted : raise Exception ( 'This Trie has been converted to an Aho-Corasick ' 'automaton and cannot be modified.' ) if not tokens_string or not isinstance ( tokens_string , str ) : return tokens = [ t for t in get_tokens ( tokens_string ) if t . strip ( ) ] self . _known_tokens . update ( tokens ) node = self . root for token in tokens : try : node = node . children [ token ] except KeyError : child = TrieNode ( token ) node . children [ token ] = child node = child node . output = ( tokens_string , value or tokens_string )
Add a new tokens_string and its associated value to the trie.
Add a new tokens_string and its associated value to the trie .
"""
        Add a new tokens_string and its associated value to the trie. If the
        tokens_string already exists in the Trie, its value is replaced with the
        provided value, typically a Token object. If a value is not provided,
        the tokens_string is used as value.

        A tokens_string is any string. It will be tokenized when added
        to the Trie.
        """ # we keep track of the set of tokens added to the trie to build the # automaton these are needed to created the first level children failure # links
self
tokens_string
value