public static List<Integer> compress(String uncompressed) {
		for (int i = 0; i < 256; i++)
			dictionary_global.put("" + (char)i, i);

		String w = "";
		List<Integer> result = new ArrayList<Integer>();
		for (char c : uncompressed.toCharArray()) {
			String wc = w + c;
			if (dictionary_global.containsKey(wc))
				w = wc;
			else {
				result.add(dictionary_global.get(w));
				// Add wc to the dictionary.
				dictionary_global.put(wc, dictSize_global++);
				w = "" + c;
			}
		}

		// Output the code for w.
		if (!w.equals(""))
			result.add(dictionary_global.get(w));
		return result;
	}