code: def _Soundex(self):
          
          
          word = self.word[1:]
  
          for w, val in zip(dict_SE.keys(), dict_SE.values()):
              word = word.replace(w, val)
  
          #Remove multiple adjacent occurences of digit
          word = re.sub(r"(\d)\1+", r"\1", word)
  
          # Strip remaining letters
          word = re.sub(r"[a-zðþƿ]+", "", word)
  
          # Add trailing zeroes and return
          return (self.word[0].upper() + word + "0" * 3)[:4]
docs: The Soundex phonetic indexing algorithm adapted to ME phonology.
  
          Algorithm:
  
          Let w the original word and W the resulting one
  
          1) Capitalize the first letter of w and append it to W
  
          2) Apply the following replacement rules
  
              p, b, f, v, gh (non-nasal fricatives) -> 1
  
              t, d, s, sh, z, r, k, g, w (non-nasal alveolars and velars) -> 2
  
              l (alveolar lateral) -> 3
  
              m, n (nasals) -> 4
  
              r (alveolar approximant) -> 5
  
          3) Concetate multiple occurrences of numbers into one
  
          4) Remove non-numerical characters
  
          Notes:
              /h/ was thought to be either a voiceless or velar fricative
          when occurring in the coda with its most used grapheme being <gh>.
          Those phonemes either disappeared, resulting in the lengthening
          of preceding vowel clusters, or were developed into /f/ as evident
          by modern spelling (e.g. 'enough': /ɪˈnʌf/ and 'though': /ðəʊ/)
  
          Examples:
              >>> Word("midel").phonetic_indexing(p="SE")
              'M230'
  
              >>> Word("myddle").phonetic_indexing(p="SE")
              'M230'
  
              >>> Word("might").phonetic_indexing(p="SE")
              'M120'
  
              >>> Word("myghtely").phonetic_indexing(p="SE")
              'M123'