Beispiel #1
0
def process_input(input, lista):
	ignore_case = input.lower()
	if len(ignore_case.split()) == 1:
		return inputAlgo.simple_resp(ignore_case, inputAlgo.levels)
	else:
		if valid_sent(ignore_case):
			sent = parse_sentence(lexicon.scan(ignore_case))
			return inputAlgo.respond_dir(sent,lista,lexicon,0)
		else:
			return inputAlgo.get_error_message()
Beispiel #2
0
def process_input(input, lista):
    ignore_case = input.lower()
    if len(ignore_case.split()) == 1:
        return inputAlgo.simple_resp(ignore_case, inputAlgo.levels)
    else:
        if valid_sent(ignore_case):
            sent = parse_sentence(lexicon.scan(ignore_case))
            return inputAlgo.respond_dir(sent, lista, lexicon, 0)
        else:
            return inputAlgo.get_error_message()
Beispiel #3
0
def process_input(input, lista, objects):
    if check_utf8_alpha(input):
        if input in lexicon.dir:
            input = "go " + input
        ignore_case = input.lower()
        temp = check_stop(ignore_case)
        if len(temp) == 1:
            return inputAlgo.simple_resp(temp[0], lista)
        else:
            if valid_sent(ignore_case):
                sent = parse_sentence(lexicon.scan(ignore_case))
                return inputAlgo.respond_dir(sent, lista, lexicon, objects)
            else:
                return inputAlgo.get_error_message()
    else:
        return "Invalid input. Letters and numbers only please."
Beispiel #4
0
def process_input(input, lista, objects):
	if check_utf8_alpha(input):
		if input in lexicon.dir:
			input = "go " + input 
		ignore_case = input.lower()
		temp = check_stop(ignore_case)
		if len(temp) == 1:
			return inputAlgo.simple_resp(temp[0], lista)
		else:
			if valid_sent(ignore_case):
				sent = parse_sentence(lexicon.scan(ignore_case))
				return inputAlgo.respond_dir(sent,lista,lexicon,objects)
			else:
				return inputAlgo.get_error_message()
	else:
		return "Invalid input. Letters and numbers only please."