/* Cherokee.c - Version 3
 *   
 *   This program reads the phonetic text file and transcodes it
 *   to a variety of file types.  UTF-8, HTML-encrusted Cherokee
 *   font, and also Cherokee font without the HTML encrusting
 *
 *   A future version will likely have the <font> </font> headers
 *   included as part of the HTML code at the beginning and end of
 *   each line.  This will make it easier to compile the lines into
 *   single book.
 *
 *   Tim Legg December 29, 2006
 *   Rewritten February 2, 2009
 */

//These below are the only known bugs

//FIXME:  review 'na' and 'nah' cases for bugginess

#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#define SIZE 1024
#define TRUE 1
#define FALSE 0
#define YSG TRUE
#define CWY FALSE
#define HTML TRUE
#define FILEIO TRUE
#define STDIO TRUE
#define DEBUG1 0
#define DEBUG 0
errordisp(int location, int violator, char* data)
{
	int c;
	printf("\nError at %d after %c\n%s\n",location,violator,data);
	for(c=0;c<location-1;c++)
	{
		printf(" ");
	}
	printf("^\n");
	return;
}
int clearspace(int counter,char* string)
{
//	while(counter<SIZE || (string[counter+1]==' ' && string[counter+2]==' '))
	{
//		counter++;
	}
	return counter;
}
/*
fillstring(char* string)
{
	FILE *infile;
        char uname[11] = "010103.txt\0";

	//open read filename
        if((infile = fopen(uname, "r")) == NULL)
        {
                printf("Error Opening File.\n");
                exit(1);
        }

	fgets(string,SIZE,infile);
	fclose(infile);	
}
*/
int findsize(char* string)
{
	int value = 0;
	while(!(string[value]=='\0' || string[value]=='\n'))
	{
		value++;
	}
	return value;
}
void testname(char* string)
{
	int size = 0;
	while(string[size]!=0)
	{
		
		if(size<6)
		//if incluesiv to 48--57
		{
			if(string[size]<48 || string[size] > 57)
			{
				printf("Error:  Illegal file numbering.\n");
				exit(1);
			}
		}
		size++;
	}
	if(!(string[6]=='.' && string[7]=='t' && string[8]=='x' &&
	   string[9]=='t' && string[10]==0))
	{
		printf("Improper filename suffix\n");
		exit(1);
	}
	if(DEBUG1==1){printf("string %s size = %d",string, size);}
	return;
}
int main(int argc, char** argv)
{
	char data[SIZE];
	int datasize;
	int counter;

        FILE *infile;
	FILE *cwy_file, *ysg_file, *hts_file;
        char uname[11] = "xxxxxx.utf\0";
	char cname[11] = "xxxxxx.cwy\0";
	char hname[11] = "xxxxxx.hts\0";
	int namesize;
	if(argc<2)
	{
		printf("Error: Too few parameters.\nTry for example\n$./a.out 010101.txt\n\n");
	}
	if(argc>2)
	{
		printf("Error: Too many parameters.\nTry for example\n$./a.out 010101.txt\n\n");
	}
	if(argc==2)
	{
		testname(argv[1]);
	}
        //open read filename
        if((infile = fopen(argv[1], "r")) == NULL)
        {
                printf("Error Opening TXT File.\n");
                exit(1);
        }
        fgets(data,SIZE,infile);
	printf("Working on %s\n", argv[1]);
	fclose(infile);
	strncpy(uname,argv[1],6);
	strncpy(cname,argv[1],6);
	strncpy(hname,argv[1],6);
	//open write file
	if(YSG && FILEIO)
	{
		if((ysg_file = fopen(uname, "w")) == NULL)
	        {
			printf("Error Opening File to be saved. [%s]\n",uname);
			exit(1);
		}
	}
	if(CWY && FILEIO)
	{
                if((cwy_file = fopen(cname, "w")) == NULL)
                {
                        printf("Error Opening File to be saved. [%s]\n",cname);
                        exit(1);
                }
	}
        if(HTML && FILEIO)
        {
                if((hts_file = fopen(hname, "w")) == NULL)
                {
                        printf("Error Opening File to be saved. [%s]\n",hname);
                        exit(1);
                }
		fputs("<font face=\"Cherokee\">",hts_file);
        }
	printf("Opened the output files\n");


	//How many times does the for loop iterate?
	datasize = findsize(data);
	printf("The txt string is %d characters long\n",datasize);

	for(counter=0;counter<datasize;counter++)
	{

//legal characters are 
//	\'-. ,!?[]:;aeiouvgkhlmnqsdtwy
		if(DEBUG1){printf("for loop pass.  counter = %d\n",counter);}

		//Verify legal character
		if(
		   ( data[counter]=='a'||data[counter]=='e'||data[counter]=='i'||
		     data[counter]=='o'||data[counter]=='u'||data[counter]=='v'||
		     data[counter]=='g'||data[counter]=='k'||data[counter]=='h'||
		     data[counter]=='l'||data[counter]=='m'||data[counter]=='n'||
		     data[counter]=='q'||data[counter]=='s'||data[counter]=='d'||
		     data[counter]=='t'||data[counter]=='w'||data[counter]=='y'||
		     data[counter]=='\''||data[counter]=='-'||data[counter]==' '||
		     data[counter]==','||data[counter]=='.'||data[counter]=='!'||
		     data[counter]=='?'||data[counter]=='['||data[counter]==']'||
		     data[counter]==':'||data[counter]==';'||data[counter]=='~'||
		     data[counter]=='('||data[counter]==')'
		    )!=1)
		{
			printf("\nError:  Illegal character %c at %d.",data[counter], counter);
			errordisp(counter+1,data[counter],data);
		}
		if((counter==0)&&(data[0]=='\''||data[0]=='-'||data[0]==' '||data[0]==','||
		    data[0]=='.'||data[0]=='!'||data[0]=='?'||data[0]==')'||
		    data[0]==']'||data[0]==':'||data[0]==';'))
		{
			printf("Error:  Peculiar character %c at beginning of line\n", data[0]);
		}

		if(data[counter]==' ')
		{
			//in future versions, it would be helpful to advance
			//the counter to where text starts to filter out
			//unneccessary spaces and force only one space between
			//words
			counter=clearspace(counter,data);
			if(STDIO)
			{
				printf(" ");
			}
			if(FILEIO && YSG)
			{
				fputs(" ",ysg_file);
			}
			if(FILEIO && CWY)
			{
				fputs(" ",cwy_file);
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing ' '\n");}
				fputs(" ",hts_file);
			}
		}

		if(data[counter]=='-')
		{
			//check if next character is '-'
			//if so, output a hyphen
			//if not, it is a delimeter
			if(DEBUG1){printf("char %d is '-'\n",counter);}
			if(counter+1<datasize)
			{
				//We have a single dash so far.  If no other dashes after this, then proceed to next loop item
				if(data[counter+1]=='-')
				{
					//We have a double dash
					if(counter+2<datasize)
					{
						if(data[counter+2]=='-')
						{
							//output '-'
							//counter++;
							if(STDIO)
							{
								printf("-");
							}
							if(FILEIO && YSG)
							{
								fputs("-",ysg_file);
							}
							if(FILEIO && CWY)
							{
								printf("- symbol not supported by Cherokee font.\n");
							}
							if(FILEIO && HTML)
							{
								if(DEBUG){printf("hts: writing '-'\n");}
								fputs("</font>-<font face=\"Cherokee\">",hts_file);
							}	
							counter+=2;
						}
						//output '-'
						//counter++;
						if(STDIO)
						{
							printf("-");
						}
						if(FILEIO && YSG)
						{
							fputs("-",ysg_file);
						}
						if(FILEIO && CWY)
						{
							printf("- symbol not supported by Cherokee font.\n");
						}
						if(FILEIO && HTML)
						{
							if(DEBUG){printf("hts: writing '-'\n");}
							fputs("</font>-<font face=\"Cherokee\">",hts_file);
						}
						counter++;
					}
				}
			}
			else
			{
				//so the string ends with a hyphen '-'
				printf("Error:  strings ends with '-'.  Change to -- to place a long dash or\ntrailing '-' will be ignored\n");
			}
		}


		if(data[counter]=='.')
		{
			//counter=clearspace(counter);
//			printf(".  ");
			if(STDIO)
			{
				printf(".");
			}
			if(FILEIO && YSG)
			{
				fputs(".",ysg_file);
			}
			if(FILEIO && CWY)
			{
				fputs(".",cwy_file);
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing '.'\n");}
				fputs("</font>.<font face=\"Cherokee\">",hts_file);
			}

		}
                if(data[counter]==',')
                {
                        //counter=clearspace(counter);
			if(STDIO)
			{
	                        printf(",");
			}
			if(FILEIO && YSG)
			{
				fputs(",",ysg_file);
			}
			if(FILEIO && CWY)
			{
				fputs(",",cwy_file);
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing ','\n");}
				fputs("</font>,<font face=\"Cherokee\">",hts_file);
			}
                }
                if(data[counter]=='!')
                {
                        //counter=clearspace(counter);
			if(STDIO)
			{
				printf("!");
			}
			if(FILEIO && YSG)
			{
				fputs("!",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf("! symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing '!'\n");}
				fputs("</font>!<font face=\"Cherokee\">",hts_file);
			}	
                }
                if(data[counter]=='?')
                {
                        //counter=clearspace(counter);
			if(STDIO)
			{
				printf("?");
			}
			if(FILEIO && YSG)
			{
				fputs("?",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf("? symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing '?'\n");}
				fputs("</font>?<font face=\"Cherokee\">",hts_file);
			}	
		}
                if(data[counter]=='\'') //the ' symbol found in a few verses
                {
                        //counter=clearspace(counter);
			if(STDIO)
			{
				printf("\'");
			}
			if(FILEIO && YSG)
			{
				fputs("\'",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf("\' symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing '\''\n");}
				fputs("</font>\'<font face=\"Cherokee\">",hts_file);
			}	
		}
		if(data[counter]=='[')
		{
                        //counter=clearspace(counter);
			if(STDIO)
			{
				printf("[");
			}
			if(FILEIO && YSG)
			{
				fputs("[",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf("[ symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing '['\n");}
				fputs("</font>[<font face=\"Cherokee\">",hts_file);
			}	
                        //counter=clearspace(counter);
		}
		if(data[counter]==']')
		{
                        //counter=clearspace(counter);
                        //counter=clearspace(counter);
			if(STDIO)
			{
				printf("]");
			}
			if(FILEIO && YSG)
			{
				fputs("]",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf("] symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing ']'\n");}
				fputs("</font>]<font face=\"Cherokee\">",hts_file);
			}	
                }
		if(data[counter]=='(')
		{
                        //counter=clearspace(counter);
			if(STDIO)
			{
				printf("(");
			}
			if(FILEIO && YSG)
			{
				fputs("(",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf("( symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing '('\n");}
				fputs("</font>(<font face=\"Cherokee\">",hts_file);
			}	
                        //counter=clearspace(counter);
		}
		if(data[counter]==')')
		{
                        //counter=clearspace(counter);
                        //counter=clearspace(counter);
			if(STDIO)
			{
				printf(")");
			}
			if(FILEIO && YSG)
			{
				fputs(")",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf(") symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing ')'\n");}
				fputs("</font>)<font face=\"Cherokee\">",hts_file);
			}	
                }
                if(data[counter]==':')
                {
			if(STDIO)
			{
				printf(":");
			}
			if(FILEIO && YSG)
			{
				fputs(":",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf(": symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing ':'\n");}
				fputs("</font>:<font face=\"Cherokee\">",hts_file);

			}	
                }
                if(data[counter]==';')
                {
			if(STDIO)
			{
				printf(";");
			}
			if(FILEIO && YSG)
			{
				fputs(";",ysg_file);
			}
			if(FILEIO && CWY)
			{
				printf("; symbol not supported by Cherokee font.\n");
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing ';'\n");}
				fputs("</font>;<font face=\"Cherokee\">",hts_file);
			}	
                }
		if(data[counter]=='~')
		{
			//Yes, there are a few verses with a funny dash which resembles a tilde.
			counter=clearspace(counter,data);
			if(STDIO)
			{
				printf("~");
			}
			if(FILEIO && YSG)
			{
				fputs("~",ysg_file);
			}
			if(FILEIO && CWY)
			{
				fputs("~",cwy_file);
			}
			if(FILEIO && HTML)
			{
				if(DEBUG){printf("hts: writing '~'\n");}
				fputs("</font>~<font face=\"Cherokee\">",hts_file);
			}
		}
		//vowel a
		if(data[counter]=='a')
		{
			if(counter+1<datasize)
			{
				if(
				data[counter+1]=='.' || data[counter+1]==',' ||
				data[counter+1]=='!' || data[counter+1]=='?' ||
				data[counter+1]==':' || data[counter+1]==';' ||
				data[counter+1]=='[' || data[counter+1]==']' ||
				data[counter+1]=='(' || data[counter+1]==')' ||
                                data[counter+1]=='-' || data[counter+1]==' ' 
				)
				//legal characters!!!!
				//output 'a'
				{
					if(STDIO)
					{
						printf("Ꭰ");
					}
					if(FILEIO && YSG)
					{
						fputs("Ꭰ",ysg_file);
					}
					if(FILEIO && CWY)
					{
						fputs("a",cwy_file);
					}
					if(FILEIO && HTML)
					{
						if(DEBUG){printf("hts: writing 'a'\n");}
						fputs("a",hts_file);
					}
				}
				else
				//illegal characters
				{
					errordisp(counter+1,'a',data);
				}
			}
			else
			{
				if(STDIO)
				{
					printf("Ꭰ");
				}
				if(FILEIO && YSG)
				{
					fputs("Ꭰ",ysg_file);
				}
				if(FILEIO && CWY)
				{
					fputs("a",cwy_file);
				}
				if(FILEIO && HTML)
				{
					if(DEBUG){printf("hts: writing 'a'\n");}
					fputs("a",hts_file);
				}
				//end of string with 'a'
				//output 'a'
			}
		}
                //vowel e
                if(data[counter]=='e')
                {
                        if(counter+1<datasize)
                        {
                                if(
                                data[counter+1]=='.' || data[counter+1]==',' ||
                                data[counter+1]=='!' || data[counter+1]=='?' ||
                                data[counter+1]==':' || data[counter+1]==';' ||
                                data[counter+1]=='[' || data[counter+1]==']' ||
				data[counter+1]=='(' || data[counter+1]==')' ||
                                data[counter+1]=='-' || data[counter+1]==' '
                                )
                                //legal characters!!!!
                                //output 'e'
                                {
					if(STDIO)
					{
						printf("Ꭱ");
                                        }
					if(FILEIO && YSG)
					{
						fputs("Ꭱ",ysg_file);
					}
					if(FILEIO && CWY)
					{
						fputs("e",cwy_file);
					}
					if(FILEIO && HTML)
					{
						if(DEBUG){printf("hts: writing 'e'\n");}
						fputs("e",hts_file);
					}
                                }
                                else
                                //illegal characters
                                {
                                        errordisp(counter+1,'e',data);
                                }
                        }
                        else
                        {

				if(STDIO)
				{
					printf("Ꭱ");
                                }
				if(FILEIO && YSG)
				{
					fputs("Ꭱ",ysg_file);
				}
				if(FILEIO && CWY)
				{
					fputs("e",cwy_file);
				}
				if(FILEIO && HTML)
				{
					if(DEBUG){printf("hts: writing 'e'\n");}
					fputs("e",hts_file);
				}
                                //end of string with 'e'
                                //output 'e'
                        }
                }

                //vowel i
                if(data[counter]=='i')
                {
                        if(counter+1<datasize)
                        {
                                if(
                                data[counter+1]=='.' || data[counter+1]==',' ||
                                data[counter+1]=='!' || data[counter+1]=='?' ||
                                data[counter+1]==':' || data[counter+1]==';' ||
                                data[counter+1]=='[' || data[counter+1]==']' ||
				data[counter+1]=='(' || data[counter+1]==')' ||
                                data[counter+1]=='-' || data[counter+1]==' '
                                )
                                //legal characters!!!!
                                //output 'i'
                                {
					if(STDIO)
					{
						printf("Ꭲ");
					}
					if(FILEIO && YSG)
					{
						fputs("Ꭲ",ysg_file);
					}
					if(FILEIO && CWY)
					{
						fputs("i",cwy_file);
					}
					if(FILEIO && HTML)
					{
						if(DEBUG){printf("hts: writing 'i'\n");}
						fputs("i",hts_file);
					}
                                }
                                else
                                //illegal characters
                                {
                                        errordisp(counter+1,'i',data);
                                }
                        }
                        else
                        {
				if(STDIO)
				{
					printf("Ꭲ");
				}
				if(FILEIO && YSG)
				{
					fputs("Ꭲ",ysg_file);
				}
				if(FILEIO && CWY)
				{
					fputs("i",cwy_file);
				}
				if(FILEIO && HTML)
				{
					if(DEBUG){printf("hts: writing 'i'\n");}
					fputs("i",hts_file);
				}
                                //end of string with 'i'
                                //output 'i'
                        }
                }

                //vowel o
                if(data[counter]=='o')
                {
                        if(counter+1<datasize)
                        {
                                if(
                                data[counter+1]=='.' || data[counter+1]==',' ||
                                data[counter+1]=='!' || data[counter+1]=='?' ||
                                data[counter+1]==':' || data[counter+1]==';' ||
                                data[counter+1]=='[' || data[counter+1]==']' ||
				data[counter+1]=='(' || data[counter+1]==')' ||
                                data[counter+1]=='-' || data[counter+1]==' '
                                )
                                //legal characters!!!!
                                //output 'o'
                                {
					if(STDIO)
					{
						printf("Ꭳ");
					}
					if(FILEIO && YSG)
					{
						fputs("Ꭳ",ysg_file);
					}
					if(FILEIO && CWY)
					{
						fputs("o",cwy_file);
					}
					if(FILEIO && HTML)
					{
						if(DEBUG){printf("hts: writing 'o'\n");}
						fputs("o",hts_file);
					}
                                }
                                else
                                //illegal characters
                                {
                                        errordisp(counter+1,'o',data);
                                }
                        }
                        else
                        {
				if(STDIO)
				{
					printf("Ꭳ");
				}
				if(FILEIO && YSG)
				{
					fputs("Ꭳ",ysg_file);
				}
				if(FILEIO && CWY)
				{
					fputs("o",cwy_file);
				}
				if(FILEIO && HTML)
				{
					fputs("o",hts_file);
					if(DEBUG){printf("hts: writing 'o'\n");}
				}
                                //end of string with 'o'
                                //output 'o'
                        }
                }

                //vowel u
                if(data[counter]=='u')
                {
                        if(counter+1<datasize)
                        {
                                if(
                                data[counter+1]=='.' || data[counter+1]==',' ||
                                data[counter+1]=='!' || data[counter+1]=='?' ||
                                data[counter+1]==':' || data[counter+1]==';' ||
                                data[counter+1]=='[' || data[counter+1]==']' ||
				data[counter+1]=='(' || data[counter+1]==')' ||
                                data[counter+1]=='-' || data[counter+1]==' '
                                )
                                //legal characters!!!!
                                //output 'u'
                                {
					if(STDIO)
					{
						printf("Ꭴ");
					}
					if(FILEIO && YSG)
					{
						fputs("Ꭴ",ysg_file);
					}
					if(FILEIO && CWY)
					{
						fputs("u",cwy_file);
					}
					if(FILEIO && HTML)
					{
						if(DEBUG){printf("hts: writing 'u'\n");}
						fputs("u",hts_file);
					}
                                }
                                else
                                //illegal characters
                                {
                                        errordisp(counter+1,'u',data);
                                }
                        }
                        else
                        {
				if(STDIO)
				{
					printf("Ꭴ");
				}
				if(FILEIO && YSG)
				{
					fputs("Ꭴ",ysg_file);
				}
				if(FILEIO && CWY)
				{
					fputs("u",cwy_file);
				}
				if(FILEIO && HTML)
				{
					if(DEBUG){printf("hts: writing 'u'\n");}
					fputs("u",hts_file);
				}
                                //end of string with 'u'
                                //output 'u'
                        }
                }
                //vowel v
                if(data[counter]=='v')
                {
                        if(counter+1<datasize)
                        {
                                if(
                                data[counter+1]=='.' || data[counter+1]==',' ||
                                data[counter+1]=='!' || data[counter+1]=='?' ||
                                data[counter+1]==':' || data[counter+1]==';' ||
                                data[counter+1]=='[' || data[counter+1]==']' ||
				data[counter+1]=='(' || data[counter+1]==')' ||
                                data[counter+1]=='-' || data[counter+1]==' '
                                )
                                //legal characters!!!!
                                //output 'v'
                                {
					if(STDIO)
					{
						printf("Ꭵ");
					}
					if(FILEIO && YSG)
					{
						fputs("Ꭵ",ysg_file);
					}
					if(FILEIO && CWY)
					{
						fputs("v",cwy_file);
					}
					if(FILEIO && HTML)
					{
						if(DEBUG){printf("hts: writing 'v'\n");}
						fputs("v",hts_file);
					}
                                }
                                else
                                //illegal characters
                                {
                                        errordisp(counter+1,'v',data);
                                }
                        }
                        else
                        {
				if(STDIO)
				{
					printf("Ꭵ");
				}
				if(FILEIO && YSG)
				{
					fputs("Ꭵ",ysg_file);
				}
				if(FILEIO && CWY)
				{
					fputs("v",cwy_file);
				}
				if(FILEIO && HTML)
				{
					if(DEBUG){printf("hts: writing 'v'\n");}
					fputs("v",hts_file);
				}

                                //end of string with 'v'
                                //output 'v'
                        }
                }

                //consonant k
                if(data[counter]=='k')
                {
                        if(counter+1<datasize)
                        {
                                if(data[counter+1]=='a')
                                //legal characters!!!!
                                //output KA
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					//legal characters!!!!
					{
						if(STDIO)
						{
							printf("Ꭷ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭷ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("K",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("K",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'k',data);
					}
                                }
                                else
                                //illegal characters
                                {
                                        errordisp(counter+1,'k',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'k'.  Not a syllable!\n");
                                //end of string with 'k'
                                //output error
                        }
                }

		//consonant g
                if(data[counter]=='g')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭶ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭶ",ysg_file);
						}
							if(FILEIO && CWY)
						{
							fputs("g",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("g",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'g',data);
					}
                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭸ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭸ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("b",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("b",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'g',data);
					}
				}
                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭹ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭹ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("f",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("f",hts_file);
						}
        	                                counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'g',data);
					}
                                }
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭺ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭺ",ysg_file);
						}
						if(FILEIO && CWY)
							{
							fputs("q",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("q",hts_file);
						}
        	                                counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'g',data);
					}
                                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭻ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭻ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("J",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("J",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'g',data);
					}
                                }
                                else if(data[counter+1]=='v')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭼ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭼ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("z",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("z",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'g',data);
					}
                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'g',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'g'.  Not a syllable!\n");
                                //end of string with 'g'
                                //output error
                        }
                }

                //consonant h
                if(data[counter]=='h')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭽ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭽ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("U",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("U",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'h',data);
					}
                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭾ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭾ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("L",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("L",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'h',data);
					}
				}
                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꭿ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꭿ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("h",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("h",hts_file);
						}
        	                                counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'h',data);
					}
                                }
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮀ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮀ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("$",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("$",hts_file);
						}
        		                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'h',data);
					}
        	                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮁ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮁ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("!",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("!",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'h',data);
					}
                                }
                                else if(data[counter+1]=='v')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮂ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮂ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("H",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("H",hts_file);
						}
        	                                counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'h',data);
					}
       	                        }
                                else if(data[counter+1]=='n')
                                {
                                        if(counter+2<datasize)
                                        {
		                                //legal characters!!!!
                                                if(data[counter+2]=='a')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮏ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮏ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("-",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("-",hts_file);
								}
        	                                                counter+=2;
							}
							else
							{
	                                                        errordisp(counter+2,'n',data);
							}
                                                }
                                                else
                                                {
                                                        errordisp(counter+2,'n',data);
                                                }
                                        }
                                        else
                                        {
                                                printf("\nError - premature EOF at 'hn'.  Not a syllable!\n");
                                        }
                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'h',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'h'.  Not a syllable!\n");
                                //end of string with 'h'
                                //output error
                        }
                }

                //consonant l
                if(data[counter]=='l')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮃ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮃ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("w",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("w",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'l',data);
					}
                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮄ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮄ",ysg_file);
						}
						if(FILEIO && CWY)
						{
						fputs(">",cwy_file);
							}
						if(FILEIO && HTML)
						{
							fputs("&gt;",hts_file);
						}
        	                                counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'l',data);
					}
				}

                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮅ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮅ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("l",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("l",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'l',data);
					}
                                }
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮆ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮆ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("]",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("]",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'l',data);
					}
                                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮇ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮇ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("M",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("M",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'l',data);
					}
                                }
                                else if(data[counter+1]=='v')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮈ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮈ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("k",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("k",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'l',data);
					}
                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'l',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'l'.  Not a syllable!\n");
                                //end of string with 'l'
                                //output error
                        }
                }

                //consonant m
                if(data[counter]=='m')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮉ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮉ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("%",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("%",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'m',data);
					}
                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮊ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮊ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("*",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("*",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'m',data);
					}
				}
                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮋ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮋ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("N",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("N",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'m',data);
					}
                                }
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮌ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮌ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("_",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("_",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'m',data);
					}
                                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮍ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮍ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("+",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("+",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'m',data);
					}
                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'m',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'l'.  Not a syllable!\n");
                                //end of string with 'l'
                                //output error
                        }
                }

		//consonant n
                if(data[counter]=='n')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='e')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮑ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮑ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("p",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("p",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'n',data);
					}
                                }
				else if(data[counter+1]=='i')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮒ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮒ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("/",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("/",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'n',data);
					}
				}
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮓ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮓ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("Z",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("Z",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'n',data);
					}
                                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮔ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮔ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("0",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("0",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'n',data);
					}
                                }
                                else if(data[counter+1]=='v')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮕ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮕ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("m",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("m",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'n',data);
					}
                                }
                                else if(data[counter+1]=='a')
                                {
					//either na or nah
                                        if(counter+2<datasize)
                                        {
                                                if(data[counter+2]=='h')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
        			                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮐ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮐ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									printf("nah detected - substituting with hna\n");
									fputs("-",cwy_file);
								}
								if(FILEIO && HTML)
								{
									printf("nah detected - substituting with hna\n");
									fputs("-",hts_file);
								}
	                                                        counter+=2;
							}
							else
							//illegal characters
							{
								errordisp(counter+1,'a',data);
							}

                                                }
						else
						{
							if((data[counter+2]=='\''||data[counter+2]=='-'||
							   data[counter+2]==' '||data[counter+2]==','||
							   data[counter+2]=='.'||data[counter+2]=='!'||
		     					   data[counter+2]=='?'||data[counter+2]=='['||
							   data[counter+2]==']'||data[counter+2]==':'||
							   data[counter+2]==';'||data[counter+2]=='~')!=1)
							{
							        errordisp(counter+1,'a',data);
							}
							else
							{
								if(STDIO)
								{
									printf("Ꮎ");
								}
								if(FILEIO && YSG)
								{
										fputs("Ꮎ",ysg_file);
									}
								if(FILEIO && CWY)
								{
									fputs("n",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("n",hts_file);
								}
		                                                counter++;
							}
						}
					}
					else
					{
						if(counter+2==datasize||
						data[counter+2]=='.' || data[counter+2]==',' ||
						data[counter+2]=='!' || data[counter+2]=='?' ||
						data[counter+2]==':' || data[counter+2]==';' ||
						data[counter+2]=='[' || data[counter+2]==']' ||
						data[counter+2]=='(' || data[counter+2]==')' ||
	        	                        data[counter+2]=='-' || data[counter+2]==' ' 
						)
						{
							if(STDIO)
							{
								printf("Ꮎ");
							}
							if(FILEIO && YSG)
							{
								fputs("Ꮎ",ysg_file);
								}
							if(FILEIO && CWY)
							{
								fputs("n",cwy_file);
							}
							if(FILEIO && HTML)
							{
								fputs("n",hts_file);
							}
	                                                counter++;
						}
						else
						//illegal characters
						{
							errordisp(counter+1,'n',data);
						}
					}
                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'n',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'n'.  Not a syllable!\n");
                                //end of string with 'n'
                                //output error
                        }
                }

                //consonant qu
                if(data[counter]=='q')
                {
			if(counter+1<datasize)
			{	
				if(data[counter+1]=='u')
				{
		                        if(counter+2<datasize)
        		                {
                        		        //legal characters!!!!
                		                if(data[counter+2]=='a')
                                		{
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮖ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮖ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("Q",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("Q",hts_file);
								}
								counter+=2;
							}
							else
							//illegal characters
							{
								errordisp(counter+1,'u',data);
							}
	                	                }
						else if(data[counter+2]=='e')
						{
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮗ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮗ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("@",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("@",hts_file);
								}
	        	                	                counter+=2;
							}
							else
							//illegal characters
							{
								errordisp(counter+1,'u',data);
							}
						}
	        	                        else if(data[counter+2]=='i')
        	        	                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮘ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮘ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("F",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("F",hts_file);
								}
	                        	        	        counter+=2;
							}
							else
							//illegal characters
							{
								errordisp(counter+1,'u',data);
							}
							
	                        	        }
        	                        	else if(data[counter+2]=='o')
	                	                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮙ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮙ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("?",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("?",hts_file);
								}
	                	                	        counter+=2;
							}
							else
							//illegal characters
							{
								errordisp(counter+1,'u',data);
							}
	                	                }
        	                	        else if(data[counter+2]=='u')
                	                	{
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮚ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮚ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("~",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("~",hts_file);
								}
		                                	        counter+=2;
							}
							else
							//illegal characters
							{
								errordisp(counter+1,'u',data);
							}
		                                }
        		                        else if(data[counter+2]=='v')
                		                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮛ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮛ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("7",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("7",hts_file);
								}
	                                		        counter+=2;
							}
							else
							//illegal characters
							{
								errordisp(counter+1,'u',data);
							}
		                                }
        		                        //illegal characters
						else
                        		        {
                                        		errordisp(counter+2,'u',data);
		                                }
        		                }
					else
					{
						//premature EOF after qu
		                                printf("\nError - premature EOF at 'qu'.  Not a syllable!\n");

					}
				}
                	        else
                        	{
					errordisp(counter+1,'q',data);
			        }
			}
			else
			{
				//premature EOF after q
				printf("\nError - premature EOF at 'q'.  Not a syllable!\n");

			}
                }

                //consonant s
                if(data[counter]=='s')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮜ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮜ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("A",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("A",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'s',data);
					}
                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮞ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮞ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("S",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("S",hts_file);
						}
        	                                counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'s',data);
					}
				}
                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮟ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮟ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("R",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("R",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'s',data);
					}
                                }
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮠ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮠ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("D",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("D",hts_file);
						}
        	                                counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'s',data);
					}

                                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮡ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮡ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("{",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("{",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'s',data);
					}

                                }
                                else if(data[counter+1]=='v')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮢ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮢ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("9",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("9",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'s',data);
					}
                                }
 				else
                                {
					if(data[counter+1]=='\''||data[counter+1]=='-'||
					   data[counter+1]==' '||data[counter+1]==','||
					   data[counter+1]=='.'||data[counter+1]=='!'||
     					   data[counter+1]=='?'||data[counter+1]=='['||
					   data[counter+1]==']'||data[counter+1]==':'||
					   data[counter+1]==';'||data[counter+1]=='~')
					{
						if(STDIO)
						{
							printf("Ꮝ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮝ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("s",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("s",hts_file);
						}
					}
					else
					{
					        errordisp(counter+1,'s',data);
					}
                               }
                        }
                        else
                        {
				if(STDIO)
				{
					printf("Ꮝ");
				}
				if(FILEIO && YSG)
				{
					fputs("Ꮝ",ysg_file);
				}
				if(FILEIO && CWY)
				{
					fputs("s",cwy_file);
				}
				if(FILEIO && HTML)
				{
					fputs("s",hts_file);
				}
                        }
                }

                //consonant d
                if(data[counter]=='d')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮣ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮣ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("c",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("c",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'d',data);
					}
                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮥ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮥ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("[",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("[",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'d',data);
					}
				}
                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮧ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮧ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("d",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("d",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'d',data);
					}
                                }
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮩ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮩ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("4",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("4",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'d',data);
					}
                                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮪ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮪ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("j",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("j",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'d',data);
					}
                                }
                                else if(data[counter+1]=='v')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮫ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮫ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("r",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("r",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'d',data);
					}
                                }
                                else if(data[counter+1]=='l')
                                {
                                        if(counter+2<datasize)
                                        {
                                                if(data[counter+2]=='a')
                                                {

							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮬ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮬ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("6",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("6",hts_file);
								}
	                                                        counter+=2;
							}
							else
							//illegal characters
							{
								errordisp(counter+1,'d',data);
							}
                                                }
                                                else
                                                {
                                                        errordisp(counter+2,'l',data);
                                                }
                                        }
                                        else
                                        {
                                                printf("\nError - premature EOF at 'dl'.  Not a syllable!\n");
                                        }
                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'d',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'd'.  Not a syllable!\n");
                                //end of string with 'h'
                                //output error
                        }
                }

		//consonant t
                if(data[counter]=='t')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮤ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮤ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("t",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("t",hts_file);
						}
						counter++;
					}
                                        else
                                        {
	                                        errordisp(counter+2,'t',data);
                                        }
                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮦ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮦ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("8",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("8",hts_file);
						}
	                                        counter++;
					}
                                        else
                                        {
	                                        errordisp(counter+2,'t',data);
                                        }
				}
                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮨ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮨ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("T",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("T",hts_file);
						}
	                                        counter++;
					}
                                        else
                                        {
	                                        errordisp(counter+2,'t',data);
                                        }

                                }
                                else if(data[counter+1]=='l')
                                {
                                        if(counter+2<datasize)
                                        {
                                                if(data[counter+2]=='a')
						{
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮭ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮭ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("^",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("^",hts_file);
								}
	                                                        counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'l',data);
	                                                }
                                                }
                                                else if(data[counter+2]=='e')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮮ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮮ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("V",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("V",hts_file);
								}
	                                                        counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'l',data);
	                                                }
                                                }
                                                else if(data[counter+2]=='i')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮯ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮯ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("C",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("C",hts_file);
								}
        	                                                counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'l',data);
	                                                }
                                                }
                                                else if(data[counter+2]=='o')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮰ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮰ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs(":",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs(":",hts_file);
								}
        	                                                counter+=2;
        						}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'l',data);
	                                                }
						}
                                                else if(data[counter+2]=='u')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮱ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮱ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("&",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("&amp;",hts_file);
								}
	                                                        counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'l',data);
	                                                }
                                                }
                                                else if(data[counter+2]=='v')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮲ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮲ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("<",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("&lt;",hts_file);
								}
	                                                        counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'l',data);
	                                                }
                                                }
                                                else
                                                {
                                                        errordisp(counter+2,'l',data);
                                                }
                                        }
                                        else
                                        {
                                                printf("\nError - premature EOF at 'tl'.  Not a syllable!\n");
                                        }
                                }
                                else if(data[counter+1]=='s')
                                {
                                        if(counter+2<datasize)
                                        {
                                                if(data[counter+2]=='a')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮳ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮳ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("E",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("E",hts_file);
								}
	                                                        counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'s',data);
	                                                }
                                                }
                                                else if(data[counter+2]=='e')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{

								if(STDIO)
								{
									printf("Ꮴ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮴ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("}",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("}",hts_file);
								}
	                                                        counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'s',data);
	                                                }
                                                }
                                                else if(data[counter+2]=='i')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮵ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮵ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("G",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("G",hts_file);
								}
	                                                        counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'s',data);
	                                                }
                                                }
                                                else if(data[counter+2]=='o')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮶ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮶ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("5",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("5",hts_file);
								}
	                                                        counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'s',data);
	                                                }
                                                }
                                                else if(data[counter+2]=='u')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮷ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮷ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs("#",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs("#",hts_file);
								}
        	                                                counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'s',data);
	                                                }
       	                                        }
                                                else if(data[counter+2]=='v')
                                                {
							if(counter+3==datasize||
							data[counter+3]=='.' || data[counter+3]==',' ||
							data[counter+3]=='!' || data[counter+3]=='?' ||
							data[counter+3]==':' || data[counter+3]==';' ||
							data[counter+3]=='[' || data[counter+3]==']' ||
							data[counter+3]=='(' || data[counter+3]==')' ||
		        	                        data[counter+3]=='-' || data[counter+3]==' ' 
							)
							{
								if(STDIO)
								{
									printf("Ꮸ");
								}
								if(FILEIO && YSG)
								{
									fputs("Ꮸ",ysg_file);
								}
								if(FILEIO && CWY)
								{
									fputs(";",cwy_file);
								}
								if(FILEIO && HTML)
								{
									fputs(";",hts_file);
								}
        	                                                counter+=2;
							}
	                                                else
	                                                {
	                                                        errordisp(counter+2,'s',data);
	                                                }
                                                }
                                                else
                                                {
                                                        errordisp(counter+2,'s',data);
                                                }
                                        }
                                        else
                                        {
                                                printf("\nError - premature EOF at 'ts'.  Not a syllable!\n");
                                        }
                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'t',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 't'.  Not a syllable!\n");
                                //end of string with 'h'
                                //output error
                        }
                }
                //consonant w
                if(data[counter]=='w')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮹ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮹ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("\\",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("\\",hts_file);
						}
						counter++;

	                                }
	                                //illegal characters
					else
	                                {
	                                        errordisp(counter+1,'w',data);
	                                }
                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮺ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮺ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("P",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("P",hts_file);
						}
	                                        counter++;

	                                }
	                                //illegal characters
					else
	                                {
	                                        errordisp(counter+1,'w',data);
	                                }
				}
                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮻ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮻ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("W",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("W",hts_file);
						}
                	                        counter++;

                	                }
                	                //illegal characters
					else
	                                {
	                                        errordisp(counter+1,'w',data);
	                                }
                                }
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮼ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮼ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("O",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("O",hts_file);
						}
        	                                counter++;
	                                }
        	                        //illegal characters
					else
	                                {
	                                        errordisp(counter+1,'w',data);
	                                }
                                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮽ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮽ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("X",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("X",hts_file);
						}
        	                                counter++;
	                                }
        	                        //illegal characters
					else
        	                        {
        	                                errordisp(counter+1,'w',data);
        	                        }
                                }
                                else if(data[counter+1]=='v')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮾ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮾ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("|",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("|",hts_file);
						}
	                                        counter++;
	                                }
	                                //illegal characters
					else
	                                {
	                                        errordisp(counter+1,'w',data);
	                                }
                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'w',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'w'.  Not a syllable!\n");
                                //end of string with 'w'
                                //output error
                        }
                }

                //consonant y
                if(data[counter]=='y')
                {
                        if(counter+1<datasize)
                        {
                                //legal characters!!!!
                                if(data[counter+1]=='a')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ꮿ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ꮿ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("y",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("y",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'y',data);
					}                                }
				else if(data[counter+1]=='e')
				{
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ᏸ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ᏸ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("B",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("B",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'y',data);
					}				}

                                else if(data[counter+1]=='i')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ᏹ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ᏹ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("I",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("I",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'y',data);
					}                                }
                                else if(data[counter+1]=='o')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ᏺ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ᏺ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("Y",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("Y",hts_file);
						}
						counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'y',data);
					}                                }
                                else if(data[counter+1]=='u')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ᏻ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ᏻ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("=",cwy_file);
						}
							if(FILEIO && HTML)
						{
							fputs("=",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'y',data);
					}
                                }
                                else if(data[counter+1]=='v')
                                {
					if(counter+2==datasize||
					data[counter+2]=='.' || data[counter+2]==',' ||
					data[counter+2]=='!' || data[counter+2]=='?' ||
					data[counter+2]==':' || data[counter+2]==';' ||
					data[counter+2]=='[' || data[counter+2]==']' ||
					data[counter+2]=='(' || data[counter+2]==')' ||
        	                        data[counter+2]=='-' || data[counter+2]==' ' 
					)
					{
						if(STDIO)
						{
							printf("Ᏼ");
						}
						if(FILEIO && YSG)
						{
							fputs("Ᏼ",ysg_file);
						}
						if(FILEIO && CWY)
						{
							fputs("x",cwy_file);
						}
						if(FILEIO && HTML)
						{
							fputs("x",hts_file);
						}
	                                        counter++;
					}
					else
					//illegal characters
					{
						errordisp(counter+1,'y',data);
					}

                                }
                                //illegal characters
				else
                                {
                                        errordisp(counter+1,'y',data);
                                }
                        }
                        else
                        {
                                printf("\nError - premature EOF at 'y'.  Not a syllable!\n");
                                //end of string with 'y'
                                //output error
                        }
                }



	}	

	printf("\n");
	//close the write file
	if(FILEIO && YSG)
	{

		fclose(ysg_file);
		printf("closing ysg file\n");
	}
	if(FILEIO && CWY)
	{
		fclose(cwy_file);
		printf("Closing cwy file\n");
	}
	if(FILEIO && HTML)
	{
		fputs("</font>\n",hts_file);
		fclose(hts_file);
		printf("Closing hts file\n");
	}

	printf("\n");
	return 0;
}
