lib/proiel/cli/converters/conll-u.rb
def process_subjunction!
        # ignore if the subjunction has no dependents or only conj dependents.
        # NB: this requires that the function is called *after* processing conjunctions
        return if dependents.reject { |d| ['conj', 'cc'].include? d.relation }.empty?
        pred = dependents.select { |d| d.relation == 'pred' }
        raise "#{pred.size} PREDs under the subjunction #{to_n}:\n#{@sentence.to_graph}" unless pred.one?
        pred = pred.first
        # promote the subjunction if the verb is empty
        if pred.is_empty?
        pred.dependents.each { |d| d.head_id = id }
        @sentence.remove_token! pred
        # else demote the subjunction
        else
          pred.invert!('mark')
        end
      end
# attach subjunctions with 'mark' under their verbs and promote
# the verb to take over the subjunction's relation. If the verb
# is empty, the subjunction stays as head.
attach subjunctions with 'mark' under their verbs and promote
the verb to take over the subjunction's relation. If the verb
is empty, the subjunction stays as head.
attach subjunctions with ' mark ' under their verbs and promote the verb to take over the subjunction ' s relation . If the verb is empty the subjunction stays as head .
def process_subjunction!
        return if dependents.reject { |d| ['conj', 'cc'].include? d.relation }.empty?
        pred = dependents.select { |d| d.relation == 'pred' }
        raise "#{pred.size} PREDs under the subjunction #{to_n}:\n#{@sentence.to_graph}" unless pred.one?
        pred = pred.first
        if pred.is_empty?
        pred.dependents.each { |d| d.head_id = id }
        @sentence.remove_token! pred
        else
          pred.invert!('mark')
        end
      end
def process_subjunction! return if dependents . reject { | d | [ 'conj' , 'cc' ] . include? d . relation } . empty? pred = dependents . select { | d | d . relation == 'pred' } raise "#{pred.size} PREDs under the subjunction #{to_n}:\n#{@sentence.to_graph}" unless pred . one? pred = pred . first if pred . is_empty? pred . dependents . each { | d | d . head_id = id } @sentence . remove_token! pred else pred . invert! ( 'mark' ) end end
attach subjunctions with 'mark' under their verbs and promote
the verb to take over the subjunction's relation.
attach subjunctions with ' mark ' under their verbs and promote the verb to take over the subjunction ' s relation .
# ignore if the subjunction has no dependents or only conj dependents. # NB: this requires that the function is called *after* processing conjunctions # promote the subjunction if the verb is empty # else demote the subjunction