-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
raise error when id tag doesn't match filename book id
- Loading branch information
1 parent
183fdfb
commit 84a6a34
Showing
11 changed files
with
230 additions
and
27 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from pytest import raises | ||
from testutils.corpora_test_helpers import USFM_INVALID_ID_PROJECT_PATH, USFM_MISMATCH_ID_PROJECT_PATH | ||
|
||
from machine.corpora import ParatextTextCorpus | ||
|
||
|
||
def test_paratext_text_corpus_invalid_id() -> None: | ||
with raises(ValueError, match=r"The \\id tag in .* is invalid."): | ||
ParatextTextCorpus(USFM_INVALID_ID_PROJECT_PATH, include_all_text=True) | ||
|
||
|
||
def test_paratext_text_corpus_mismatch_id() -> None: | ||
with raises(ValueError, match=r"The \\id tag .* in .* does not match filename book id .*"): | ||
ParatextTextCorpus(USFM_MISMATCH_ID_PROJECT_PATH, include_all_text=True) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
\id JGS - Test | ||
\h Judges | ||
\mt Judges | ||
\c 1 | ||
\v 1 Chapter one, verse one. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<ScriptureText> | ||
<StyleSheet>usfm.sty</StyleSheet> | ||
<Versification>4</Versification> | ||
<LanguageIsoCode>en:::</LanguageIsoCode> | ||
<Language>English</Language> | ||
<MinParatextVersion>8.0.100.76</MinParatextVersion> | ||
<FullName>Test</FullName> | ||
<Encoding>65001</Encoding> | ||
<Editable>T</Editable> | ||
<Copyright /> | ||
<NormalizationForm>NFC</NormalizationForm> | ||
<Name>invalid_id</Name> | ||
<Guid>a7e0b3ce0200736062f9f810a444dbfbe64aca35</Guid> | ||
<DefaultFont>Charis SIL</DefaultFont> | ||
<DefaultFontSize>12</DefaultFontSize> | ||
<FontFeatures /> | ||
<HtmlLanguage /> | ||
<AssociatedLexicalProject /> | ||
<FileNameBookNameForm>41MAT</FileNameBookNameForm> | ||
<FileNamePrePart /> | ||
<FileNamePostPart>.SFM</FileNamePostPart> | ||
<BiblicalTermsListSetting>Major::BiblicalTerms.xml</BiblicalTermsListSetting> | ||
<MatchBasedOnStems>F</MatchBasedOnStems> | ||
<AllowReadAccess>F</AllowReadAccess> | ||
<AllowSharingWithSLDR>F</AllowSharingWithSLDR> | ||
<Visibility>Public</Visibility> | ||
<TranslationInfo>Standard::</TranslationInfo> | ||
<EncodingConverter /> | ||
<UsfmVersion>3</UsfmVersion> | ||
<ParallelPassagesBooks>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</ParallelPassagesBooks> | ||
<BooksPresent>000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000</BooksPresent> | ||
<BibleModuleAssociations /> | ||
<Naming PrePart="" PostPart=".SFM" BookNameForm="41MAT" /> | ||
</ScriptureText> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# custom.vrs | ||
|
||
LEV 14:56 | ||
ROM 14:26 | ||
REV 12:17 | ||
TOB 5:22 | ||
TOB 10:12 | ||
SIR 23:28 | ||
ESG 1:22 | ||
ESG 3:15 | ||
ESG 5:14 | ||
ESG 8:17 | ||
ESG 10:14 | ||
SIR 33:33 | ||
SIR 41:24 | ||
BAR 1:22 | ||
4MA 7:25 | ||
4MA 12:20 | ||
|
||
# deliberately missing verses | ||
-ROM 16:26 | ||
-ROM 16:27 | ||
-3JN 1:15 | ||
-S3Y 1:49 | ||
-ESG 4:6 | ||
-ESG 9:5 | ||
-ESG 9:30 | ||
|
||
LEV 14:55 = LEV 14:55 | ||
LEV 14:55 = LEV 14:56 | ||
LEV 14:56 = LEV 14:57 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
\id JUD - Test | ||
\h Judges | ||
\mt Judges | ||
\c 1 | ||
\v 1 Chapter one, verse one. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<ScriptureText> | ||
<StyleSheet>usfm.sty</StyleSheet> | ||
<Versification>4</Versification> | ||
<LanguageIsoCode>en:::</LanguageIsoCode> | ||
<Language>English</Language> | ||
<MinParatextVersion>8.0.100.76</MinParatextVersion> | ||
<FullName>Test</FullName> | ||
<Encoding>65001</Encoding> | ||
<Editable>T</Editable> | ||
<Copyright /> | ||
<NormalizationForm>NFC</NormalizationForm> | ||
<Name>mismatch_id</Name> | ||
<Guid>a7e0b3ce0200736062f9f810a444dbfbe64aca35</Guid> | ||
<DefaultFont>Charis SIL</DefaultFont> | ||
<DefaultFontSize>12</DefaultFontSize> | ||
<FontFeatures /> | ||
<HtmlLanguage /> | ||
<AssociatedLexicalProject /> | ||
<FileNameBookNameForm>41MAT</FileNameBookNameForm> | ||
<FileNamePrePart /> | ||
<FileNamePostPart>.SFM</FileNamePostPart> | ||
<BiblicalTermsListSetting>Major::BiblicalTerms.xml</BiblicalTermsListSetting> | ||
<MatchBasedOnStems>F</MatchBasedOnStems> | ||
<AllowReadAccess>F</AllowReadAccess> | ||
<AllowSharingWithSLDR>F</AllowSharingWithSLDR> | ||
<Visibility>Public</Visibility> | ||
<TranslationInfo>Standard::</TranslationInfo> | ||
<EncodingConverter /> | ||
<UsfmVersion>3</UsfmVersion> | ||
<ParallelPassagesBooks>000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000</ParallelPassagesBooks> | ||
<BooksPresent>000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000</BooksPresent> | ||
<BibleModuleAssociations /> | ||
<Naming PrePart="" PostPart=".SFM" BookNameForm="41MAT" /> | ||
</ScriptureText> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# custom.vrs | ||
|
||
LEV 14:56 | ||
ROM 14:26 | ||
REV 12:17 | ||
TOB 5:22 | ||
TOB 10:12 | ||
SIR 23:28 | ||
ESG 1:22 | ||
ESG 3:15 | ||
ESG 5:14 | ||
ESG 8:17 | ||
ESG 10:14 | ||
SIR 33:33 | ||
SIR 41:24 | ||
BAR 1:22 | ||
4MA 7:25 | ||
4MA 12:20 | ||
|
||
# deliberately missing verses | ||
-ROM 16:26 | ||
-ROM 16:27 | ||
-3JN 1:15 | ||
-S3Y 1:49 | ||
-ESG 4:6 | ||
-ESG 9:5 | ||
-ESG 9:30 | ||
|
||
LEV 14:55 = LEV 14:55 | ||
LEV 14:55 = LEV 14:56 | ||
LEV 14:56 = LEV 14:57 |