class_docstr: Provides 2 main methods that syllabify words given phonology of its language.
docstr: Syllabifies a word according to the Sonority Sequencing Principle
  
  :param word: Word to be syllabified
  :return: List consisting of syllables
  
  First you need to define the matters of articulation
  >>> high_vowels = ['a']
  >>> mid_vowels = ['e']
  >>> low_vowels = ['i', 'u']
  >>> flaps = ['r']
  >>> nasals = ['m', 'n']
  >>> fricatives = ['f']
  >>> s = Syllabifier(high_vowels=high_vowels, mid_vowels=mid_vowels, low_vowels=low_vowels, flaps=flaps, nasals=nasals, fricatives=fricatives)
  >>> s.syllabify("feminarum")
  ['fe', 'mi', 'na', 'rum']
  
  Not specifying your alphabet results in an error:
  >>> s.syllabify("foemina")
  Traceback (most recent call last):
  ...
  cltk.core.exceptions.CLTKException
  
  Additionally, you can utilize the language parameter:
  >>> s = Syllabifier(language='gmh')
  >>> s.syllabify('lobebæren')
  ['lo', 'be', 'bæ', 'ren']
  >>> s = Syllabifier(language='enm')
  >>> s.syllabify("huntyng")
  ['hun', 'tyng']
  >>> s = Syllabifier(language='ang')
  >>> s.syllabify("arcebiscop")
  ['ar', 'ce', 'bis', 'cop']
  
  The break_geminants parameter ensures a breakpoint is placed between geminants:
  >>> geminant_s = Syllabifier(break_geminants=True)
  >>> hierarchy = [["a", "á", "æ", "e", "é", "i", "í", "o", "ǫ", "ø", "ö", "œ", "ó", "u", "ú", "y", "ý"], ["j"], ["m"], ["n"], ["p", "b", "d", "g", "t", "k"], ["c", "f", "s", "h", "v", "x", "þ", "ð"], ["r"], ["l"]]
  >>> geminant_s.set_hierarchy(hierarchy)
  >>> geminant_s.set_vowels(hierarchy[0])
  >>> geminant_s.syllabify("ennitungl")
  ['en', 'ni', 'tungl']
docstr_tok: ["Syllabifies","a","word","according","to","the","Sonority","Sequencing","Principle",":","param","word",":","Word","to","be","syllabified",":","return",":","List","consisting","of","syllables","First","you","need","to","define","the","matters","of","articulation",">",">",">","high_vowels","=","[","'","a","'","]",">",">",">","mid_vowels","=","[","'","e","'","]",">",">",">","low_vowels","=","[","'","i","'",",","'","u","'","]",">",">",">","flaps","=","[","'","r","'","]",">",">",">","nasals","=","[","'m","'",",","'n","'","]",">",">",">","fricatives","=","[","'","f","'","]",">",">",">","s","=","Syllabifier","(","high_vowels=high_vowels",",","mid_vowels=mid_vowels",",","low_vowels=low_vowels",",","flaps=flaps",",","nasals=nasals",",","fricatives=fricatives",")",">",">",">","s.syllabify","(","``","feminarum","''",")","[","'fe","'",",","'mi","'",",","'na","'",",","'rum","'","]","Not","specifying","your","alphabet","results","in","an","error",":",">",">",">","s.syllabify","(","``","foemina","''",")","Traceback","(","most","recent","call","last",")",":","...","cltk.core.exceptions.CLTKException","Additionally",",","you","can","utilize","the","language","parameter",":",">",">",">","s","=","Syllabifier","(","language='gmh","'",")",">",">",">","s.syllabify","(","'lobeb\u00e6ren","'",")","[","'lo","'",",","'be","'",",","'b\u00e6","'",",","'ren","'","]",">",">",">","s","=","Syllabifier","(","language='enm","'",")",">",">",">","s.syllabify","(","``","huntyng","''",")","[","'hun","'",",","'tyng","'","]",">",">",">","s","=","Syllabifier","(","language='ang","'",")",">",">",">","s.syllabify","(","``","arcebiscop","''",")","[","'ar","'",",","'ce","'",",","'bis","'",",","'cop","'","]","The","break_geminants","parameter","ensures","a","breakpoint","is","placed","between","geminants",":",">",">",">","geminant_s","=","Syllabifier","(","break_geminants=True",")",">",">",">","hierarchy","=","[","[","``","a","''",",","``","\u00e1","''",",","``","\u00e6","''",",","``","e","''",",","``","\u00e9","''",",","``","i","''",",","``","\u00ed","''",",","``","o","''",",","``","\u01eb","''",",","``","\u00f8","''",",","``","\u00f6","''",",","``","\u0153","''",",","``","\u00f3","''",",","``","u","''",",","``","\u00fa","''",",","``","y","''",",","``","\u00fd","''","]",",","[","``","j","''","]",",","[","``","m","''","]",",","[","``","n","''","]",",","[","``","p","''",",","``","b","''",",","``","d","''",",","``","g","''",",","``","t","''",",","``","k","''","]",",","[","``","c","''",",","``","f","''",",","``","s","''",",","``","h","''",",","``","v","''",",","``","x","''",",","``","\u00fe","''",",","``","\u00f0","''","]",",","[","``","r","''","]",",","[","``","l","''","]","]",">",">",">","geminant_s.set_hierarchy","(","hierarchy",")",">",">",">","geminant_s.set_vowels","(","hierarchy","[","0","]",")",">",">",">","geminant_s.syllabify","(","``","ennitungl","''",")","[","'en","'",",","'ni","'",",","'tungl","'","]"]
code: def syllabify_ssp(self, word: str) -> List[str]:
      """
      Syllabifies a word according to the Sonority Sequencing Principle
  
      :param word: Word to be syllabified
      :return: List consisting of syllables
  
      First you need to define the matters of articulation
      >>> high_vowels = ['a']
      >>> mid_vowels = ['e']
      >>> low_vowels = ['i', 'u']
      >>> flaps = ['r']
      >>> nasals = ['m', 'n']
      >>> fricatives = ['f']
      >>> s = Syllabifier(high_vowels=high_vowels, mid_vowels=mid_vowels, low_vowels=low_vowels, flaps=flaps, nasals=nasals, fricatives=fricatives)
      >>> s.syllabify("feminarum")
      ['fe', 'mi', 'na', 'rum']
  
      Not specifying your alphabet results in an error:
      >>> s.syllabify("foemina")
      Traceback (most recent call last):
      ...
      cltk.core.exceptions.CLTKException
  
      Additionally, you can utilize the language parameter:
      >>> s = Syllabifier(language='gmh')
      >>> s.syllabify('lobebæren')
      ['lo', 'be', 'bæ', 'ren']
      >>> s = Syllabifier(language='enm')
      >>> s.syllabify("huntyng")
      ['hun', 'tyng']
      >>> s = Syllabifier(language='ang')
      >>> s.syllabify("arcebiscop")
      ['ar', 'ce', 'bis', 'cop']
  
      The break_geminants parameter ensures a breakpoint is placed between geminants:
      >>> geminant_s = Syllabifier(break_geminants=True)
      >>> hierarchy = [["a", "á", "æ", "e", "é", "i", "í", "o", "ǫ", "ø", "ö", "œ", "ó", "u", "ú", "y", "ý"], ["j"], ["m"], ["n"], ["p", "b", "d", "g", "t", "k"], ["c", "f", "s", "h", "v", "x", "þ", "ð"], ["r"], ["l"]]
      >>> geminant_s.set_hierarchy(hierarchy)
      >>> geminant_s.set_vowels(hierarchy[0])
      >>> geminant_s.syllabify("ennitungl")
      ['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 CLTKException
  
      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:
              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)
  
imports: import logging
  import unicodedata
  from collections import defaultdict
  from typing import List, Union
  import cltk.phonology.ang.syllabifier
  import cltk.phonology.enm.syllabifier
  import cltk.phonology.gmh.syllabifier
  import cltk.phonology.non.syllabifier
  import cltk.phonology.non.utils
  from cltk.core.exceptions import CLTKException
label_desc: Use image node_id 7 for calling the Syllabifier obj's underlying member method code with example usage: obj.syllabify_ssp(word) and returns: self