Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include tests #1

Open
PonteIneptique opened this issue Jun 12, 2017 · 0 comments
Open

Include tests #1

PonteIneptique opened this issue Jun 12, 2017 · 0 comments

Comments

@PonteIneptique
Copy link
Contributor

Using https://github.com/steko/epidoc/blob/master/deprecated/chetc-py/tests/chetc_replacements_panciera.txt

==============================================================================

File: chetc_replacements_panciera.txt
doctests for chetc.convert()
Leiden input mode for Latin epigraphy (Panciera style)

EpiDoc: Guidelines for Structured Markup of Epigraphic Texts in TEI
Copyright (C) 2007 by Hugh Cayless and Tom Elliott.
Additional contributors' copyright may be designated in individual source files.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

Information about the EpiDoc community can be obtained via 
http://epidoc.sf.net.

Funding from the Andrew W. Mellon Foundation paid for the initial 
version of this code through a grant to Duke University and partners
for the enhancement of the Duke Database of Documentary Greek 
Papyri and the Papyrological Navigator web portal.

==============================================================================
tests in this file should coordinate with parsing pairs in 
../replacements/replacements_panciera.txt and with the
encoding examples and guidance in the EpiDoc Guidelines
==============================================================================

>>> from chetc import convert

------------------------------------------------------------------------------

Letters erroneously omitted from the text, which the editor adds (erroneous omission)    

>>> convert (u'Valeri<a>nus', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valeri<supplied reason="omitted" cert="high">a</supplied>nus'

------------------------------------------------------------------------------

Transcription wherein the character would not be unambiguous outside its context (unclear)

>>> convert (u'Valerianus\u0323', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianu<unclear reason="undefined" cert="high">s</unclear>'

------------------------------------------------------------------------------

Transcription wherein vestiges of characters remain, but they cannot be recognized (extent certain or nearly so) (vestiges)

>>> convert (u'Valerianus +++ filius optimus', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <gap reason="illegible" extent="3" unit="character"/> filius optimus'

>>> convert (u'Valerianus ++ filius optimus', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <gap reason="illegible" extent="2" unit="character"/> filius optimus'

>>> convert (u'Valerianus + filius optimus', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <gap reason="illegible" extent="1" unit="character"/> filius optimus'

>>> convert (u'Valerianus +++ filius optim++', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <gap reason="illegible" extent="3" unit="character"/> filius optim<gap reason="illegible" extent="2" unit="character"/>'

>>> convert (u'Valerianus + 10 + filius optimus', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <gap reason="illegible" extent="10" unit="character"/> filius optimus'

>>> convert (u'Valerianus + 10 + filius optim++', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <gap reason="illegible" extent="10" unit="character"/> filius optim<gap reason="illegible" extent="2" unit="character"/>'

>>> convert (u'Valerianus + 4.2cm + filius optimus', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <gap reason="illegible" extent="4.2" unit="cm"/> filius optimus'

>>> convert (u'Valerianus + 4.2cm + filius optim++', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <gap reason="illegible" extent="4.2" unit="cm"/> filius optim<gap reason="illegible" extent="2" unit="character"/>'

>>> convert (u'Valerianus + c.10 + filius optimus', 'panciera').encode('ascii', 'xmlcharrefreplace')
'untestable: guidelines still use <certainty> tag (vestiges.html)'

>>> convert (u'Valerianus + c.4.2cm + filius optimus', 'panciera').encode('ascii', 'xmlcharrefreplace')
'untestable: guidelines still use <certainty> tag (vestiges.html)'

------------------------------------------------------------------------------

Letters completely lost (extent certain or not certain; lostcertain)

>>> convert (u'[ · · · ]', 'panciera').encode('ascii', 'xmlcharrefreplace')
'<gap reason="lost" extent="3" unit="character"/>'

>>> convert (u'[···]', 'panciera').encode('ascii', 'xmlcharrefreplace')
'<gap reason="lost" extent="3" unit="character"/>'

>>> convert (u'[ . . . ]', 'panciera').encode('ascii', 'xmlcharrefreplace')
'<gap reason="lost" extent="3" unit="character"/>'

>>> convert (u'[...]', 'panciera').encode('ascii', 'xmlcharrefreplace')
'<gap reason="lost" extent="3" unit="character"/>'

------------------------------------------------------------------------------

Editorial supplement in which the editor explains a "breviatio" or note

>>> convert (u'donatus ab eo (i.e. imperatore) ad populum', 'panciera').encode('ascii', 'xmlcharrefreplace')
'donatus ab eo <supplied reason="explanation" cert="high">imperatore</supplied> ad populum'

------------------------------------------------------------------------------

Special characters (notations)

>>> convert (u'Valerianus ((crux))', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <g type="crux"/>'

------------------------------------------------------------------------------

Identification and expansion of abbreviations understood by the editor

>>> convert (u'co(n)s(ul)', 'panciera').encode('ascii', 'xmlcharrefreplace')
'<expan>co<supplied reason="abbreviation" cert="high">n</supplied>s<supplied reason="abbreviation" cert="high">ul</supplied></expan>'

>>> convert (u'Valerianus p(ater?) hic situs est', 'panciera').encode('ascii', 'xmlcharrefreplace')
'Valerianus <expan>p<supplied reason="abbreviation" cert="low">ater</supplied></expan> hic situs est'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant