Class: Google::Apis::LanguageV1beta2::Token
- Inherits:
-
Object
- Object
- Google::Apis::LanguageV1beta2::Token
- 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 the smallest syntactic building block of the text.
Instance Attribute Summary collapse
-
#dependency_edge ⇒ Google::Apis::LanguageV1beta2::DependencyEdge
Represents dependency parse tree information for a token.
-
#lemma ⇒ String
Lemma of the token.
-
#part_of_speech ⇒ Google::Apis::LanguageV1beta2::PartOfSpeech
Represents part of speech information for a token.
-
#text ⇒ Google::Apis::LanguageV1beta2::TextSpan
Represents a text span in the input document.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Token
constructor
A new instance of Token.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Token
Returns a new instance of Token.
1262 1263 1264 |
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1262 def initialize(**args) update!(**args) end |
Instance Attribute Details
#dependency_edge ⇒ Google::Apis::LanguageV1beta2::DependencyEdge
Represents dependency parse tree information for a token.
Corresponds to the JSON property dependencyEdge
1245 1246 1247 |
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1245 def dependency_edge @dependency_edge end |
#lemma ⇒ String
Lemma of the token.
Corresponds to the JSON property lemma
1250 1251 1252 |
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1250 def lemma @lemma end |
#part_of_speech ⇒ Google::Apis::LanguageV1beta2::PartOfSpeech
Represents part of speech information for a token.
Corresponds to the JSON property partOfSpeech
1255 1256 1257 |
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1255 def part_of_speech @part_of_speech end |
#text ⇒ Google::Apis::LanguageV1beta2::TextSpan
Represents a text span in the input document.
Corresponds to the JSON property text
1260 1261 1262 |
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1260 def text @text end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1267 1268 1269 1270 1271 1272 |
# File 'lib/google/apis/language_v1beta2/classes.rb', line 1267 def update!(**args) @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) @text = args[:text] if args.key?(:text) end |