def _set_suffix_links(self):
        '''
        Sets all suffix links in all nodes in this trie.
        '''
        self._suffix_links_set = True
        for current, parent in self.bfs():
            # skip the root node
            if parent is None:
                continue
            current.longest_prefix = parent.longest_prefix
            if parent.has_value:
                current.longest_prefix = parent
            # the root doesn't get a suffix link
            # also, skip previously set suffix links
            if current.has_suffix:
                continue
            # current is not the root and has no suffix
            # set current's suffix to parent's suffix
            suffix = parent
            while True:
                if not suffix.has_suffix:
                    current.suffix = self.root
                    break
                else:
                    suffix = suffix.suffix
                if current.uplink in suffix:
                    current.suffix = suffix[current.uplink]
                    break
            # now find the dict_suffix value
            suffix = current.suffix
            while not suffix.has_value and suffix.has_suffix:
                suffix = suffix.suffix
            if suffix.has_value:
                current.dict_suffix = suffix
Sets all suffix links in all nodes in this trie.