Skip to content

Commit

Permalink
Merge pull request #1 from DCLP/issue177
Browse files Browse the repository at this point in the history
Include @corresp in Leiden+
  • Loading branch information
paregorios authored Jun 2, 2017
2 parents 96e12fc + 62e602c commit 5d60c53
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
7 changes: 7 additions & 0 deletions epidoc.xsg
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ WORD = ([^ \/\\\n\r\t\[\]\^<>_#@~〚〛$\*\&\,\.\:\=\|\'\!\(\)\{\}\?\"¯+\u0304\
// WORDDIV breaks at space and does not allow DOT - allows +, \,
WORDDIV = ([^ \n\r\t\[\]\^<>_#@~〚〛$\*\&\.\:\=\|\'\!\(\)\{\}\?\"¯\u0304\u0323]+) (MAX)

//WORDDIVHASH same as WORDDIV but allows octothorpe (#) for IDREFs
WORDDIVHASH = ([^ \n\r\t\[\]\^<>_@~〚〛$\*\&\.\:\=\|\'\!\(\)\{\}\?\"¯\u0304\u0323]+) (MAX)

// WORDVEST same as WORD except added 'v' to keep vestig out
WORDVEST = ([^ \/\\\n\r\t\[\]\^<>v_#@~〚〛$\*\&\,\.\:\=\|\'\!\(\)\{\}\?\"¯+\u0304\u0323]+) (MAX)

Expand Down Expand Up @@ -128,10 +131,14 @@ divtag
>: [BEGDIV] "." [WORDDIV n] [ANYSP a] [abtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] [divtag more] = <div n=[WORDDIV n] type="textpart"> [ANYSP a] [abtag ab][ANYSP aa]</> [ANYSP aaa] [divtag more]
>: [BEGDIV] "." [WORDDIV n] "." [WORDDIV s] [ANYSP a] [abtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] = <div n=[WORDDIV n] subtype =[WORDDIV s] type="textpart"> [ANYSP a] [abtag ab][ANYSP aa]</> [ANYSP aaa]
>: [BEGDIV] "." [WORDDIV n] "." [WORDDIV s] [ANYSP a] [abtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] [divtag more] = <div n=[WORDDIV n] subtype =[WORDDIV s] type="textpart"> [ANYSP a] [abtag ab][ANYSP aa]</> [ANYSP aaa] [divtag more]
>: [BEGDIV] "." [WORDDIV n] "." [WORDDIV s] "." [WORDDIVHASH c] [ANYSP a] [abtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] = <div n=[WORDDIV n] subtype =[WORDDIV s] type="textpart" corresp=[WORDDIVHASH c]> [ANYSP a] [abtag ab][ANYSP aa]</> [ANYSP aaa]
>: [BEGDIV] "." [WORDDIV n] "." [WORDDIV s] "." [WORDDIVHASH c] [ANYSP a] [abtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] [divtag more] = <div n=[WORDDIV n] subtype =[WORDDIV s] type="textpart" corresp=[WORDDIVHASH c]> [ANYSP a] [abtag ab][ANYSP aa]</> [ANYSP aaa] [divtag more]
>: [BEGDIV] "." [WORDDIV n] [ANYSP a] [divtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] = <div n=[WORDDIV n] type="textpart"> [ANYSP a] [divtag ab][ANYSP aa]</> [ANYSP aaa]
>: [BEGDIV] "." [WORDDIV n] [ANYSP a] [divtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] [divtag more] = <div n=[WORDDIV n] type="textpart"> [ANYSP a] [divtag ab][ANYSP aa]</> [ANYSP aaa] [divtag more]
>: [BEGDIV] "." [WORDDIV n] "." [WORDDIV s] [ANYSP a] [divtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] = <div n=[WORDDIV n] subtype =[WORDDIV s] type="textpart"> [ANYSP a] [divtag ab][ANYSP aa]</> [ANYSP aaa]
>: [BEGDIV] "." [WORDDIV n] "." [WORDDIV s] [ANYSP a] [divtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] [divtag more] = <div n=[WORDDIV n] subtype =[WORDDIV s] type="textpart"> [ANYSP a] [divtag ab][ANYSP aa]</> [ANYSP aaa] [divtag more]
>: [BEGDIV] "." [WORDDIV n] "." [WORDDIV s] "." [WORDDIVHASH c] [ANYSP a] [divtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] = <div n=[WORDDIV n] subtype =[WORDDIV s] type="textpart" corresp=[WORDDIVHASH c]> [ANYSP a] [divtag ab][ANYSP aa]</> [ANYSP aaa]
>: [BEGDIV] "." [WORDDIV n] "." [WORDDIV s] "." [WORDDIVHASH c] [ANYSP a] [divtag ab] [ANYSP aa][ENDDIV] [ANYSP aaa] [divtag more] = <div n=[WORDDIV n] subtype =[WORDDIV s] type="textpart" corresp=[WORDDIVHASH c]> [ANYSP a] [divtag ab][ANYSP aa]</> [ANYSP aaa] [divtag more]

abtag
: [BEGAB] [items z] [ENDAB] [ANYSP a] = <ab>[items z]</> [ANYSP a]
Expand Down
20 changes: 20 additions & 0 deletions test/test_assertions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,25 @@ def assert_equal_xml_fragment_to_non_xml_to_xml_fragment(expected, input)

def transform_xml_fragment_to_non_xml(input)
xml_to_non_xml = @xsugar.xml_to_non_xml(ab(lb(input)))
return xml_to_non_xml
end

def transform_non_xml_fragment_to_xml(input)
return @xsugar.non_xml_to_xml(lab(input))
end

def transform_non_xml_to_xml(input)
return @xsugar.non_xml_to_xml(input)
end

def transform_xml_to_non_xml(input)
return @xsugar.xml_to_non_xml(input)
end

def assert_equal_edition_roundtrip(input)
xml = @xsugar.non_xml_to_xml(input)
nonxml = @xsugar.xml_to_non_xml(xml)
assert_equal(input, nonxml)
end

end
11 changes: 11 additions & 0 deletions test/test_grammar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1370,5 +1370,16 @@ def test_unicode_greek_reversibility
# def test_xsugar_reversibility_true
# assert @xsugar.reversible?
# end

# DCLP tests begin here

def test_dclp_177
# specify corresp for a textpart div (e.g., fragment ID)
foo = '<S=.grc<D=.1.column.#FR365<=foo=>=D>'
bar = transform_non_xml_to_xml(foo)
assert_equal(bar, '<div xml:lang="grc" type="edition" xml:space="preserve" xmlns:xml="http://www.w3.org/XML/1998/namespace"><div n="1" subtype="column" type="textpart" corresp="#FR365"><ab>foo</ab></div></div>')
assert_equal_edition_roundtrip(foo)
end

end
end

0 comments on commit 5d60c53

Please sign in to comment.