<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def syllabify_ssp(self, word):
 """ Syllabifies a word according to the Sonority Sequencing Principle :param word: Word to be syllabified :return: List consisting of syllables Example: First you need to define the matters of articulation ['fe', 'mi', 'na', 'rum'] Not specifying your alphabet results in an error: Traceback (most recent call last):
 cltk.exceptions.InputError Additionally, you can utilize the language parameter: ['lo', 'be', 'bæ', 'ren'] ['hun', 'tyng'] ['ar', 'ce', 'bis', 'cop'] The break_geminants parameter ensures a breakpoint is placed between geminants: ['en', 'ni', 'tungl'] """


        # List indicating the syllable indices
        syllables = []

        find_nucleus = True

        i = 0

        try:
            # Replace each letter occurence with its corresponding number
            # indicating its position in the sonority hierarchy
            encoded = list(map(lambda x: self.hierarchy[x], word))

        except KeyError:
            LOG.error(
                "The given string contains invalid characters. "
                "Make sure to define the mater of articulation for each phoneme.")
            raise InputError

        while i < len(word) - 1:
            # Search for nucleus
            while word[i] not in self.vowels and i < len(word) - 1 and find_nucleus:
                i += 1
            
            if find_nucleus is True:
                i += 1
            
            if i >= len(word) - 1:
                break

            else:
                # If the break_geminants parameter is set to True, prioritize geminants
                if self.break_geminants and word[i-1] == word[i]:
                    syllables.append(i-1)
                    find_nucleus = True 
                    
                # If a cluster of three phonemes with the same values exist, break syllable
                elif encoded[i - 1] == encoded[i] == encoded[i + 1]:
                    syllables.append(i)
                    find_nucleus = True

                elif encoded[i] > encoded[i - 1] and encoded[i] > encoded[i + 1]:
                    syllables.append(i)
                    find_nucleus = True

                elif encoded[i] < encoded[i - 1] and encoded[i] < encoded[i + 1]:
                    syllables.append(i)
                    find_nucleus = True

                else:
                    find_nucleus = False

                i += 1

        for n, k in enumerate(syllables):
            word = word[:k + n + 1] + "." + word[k + n + 1:]

        word = word.split('.')

        # Check if last syllable has a nucleus

        if sum([x in self.vowels for x in word[-1]]) == 0:
            word[-2] += word[-1]
            word = word[:-1]

        return self.onset_maximization(word)