-
-
Notifications
You must be signed in to change notification settings - Fork 2
Scripture Update block #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…translations. These updates make it happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I just have a couple of comments.
Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @johnml1135)
machine/corpora/scripture_update_block.py
line 11 at r1 (raw file):
def __init__(self) -> None: self._ref: ScriptureRef = ScriptureRef()
What is this field used for?
machine/corpora/scripture_update_block.py
line 12 at r1 (raw file):
def __init__(self) -> None: self._ref: ScriptureRef = ScriptureRef() self._elements: list[ScriptureUpdateElement] = []
If this is accessible outside of this class, then I would expose it as a public read-only property.
@property
def elements(self) -> List[ScriptureUpdateElement]:
return self._elements
machine/corpora/scripture_update_block_handler_base.py
line 6 at r1 (raw file):
class ScriptureUpdateBlockHandlerBase:
This can just be an interface. You can rename it to ScriptureUpdateBlockHandler
.
machine/corpora/usfm_parser_state.py
line 112 at r1 (raw file):
def is_verse_text(self) -> bool: # anything before verse 1 is not verse text if self.verse_ref.verse_num == 0:
I am a little worried about this change. In this context, is_verse_text
is referring to the UsfmTextType
. Just to be safe, I think we should remove this change and add the check to UpdateUsfmParserHandler.end_para()
.
machine/corpora/scripture_update_element.py
line 16 at r1 (raw file):
@dataclass class ScriptureUpdateElement:
I think ScriptureUpdateOperation
would be a more precise name, unless I'm misunderstanding the purpose of this class. "Element" is kind of generic.
Previously, ddaspit (Damien Daspit) wrote…
Some functionality will have to be aware of the scripture passage to know how to process the verse text. For instance, if Ben's algorithm fails in a chapter, that entire chapter should be left alone - this is facilitated by being verse-aware. |
Previously, ddaspit (Damien Daspit) wrote…
Done. |
Previously, ddaspit (Damien Daspit) wrote…
Done. |
Previously, ddaspit (Damien Daspit) wrote…
These are the elements that are updated - they are not the operations themselves. I don't know if there is a better way to represent that. |
Previously, ddaspit (Damien Daspit) wrote…
Let's discuss the implications for the different scenarios. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 13 of 13 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @johnml1135)
machine/corpora/scripture_update_block.py
line 11 at r1 (raw file):
Previously, johnml1135 (John Lambert) wrote…
Some functionality will have to be aware of the scripture passage to know how to process the verse text. For instance, if Ben's algorithm fails in a chapter, that entire chapter should be left alone - this is facilitated by being verse-aware.
Ok, then you should expose it as a public property.
machine/corpora/scripture_update_element.py
line 16 at r1 (raw file):
Previously, johnml1135 (John Lambert) wrote…
These are the elements that are updated - they are not the operations themselves. I don't know if there is a better way to represent that.
Ok, I think I understand better what the class represents.
tests/corpora/test_usfm_file_text.py
line 69 at r2 (raw file):
rows = list(text) assert len(rows) == 52
Why did this unit test change? It worries me that changing the USFM updater is affecting USFM parsing.
machine/corpora/scripture_update_block_handler.py
line 10 at r2 (raw file):
class ScriptureUpdateBlockHandler(ABC): def process_block(self, block: ScriptureUpdateBlock) -> ScriptureUpdateBlock:
This method should not have an implementation, like other interfaces in Machine.py.
@abstractmethod
def process_block(self, block: ScriptureUpdateBlock) -> ScriptureUpdateBlock:
...
Previously, ddaspit (Damien Daspit) wrote…
Yes... that makes sense now :-) |
Previously, ddaspit (Damien Daspit) wrote…
Paradigms... |
Previously, ddaspit (Damien Daspit) wrote…
It's related to the "is verse text" If there are two '\p' before a verse, are they separate enties to be translated differently or should the second one be a true "paragraph" while the first is a "segment initiating paragraph"? |
Pass marker type (embed, style) to update block
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #168 +/- ##
==========================================
- Coverage 88.55% 87.20% -1.35%
==========================================
Files 276 276
Lines 16498 16094 -404
==========================================
- Hits 14609 14035 -574
- Misses 1889 2059 +170 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Will this evolve first?
This change is