Skip to content

Commit

Permalink
Fixed a bug where uncertain in supplied would not be treated correctly
Browse files Browse the repository at this point in the history
See #3
  • Loading branch information
PonteIneptique committed Nov 2, 2017
1 parent 78c64dd commit 7e32cab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions chetc/configs/clauss.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def replacements(self):
##########################################

# Abbreviation inside Parentheses, even with supplied inside
("(\w*)\[(" + Clauss.word_matcher_regularization + "*)\((\w+)\)(" + Clauss.word_matcher_regularization + "*)\]",
("(\w*)\[(" + Clauss.word_matcher_regularization + "*)\((\w+\??)\)(" + Clauss.word_matcher_regularization + "*)\]",
"<expan><abbr>$1<supplied reason=\"lost\">$2</supplied></abbr><ex>$3</ex><abbr><supplied reason=\"lost\">$4</supplied></abbr></expan>"),

##########################################
Expand Down Expand Up @@ -158,7 +158,9 @@ def replacements(self):
("(<abbr></abbr>)", ""),

# If two expan are glued, it means they are from the same group...
("(</expan><expan>)", "")
("(</expan><expan>)", ""),
# Ex that were not treated
("<ex>(\w+)\?</ex>", "<ex cert=\"low\">$1</ex>")

]
for pattern, replacement in x:
Expand Down
5 changes: 4 additions & 1 deletion tests/test_Clauss_now.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ http://db.edcs.eu/epigr/edcs_id.php?s_sprache=en&p_edcs_id=EDCS-25800673
<lb n="1"/><gap reason="lost" extent="3" unit="character"/> Aqutium <gap reason="lost" extent="3" unit="character"/> <lb n="2"/> <expan><abbr>d</abbr><ex>uum</ex><abbr>v</abbr><ex>irum</ex></expan> <expan><abbr>v</abbr><ex>irum</ex></expan> <expan><abbr><supplied reason="lost">b</supplied></abbr><ex>onum</ex></expan>
http://db.edcs.eu/epigr/edcs_id.php?s_sprache=en&p_edcs_id=EDCS-25900625
M(arcum) Mari(um) ae[d(ilem)] v(irum) b(onum) [3]
<lb n="1"/><expan><abbr>M</abbr><ex>arcum</ex></expan> <expan><abbr>Mari</abbr><ex>um</ex></expan> <expan><abbr>ae<supplied reason="lost">d</supplied></abbr><ex>ilem</ex></expan> <expan><abbr>v</abbr><ex>irum</ex></expan> <expan><abbr>b</abbr><ex>onum</ex></expan> <gap reason="lost" extent="3" unit="character"/>
<lb n="1"/><expan><abbr>M</abbr><ex>arcum</ex></expan> <expan><abbr>Mari</abbr><ex>um</ex></expan> <expan><abbr>ae<supplied reason="lost">d</supplied></abbr><ex>ilem</ex></expan> <expan><abbr>v</abbr><ex>irum</ex></expan> <expan><abbr>b</abbr><ex>onum</ex></expan> <gap reason="lost" extent="3" unit="character"/>
http://db.edcs.eu/epigr/edcs_id.php?s_sprache=en&p_edcs_id=EDCS-25900636
[P]om[ponium(?)] / [ae]d(ilem) v(irum) b(onum) o[ro v(os) f(aciatis?)]
<lb n="1"/><supplied reason="lost">P</supplied>om<supplied reason="lost" cert="low">ponium</supplied> <lb n="2"/> <expan><abbr><supplied reason="lost">ae</supplied>d</abbr><ex>ilem</ex></expan> <expan><abbr>v</abbr><ex>irum</ex></expan> <expan><abbr>b</abbr><ex>onum</ex></expan> o<supplied reason="lost">ro</supplied> <expan><abbr><supplied reason="lost">v</supplied></abbr><ex>os</ex></expan> <expan><abbr><supplied reason="lost">f</supplied></abbr><ex cert="low">aciatis</ex></expan>

0 comments on commit 7e32cab

Please sign in to comment.