only add 1/2 the co-occurences, otherwise they would be counted 2 times.
8147
protected Cooccurrence filterCooccurence(JCas jCas, Annotation enclosingAnnot,
            Annotation annot1, Annotation annot2, String[] ids1, String[] ids2) {

        if (annot1.getAddress() < annot2.getAddress()) {
            return super.filterCooccurence(jCas, enclosingAnnot, annot1, annot2, ids1,
                    ids2);
        } else {
            return null;
        }
    }
1286793
private List<PeriodAssociative<T>> _Combine( List<PeriodAssociative<T>> periods1, List<PeriodAssociative<T>> periods2 )
	{
		List<PeriodAssociative<T>> result = new ArrayList<PeriodAssociative<T>>();

		int count1 = periods1.size();
		int count2 = periods2.size();

		int i = 0;
		int j = 0;
		while( i < count1 && j < count2 )
		{
			if( periods1.get( i ).getFrom().compareTo( periods2.get( j ).getFrom() ) <= 0 )
			{
				result.add( periods1.get( i ) );
				i++;
			}
			else
			{
				result.add( periods2.get( j ) );
				j++;
			}
		}
		while( i < count1 )
		{
			result.add( periods1.get( i ) );
			i++;
		}
		while( j < count2 )
		{
			result.add( periods2.get( j ) );
			j++;
		}

		return result;
	}
949666
void combine(final MomentStatistics b) {
		requireNonNull(b);

		final double m2 = _m2.value();
		final double m3 = _m3.value();

		final double pn = _n;
		final double n = _n + b._n;
		final double nn = n*n;

		final double d = b._m1.value() - _m1.value();
		final double dd = d*d;

		_n += b._n;

		_m1.add(d*b._n/n);

		_m2.add(b._m2).add(dd*pn*b._n/n);

		_m3.add(b._m3)
			.add(dd*d*(pn*b._n*(pn - b._n)/nn))
			.add(3.0*d*(pn*b._m2.value() - b._n*m2)/n);

		final double bnbn = (double)b._n*(double)b._n;

		_m4.add(b._m4)
			.add(dd*dd*(pn*b._n*(pn*pn - pn*b._n + bnbn)/(nn*n)))
			.add(6.0*dd*(pn*pn*b._m2.value() + bnbn*m2)/nn)
			.add(4.0*d*(pn*b._m3.value() - b._n*m3)/n);
	}
353187
private void addTokens(Queue<String> words,
                           int focusIndex,
                           int distance,
                           Map<Pair<Integer>, Double> matrixEntryToCount) {
        for (String word : words) {
            // skip adding co-occurence values for words that are not
            // accepted by the filter
            if (!word.equals(IteratorFactory.EMPTY_TOKEN)) {
                int index = termToIndex.getDimension(word);
                if (index >= 0) {
                    // Get the current number of times that the focus word has
                    // co-occurred with this word before after it.  Weight the
                    // word appropriately baed on distance
                    Pair<Integer> p = new Pair<Integer>(index, focusIndex);
                    double value = weighting.weight(distance, windowSize);
                    Double curCount = matrixEntryToCount.get(p);
                    matrixEntryToCount.put(p, (curCount == null)
                                           ? value : value + curCount);
                }
            }
            distance++;
        }
    }
881212
public function deduplicate()
	{
		if ($this->useCount > 1)
		{
			$this->isDeduplicated = true;
			$this->decrementUseCount($this->useCount - 1);
		}
	}
746214
private int count_gaps(int[] i1, int[] i2){

		int i0 = i1[0];
		int j0 = i2[0];
		int gaps = 0;
		for (int i =1 ; i<i1.length;i++ ){
			if ( Math.abs(i1[i]-i0) != 1 ||
					( Math.abs(i2[i]-j0) != 1)){
				gaps +=1;
			}
			i0 = i1[i];
			j0 = i2[i];
		}

		return gaps;
	}
910188
def _deduplicate(lst):
    """"""
    out = []
    for i in lst:
        if i not in out:
            out.append(i)
    return out
188804
public void incrementCount2D(K first, K second, double count) {
    if (depth != 2) {
      wrongDepth(); //throws exception
    }

    this.addToTotal(count);
    GeneralizedCounter<K> next = this.conditionalizeHelper(first);
    next.incrementCount1D(second, count);
  }
1074609
def count(self):
        
        return (
            self
            .mapPartitions(lambda p: [sum(1 for _ in p)])
            .reduce(operator.add)
        )
431642
def count(self, value=True):
        """"""
        if value not in (True, False):
            raise ValueError('can only count True or False, not %r' % (value,))
        return bin(self)[2:].count('01'[value])
1062815
def _multiply(self, x1, x2, out):
        """"""
        for spc, xp, yp, outp in zip(self.spaces, x1.parts, x2.parts,
                                     out.parts):
            spc._multiply(xp, yp, outp)
1365801
public void tally( Statistics other )
    {
        rightCount += other.rightCount();
        wrongCount += other.wrongCount();
        ignoredCount += other.ignoredCount();
        exceptionCount += other.exceptionCount();
    }
1250014
public void add(Counter<? extends G> c) {
        for (Map.Entry<? extends G,Integer> e : c) {
            count(e.getKey(), e.getValue());
        }
    }
96142
function (partStatistics) {
        this.count += partStatistics.count;
        this.tested += partStatistics.tested;
        this.ignored += partStatistics.ignored;
    }
850303
public void combine(WSStatistic otherStat) {
        if (!validate(otherStat))
            return;

        DoubleStatisticImpl other = (DoubleStatisticImpl) otherStat;
        count += other.count;
        //TODO: how to update lastSampleTime???
        //if (other.lastSampleTime > lastSampleTime)
        //  lastSampleTime = other.lastSampleTime;
    }
923410
public void removeDuplicateRules() {
        int prod1, prod2;
        int[] tmp1, tmp2;

        for (prod1 = getProductionCount() - 1; prod1 >= 0; prod1--) {
            tmp1 = getProduction(prod1);
            for (prod2 = prod1 - 1; prod2 >= 0; prod2--) {
                tmp2 = getProduction(prod2);
                if (tmp1[0] == tmp2[0]) {
                    if (equal(tmp1, tmp2)) {
                        removeProduction(prod1);
                        break;
                    }
                }
            }
        }
    }
427689
function _repeat (source, times) {
    var result = "";

    for (var i = 0; i < times; i++) {
        result += source;
    }

    return result;
}