Commit a6605b0f authored by Arkadiusz Janz's avatar Arkadiusz Janz

fixing minor bugs found in XML reader, we solved #7, #8, #9 and #10 issues;...

fixing minor bugs found in XML reader, we solved #7, #8, #9 and #10 issues; still - the code needs more testing
parent 794513d3
Pipeline #3327 passed with stages
in 1 minute and 26 seconds
......@@ -330,6 +330,7 @@ class Domain(Enum):
dtk = u'czasowniki oznacz. kontakt fizyczny ' \
u'(dotykanie, uderzenie, rycie itp.)'
cwytw = u'czasowniki oznacz. wytwarzanie czegoś'
cwyt = u'czasowniki oznacz. wytwarzanie czegoś'
cczuj = u'czasowniki wyrażające uczucia'
ruch = u'czasowniki ruchu'
pst = u'czasowniki postrzegania (percepcji)'
......
......@@ -40,6 +40,7 @@ _POSES = {
_RELKINDS = {
u'relacja pomiędzy synsetami': en.RelationKind.synset,
u'relacja leksykalna': en.RelationKind.lexical,
u'relacja synonimii': en.RelationKind.lexical
}
_BOOLVALUES = {u'true': True, u'false': False}
......@@ -118,7 +119,17 @@ class WNXMLReader(object):
id_ = int(elem.get('id'))
var = int(elem.get('variant'))
pos = _POSES[elem.get('pos')]
dom = en.Domain(elem.get('domain'))
dom = elem.get('domain')
try:
dom = en.Domain(dom)
except ValueError:
try:
dom = getattr(en.Domain, dom)
except AttributeError:
raise ValueError(
"The domains found in the dump are incompatible with "
"current library version."
)
self._schema.take_lexical_unit(
id_,
......
......@@ -1454,8 +1454,8 @@ class _DBBuilder(object):
lu_node.id,
)
# Drop relations for this unit, if any
self._lexrels.pop(lu_node.id, None)
return
self._adhoc_lexrels.pop(lu_node.id, None)
continue
cur.executemany(
u"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment