awaisathar/dependensee

some minor bugs

Closed this issue · 2 comments

This is a parsed tree (produced by stanford parser) that DependenSee failed to produce a picture:

advmod(blocked-9, Moreover-1)
amod(activity-7, simian-3)
nn(activity-7, virus-4)
num(activity-7, 40-5)
nn(activity-7, enhancer-6)
nsubjpass(blocked-9, activity-7)
nsubjpass(blocked-9', activity-7)
auxpass(blocked-9, was-8)
root(ROOT-0, blocked-9)
conj_negcc(blocked-9, blocked-9')
det(fragment-13, the-11)
amod(fragment-13, MnlI-AluI-12)
agent(blocked-9, fragment-13)
nn(cells-16, HeLa-15)
prep_in(fragment-13, cells-16)
nn(cells-21, B-20)
prep_in(blocked-9', cells-21)

This is the error message:

Exception in thread "main" java.lang.NumberFormatException: For input string: "9'"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:492)
    at java.lang.Integer.parseInt(Integer.java:527)
    at com.chaoticity.dependensee.Node.<init>(Node.java:47)
    at com.chaoticity.dependensee.Graph.addNode(Graph.java:65)
    at com.chaoticity.dependensee.Main.writeFromTextFile(Main.java:376)
    at com.chaoticity.dependensee.Main.main(Main.java:57)

I think it's the extra dash in the node 9'. I though node ids were always numbers.

You mean the apostrophe? Yes, it's the problem. DependenSee can produce an image after removing all the apostrophes.

I find it hard to interpret the apostrophe here, so I checked the manual and found this:

Introduction of copy nodes marked with an apostrophe. A copy node will be introduced in the case of PP conjunction as in “Bill went over the river and through the woods”. In this example, the two prepositions “over” and “through” are conjoined and governed by the verb “went”. To avoid disjoint subgraphs when collapsing the relations (preposition and conjunction), sentences like this are transformed into VP coordination, which requires making a copy of the word “went”. A copy node will be marked with one or more apostrophes in the plain text output or by a copy attribute in the XML output. This gives the following representation, which corresponds to a sentence like “Bill went over the river and went through the woods”:

prep over(went-2, river-5)
prep through(went-2’, woods-10)
conj and(went-2, went-2’)