def split_multiclause(sentence, tagged_sentence): # extract the text the divider tag represents divider = first(find_first(is_divider, tagged_sentence)) if divider is not None: first_clause = sentence[0:sentence.index(divider)].rstrip() second_clause = sentence[sentence.index(divider) + 1:].lstrip() return [first_clause, second_clause] else: return [sentence]
def split_multiclause(sentence, tagged_sentence): # extract the text the divider tag represents divider = first(find_first(is_divider, tagged_sentence)) if divider is not None: first_clause = sentence[0:sentence.index(divider)].rstrip() second_clause = sentence[sentence.index(divider)+1:].lstrip() return [first_clause, second_clause] else: return [sentence]
def first_consonant_sound(word): phonemes = word_to_phonemes(word) if not is_empty(phonemes): return find_first(is_consonant_phoneme, phonemes) else: return first(consonant_re.findall(word.upper()))