Speech Recognizer in App inventor doesnt work to strings












0















I created a basic app (to practice).



So, i created one with this one:



Test App
enter image description here



So, when the button "habla" it's clicked the recognizer starts. After that i do a condition that compares the text obtained in the recognizer with the word "day". And if the word is same the player1 starts.



Now, i change the word "day" to "day tripper" and doesn't works. So how i can do to the recognizer detects string or more than 1 word?










share|improve this question

























  • you might want to display the recognized text in a label to find out, what's going on...

    – Taifun
    Dec 2 '18 at 16:31
















0















I created a basic app (to practice).



So, i created one with this one:



Test App
enter image description here



So, when the button "habla" it's clicked the recognizer starts. After that i do a condition that compares the text obtained in the recognizer with the word "day". And if the word is same the player1 starts.



Now, i change the word "day" to "day tripper" and doesn't works. So how i can do to the recognizer detects string or more than 1 word?










share|improve this question

























  • you might want to display the recognized text in a label to find out, what's going on...

    – Taifun
    Dec 2 '18 at 16:31














0












0








0








I created a basic app (to practice).



So, i created one with this one:



Test App
enter image description here



So, when the button "habla" it's clicked the recognizer starts. After that i do a condition that compares the text obtained in the recognizer with the word "day". And if the word is same the player1 starts.



Now, i change the word "day" to "day tripper" and doesn't works. So how i can do to the recognizer detects string or more than 1 word?










share|improve this question
















I created a basic app (to practice).



So, i created one with this one:



Test App
enter image description here



So, when the button "habla" it's clicked the recognizer starts. After that i do a condition that compares the text obtained in the recognizer with the word "day". And if the word is same the player1 starts.



Now, i change the word "day" to "day tripper" and doesn't works. So how i can do to the recognizer detects string or more than 1 word?







button speech-recognition app-inventor






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 3 at 5:52









2Code

106




106










asked Nov 30 '18 at 21:17









paulpaul

1




1













  • you might want to display the recognized text in a label to find out, what's going on...

    – Taifun
    Dec 2 '18 at 16:31



















  • you might want to display the recognized text in a label to find out, what's going on...

    – Taifun
    Dec 2 '18 at 16:31

















you might want to display the recognized text in a label to find out, what's going on...

– Taifun
Dec 2 '18 at 16:31





you might want to display the recognized text in a label to find out, what's going on...

– Taifun
Dec 2 '18 at 16:31












1 Answer
1






active

oldest

votes


















0














The number one skill involved in debugging is problem finding, and the problem you have stated for this is




I change the word "day" to "day tripper" and it doesn't work.




What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".



One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.



Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53565034%2fspeech-recognizer-in-app-inventor-doesnt-work-to-strings%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The number one skill involved in debugging is problem finding, and the problem you have stated for this is




    I change the word "day" to "day tripper" and it doesn't work.




    What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".



    One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.



    Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.






    share|improve this answer




























      0














      The number one skill involved in debugging is problem finding, and the problem you have stated for this is




      I change the word "day" to "day tripper" and it doesn't work.




      What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".



      One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.



      Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.






      share|improve this answer


























        0












        0








        0







        The number one skill involved in debugging is problem finding, and the problem you have stated for this is




        I change the word "day" to "day tripper" and it doesn't work.




        What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".



        One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.



        Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.






        share|improve this answer













        The number one skill involved in debugging is problem finding, and the problem you have stated for this is




        I change the word "day" to "day tripper" and it doesn't work.




        What you need to do, then, is change the logic flow from if mus.result = "day" to if mus.result includes "day".



        One way to make this happen would be to initialize a new variable (name doesn't matter) as an empty list. Then, inside of the mus.AfterGettingText control block, set the variable to split at spaces mus.result. Split at spaces is a text function that creates a list of the words in a string.



        Then, all you need to do is check each element in the list to see if it is the word "day". This way, the input can be any sentence with the word "day" and player1 would still start.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 3 at 3:28









        2Code2Code

        106




        106
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53565034%2fspeech-recognizer-in-app-inventor-doesnt-work-to-strings%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas