code: def prepare_sentence(self, sentence):
          
          # depending on how the morphological analysis was added, there may be
          # phonetic markup. Remove it, if it exists.
          for word in sentence:
              for analysis in word[ANALYSIS]:
                  analysis[ROOT] = analysis[ROOT].replace('~', '')
                  analysis[ROOT] = re.sub('[?<\]]([aioueöäõü])', '\\1', analysis[ROOT])
          return json.dumps({WORDS: sentence})
docs: Prepare the sentence for segment detection.