Open brady-ds opened 5 years ago
Thanks for the very thorough report! I'm afraid my answers to both are not great, since my knowledge of this code is quickly rotting. I'll have to leave this open and see if I can dig into it more later, but here's some information for the curious/brave:
For the first part, it looks like there's a memory error in my SWIG wrapper, unfortunately. I haven't been able to track it down, but you can likely get around it by unwrapping the list comprehension into a for-loop. A lightly tested (possible) fix) is to add a disown()
after the inputTreeFromString
in RerankingParser.py
:
input_tree_or_string = \
parser.inputTreeFromString(input_tree_or_string)
input_tree_or_string.this.disown() # <<< ADD THIS LINE
For the second part (parse.ptb_parse.head()
) -- agreed, this should totally work. Internally, there are different ways of constructing the underlying InputTree
objects and it seems like the one straight from the parser hasn't run the headfinder for some reason. When you reread them from a string, that activates head percolation. I'm guessing it only cares about the headfinder for training, which is where it loads from strings instead of constructing them on its own.
The three lines of code below reliably provoke a segfault for me:
(Apologies for the strange choice of text to parse; I had difficulty finding a text that would provoke a crash instead of a hang, at least on my machine.)
In case it is useful, a backtrace is given below:
Incidentally, is there a reason why just
is not supported?