Giter VIP home page Giter VIP logo

Comments (4)

proycon avatar proycon commented on June 2, 2024

Isn't the last statement always a neat warning/error already? It should be

from folia.

kosloot avatar kosloot commented on June 2, 2024

Well, your mileage me vary of course, but I think this is messy (especially the cascade op exceptions):

VALIDATION ERROR on full parse by library (stage 2/2), in zonderPart.mini.xml
ParseError: FoLiA exception in handling of <list> @ line 79: [InconsistentText] Text for ListItem, ID TEI.1.text.1.body.1.div1.1.p.3.list.1.item.1, class default, is inconsistent: expected (after normalization): '1.', got (after normalization): 'La reformation de l'instruction du Conseil, qui peut cependant agir selon qu'il est instruict.'
-- Full traceback follows -->
Traceback (most recent call last):
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 2586, in parsexml
    e = doc.parsexml(subnode, Class)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 7273, in parsexml
    return Class.parsexml(node,self)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 2664, in parsexml
    instance = Class(doc, *args, **kwargs)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 3158, in __init__
    super(AbstractStructureElement,self).__init__(doc, *args, **kwargs)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 686, in __init__
    self.append(child)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 3169, in append
    e = super(AbstractStructureElement,self).append(child, *args, **kwargs)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 1590, in append
    if dopostappend: child.postappend()
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 3177, in postappend
    self.doc.textvalidationerrors += int(not self.textvalidation())
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 858, in textvalidation
    raise InconsistentText(msg)
pynlpl.formats.folia.InconsistentText: Text for ListItem, ID TEI.1.text.1.body.1.div1.1.p.3.list.1.item.1, class default, is inconsistent: expected (after normalization): '1.', got (after normalization): 'La reformation de l'instruction du Conseil, qui peut cependant agir selon qu'il est instruict.'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/FoLiA_tools-1.5.1.59-py3.4.egg/foliatools/foliavalidator.py", line 55, in validate
    document = folia.Document(file=filename, deepvalidation=deep,textvalidation=True,verbose=True, debug=debug)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 6398, in __init__
    self.load(self.filename)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 6435, in load
    self.parsexml(self.tree.getroot())
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 7265, in parsexml
    e = self.parsexml(subnode)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 7273, in parsexml
    return Class.parsexml(node,self)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 2586, in parsexml
    e = doc.parsexml(subnode, Class)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 7273, in parsexml
    return Class.parsexml(node,self)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 2586, in parsexml
    e = doc.parsexml(subnode, Class)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 7273, in parsexml
    return Class.parsexml(node,self)
  File "/home/does/lamachine/lamachine/lib/python3.4/site-packages/PyNLPl-1.2.5-py3.4.egg/pynlpl/formats/folia.py", line 2591, in parsexml
    raise ParseError("FoLiA exception in handling of <" + subnode.tag[len(NSFOLIA)+2:] + "> @ line " + str(subnode.sourceline) + ": [" + e.__class__.__name__ + "] " + str(e), cause=e)
pynlpl.formats.folia.ParseError: FoLiA exception in handling of <list> @ line 79: [InconsistentText] Text for ListItem, ID TEI.1.text.1.body.1.div1.1.p.3.list.1.item.1, class default, is inconsistent: expected (after normalization): '1.', got (after normalization): 'La reformation de l'instruction du Conseil, qui peut cependant agir selon qu'il est instruict.'

from folia.

proycon avatar proycon commented on June 2, 2024

Ok, there might be some room for improvement, perhaps I should make full tracebacks optional.

from folia.

proycon avatar proycon commented on June 2, 2024

Finally implemented in new validator for FoLiA v2

from folia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.