private void _init(boolean reversed) {
    this.reversed = reversed;
    this.maps = new HashMap<String,String>();
    try {
      BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("ligatures.txt"), "UTF-8"));
      String line;
      while ( (line = reader.readLine()) != null ) {
        String[] s = line.split("\\s+");
        String k,v;
        if ( s.length >= 2 ) {
          if ( reversed ) {
            k = s[1];
            v = s[0];
          } else {
            k = s[0];
            v = s[1];
          }
          if ( k.length() > 0  &&  this.maps.get(k) == null ) {
            this.maps.put(k, v);
          }
        }
      }
      List<String> ls = new ArrayList<String>(this.maps.keySet());
      Collections.sort(ls, new Comparator<String>(){
          public int compare(String a, String b) {
            if ( a.length() != b.length() ) {
              return b.length() - a.length();
            }
            return a.compareTo(b);
          }
          public boolean equals(String a, String b) {
            return compare(a, b) == 0;
          }
        });
      StringBuffer buff = new StringBuffer("(");
      for ( String k: ls) {
        if ( buff.length() > 1 ) {
          buff.append("|");
        }
        buff.append(unicode_escape(reverse(k)));
      }
      buff.append(")");
      this.patt = Pattern.compile(buff.toString(), Pattern.MULTILINE);
    } catch (IOException e) {
      e.printStackTrace();
      return;
    }
  }