Class: AWSCDK::Lex::CfnBot::CustomVocabularyItemProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
lex/cfn_bot.rb

Overview

Specifies an entry in a custom vocabulary.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(phrase:, display_as: nil, weight: nil) ⇒ CustomVocabularyItemProperty

Returns a new instance of CustomVocabularyItemProperty.

Parameters:

  • phrase (String)

    Specifies 1 - 4 words that should be recognized.

  • display_as (String, nil) (defaults to: nil)

    The DisplayAs value for the custom vocabulary item from the custom vocabulary list.

  • weight (Numeric, nil) (defaults to: nil)

    Specifies the degree to which the phrase recognition is boosted.



1955
1956
1957
1958
1959
1960
1961
1962
# File 'lex/cfn_bot.rb', line 1955

def initialize(phrase:, display_as: nil, weight: nil)
  @phrase = phrase
  Jsii::Type.check_type(@phrase, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "phrase")
  @display_as = display_as
  Jsii::Type.check_type(@display_as, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "displayAs") unless @display_as.nil?
  @weight = weight
  Jsii::Type.check_type(@weight, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "weight") unless @weight.nil?
end

Instance Attribute Details

#display_asString? (readonly)

The DisplayAs value for the custom vocabulary item from the custom vocabulary list.



1973
1974
1975
# File 'lex/cfn_bot.rb', line 1973

def display_as
  @display_as
end

#phraseString (readonly)

Specifies 1 - 4 words that should be recognized.



1968
1969
1970
# File 'lex/cfn_bot.rb', line 1968

def phrase
  @phrase
end

#weightNumeric? (readonly)

Specifies the degree to which the phrase recognition is boosted.

The default value is 1.



1980
1981
1982
# File 'lex/cfn_bot.rb', line 1980

def weight
  @weight
end

Class Method Details

.jsii_propertiesObject



1982
1983
1984
1985
1986
1987
1988
# File 'lex/cfn_bot.rb', line 1982

def self.jsii_properties
  {
    :phrase => "phrase",
    :display_as => "displayAs",
    :weight => "weight",
  }
end

Instance Method Details

#to_jsiiObject



1990
1991
1992
1993
1994
1995
1996
1997
1998
# File 'lex/cfn_bot.rb', line 1990

def to_jsii
  result = {}
  result.merge!({
    "phrase" => @phrase,
    "displayAs" => @display_as,
    "weight" => @weight,
  })
  result.compact
end