nschneid / activedop

A treebank annotation tool based on a statistical parser that is re-trained during annotation
GNU General Public License v2.0
3 stars 1 forks source link

ValueError upon selecting a subtree parse #111

Closed nschneid closed 5 days ago

nschneid commented 6 days ago
File ".../activedop/app.py", line 1061, in replacesubtree
    treeobj = ActivedopTree(ptree = ptree, senttok = treeobj.senttok,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../activedop/activedoptree.py", line 101, in __init__
    self.cgel_tree.update_terminals(cgel_tree_terminals, gaps=True, restore_old_cat=True, restore_old_func=True, restore_old_label=True)
  File ".../activedop/./cgel/cgel.py", line 508, in update_terminals
    for i,newterm in zip(offsets, newterminals, strict=True):
ValueError: zip() argument 2 is shorter than argument 1

This may be because I stripped punctuation that was causing parser problems from the input and added it manually in the CGEL format. If altering the tokenization/punctuation is forbidden, there should be an error message explaining this.

Steps to reproduce:

  1. Input the sentence The term motor vehicle means any vehicle which is manufactured primarily for use on public streets , roads , and highways -LRB- not including a vehicle operated exclusively on a rail or rails -RRB- and which has at least 4 wheels .
  2. In edit mode, input the contents of badtree.txt and click Validate.
  3. Right-click the Nom spanning “ motor vehicle ” to expand parse candidates.
  4. Select the first parse candidate.
nschneid commented 5 days ago

Confirmed fixed