syllabicator/trie.py
def insert(self, word: str, value: object = True) -> None:
        """Insert a new word into the trie and optionally assign a value to it.

        Parameters:
        word (str): the word to insert.
        value (object): optional value assigned to the word.  Default is True.
        """
        if len(word) == 0:
            raise ValueError("Inserting the empty word in non root nodes is not possible")

        v = value if len(word) == 1 else None
        child = self.children.setdefault(word[0], Node(word[0]))
        child.value = v
        if len(word) > 1:
            child.insert(word[1:], value)
Insert a new word into the trie and optionally assign a value to it.

        Parameters:
        word (str): the word to insert.
        value (object): optional value assigned to the word.  Default is True.
        
Insert a new word into the trie and optionally assign a value to it.
Parameters:
word (str): the word to insert.
value (object): optional value assigned to the word.  Default is True.
Insert a new word into the trie and optionally assign a value to it . Parameters : word ( str ) : the word to insert . value ( object ) : optional value assigned to the word . Default is True .
def insert(self, word: str, value: object = True) -> None:
        if len(word) == 0:
            raise ValueError("Inserting the empty word in non root nodes is not possible")
        v = value if len(word) == 1 else None
        child = self.children.setdefault(word[0], Node(word[0]))
        child.value = v
        if len(word) > 1:
            child.insert(word[1:], value)
def insert ( self , word : str , value : object = True ) -> None : if len ( word ) == 0 : raise ValueError ( "Inserting the empty word in non root nodes is not possible" ) v = value if len ( word ) == 1 else None child = self . children . setdefault ( word [ 0 ] , Node ( word [ 0 ] ) ) child . value = v if len ( word ) > 1 : child . insert ( word [ 1 : ] , value )
Insert a new word into the trie and optionally assign a value to it.
Insert a new word into the trie and optionally assign a value to it .
"""Insert a new word into the trie and optionally assign a value to it.

        Parameters:
        word (str): the word to insert.
        value (object): optional value assigned to the word.  Default is True.
        """
self
word
str
value
object