/** * Constructs a new Counter with the contents of the given Counter. */ public IntCounter(IntCounter<E> c) { this(); addAll(c); }
/** * Splits the state counts. Root states and the boundary tag do not * get their counts increased, and all others are doubled. Betas * and transition weights are handled later. */ private void splitStateCounts() { // double the count of states... IntCounter<String> newStateSplitCounts = new IntCounter<>(); newStateSplitCounts.addAll(stateSplitCounts); newStateSplitCounts.addAll(stateSplitCounts); // root states should only have 1 for (String root : startSymbols) { if (newStateSplitCounts.getCount(root) > 1) { newStateSplitCounts.setCount(root, 1); } } if (newStateSplitCounts.getCount(Lexicon.BOUNDARY_TAG) > 1) { newStateSplitCounts.setCount(Lexicon.BOUNDARY_TAG, 1); } stateSplitCounts = newStateSplitCounts; }
/** * Constructs a new Counter with the contents of the given Counter. */ public IntCounter(IntCounter<E> c) { this(); addAll(c); }
/** * Constructs a new Counter with the contents of the given Counter. */ public IntCounter(IntCounter<E> c) { this(); addAll(c); }
/** * Constructs a new Counter with the contents of the given Counter. */ public IntCounter(IntCounter<E> c) { this(); addAll(c); }
/** * Constructs a new Counter with the contents of the given Counter. */ public IntCounter(IntCounter<E> c) { this(); addAll(c); }
/** * Splits the state counts. Root states and the boundary tag do not * get their counts increased, and all others are doubled. Betas * and transition weights are handled later. */ private void splitStateCounts() { // double the count of states... IntCounter<String> newStateSplitCounts = new IntCounter<>(); newStateSplitCounts.addAll(stateSplitCounts); newStateSplitCounts.addAll(stateSplitCounts); // root states should only have 1 for (String root : startSymbols) { if (newStateSplitCounts.getCount(root) > 1) { newStateSplitCounts.setCount(root, 1); } } if (newStateSplitCounts.getCount(Lexicon.BOUNDARY_TAG) > 1) { newStateSplitCounts.setCount(Lexicon.BOUNDARY_TAG, 1); } stateSplitCounts = newStateSplitCounts; }
/** * Splits the state counts. Root states and the boundary tag do not * get their counts increased, and all others are doubled. Betas * and transition weights are handled later. */ private void splitStateCounts() { // double the count of states... IntCounter<String> newStateSplitCounts = new IntCounter<>(); newStateSplitCounts.addAll(stateSplitCounts); newStateSplitCounts.addAll(stateSplitCounts); // root states should only have 1 for (String root : startSymbols) { if (newStateSplitCounts.getCount(root) > 1) { newStateSplitCounts.setCount(root, 1); } } if (newStateSplitCounts.getCount(Lexicon.BOUNDARY_TAG) > 1) { newStateSplitCounts.setCount(Lexicon.BOUNDARY_TAG, 1); } stateSplitCounts = newStateSplitCounts; }
/** * Splits the state counts. Root states and the boundary tag do not * get their counts increased, and all others are doubled. Betas * and transition weights are handled later. */ private void splitStateCounts() { // double the count of states... IntCounter<String> newStateSplitCounts = new IntCounter<String>(); newStateSplitCounts.addAll(stateSplitCounts); newStateSplitCounts.addAll(stateSplitCounts); // root states should only have 1 for (String root : startSymbols) { if (newStateSplitCounts.getCount(root) > 1) { newStateSplitCounts.setCount(root, 1); } } if (newStateSplitCounts.getCount(Lexicon.BOUNDARY_TAG) > 1) { newStateSplitCounts.setCount(Lexicon.BOUNDARY_TAG, 1); } stateSplitCounts = newStateSplitCounts; }