Class: Google::Apis::TranslateV3::Example

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

Overview

A sentence pair.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Example

Returns a new instance of Example.



585
586
587
# File 'lib/google/apis/translate_v3/classes.rb', line 585

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

Instance Attribute Details

#nameString

Output only. The resource name of the example, in form of projects/project- number-or-id/locations/location_id/datasets/dataset_id/examples/ example_id' Corresponds to the JSON propertyname`

Returns:

  • (String)


568
569
570
# File 'lib/google/apis/translate_v3/classes.rb', line 568

def name
  @name
end

#source_textString

Sentence in source language. Corresponds to the JSON property sourceText

Returns:

  • (String)


573
574
575
# File 'lib/google/apis/translate_v3/classes.rb', line 573

def source_text
  @source_text
end

#target_textString

Sentence in target language. Corresponds to the JSON property targetText

Returns:

  • (String)


578
579
580
# File 'lib/google/apis/translate_v3/classes.rb', line 578

def target_text
  @target_text
end

#usageString

Output only. Usage of the sentence pair. Options are TRAIN|VALIDATION|TEST. Corresponds to the JSON property usage

Returns:

  • (String)


583
584
585
# File 'lib/google/apis/translate_v3/classes.rb', line 583

def usage
  @usage
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



590
591
592
593
594
595
# File 'lib/google/apis/translate_v3/classes.rb', line 590

def update!(**args)
  @name = args[:name] if args.key?(:name)
  @source_text = args[:source_text] if args.key?(:source_text)
  @target_text = args[:target_text] if args.key?(:target_text)
  @usage = args[:usage] if args.key?(:usage)
end