public void canonicalize(FlexibleMap map) { setCanonicalEvents(map); int prevMapSize = map.size(); for (int level = 0; level < numLevels; level++) { CountsTrio trio = counts[level]; canonicalize(trio.history(), map);  canonicalize(trio.transition(), map); }  if (verbose) { System.err.println("Canonicalized Sexp objects; " + "now canonicalizing Event objects"); }  for (int level = 0; level < numLevels; level++) { CountsTrio trio = counts[level]; canonicalizeEvents(trio.history(), map);  canonicalizeEvents(trio.transition(), map); } int increase = map.size() - prevMapSize;  if (verbose) { System.err.print("Canonicalized " + numCanonicalizableEvents + " events; map grew by " + increase + " elements to " + map.size()); if (doGCBetweenCanonicalizations) { System.err.print(" (gc ... "); System.err.flush(); } else System.err.println(); } if (doGCBetweenCanonicalizations) { System.gc(); if (verbose) System.err.println("done)."); }   numCanonicalizableEvents = 0;
public void canonicalize() { canonicalize(new danbikel.util.HashMap());
  public void canonicalize(FlexibleMap map) {    setCanonicalEvents(map);    int prevMapSize = map.size();    for (int level = 0; level < numLevels; level++) {      CountsTrio trio = counts[level];      canonicalize(trio.history(), map);      //canonicalize(trio.unique(), map);      canonicalize(trio.transition(), map);    }    if (verbose) {      System.err.println("Canonicalized Sexp objects; " +			 "now canonicalizing Event objects");    }    for (int level = 0; level < numLevels; level++) {      CountsTrio trio = counts[level];      canonicalizeEvents(trio.history(), map);      //canonicalizeEvents(trio.unique(), map);      canonicalizeEvents(trio.transition(), map);    }    int increase = map.size() - prevMapSize;    if (verbose) {      System.err.print("Canonicalized " + numCanonicalizableEvents +		       " events; map grew by " + increase + " elements to " +		       map.size());      if (doGCBetweenCanonicalizations) {	System.err.print(" (gc ... ");	System.err.flush();      }      else	System.err.println();    }    if (doGCBetweenCanonicalizations) {      System.gc();      if (verbose)	System.err.println("done).");    }    // reset for use by this method if it is called again    numCanonicalizableEvents = 0;  }