Class: Google::Apis::CommentanalyzerV1alpha1::SpanScore

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

Overview

This is a single score for a given span of text.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Google::Apis::Core::JsonObjectSupport

#to_json

Methods included from Google::Apis::Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ SpanScore

Returns a new instance of SpanScore.



330
331
332
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 330

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

Instance Attribute Details

#beginFixnum

"begin" and "end" describe the span of the original text that the attribute score applies to. The values are the UTF-16 codepoint range. "end" is exclusive. For example, with the text "Hi there", the begin/end pair (0,2) describes the text "Hi". If "begin" and "end" are unset, the score applies to the full text. Corresponds to the JSON property begin

Returns:

  • (Fixnum)


318
319
320
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 318

def begin
  @begin
end

#endFixnum

Corresponds to the JSON property end

Returns:

  • (Fixnum)


323
324
325
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 323

def end
  @end
end

#scoreGoogle::Apis::CommentanalyzerV1alpha1::Score

Analysis scores are described by a value and a ScoreType. Corresponds to the JSON property score



328
329
330
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 328

def score
  @score
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



335
336
337
338
339
# File 'generated/google/apis/commentanalyzer_v1alpha1/classes.rb', line 335

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