Skip to content

Commit

Permalink
Change type to unit for biblScope in commentary.xsg (ticket #335)
Browse files Browse the repository at this point in the history
  • Loading branch information
Elemmire committed Sep 1, 2017
1 parent e579aea commit e224606
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
10 changes: 5 additions & 5 deletions commentary.xsg
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ bib_scope
: =

bib_scope_detail
: "|v=" [NUM_RNG_WHL nrw] = <biblScope type="vol">[NUM_RNG_WHL nrw]</>
: "|i=" [NUM_RNG_WHL nrw] = <biblScope type="issue">[NUM_RNG_WHL nrw]</>
: "|p=" [NUM_RNG_WHL nrw] = <biblScope type="pp">[NUM_RNG_WHL nrw]</>
: "|l=" [NUM_RNG_WHL nrw] = <biblScope type="ll">[NUM_RNG_WHL nrw]</>
: "|ch=" [NUM_RNG_WHL nrw] = <biblScope type="chap">[NUM_RNG_WHL nrw]</>
: "|v=" [NUM_RNG_WHL nrw] = <biblScope unit="vol">[NUM_RNG_WHL nrw]</>
: "|i=" [NUM_RNG_WHL nrw] = <biblScope unit="issue">[NUM_RNG_WHL nrw]</>
: "|p=" [NUM_RNG_WHL nrw] = <biblScope unit="pp">[NUM_RNG_WHL nrw]</>
: "|l=" [NUM_RNG_WHL nrw] = <biblScope unit="ll">[NUM_RNG_WHL nrw]</>
: "|ch=" [NUM_RNG_WHL nrw] = <biblScope unit="chap">[NUM_RNG_WHL nrw]</>

bib
: "<:" [WORDSLOOSE text] "|" [bib_target bt] [bib_scope bs] ":>" = <listBibl><bibl><ref target=[bib_target bt]>[WORDSLOOSE text]</>[bib_scope bs]</></>
Expand Down
15 changes: 8 additions & 7 deletions test/test_commentary_grammar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ def test_footnote
#=end
def test_bib
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=2:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope type="pp">2</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=2-4:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope type="pp">2-4</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=II:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope type="pp">II</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=II-IV:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope type="pp">II-IV</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=ii:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope type="pp">ii</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=ii-iv:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope type="pp">ii-iv</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|v=3|i=25|ch=7|p=ii-iv|l=47:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope type="vol">3</biblScope><biblScope type="issue">25</biblScope><biblScope type="chap">7</biblScope><biblScope type="pp">ii-iv</biblScope><biblScope type="ll">47</biblScope></bibl></listBibl>'
# the ddb fragments below no longer conform to real life test cases as the tei:biblScope/@type attribute has been changed to teibiblScope/@unit
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=2:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope unit="pp">2</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=2-4:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope unit="pp">2-4</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=II:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope unit="pp">II</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=II-IV:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope unit="pp">II-IV</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=ii:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope unit="pp">ii</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|p=ii-iv:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope unit="pp">ii-iv</biblScope></bibl></listBibl>'
assert_equal_fragment_transform '<:the words for the link|bibl/papyri.info/ddbdp/bgu;7;33|v=3|i=25|ch=7|p=ii-iv|l=47:>', '<listBibl><bibl><ref target="http://papyri.info/ddbdp/bgu;7;33">the words for the link</ref><biblScope unit="vol">3</biblScope><biblScope unit="issue">25</biblScope><biblScope unit="chap">7</biblScope><biblScope unit="pp">ii-iv</biblScope><biblScope unit="ll">47</biblScope></bibl></listBibl>'
end

def test_url
Expand Down

0 comments on commit e224606

Please sign in to comment.