code: public static Replacer makeTable(Map<String, String> dict)
      {
          if(dict == null || dict.isEmpty())
              return new Replacer(Pattern.compile("$"), new DummySubstitution(""));
          TableSubstitution tab = new TableSubstitution(new LinkedHashMap<String, String>(dict));
          StringBuilder sb = new StringBuilder(128);
          sb.append("(?>");
          for(String s : tab.dictionary.keySet())
          {
              sb.append("\\Q");
              sb.append(s);
              sb.append("\\E|");
          }
          if(sb.length() > 3) sb.setCharAt(sb.length() - 1, ')');
          else sb.append(')');
          return new Replacer(Pattern.compile(sb.toString()), tab);
      }
docs: Makes a Replacer that replaces a literal String key in dict with the corresponding String value in dict. Doesn't
  need escapes in the Strings it searches for (at index 0, 2, 4, etc.), but cannot search for the exact two
  characters in immediate succession, backslash then capital E, because it finds literal Strings using
  {@code \\Q...\\E}. Uses only default modes (not case-insensitive, and most other flags don't have any effect
  since this doesn't care about "\\w" or other backslash-escaped special categories), but you can get the Pattern
  from this afterwards and set its flags with its setFlags() method. The Strings this replaces with are the values,
  and are also literal. If the Map this is given is a sorted Map of some kind or a (preferably) LinkedHashMap, then
  the order search strings will be tried will be stable; the same is not necessarily true for HashMap.
  @param dict a Map (hopefully with stable order) with search String keys and replacement String values
  @return a Replacer that will act as a replacement table for the given Strings