Class: Google::Apis::LanguageV1beta2::DependencyEdge

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/language_v1beta2/classes.rb,
lib/google/apis/language_v1beta2/representations.rb,
lib/google/apis/language_v1beta2/representations.rb

Overview

Represents dependency parse tree information for a token.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ DependencyEdge

Returns a new instance of DependencyEdge.



681
682
683
# File 'lib/google/apis/language_v1beta2/classes.rb', line 681

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#head_token_indexFixnum

Represents the head of this token in the dependency tree. This is the index of the token which has an arc going to this token. The index is the position of the token in the array of tokens returned by the API method. If this token is a root token, then the head_token_index is its own index. Corresponds to the JSON property headTokenIndex

Returns:

  • (Fixnum)


674
675
676
# File 'lib/google/apis/language_v1beta2/classes.rb', line 674

def head_token_index
  @head_token_index
end

#labelString

The parse label for the token. Corresponds to the JSON property label

Returns:

  • (String)


679
680
681
# File 'lib/google/apis/language_v1beta2/classes.rb', line 679

def label
  @label
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



686
687
688
689
# File 'lib/google/apis/language_v1beta2/classes.rb', line 686

def update!(**args)
  @head_token_index = args[:head_token_index] if args.key?(:head_token_index)
  @label = args[:label] if args.key?(:label)
end