private void ReadRules (String stemRules)
	{
	int ruleCount=0;
	int j=0;

	 //Acquire each rule in turn. They each take up one line
	try
		{
		FileReader fr = new FileReader(stemRules);
		BufferedReader br = new BufferedReader(fr);
		String line = " ";
		try
			{
			while ((line=br.readLine())!= null)
				{
				ruleCount++;
				j=0;
				String rule = new String();
				rule ="";
				while ((j < line.length()) && (line.charAt(j) != ' '))
					{
					rule+= line.charAt(j);
					j++;
					}
				ruleTable.addElement(rule);
 				}
			}
		catch(Exception e)
			{
			System.err.println("File Error Durring Reading Rules"+e);
			System.exit(0);
			}
			// try to close file, file is not needed again so if can't close don't exit
		try
			{
			fr.close();
			}
		catch(Exception e)
			{
			System.err.println("Error Closing File During Reading Rules");
			}
		}
	catch(Exception e)
		{
		System.err.println("Input File" + stemRules +"not found");
		System.exit(1);
		}


	// Now assign the number of the first rule that starts with each letter
	// (if any) to an alphabetic array to facilitate selection of sections

	char ch ='a';
	for(j=0; j <25; j++)
		{
		ruleIndex[j] = 0;
		}

	for (j=0; j<(ruleCount-1); j++)
		{
		while( ((String) ruleTable.elementAt(j)).charAt(0) != ch)
			{
			ch++;
			ruleIndex[charCode(ch)] = j;
			}
		}
	}