Skip to content

Instantly share code, notes, and snippets.

@getadeo
Forked from radralph/test.rb
Last active August 17, 2018 06:18
Show Gist options
  • Select an option

  • Save getadeo/9dd24b33c39935d5307d4a1aada41285 to your computer and use it in GitHub Desktop.

Select an option

Save getadeo/9dd24b33c39935d5307d4a1aada41285 to your computer and use it in GitHub Desktop.

Revisions

  1. Genesis Tadeo revised this gist Aug 17, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion speech-recognition-a2p.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    call "9263262904", {:callerID => 'sip:21588260@sip.tropo.net'}
    call "9263262904", {:callerID => 'sip:21588734@sip.tropo.net'}
    ask "Who would you like to call? Just say Joe or John", {
    :choices => "Joe, John",
    :mode => "speech",
  2. Genesis Tadeo revised this gist Aug 17, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion speech-recognition-a2p.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    call "9273953465", {:callerID => 'sip:[email protected]'}
    call "9263262904", {:callerID => 'sip:[email protected]'}
    ask "Who would you like to call? Just say Joe or John", {
    :choices => "Joe, John",
    :mode => "speech",
  3. Genesis Tadeo revised this gist May 16, 2018. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions speech-recognition-a2p.rb
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    #call "9273953465", {:callerID => 'sip:[email protected]'}
    call "9273953465"
    call "9273953465", {:callerID => 'sip:[email protected]'}
    ask "Who would you like to call? Just say Joe or John", {
    :choices => "Joe, John",
    :mode => "speech",
  4. Genesis Tadeo revised this gist May 16, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion speech-recognition-a2p.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    call "9273953465", {:callerID => 'sip:[email protected]'}
    #call "9273953465", {:callerID => 'sip:[email protected]'}
    call "9273953465"
    ask "Who would you like to call? Just say Joe or John", {
    :choices => "Joe, John",
    :mode => "speech",
  5. Genesis Tadeo renamed this gist May 16, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. Genesis Tadeo renamed this gist May 16, 2018. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions test.rb → test-a2p.rb
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    ask "Who would you like to call? Just say Joe or Jane", {
    :choices => "Joe, Jane",
    call "9273953465", {:callerID => 'sip:[email protected]'}
    ask "Who would you like to call? Just say Joe or John", {
    :choices => "Joe, John",
    :mode => "speech",
    :recognizer => "en-PH",
    :minConfidence => 0.6,
  7. @radralph radralph revised this gist May 19, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ask "Who would you like to call? Just say John or Jane", {
    ask "Who would you like to call? Just say Joe or Jane", {
    :choices => "Joe, Jane",
    :mode => "speech",
    :recognizer => "en-PH",
  8. @radralph radralph revised this gist May 19, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test.rb
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    ask "Who would you like to call? Just say John or Jane", {
    :choices => "john, jane",
    :choices => "Joe, Jane",
    :mode => "speech",
    :recognizer => "en-PH",
    :minConfidence => 0.6,
  9. @radralph radralph revised this gist May 19, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion test.rb
    Original file line number Diff line number Diff line change
    @@ -7,4 +7,5 @@
    :onBadChoice => lambda { |event| say "I'm sorry, I didn't understand what you said."},
    :onTimeout => lambda { |event| say "I'm sorry, I didn't hear anything"},
    :onHangup => lambda { |event| log "Caller disconnected"}
    }
    }
    hangup
  10. @radralph radralph revised this gist May 19, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions test.rb
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@
    :choices => "john, jane",
    :mode => "speech",
    :recognizer => "en-PH",
    :minConfidence => 0.6,
    :onChoice => lambda { |event| say "You said" + event.value},
    :onBadChoice => lambda { |event| say "I'm sorry, I didn't understand what you said."},
    :onTimeout => lambda { |event| say "I'm sorry, I didn't hear anything"},
  11. @radralph radralph revised this gist May 19, 2017. 2 changed files with 9 additions and 12 deletions.
    12 changes: 0 additions & 12 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    var result = ask("Who would you like to call? Just say John or Jane", {
    choices:"john, jane",
    attempts:3,
    timeout:7,
    mode: "speech",
    recognizer: "en-PH",
    onChoice: function(event) { say("You said" + event.choice);},
    onBadChoice: function(event) { say("I'm sorry, I didn't understand what you said.");},
    onError:function(event) { log("There was an error");},
    onHangup:function(event) { log("The user hungup");},
    onTimeout:function(event) { say("I'm sorry, I didn't hear anything.");}
    });
    9 changes: 9 additions & 0 deletions test.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    ask "Who would you like to call? Just say John or Jane", {
    :choices => "john, jane",
    :mode => "speech",
    :recognizer => "en-PH",
    :onChoice => lambda { |event| say "You said" + event.value},
    :onBadChoice => lambda { |event| say "I'm sorry, I didn't understand what you said."},
    :onTimeout => lambda { |event| say "I'm sorry, I didn't hear anything"},
    :onHangup => lambda { |event| log "Caller disconnected"}
    }
  12. @radralph radralph revised this gist May 19, 2017. 2 changed files with 12 additions and 11 deletions.
    12 changes: 12 additions & 0 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    var result = ask("Who would you like to call? Just say John or Jane", {
    choices:"john, jane",
    attempts:3,
    timeout:7,
    mode: "speech",
    recognizer: "en-PH",
    onChoice: function(event) { say("You said" + event.choice);},
    onBadChoice: function(event) { say("I'm sorry, I didn't understand what you said.");},
    onError:function(event) { log("There was an error");},
    onHangup:function(event) { log("The user hungup");},
    onTimeout:function(event) { say("I'm sorry, I didn't hear anything.");}
    });
    11 changes: 0 additions & 11 deletions test.php
    Original file line number Diff line number Diff line change
    @@ -1,11 +0,0 @@
    <?php

    $result = ask("What's your favorite color? Choose from red, blue or green.", array(
    "choices" => "red, blue, green",
    "attempts" => 3,
    "recognizer" => "en-PH",
    "mode" => "speech"
    ));
    say("You chose" . $result->value);

    ?>
  13. @radralph radralph revised this gist May 19, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion test.php
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    $result = ask("What's your favorite color? Choose from red, blue or green.", array(
    "choices" => "red, blue, green",
    "attempts" => 3,
    "recognizer" => "en-PH"
    "recognizer" => "en-PH",
    "mode" => "speech"
    ));
    say("You chose" . $result->value);
  14. @radralph radralph revised this gist May 19, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion test.php
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,9 @@

    $result = ask("What's your favorite color? Choose from red, blue or green.", array(
    "choices" => "red, blue, green",
    "attempts" => 3
    "attempts" => 3,
    "recognizer" => "en-PH"
    "mode" => "speech"
    ));
    say("You chose" . $result->value);

  15. @radralph radralph revised this gist May 18, 2017. 2 changed files with 9 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +0,0 @@
    var result = ask("What's your favorite color? Choose from red, blue or green.", {
    choices: "red, blue, green",
    attempts: 3
    });
    9 changes: 9 additions & 0 deletions test.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <?php

    $result = ask("What's your favorite color? Choose from red, blue or green.", array(
    "choices" => "red, blue, green",
    "attempts" => 3
    ));
    say("You chose" . $result->value);

    ?>
  16. @radralph radralph revised this gist May 18, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    var result = ask("What's your favorite color? Choose from red, blue or green.", {
    choices:"red, blue, green"
    });
    say("You said " + result.value);
    choices: "red, blue, green",
    attempts: 3
    });
  17. @radralph radralph revised this gist May 18, 2017. 1 changed file with 4 additions and 20 deletions.
    24 changes: 4 additions & 20 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -1,20 +1,4 @@
    var event = ask("Who would you like to call? Just say John or Jane", {
    attempts:3,
    timeout:7,
    choices:"john, jane",
    onChoice:function(event) {
    say("You said" + event.choice);
    },
    onBadChoice: function(event) {
    say("I'm sorry, I didn't understand what you said.");
    },
    onError:function(event) {
    log("There was an error");
    },
    onHangup:function(event) {
    log("The user hungup");
    },
    onTimeout:function(event) {
    say("I'm sorry, I didn't hear anything.");
    }
    });
    var result = ask("What's your favorite color? Choose from red, blue or green.", {
    choices:"red, blue, green"
    });
    say("You said " + result.value);
  18. @radralph radralph revised this gist May 18, 2017. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,4 @@
    answer();
    event=ask("Who would you like to call? Just say John or Jane", {
    var event = ask("Who would you like to call? Just say John or Jane", {
    attempts:3,
    timeout:7,
    choices:"john, jane",
  19. @radralph radralph created this gist May 18, 2017.
    21 changes: 21 additions & 0 deletions test.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    answer();
    event=ask("Who would you like to call? Just say John or Jane", {
    attempts:3,
    timeout:7,
    choices:"john, jane",
    onChoice:function(event) {
    say("You said" + event.choice);
    },
    onBadChoice: function(event) {
    say("I'm sorry, I didn't understand what you said.");
    },
    onError:function(event) {
    log("There was an error");
    },
    onHangup:function(event) {
    log("The user hungup");
    },
    onTimeout:function(event) {
    say("I'm sorry, I didn't hear anything.");
    }
    });