String anonymizeString(String input,String nameToBeAnonymized)
	{
		//extract name terms
		String nameTerms[] = nameToBeAnonymized.split(" ");

		String textTerms[] = input.split(" ");
		String output = null;
		//go through input, replace name term sequences with substitute
		boolean lastTermWasName = false;
		for(int i = 0; i < textTerms.length;i++)
		{
			boolean foundName = false;
			for(int j = 0; j < nameTerms.length;j++)
			{
				String processedTextTerm = textTerms[i].toLowerCase().replaceAll("[,.:;]+", "");
				//System.out.println(processedTextTerm);
				if(processedTextTerm.compareTo(nameTerms[j].toLowerCase()) == 0)
				{				
					foundName = true;
				}
			}
			if((foundName == true) && (anonymize == true))
			{
				if(lastTermWasName == false)
				{
					if(output == null)
					{
						output = anonymousSubstituteName;
					}
					else
					{
						output = output + " " + anonymousSubstituteName;
					}
				}
				lastTermWasName = true;
			}
			else
			{
				if(output == null)
				{
					output = textTerms[i];
				}
				else
				{
					output = output + " " + textTerms[i];
				}
				lastTermWasName = false;
			}
		}

		return output;
	}