public string GetResponse(string given)
    {
        string output = bot.getOutput(given);

        output = Regex.Replace(output, @"\.(?! |$)", ". ");
        output = Regex.Replace(output, @"\!(?! |$)", "! ");
        output = Regex.Replace(output, @"\?(?! |$)", "? ");
        return(output);
    }
 /// <summary>
 /// Button to send the question to the robot
 /// </summary>
 public void SendQuestionToRobot()
 {
     if (string.IsNullOrEmpty(inputField.text) == false)
     {
         // Response Bot AIML
         var answer = bot.getOutput(inputField.text);
         // Response BotAIml in the Chat window
         robotOutput.text = answer;
         //
         inputField.text = string.Empty;
     }
 }
예제 #3
0
    IEnumerator SendQuesToBot()
    {
        if (string.IsNullOrEmpty(InputBox.text) == false)
        {
            OutputBox.text = ("Typing.");
            yield return(new WaitForSeconds(0.3f));

            OutputBox.text = ("Typing..");
            yield return(new WaitForSeconds(0.6f));

            OutputBox.text = ("Typing...");
            yield return(new WaitForSeconds(0.9f));

            // Response Bot AIML
            var answer = bot.getOutput(InputBox.text);
            // Response BotAIml in the Chat window
            OutputBox.text = answer;
            //
            InputBox.text = string.Empty;
        }
    }
예제 #4
0
    /// <summary>
    /// Button to send the question to the robot
    /// </summary>
    public string SendQuestionToRobot(string userQuestion)
    {
        ChatbotMobileWeb bot1 = bot;

        if (!userQuestion.Equals(""))
        {
            // Response Bot AIML
            var x = bot1.getOutput(userQuestion);
            // Response BotAIml in the Chat window
            robotOutput.text = x;
            answer           = x;
            Debug.Log("Inside the sendquestionto robot function");
            // for empty the voice input
        }
        else
        {
            answer = "Sorry can you repete that again...";
        }

        Debug.Log("Answer of question:" + answer);

        return(answer);
    }
 public string getResponse(string text)
 {
     text = bot.getOutput(text);
     return(text);
 }