lib/proiel/cli/converters/conll-u.rb
# Inverts the direction of a dependency relation. By default the
# labels are also swapped, but new relations can be specified
# for both the new dependent and the new head.
Inverts the direction of a dependency relation. By default the
labels are also swapped, but new relations can be specified
for both the new dependent and the new head.
Inverts the direction of a dependency relation . By default the labels are also swapped but new relations can be specified for both the new dependent and the new head .
def invert!(new_dependent_relation = nil, new_head_relation = nil)
        raise 'Cannot promote a token under root!' if @head_id == 0
        new_dependent_relation ||= @relation
        new_head_relation ||= head.relation
        new_head_id = head.head_id
        head.head_id = @id
        head.relation = new_dependent_relation
        @head_id = new_head_id
        self.relation = new_head_relation
      end
def invert! ( new_dependent_relation = nil , new_head_relation = nil ) raise 'Cannot promote a token under root!' if @head_id == 0 new_dependent_relation ||= @relation new_head_relation ||= head . relation new_head_id = head . head_id head . head_id = @id head . relation = new_dependent_relation @head_id = new_head_id self . relation = new_head_relation end
Inverts the direction of a dependency relation.
Inverts the direction of a dependency relation .
new_dependent_relation
new_head_relation