/** * Normalizes the target counter in-place, so the sum of the resulting values * equals 1. * * @param <E> Type of elements in TwoDimensionalCounter * @param <F> Type of elements in TwoDimensionalCounter */ public static <E, F> void normalize(TwoDimensionalCounter<E, F> target) { Counters.divideInPlace(target, target.totalCount()); }
double nMWEs = mweLabelToString.totalCount(); int nAllSingletons = 0; int nTokens = 0; for(String mweLabel : mweLabelToString.firstKeySet()) { int nSingletons = 0; double totalCount = mweLabelToString.totalCount(mweLabel); Counter<String> mc = mweLabelToString.getCounter(mweLabel); for(String term : mc.keySet()) {
/** * Normalizes the target counter in-place, so the sum of the resulting values * equals 1. * * @param <E> Type of elements in TwoDimensionalCounter * @param <F> Type of elements in TwoDimensionalCounter */ public static <E, F> void normalize(TwoDimensionalCounter<E, F> target) { Counters.divideInPlace(target, target.totalCount()); }
/** * Normalizes the target counter in-place, so the sum of the resulting values * equals 1. * * @param <E> Type of elements in TwoDimensionalCounter * @param <F> Type of elements in TwoDimensionalCounter */ public static <E, F> void normalize(TwoDimensionalCounter<E, F> target) { Counters.divideInPlace(target, target.totalCount()); }
/** * Normalizes the target counter in-place, so the sum of the resulting values * equals 1. * * @param <E> Type of elements in TwoDimensionalCounter * @param <F> Type of elements in TwoDimensionalCounter */ public static <E, F> void normalize(TwoDimensionalCounter<E, F> target) { Counters.divideInPlace(target, target.totalCount()); }