Skip to content

Instantly share code, notes, and snippets.

@getadeo
Forked from radralph/colors.rb
Last active May 16, 2018 01:52
Show Gist options
  • Save getadeo/4e29b8fd5e1ec7c36d23a067d4e65e67 to your computer and use it in GitHub Desktop.
Save getadeo/4e29b8fd5e1ec7c36d23a067d4e65e67 to your computer and use it in GitHub Desktop.

Revisions

  1. Genesis Tadeo renamed this gist May 16, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @radralph radralph revised this gist Apr 26, 2017. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions colors.rb
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,12 @@
    wait(1500)
    say "Starting to test ASR..."
    result = ask "Please choose a color from Red, Blue or Green.", {
    :choices => "Red, Blue, Green",
    result = ask "Please choose a color from red, blue or green.", {
    :choices => "red, blue, green",
    :recognizer => "en-PH",
    :timeout => 20,
    :bargein => true,
    :mode => "speech",
    :minConfidence => 0.6,
    :onChoice => lambda { |event|
    say "On Choice"
    },
    @@ -16,12 +17,12 @@
    say "we didn't receive your input"
    }
    }
    if result.value.eql? "Red"
    say "you chose Red"
    elsif result.value.eql? "Blue"
    say "you chose Blue"
    elsif result.value.eql? "Green"
    say "you chose Green"
    if result.value.eql? "red"
    say "you chose red"
    elsif result.value.eql? "blue"
    say "you chose blue"
    elsif result.value.eql? "green"
    say "you chose green"
    else
    say "ASR not working"
    end
  3. @radralph radralph renamed this gist Apr 26, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. @radralph radralph created this gist Mar 29, 2017.
    29 changes: 29 additions & 0 deletions color.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    wait(1500)
    say "Starting to test ASR..."
    result = ask "Please choose a color from Red, Blue or Green.", {
    :choices => "Red, Blue, Green",
    :recognizer => "en-PH",
    :timeout => 20,
    :bargein => true,
    :mode => "speech",
    :onChoice => lambda { |event|
    say "On Choice"
    },
    :onBadChoice => lambda { |event|
    say "On Bad Choice"
    },
    :onTimeout => lambda { |event|
    say "we didn't receive your input"
    }
    }
    if result.value.eql? "Red"
    say "you chose Red"
    elsif result.value.eql? "Blue"
    say "you chose Blue"
    elsif result.value.eql? "Green"
    say "you chose Green"
    else
    say "ASR not working"
    end
    say "goodbye"
    hangup