get_paradigm.c 1.16 KB
Newer Older
priyank's avatar
priyank committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
/**
 * File Name : get_paradigm.c
 */

/** Function:get_paradigm
 * This function takes the last letter of the word and checks the guessed paradigm from the 
 * paradigm list using the switch case
 * It takes arguments : word of char array and pdgm of char array
 * Return void 
 */



#include <string.h>
#include "defn.h"

void get_paradigm(word,pdgm)
  char word[WORD_SIZE];        /* morph word */
  char pdgm[WORD_SIZE];        /* paradigm */
  {
	int n;
	//struct exp_pdgm *tag;  /* guessed paradigm object of strucure exp_pdgm */
	pdgm[0]='\0';
	n = strlen(word);
   /* takes the last letter of the word and checks the guessed paradigm from the
        paradigm list using the switch case */
	switch(word[n-1])
	 {
           case 'a' : strcpy(pdgm,"Gara");
		   break;
	   case 'A' : strcpy(pdgm,"ladakA");
		   break;
	   case 'i' : strcpy(pdgm,"kavi");
	    	   break;
	   case 'I' : strcpy(pdgm,"ladakI");
	 	   break;
	   case 'u' : strcpy(pdgm,"Sawru");
		   break;
	   case 'U' : strcpy(pdgm,"AlU");
	 	   break;
	   case 'z' : strcpy(pdgm,"kuAz");
		   break;
	   case 'M' : strcpy(pdgm,"sarasoM");
		   break;
	   case 'o' : strcpy(pdgm,"redio");
		   break;
	  }
   }