Java Code Examples for com.google.common.collect.ConcurrentHashMultiset#add()
The following examples show how to use
com.google.common.collect.ConcurrentHashMultiset#add() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AlignmentTemplates.java From phrasal with GNU General Public License v3.0 | 6 votes |
/** * Increment count for a given alignment for a given phrase-pair. */ public void incrementAlignmentCount(AlignmentTemplate alTemp) { if (storeAlignmentCounts) { int idx = alTemp.getKey(); int alIdx = alTemp.getAKey(); final ConcurrentHashMultiset<Integer> aCounts; if (idx >= 0) { assert (idx <= index.size()); synchronized (aCounter) { // assert(idx <= aCounter.size()); while (idx >= aCounter.size()) aCounter.add(ConcurrentHashMultiset.create()); aCounts = aCounter.get(idx); } aCounts.add(alIdx); } } }
Example 2
Source File: MosesPharoahFeatureExtractor.java From phrasal with GNU General Public License v3.0 | 5 votes |
private static void addCountToArray(ConcurrentHashMultiset<Integer> counter, int idx) { if (idx < 0) return; counter.add(idx); if (DEBUG_LEVEL >= 3) System.err.println("Increasing count idx=" + idx + " in vector (" + counter + ")."); }
Example 3
Source File: CountFeatureExtractor.java From phrasal with GNU General Public License v3.0 | 5 votes |
private static void addCountToArray(final ConcurrentHashMultiset<Integer> counter, int idx) { if (idx < 0) return; counter.add(idx); if (DEBUG_LEVEL >= 3) System.err.println("Increasing count idx=" + idx + " in vector (" + counter + ")."); }