FunctionWordFrequenciesMeasure extends JCasTextSimilarityMeasureBase { @Override public double getSimilarity(JCas jcas1, JCas jcas2) throws SimilarityException { double[] v1 = getDocumentVector(jcas1); double[] v2 = getDocumentVector(jcas2); PearsonsCorrelation p = new PearsonsCorrelation(); return p.correlation(v1, v2); } FunctionWordFrequenciesMeasure();  FunctionWordFrequenciesMeasure(String functionWordListLocation); @Override double getSimilarity(JCas jcas1, JCas jcas2); @Override double getSimilarity(JCas jcas1, JCas jcas2, Annotation coveringAnnotation1,
            Annotation coveringAnnotation2);  }
@Test public void run() throws Exception { JCasTextSimilarityMeasure comparator = new FunctionWordFrequenciesMeasure(); AnalysisEngine ae = AnalysisEngineFactory.createEngine(BreakIteratorSegmenter.class); JCasBuilder cb1 = new JCasBuilder(ae.newJCas()); cb1.add("a", Token.class); cb1.add("your", Token.class); cb1.add("were", Token.class); cb1.close(); JCasBuilder cb2 = new JCasBuilder(ae.newJCas()); cb2.add("this", Token.class); cb2.add("is", Token.class); cb2.add("a", Token.class); cb2.close(); assertEquals(0.303, comparator.getSimilarity(cb1.getJCas(), cb2.getJCas()), epsilon); }