Beispiel #1
0
def test_recombyte_q6():
    assert rb.recombyte_q(
        "Wnna open a file",
        query_list,
        words_dict,
        tot_words_dict,
        take_best=True,
    )[0][0] == "Search File"
Beispiel #2
0
def test_recombyte_q4():
    assert rb.recombyte_q(
        "ply msc",
        query_list,
        words_dict,
        tot_words_dict,
        take_best=True,
    )[0][0] == "Play music"
Beispiel #3
0
def test_recombyte_q1():
    assert rb.recombyte_q(
        "Hey badman, don go upa n dan jass open mozillla firefoxy",
        query_list,
        words_dict,
        tot_words_dict,
        take_best=True,
    )[0][0] == "Open Mozila firefox"
Beispiel #4
0
def test_recombyte_q7():
    assert len(
        rb.recombyte_q(
            "No ha ha ha ha ha",
            query_list,
            words_dict,
            tot_words_dict,
            take_best=True,
        )) == 0
Beispiel #5
0
def test_recombyte_q5():
    assert rb.recombyte_q("I want to Search online",
                          query_list,
                          words_dict,
                          tot_words_dict,
                          take_best=False,
                          t1=0.7,
                          t2=0.69,
                          t4=0)[0][0] == "Search Online"
Beispiel #6
0
def test_recombyte_q3():
    assert len(
        rb.recombyte_q(
            "Nothing to say",
            query_list,
            words_dict,
            tot_words_dict,
            take_best=False,  # Change Naman
            t1=1.0,
            t4=1.0,
        )) == 0
if rm or not os.path.exists(rb.DATA_STORAGE_FILENAME):
    # os.remove("F:\\temp\Grp-28-Intelligent_Systems_of_Voice_Recognition\Project\ISVR\data_storage.p")
    rb.save_data(query_list)

query_list, total_words, words_dict, tot_words_dict = rb.load_data()
command = None
while True:

    command = va.ask().lower()
    if command == "":
        continue
    if "search" in command and "online" in command:
        webbrowser.open("https://www.google.com/search?q=" +
                        command.split("online")[1])
        continue
    if ("stop" in command and "stopwatch"
            not in command) or "shut down" in command or "shutdown" in command:
        break
    answer = rb.recombyte_q(command,
                            query_list,
                            words_dict,
                            tot_words_dict,
                            t4=0.9)

    # print(answer)
    if answer != []:
        answer[0][0] = answer[0][0].lower()
        # va.speak(answer[0][0])
        if answer[0][0] in dict1:
            dict1[answer[0][0]](command)