private static int[] DiffCodes(String aText, Hashtable<String, Integer> h, boolean trimSpace, boolean ignoreSpace, boolean ignoreCase) {
      // get all codes of the text
      String[] Lines;
      int[] Codes;
      int lastUsedCode = h.size();
      Integer aCode;
      String s;

      // strip off all cr, only use lf as textline separator.
      aText = aText.replace("\r", "");
      Lines = aText.split("\n");

      Codes = new int[Lines.length];

      for (int i = 0; i < Lines.length; ++i) {
        s = Lines[i];
        if (trimSpace)
          s = s.trim();

        if (ignoreSpace) {
          s = s.replaceAll("\\s+", " ");            // TODO: optimize IF NEEDED: faster blank removal.
        }

        if (ignoreCase)
          s = s.toLowerCase();

        aCode = h.get(s);
        if (aCode == null) {
          lastUsedCode++;
          h.put(s, lastUsedCode);
          Codes[i] = lastUsedCode;
        } else {
          Codes[i] = aCode;
        } // if
      } // for
      return (Codes);
    } // DiffCodes