rst-workbench / rst-converter-service

Convert between different Rhetorical Structure Theory file formats (Python library / command-line tool / web service).
BSD 3-Clause "New" or "Revised" License
8 stars 4 forks source link

Can't handle rs3 files generated by isanlp_rst #5

Closed arne-cl closed 3 years ago

arne-cl commented 3 years ago

hate.rs3.txt

The isanlp_rst parser produces rs3 files that can be read by RSTTool, but it crashes rst-converter-service / discoursegraphs, as well as rstWeb (at least the version I integrated into rst-workbench).

arne@t470:~/repos/isanlp_rst/examples$ curl -XPOST localhost:5000/convert/rs3/tree.prettyprint -F input=@hate.rs
{"error":"<class 'discoursegraphs.readwrite.rst.rs3.rs3tree.RSTTree'> can't handle input file 'hate.rs3'. Got: 'satellite'","traceback":"Traceback (most recent call last):\n  File \"app.py\", line 112, in post\n    tree = read_function(temp_inputfile.name)\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line 57, in __init__\n    self.tree = self.dt()\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line
117, in dt\n    return self.root2tree(start_node=start_node)\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line 140, in root2tree\n    return self.dt(start_node=root_nodes[0])\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line 134, in dt\n    elem_id, elem, elem_type, start_node=start_node)\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line 240, in group2tree\n
  sat_id = children['satellite']\nKeyError: 'satellite'\n"}
arne@t470:~/repos/isanlp_rst/examples$ curl -XPOST localhost:5000/convert/rs3/dis -F input=@hate.rs3
{"error":"<class 'discoursegraphs.readwrite.rst.rs3.rs3tree.RSTTree'> can't handle input file 'hate.rs3'. Got: 'satellite'","traceback":"Traceback (most recent call last):\n  File \"app.py\", line 112, in post\n    tree = read_function(temp_inputfile.name)\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line 57, in __init__\n    self.tree = self.dt()\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line
117, in dt\n    return self.root2tree(start_node=start_node)\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line 140, in root2tree\n    return self.dt(start_node=root_nodes[0])\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line 134, in dt\n    elem_id, elem, elem_type, start_node=start_node)\n  File \"/opt/discoursegraphs/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py\", line 240, in group2tree\n
  sat_id = children['satellite']\nKeyError: 'satellite'\n"}

rsttool_hate

arne-cl commented 3 years ago

Closed upstream in arne-cl/discoursegraphs#163.