-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add versification table implementation #283
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #283 +/- ##
=======================================
Coverage 70.26% 70.26%
=======================================
Files 385 388 +3
Lines 31957 32008 +51
Branches 4488 4494 +6
=======================================
+ Hits 22455 22492 +37
- Misses 8463 8474 +11
- Partials 1039 1042 +3 ☔ View full report in Codecov by Sentry. |
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 6 of 6 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Enkidu93 and @johnml1135)
src/SIL.Machine/Corpora/VersificationTableBase.cs
line 7 at r1 (raw file):
namespace SIL.Machine.Corpora { public abstract class VersificationTableBase : Versification.Table
Is there some way that we could make this implementation stateless? We don't want to save every versification that we load. It could create a subtle memory leak when applications use Machine. I wish there was some way we could bypass this table when loading a versification. Worse comes to worse, we could remove all custom versifications after we load a versification. If we could just make the proper Load
method protected
, then we could make a stateless table.
src/SIL.Machine/Corpora/FileParatextProjectSettingsParser.cs
line 14 at r1 (raw file):
{ _projectDir = projectDir; Versification.Table.Implementation = new FileVersificationTable(projectDir);
Versification.Table.Implementation
is a static singleton. If we try to use FileParatextProjectSettingsParser
and ZipParatextProjectSettingsParser
in the same process, then they might stomp on each other, causing the code to break in weird ways, since the wrong versification table implementation would be used. Is there some way we could use the same implementation for both parsers? Maybe use a special path for zip files.
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ddaspit and @johnml1135)
src/SIL.Machine/Corpora/FileParatextProjectSettingsParser.cs
line 14 at r1 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
Versification.Table.Implementation
is a static singleton. If we try to useFileParatextProjectSettingsParser
andZipParatextProjectSettingsParser
in the same process, then they might stomp on each other, causing the code to break in weird ways, since the wrong versification table implementation would be used. Is there some way we could use the same implementation for both parsers? Maybe use a special path for zip files.
OK, yes, I'll stew on it.
src/SIL.Machine/Corpora/VersificationTableBase.cs
line 7 at r1 (raw file):
Previously, ddaspit (Damien Daspit) wrote…
Is there some way that we could make this implementation stateless? We don't want to save every versification that we load. It could create a subtle memory leak when applications use Machine. I wish there was some way we could bypass this table when loading a versification. Worse comes to worse, we could remove all custom versifications after we load a versification. If we could just make the proper
Load
methodprotected
, then we could make a stateless table.
Yes, sorry! I think I forgot why we were doing this in the first place 😅 - looking into it. I think we may be able to get around adding the versification to the table.
Fixes #241
Once this goes through, a change will need to be made in Serval to the
ZipParatextProjectSettingsParser
.This change is