grafeno.transformers.genitive module

class grafeno.transformers.genitive.Transformer(attach_genitive=False, add_genitive_class=True, **kwds)

Bases: grafeno.transformers.__utils.Transformer

Processes genitive relations. Does two main things:

1. Turns saxon genitive ('s) into the preposition of with the correct dependencencies. This means that it must appear before preposition processing nodes in the transformer chain. 2. If enabled, collapses of edges, adding the information to the parent node.

Parameters:

attach_genitive : bool

If True, the concept is attached to the parent concept. For example, john's father turns into a single node father_of_john, instead of a father node with an of edge to a john node.

add_genitive_class : bool

If both attach_genitive and add_genitive_class are True, a HYP edge is added with the original dependent concept.

Methods

transform_dep(dep, parent, child)
transform_node(ms)