Class: Google::Apis::LanguageV1beta1::Token

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

Overview

Represents the smallest syntactic building block of the text.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Token

Returns a new instance of Token



473
474
475
# File 'generated/google/apis/language_v1beta1/classes.rb', line 473

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

Instance Attribute Details

#dependency_edgeGoogle::Apis::LanguageV1beta1::DependencyEdge

Represents dependency parse tree information for a token. Corresponds to the JSON property dependencyEdge



461
462
463
# File 'generated/google/apis/language_v1beta1/classes.rb', line 461

def dependency_edge
  @dependency_edge
end

#lemmaString

Lemma of the token. Corresponds to the JSON property lemma

Returns:

  • (String)


466
467
468
# File 'generated/google/apis/language_v1beta1/classes.rb', line 466

def lemma
  @lemma
end

#part_of_speechGoogle::Apis::LanguageV1beta1::PartOfSpeech

Represents part of speech information for a token. Corresponds to the JSON property partOfSpeech



471
472
473
# File 'generated/google/apis/language_v1beta1/classes.rb', line 471

def part_of_speech
  @part_of_speech
end

#textGoogle::Apis::LanguageV1beta1::TextSpan

Represents an output piece of text. Corresponds to the JSON property text



456
457
458
# File 'generated/google/apis/language_v1beta1/classes.rb', line 456

def text
  @text
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



478
479
480
481
482
483
# File 'generated/google/apis/language_v1beta1/classes.rb', line 478

def update!(**args)
  @text = args[:text] if args.key?(:text)
  @dependency_edge = args[:dependency_edge] if args.key?(:dependency_edge)
  @lemma = args[:lemma] if args.key?(:lemma)
  @part_of_speech = args[:part_of_speech] if args.key?(:part_of_speech)
end