Esempio n. 1
0
void Eliza::find_response() {
	find_keyword();
	std::string tempStr = m_sKeyWord;
	tempStr.insert(0, " ");
	tempStr.append(" ");
	if(tempStr.find(" MY ") != std::string::npos ||
		tempStr.find(" I'M ") != std::string::npos ||
		tempStr.find(" I ") != std::string::npos) {
		memorise_input();
	}
	save_user_name();
	if(!bot_understand()) {
		handle_unknown_sentence();
	}
}
Esempio n. 2
0
void ofxEliza::find_response() {
	find_keyword();
	std::string tempStr = m_sKeyWord;
	tempStr.insert(0, " ");
	tempStr.append(" ");
	if(tempStr.find(" MY ") != std::string::npos ||
       tempStr.find(" I'M ") != std::string::npos ||
       tempStr.find(" I ") != std::string::npos) {
		m_sSymbol = "@";
        extract_suffix();
        memory.push(m_sSuffix);
	}
	save_user_name();
	if(!bot_understand()) {
		handle_unknown_sentence();
	}
}