private String applyMappings(Mapping[] mappings, String string) {
		StringBuffer result = new StringBuffer();

		if (string != null && string.length() > 0) {
			char[] stringChars = string.toCharArray();
			for (int stringIndex = 0; stringIndex < stringChars.length; ++stringIndex) {

				boolean mapped = false;
				for (int mappingIndex = 0; mappingIndex < mappings.length; ++mappingIndex) {
					Mapping mapping = mappings[mappingIndex];

					boolean matches = true;
					for (int sourceIndex = 0; sourceIndex < mapping.source.length
							&& stringIndex + sourceIndex < stringChars.length; ++sourceIndex) {
						if (stringChars[stringIndex + sourceIndex] != mapping.source[sourceIndex]) {
							matches = false;
							break;
						}
					}

					if (matches) {
						mapped = true;
						result.append(mapping.dest);
						stringIndex += (mapping.source.length - 1);
						break;
					}
				}

				if (!mapped) {
					result.append(stringChars[stringIndex]);
				}
			}
		}

		return result.toString();
	}