From 78c64ddb3d5d165c0d454ecf944877f90aa34357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Cl=C3=A9rice?= Date: Thu, 2 Nov 2017 17:58:35 +0100 Subject: [PATCH] A supplied abbreviation can have tokens prepended Also fixed : supplied should be applied only to abbr Fixed #7 --- chetc/configs/clauss.py | 5 +++-- tests/test_Clauss_now.txt | 9 ++++++--- tests/test_Clauss_wordid.txt | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/chetc/configs/clauss.py b/chetc/configs/clauss.py index 731cea5..da368cc 100644 --- a/chetc/configs/clauss.py +++ b/chetc/configs/clauss.py @@ -102,8 +102,8 @@ def replacements(self): ########################################## # Abbreviation inside Parentheses, even with supplied inside - ("\[(" + Clauss.word_matcher_plus_square_brkcts + "*)\((\w+)\)(" + Clauss.word_matcher_plus_square_brkcts + "*)\]", - "$1$2$3"), + ("(\w*)\[(" + Clauss.word_matcher_regularization + "*)\((\w+)\)(" + Clauss.word_matcher_regularization + "*)\]", + "$1$2$3$4"), ########################################## # Parentheses @@ -154,6 +154,7 @@ def replacements(self): ########################################## # Clean Up ########################################## + ("()", ""), ("()", ""), # If two expan are glued, it means they are from the same group... diff --git a/tests/test_Clauss_now.txt b/tests/test_Clauss_now.txt index 3e9ed53..043e9cd 100644 --- a/tests/test_Clauss_now.txt +++ b/tests/test_Clauss_now.txt @@ -1,9 +1,12 @@ CIL 4 60 -- http://arachne.uni-koeln.de/item/buchseite/554886 C(aio) Iulio Caesare dict(atore) iter(um) / M(arco) Antonio mag(istro) eq(uitum) / mag(istri) vici et compiti / M(arcus) Blattius M(arci) f(ilius) / M(arcus) Cerrinius M(arci) f(ilius) / M(arcus) Sepullius [3] / [6] / Q(uintus) Pra[3] / C(aius) Corne[lius 3] / [6] / P(ublius) Ro[c]ius [3]s / Salvius E[3]ro() M(arci) s(ervus) // C(aio) Caes]are M(arco) Lepido co(n)s(ulibus) / [3] Blattius M(arci) f(ilius) / C(aius) [H]ermatorius(?) P(ubli) f(ilius) / M(arcus) [3]ius M(arci) f(ilius?) Plutus / M(arcus) Stronnius M(arci) l(ibertus) Nic[3]o / M(arcus) Oppius S(exti) l(ibertus) Aes[chines(?)] C(aius) Cepidius C(ai) [l(ibertus) -Caio Iulio Caesare dictatore iterum Marco Antonio magistro equitum magistri vici et compiti Marcus Blattius Marci filius Marcus Cerrinius Marci filius Marcus Sepullius Quintus Pra Caius Cornelius Publius Rocius s Salvius Ero Marci servus Caio Caes]are Marco Lepido consulibus Blattius Marci filius Caius Hermatorius Publi filius Marcus ius Marci filius Plutus Marcus Stronnius Marci libertus Nico Marcus Oppius Sexti libertus Aeschines Caius Cepidius Cai libertus +Caio Iulio Caesare dictatore iterum Marco Antonio magistro equitum magistri vici et compiti Marcus Blattius Marci filius Marcus Cerrinius Marci filius Marcus Sepullius Quintus Pra Caius Cornelius Publius Rocius s Salvius Ero Marci servus Caio Caes]are Marco Lepido consulibus Blattius Marci filius Caius Hermatorius Publi filius Marcus ius Marci filius Plutus Marcus Stronnius Marci libertus Nico Marcus Oppius Sexti libertus Aeschines Caius Cepidius Cai libertus CIL 04, 00131 Sittium a[e]d(ilem) [o(ro) v(os)] f(aciatis) -Sittium aedilem oro vos faciatis +Sittium aedilem oro vos faciatis http://db.edcs.eu/epigr/edcs_id.php?s_sprache=en&p_edcs_id=EDCS-25800673 [3] Aqutium [3] / d(uum)v(irum) v(irum) [b(onum)] - Aqutium duumvirum virum bonum \ No newline at end of file + Aqutium duumvirum virum bonum +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] +Marcum Marium aedilem virum bonum \ No newline at end of file diff --git a/tests/test_Clauss_wordid.txt b/tests/test_Clauss_wordid.txt index 2c005e7..f07b056 100644 --- a/tests/test_Clauss_wordid.txt +++ b/tests/test_Clauss_wordid.txt @@ -1,6 +1,6 @@ CIL 4 60 -- http://arachne.uni-koeln.de/item/buchseite/554886 C(aio) Iulio Caesare dict(atore) iter(um) / M(arco) Antonio mag(istro) eq(uitum) / mag(istri) vici et compiti / M(arcus) Blattius M(arci) f(ilius) / M(arcus) Cerrinius M(arci) f(ilius) / M(arcus) Sepullius [3] / [6] / Q(uintus) Pra[3] / C(aius) Corne[lius 3] / [6] / P(ublius) Ro[c]ius [3]s / Salvius E[3]ro() M(arci) s(ervus) // C(aio) Caes]are M(arco) Lepido co(n)s(ulibus) / [3] Blattius M(arci) f(ilius) / C(aius) [H]ermatorius(?) P(ubli) f(ilius) / M(arcus) [3]ius M(arci) f(ilius?) Plutus / M(arcus) Stronnius M(arci) l(ibertus) Nic[3]o / M(arcus) Oppius S(exti) l(ibertus) Aes[chines(?)] C(aius) Cepidius C(ai) [l(ibertus) -Caio Iulio Caesare dictatore iterum Marco Antonio magistro equitum magistri vici et compiti Marcus Blattius Marci filius Marcus Cerrinius Marci filius Marcus Sepullius Quintus Pra Caius Cornelius Publius Rocius s Salvius Ero Marci servus Caio Caes]are Marco Lepido consulibus Blattius Marci filius Caius Hermatorius Publi filius Marcus ius Marci filius Plutus Marcus Stronnius Marci libertus Nico Marcus Oppius Sexti libertus Aeschines Caius Cepidius Cai libertus +Caio Iulio Caesare dictatore iterum Marco Antonio magistro equitum magistri vici et compiti Marcus Blattius Marci filius Marcus Cerrinius Marci filius Marcus Sepullius Quintus Pra Caius Cornelius Publius Rocius s Salvius Ero Marci servus Caio Caes]are Marco Lepido consulibus Blattius Marci filius Caius Hermatorius Publi filius Marcus ius Marci filius Plutus Marcus Stronnius Marci libertus Nico Marcus Oppius Sexti libertus Aeschines Caius Cepidius Cai libertus CIL 04, 00131 Sittium a[e]d(ilem) [o(ro) v(os)] f(aciatis) -Sittium aedilem oro vos faciatis \ No newline at end of file +Sittium aedilem oro vos faciatis \ No newline at end of file