/*********************************************************************************** * File: pro.c * Created: 19 NO 2000 * Author: R. DeArmond * Date modified: xx NO 2000 * * This file contains the proform (pronoun et al) struct and array declaration for the lexicon, and * the prototypes for all of the functions specific to pronouns, to be used with the * grammars one through eight. The functions are used to manipulate the proforms in * an array of proforms, which represents the proform portion of a lexicon. * * The current implementation, using an array to store the lexical entries for each * type of word is adequate for now, but if the lexicon is to be allowed to grow to * any size, this will have to change. In that case, the lexicon will have to be * used in the file, and file access performed whenever the lexicon is to be used. * Currently, a maximum number of proforms (MAX_PRONOUNS = 16) is imposed so that the * array can be declared. ***********************************************************************************/ /*********************************************************************************** * includes ***********************************************************************************/ #include #include #include "pro.h" #include "lib.h" #include "lexicon.h" #include "functions.h" int pro_cat; int proplural; int propersonal; int profirst; int proanimate; int profem; int prohuman; int prowh; int proloc; int protemp; int prowhy; int prohow; int prorel; int procase; int anaphor; int reflex; int proposs; int proposs_s; int prodef; char pro_cat_form[STRING_SIZE]; char proform[STRING_SIZE]; //struct psuffix_struct psuff; struct pro_struct pro1, pro2; /*********************************************************************************** * local function prototypes ***********************************************************************************/ void print_pro_features(struct pro_struct* p); /*********************************************************************************** * input: a proform struct for which the features are to be displayed. * description: uses printf to display the features to stdout. ***********************************************************************************/ /*********************************************************************************** * extern function implementations ***********************************************************************************/ int find_pro_index(char *s) // iterate through the list_pros, comparing the string passed in via the parameter // to each proform, until the proform is found, or the end of the list is reached. { int i; for(i=0;i=0;i--) for(j=0;j0) { memmove(&temp_pro,&list_pros[j],sizeof(struct pro_struct)); memmove(&list_pros[j],&list_pros[j+1],sizeof(struct pro_struct)); memmove(&list_pros[j+1],&temp_pro,sizeof(struct pro_struct)); } } } void list_pros() { int i; printf("There are %d proforms.\n",pronouns); for(i=0;ipro_cat_form); scanf("%s",p->pro_cat_form); printf("\n[%s %s ] is a proform.\n\n",p->pro_cat_form,p->proform); } void print_pro_features(struct pro_struct* p) { printf("\t\tProform:\t\t\t\t\t\t\t\t\t%s\n",p->proform); printf("\t\tCategory of Proform:\t\t\t\t\t\t%s\p", p->pro_cat_form); } //#endif