c-project/C Project/C Project/chatbot.c
int chatbot_is_smalltalk(const char* intent) {
	int flag = 0;

	// This loop will loop through the whole length of the intent
	for (int i = 0; i < MAX_REPLIES; i++) {
		// The loop is checking through each char and if the user intent matches the predefined greetings, all the chars will set the flag to 1 each time ending up with flag = 1 at the end
		if (compare_token(intent, USER_GREETINGS[i]) == 0) {
			flag = 1;                                                                           // Use compare_token method to check through the predefined greeting message to see if user input has a keyword
		}
		else if (strcmp(intent, "it's") == 0 || strcmp(intent, "It's") == 0) {                  // Check if intent has it's for both lower caps and upper caps. Not sure why compare_token doesn't like It's
			flag = 1;
		}
	}
	if (flag == 1) {                                                                            // If the flag at the end of the loop is 1, that means the trigger words matches the user input so we return 1
		return 1;
	}
	else {                                                                                      // If 1 char is not the same, then the word does not match at all so we return 0
		return 0;
	}
}
/*
 * Determine which an intent is smalltalk.
 *
 *
 * Input:
 *  intent - the intent
 *
 * Returns:
 *  1, if the intent is the first word of one of the smalltalk phrases
 *  0, otherwise
 */
Determine which an intent is smalltalk.

the intent

1, if the intent is the first word of one of the smalltalk phrases
0, otherwise
Determine which an intent is smalltalk . the intent 1 if the intent is the first word of one of the smalltalk phrases 0 otherwise
int chatbot_is_smalltalk(const char* intent) {
	int flag = 0;
	for (int i = 0; i < MAX_REPLIES; i++) {
		if (compare_token(intent, USER_GREETINGS[i]) == 0) {
			flag = 1;                                                                           
		}
		else if (strcmp(intent, "it's") == 0 || strcmp(intent, "It's") == 0) {                  
			flag = 1;
		}
	}
	if (flag == 1) {                                                                            
		return 1;
	}
	else {                                                                                      
		return 0;
	}
}
int chatbot_is_smalltalk ( const char * intent ) { int flag = 0 ; for ( int i = 0 ; i < MAX_REPLIES ; i ++ ) { if ( compare_token ( intent , USER_GREETINGS [ i ] ) == 0 ) { flag = 1 ; } else if ( strcmp ( intent , " " ) == 0 || strcmp ( intent , " " ) == 0 ) { flag = 1 ; } } if ( flag == 1 ) { return 1 ; } else { return 0 ; } }
Determine which an intent is smalltalk.
Determine which an intent is smalltalk .
// This loop will loop through the whole length of the intent
 // The loop is checking through each char and if the user intent matches the predefined greetings, all the chars will set the flag to 1 each time ending up with flag = 1 at the end
 // Use compare_token method to check through the predefined greeting message to see if user input has a keyword
 // Check if intent has it's for both lower caps and upper caps. Not sure why compare_token doesn't like It's
 // If the flag at the end of the loop is 1, that means the trigger words matches the user input so we return 1
 // If 1 char is not the same, then the word does not match at all so we return 0
