public static String connectPunctuations(String sentence) 
	{
		int i,j;
		i = sentence.length() - 1;
		//leave one space at end
		if (sentence.charAt(i) == ' ')
		{
			i--;
		}
		j=i;
		//connect , and .
		while (i > 0)
		{
			while (j >= 0 && sentence.charAt(j) != ' ')
			{
				j--;
			}
			char ch = sentence.charAt(j+1);
			if ((i-j == 1) && ((ch == ',') || (ch == '.') || (ch == ':') || (ch == ';')))
			{
				//if the word is of length 1 - delete the space
				sentence = sentence.substring(0, j) + sentence.substring(j+1);
				i = j;
			}
			else
			{
				i = j-1;
				j = i;
			}
		}
		return sentence;
	}