public static ArrayList<Tuple> correct(String input)
			throws FileNotFoundException
	{
//		System.out.println("TestData -- " + input);

		StringTokenizer tokenizer = new StringTokenizer(input, " !?.;,");

		String misSpelt = "";
		String misSpeltPPOS = "";
		ArrayList<String> contextWord = new ArrayList<String>();
		ArrayList<String> coOccurenceWord = new ArrayList<String>();

		ArrayList<String> contextPOS = new ArrayList<String>();

		boolean beforeOccurence = true; // Assume a sentence has just one
										// spelling error
		// TODO: For more than one a repeated guess and correct learn method
		// will be followed
		while (tokenizer.hasMoreElements())
		{
			String token = tokenizer.nextToken();

			ArrayList<String> possibility_list = Dictionary.dictionary
					.get(token.length());

			boolean found = false;
			for (String str : possibility_list)
			{
				str = str.replaceAll("[^a-zA-Z]", "");
				token = token.replaceAll("[^a-zA-Z]", "");
				token = token.toLowerCase();

				int edit_dist = LD.getLD(str, token, matrix);
				if (edit_dist == 0)
				{
					found = true;
					break;
				}
			}
			if (!found)
			{
				misSpelt = token;
				beforeOccurence = false;

			} else
			{
				if (beforeOccurence)
					contextWord.add(token);
				String POS;
				if (PartsOfSpeech.wordPOSMap.containsKey(token))
					POS = PartsOfSpeech.wordPOSMap.get(token);
				else
				{
					PartsOfSpeech.wordPOSMap.put(token, "UND"); // code for
					POS = "UND";
				}
				if (beforeOccurence)
					contextPOS.add(POS);
				coOccurenceWord.add(token);

			}

		}

		// Once the list of word to be corrected, context words, collocation
		// words, context POS and
		// collocation POS is found, we need to find the candidates and then
		// find the respective probabilities

		// Getting candidates baseed on Edit distance
//		System.out.println("Misspelt " + misSpelt);
		ArrayList<String> candidates = getCandidates(misSpelt);

		ArrayList<Tuple> correction = new ArrayList<Tuple>();
		for (String cand : candidates)
		{
			misSpeltPPOS = PartsOfSpeech.wordPOSMap.get(cand);
			long rank = 0;
			if (misSpeltPPOS != null)
				rank = getIntersection(cand, misSpeltPPOS, contextWord,
						contextPOS, coOccurenceWord);
			Tuple t = new Tuple();
			t.word = cand;
			t.rank = rank;

			// if (rank != 0)
			correction.add(t);
		}

		return correction;
	}