christianbuck / nlu

7 stars 1 forks source link

Quantities stored as numeric values in AMR #27

Closed nschneid closed 12 years ago

nschneid commented 12 years ago

This causes problems because items are checked against one another using identity, so if it sees the same quantity in two places it treats them as the same node. For instance, make_rooted_amr() will invert one of the edges going into the quantity.

nschneid commented 12 years ago

Solution: the Quant class as a wrapper. Quant(x)==Quant(x)==x, but Quant(x) is not Quant(x) and Quant(x) is not x. pipeline.ensure_quant() takes an iterable of tuples and ensures that any int or float on the RHS of a triple is wrapped.