### Question:
TreeKernel implements ISimilarity <DependencyTree>, Serializable { @Override public float calc(DependencyTree item1, DependencyTree item2){ float score = getDepScore(item1, item2, 1); float base = item1.size()*item2.size(); base = (float) Math.sqrt(base); return (score / base); }  @Override float calc(DependencyTree item1, DependencyTree item2); void setWordGraph(WordGraph wg); public double factor; }### Answer:
@Test public void testCalc() throws Exception { Vector<String[]> s = new Vector<String[]>(); s.add(new String[]{"听歌","唱歌"}); s.add(new String[]{"听歌","听个歌"}); s.add(new String[]{"听下面的歌","听周杰伦的歌"}); s.add(new String[]{"听吴世宇的歌","听周杰伦的歌"}); s.add(new String[]{"要导航","我要导航"}); s.add(new String[]{"我想去人民广场","我想到人民广场"}); s.add(new String[]{"我要去肯德基","我要去麦当劳"}); s.add(new String[]{"我要去肯德基","我要先去肯德基"}); s.add(new String[]{"发短信","发一条短信"}); s.add(new String[]{"我想去南京东路","我想去#POI#"}); s.add(new String[]{"播放流行的歌","我想听流行的歌"}); s.add(new String[]{"拍张照片","拍照"}); }