From 957cd1f7e640411ae22ffd7f4ec20d913a0fe68e Mon Sep 17 00:00:00 2001 From: Enkidu93 Date: Tue, 7 Oct 2025 17:17:12 -0400 Subject: [PATCH] Update version to 1.8.4; minor changes for consistency with Machine --- machine/punctuation_analysis/usfm_structure_extractor.py | 3 +-- pyproject.toml | 2 +- tests/punctuation_analysis/test_usfm_structure_extractor.py | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/machine/punctuation_analysis/usfm_structure_extractor.py b/machine/punctuation_analysis/usfm_structure_extractor.py index baeef06..85778ff 100644 --- a/machine/punctuation_analysis/usfm_structure_extractor.py +++ b/machine/punctuation_analysis/usfm_structure_extractor.py @@ -27,8 +27,7 @@ def chapter( pub_number: Optional[str], ) -> None: self._next_text_segment_builder.add_preceding_marker(UsfmMarkerType.CHAPTER) - chapter_number: int = int(number) if number.isdigit() else 0 - self._next_text_segment_builder.set_chapter(chapter_number) + self._next_text_segment_builder.set_chapter(state.verse_ref.chapter_num) def start_para( self, diff --git a/pyproject.toml b/pyproject.toml index 4b97cdf..f0b99df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ reportMissingModuleSource = false [tool.poetry] name = "sil-machine" -version = "1.8.3" +version = "1.8.4" description = "A natural language processing library that is focused on providing tools for resource-poor languages." license = "MIT" authors = ["SIL International"] diff --git a/tests/punctuation_analysis/test_usfm_structure_extractor.py b/tests/punctuation_analysis/test_usfm_structure_extractor.py index 7249a6a..571b0f8 100644 --- a/tests/punctuation_analysis/test_usfm_structure_extractor.py +++ b/tests/punctuation_analysis/test_usfm_structure_extractor.py @@ -21,12 +21,15 @@ def test_get_chapters_filter_by_book(): def test_get_chapters_filter_by_chapter(): usfm_structure_extractor = UsfmStructureExtractor() usfm_structure_extractor.start_book(verse_text_parser_state, "id", "MAT") + verse_text_parser_state.verse_ref.chapter_num = 1 usfm_structure_extractor.chapter(verse_text_parser_state, "1", "c", None, None) usfm_structure_extractor.verse(verse_text_parser_state, "1", "v", None, None) usfm_structure_extractor.text(verse_text_parser_state, "test") + verse_text_parser_state.verse_ref.chapter_num = 2 usfm_structure_extractor.chapter(verse_text_parser_state, "2", "c", None, None) usfm_structure_extractor.verse(verse_text_parser_state, "1", "v", None, None) usfm_structure_extractor.text(verse_text_parser_state, "test2") + verse_text_parser_state.verse_ref.chapter_num = 3 usfm_structure_extractor.chapter(verse_text_parser_state, "3", "c", None, None) usfm_structure_extractor.verse(verse_text_parser_state, "1", "v", None, None) usfm_structure_extractor.text(verse_text_parser_state, "test3")