private String resToString() {
    if (res == null) return "";
    String resultStr = "";
    for (String symbol : bn.symbols) {
      if (res.containsKey(symbol)) {
        resultStr += "Matches for <" + symbol + ">:\n";
        TreeSet<String> matches = res.get(symbol);
        for (String match : matches)
          resultStr += ">>> " + match + "\n";
        resultStr += "\n";
      }
    }
    return resultStr;
  }