add support for chapter level usfm filtering and remarks#1021
Open
mshannon-sil wants to merge 1 commit into
Open
add support for chapter level usfm filtering and remarks#1021mshannon-sil wants to merge 1 commit into
mshannon-sil wants to merge 1 commit into
Conversation
Enkidu93
approved these changes
May 14, 2026
Collaborator
There was a problem hiding this comment.
Looks good!
I think we can assume that \c 1 always exists. I've never seen it omitted I don't think. And if it were omitted, I think it would cause other problems in our tools. Maybe you could ask the EITL team if they've seen this before if you'd like to double-check?
I'm fine with only updating translate_book, but that's more a question for Ben and Damien, I guess.
@Enkidu93 reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on ddaspit).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses issue #836 and is dependent on changes in machine.py that are in this PR: sillsdev/machine.py#285.
This passes the chapters argument into the
update_usfmmethod from machine.py so that any usfm markers that are not the \id marker or in the requested chapters are omitted. It also updates remarks to be applied at a chapter level rather than at a book level.A couple questions/notes:
\c 1marker, or is it possible projects may omit it? Because the way the remarks algorithm now works for a book like Jude, it creates a remark for chapter 1, but the remark won't be applied if there is no\c 1marker.translate_usfmmethod, since the way silnlp is set up it doesn't get used when books/chapters are specified. Also, updating it to support chapters would include having to import more from machine.py, particularlyfilter_tokens_by_chapterthat we didn't want to import if we didn't have to. If I should still add support for chapter level drafting to this manual version regardless, please let me know.This change is