syllabicator/trie.py
def longestMatch(self, word: str) -> str:
        """Return the longest matching prefix in the trie for the given word.

        Parameters:
        word (str): the word to match.

        Returns:
        str:the longest match found. Empty string if no match was found.
        """
        child = self.children.get(word[0:1])
        if child is None:
            return ""
        childsMatch = child.longestMatch(word[1:])
        if childsMatch != "":
            return word[0] + childsMatch
        else:
            return word[0] if child.isFinal() else ""
Return the longest matching prefix in the trie for the given word.

        Parameters:
        word (str): the word to match.

        Returns:
        str:the longest match found. Empty string if no match was found.
        
Return the longest matching prefix in the trie for the given word.
Parameters:
word (str): the word to match.

the longest match found. Empty string if no match was found.
Return the longest matching prefix in the trie for the given word . Parameters : word ( str ) : the word to match . the longest match found . Empty string if no match was found .
def longestMatch(self, word: str) -> str:
        child = self.children.get(word[0:1])
        if child is None:
            return ""
        childsMatch = child.longestMatch(word[1:])
        if childsMatch != "":
            return word[0] + childsMatch
        else:
            return word[0] if child.isFinal() else ""
def longestMatch ( self , word : str ) -> str : child = self . children . get ( word [ 0 : 1 ] ) if child is None : return "" childsMatch = child . longestMatch ( word [ 1 : ] ) if childsMatch != "" : return word [ 0 ] + childsMatch else : return word [ 0 ] if child . isFinal ( ) else ""
Return the longest matching prefix in the trie for the given word.
Return the longest matching prefix in the trie for the given word .
"""Return the longest matching prefix in the trie for the given word.

        Parameters:
        word (str): the word to match.

        Returns:
        str:the longest match found. Empty string if no match was found.
        """
self
word
str