def test_set_paragraph(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() builder.set_paragraph(state, patterns, tags, PARAGRAPH_NO_DIALOG) assert state.text == PARAGRAPH_NO_DIALOG
def test_create_sentence_states_dialog_begin(): state = paragraph_state.Paragraph_State() state.paragraph_tags = paragraph_tags.Paragraph_Tags() state.paragraph_patterns = paragraph_patterns.Paragraph_Patterns() state.paragraph_list_dict = PARAGRAPHS_CONTINUE_DIALOG_LIST_DICT builder.create_sentence_states(state) assert PARAGRAPHS_CONTINUE_DIALOG_LIST_DICT == state.paragraph_list_dict
def test_none_paragraph_tag_in_paragraph_state_in_split_paragraph(): state = paragraph_state.Paragraph_State() tags = None patterns = paragraph_patterns.Paragraph_Patterns() builder.set_paragraph(state, patterns, tags, PARAGRAPH_NO_DIALOG) builder.split_paragraph_text(state) assert state.paragraph_list_dict == []
def test_enumerate_tag_paragraph_list_dict_data_nested_dialog(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() builder.set_paragraph(state, patterns, tags, PARAGRAPHS_CONTINUE_DIALOG) builder.split_paragraph_text(state) builder.tag_paragraph_list_dict_data(state) assert PARAGRAPHS_CONTINUE_DIALOG_LIST_DICT == state.paragraph_list_dict
def test_enumerate_tag_paragraph_list_dict_data(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() builder.set_paragraph(state, patterns, tags, PARAGRAPH_AUDIO_DIALOG) builder.split_paragraph_text(state) builder.tag_paragraph_list_dict_data(state) assert PARAGRAPH_TAGGED == state.paragraph_list_dict
def test_split_paragraph_text(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() builder.set_paragraph(state, patterns, tags, PARAGRAPH_NO_DIALOG) builder.split_paragraph_text(state) assert list(state.paragraph_list_dict[0].items())[0][0] + \ list(state.paragraph_list_dict[1].items())[0][0] == "The valley filled with smoke smoldering from pine trees. "
def test_set_split_paragraph_same_patternsing_and_capture(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() builder.set_paragraph(state, patterns, tags, PARAGRAPH_REPEAT_patternsING) builder.split_paragraph_text(state) assert state.text == PARAGRAPH_REPEAT_patternsING
def test_split_paragraph_text_dialog(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() builder.set_paragraph(state, patterns, tags, PARAGRAPH_AUDIO_DIALOG) builder.split_paragraph_text(state) assert list(state.paragraph_list_dict[0].items())[0][0] + \ list(state.paragraph_list_dict[1].items())[0][0] + \ list(state.paragraph_list_dict[2].items())[0][0] + \ list(state.paragraph_list_dict[3].items())[0][0] == ",,What.'' I said"
def test_split_paragraph_text_split_patterns(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() i = -1 for string in PARAGRAPH_patterns: builder.set_paragraph(state, patterns, tags, string) builder.split_paragraph_text(state) i += 1 assert list(state.paragraph_list_dict[0].items())[0][0] + \ list(state.paragraph_list_dict[1].items())[0][0] == PARAGRAPH_patterns[i]
def test_narrative_continue_to_dialog_string(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() i = -1 for string in NARRATOR_BEGIN_NARRATOR_patterns_STRING: builder.set_paragraph(state, patterns, tags, string) builder.split_paragraph_text(state) i += 1 assert list(state.paragraph_list_dict[0].items())[0][0] + \ list(state.paragraph_list_dict[1].items())[0][0] + \ list(state.paragraph_list_dict[2].items())[0][0] + \ list(state.paragraph_list_dict[3].items())[0][0] == NARRATOR_BEGIN_NARRATOR_patterns_STRING[i]
def test_mark_dialog_begin_string(): state = paragraph_state.Paragraph_State() tags = paragraph_tags.Paragraph_Tags() patterns = paragraph_patterns.Paragraph_Patterns() i = -1 for string in MARK_DIALOG_BEGIN_STRING: builder.set_paragraph(state, patterns, tags, string) builder.split_paragraph_text(state) i += 1 assert list(state.paragraph_list_dict[0].items())[0][0] + \ list(state.paragraph_list_dict[1].items())[0][0] + \ list(state.paragraph_list_dict[2].items())[0][0] + \ list(state.paragraph_list_dict[3].items())[0][0] + \ list(state.paragraph_list_dict[4].items())[0][0] == MARK_DIALOG_BEGIN_STRING[i]