Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F60667493
test_description.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, May 1, 20:21
Size
1 KB
Mime Type
text/x-python
Expires
Fri, May 3, 20:21 (2 d)
Engine
blob
Format
Raw Data
Handle
17365587
Attached To
rNIETZSCHEPYTHON nietzsche-python
test_description.py
View Options
import
unittest
from
os
import
sep
,
path
from
os.path
import
dirname
,
basename
,
isfile
,
isdir
import
lxml.etree
as
ET
import
sys
sys
.
path
.
append
(
'svgscripts'
)
from
datatypes.page
import
Page
from
datatypes.standoff_tag
import
StandoffTag
from
datatypes.text
import
Text
from
datatypes.description
import
Description
class
TestText
(
unittest
.
TestCase
):
def
setUp
(
self
):
DATADIR
=
dirname
(
__file__
)
+
sep
+
'test_data'
if
not
isdir
(
DATADIR
):
DATADIR
=
dirname
(
dirname
(
__file__
))
+
sep
+
'test_data'
self
.
test_file
=
DATADIR
+
sep
+
'test.xml'
self
.
test_svg_file
=
DATADIR
+
sep
+
'test421.svg'
self
.
pdf_xml
=
DATADIR
+
sep
+
'W_I_8_page125.xml'
self
.
xml_file
=
DATADIR
+
sep
+
'N_VII_1_page005.xml'
self
.
xml_fileB
=
DATADIR
+
sep
+
'N_VII_1_page006.xml'
self
.
pdf_xml_source
=
DATADIR
+
sep
+
'W_I_8_neu_125-01.svg'
self
.
test_page
=
DATADIR
+
sep
+
'N_VII_1_page001.xml'
self
.
test_manuscript
=
DATADIR
+
sep
+
'N_VII_1.xml'
def
test_semantic
(
self
):
pass
#print(Text.get_semantic_dictionary())
def
test_create_cls_from_node
(
self
):
tree
=
ET
.
parse
(
self
.
test_manuscript
)
node
=
tree
.
xpath
(
'description/earlierDescription[@id="1"]/manuscriptDescription'
)[
0
]
description
=
Description
.
create_cls_from_node
(
node
)
self
.
assertTrue
(
len
(
description
.
standoff_markups
)
>
0
)
#print(description.content, description.standoff_markups)
if
__name__
==
"__main__"
:
unittest
.
main
()
Event Timeline
Log In to Comment