Skip to content

Recrossing failure

Recrossing fails on the following input tree:

(SENTENCE (CLAUSE (CORE (NP (PRO Il)) (ADVP (PRO-CLT y)) (NUC (V avait)) (ADVP-PERI (CORE_ADV (NUC_ADV (ADV toujours)))) (NP (OP-DEF de) (CORE_N (NUC_N (N nouvelles) (AP-PERI (CORE_A (NUC_A (A dupes)))) (CLAUSE-PERI (PrCS (NP-REL (PRO-REL qui))) (CORE (NUC (V attendaient)) (PP (P d') (NP (CORE_N (NUC_N (OP-DEF être))))) (ADVP-PERI (CORE_ADV (NUC_ADV (ADV séduites)))) (PP-PERI (CORE_P (NUC_P (P par)) (NP (PRO lui) (. .))))))))))))

To reproduce the issue, run:

twg-extraction$ python3 backtransformation/backtransformation.py bug.bracket out.discbracket bracket

where bug.bracket is the file with the problematic tree given above.

The output I obtain with this command (using the currently latest version 1daf2ede) is:

Please specify whether your input file is in Bracket or Negra format, e.g. 
 python3 backtransformation/backtransformation.py example.export example_decrossed.export negra
<class 'discodop.treebank.BracketCorpusReader'>
(SENTENCE (CLAUSE (CORE (NP (PRO 0)) (ADVP (PRO-CLT 1)) (NUC (V 2)) (NP (OP-DEF 4) (CORE_N (NUC_N (N 5) (AP-PERI (CORE_A (NUC_A (A 6)))) (CLAUSE-PERI (PrCS (NP-REL (PRO-REL 7))) (CORE (NUC (V 8)) (PP (P 9) (NP (CORE_N (NUC_N )) (OP-DEF 10))) (PP-PERI (CORE_P (NUC_P (P 12)) (NP (PRO 13) (. 14)))) (ADVP-PERI (CORE_ADV (NUC_ADV (ADV 11))))))))) (ADVP-PERI (CORE_ADV (NUC_ADV (ADV 3)))))))
Converted tree:
Traceback (most recent call last):
  File "backtransformation/backtransformation.py", line 592, in <module>
    raise e
  File "backtransformation/backtransformation.py", line 586, in <module>
    print(DrawTree(newtree, origsent).text())
  File "/home/kuba/.local/lib/python3.8/site-packages/disco_dop-0.6a0-py3.8-linux-x86_64.egg/discodop/tree.py", line 1080, in __init__
    self.nodes, self.coords, self.edges, self.labels = self.nodecoords(
  File "/home/kuba/.local/lib/python3.8/site-packages/disco_dop-0.6a0-py3.8-linux-x86_64.egg/discodop/tree.py", line 1187, in nodecoords
    raise ValueError(
ValueError: Non-terminals must dominate one or more leaves