// ApplicationContext appCtxSim = new ClassPathXmlApplicationContext(
// new String[] { "org/apache/ctakes/ytex/beans-kernel-sim.xml" },
// appCtx);
// ConceptSimilarityService simSvc = appCtxSim
// .getBean(ConceptSimilarityService.class);
ConceptSimilarityService simSvc = SimSvcContextHolder
.getApplicationContext()
.getBean(ConceptSimilarityService.class);
ConceptPairSimilarity simDogCat = simSvc.similarity(
Arrays.asList(SimilarityMetricEnum.PATH,
SimilarityMetricEnum.INTRINSIC_PATH), "dog", "cat",
null, false);
ConceptPairSimilarity simDogEColi = simSvc.similarity(
Arrays.asList(SimilarityMetricEnum.PATH,
SimilarityMetricEnum.INTRINSIC_PATH), "dog", "e coli",
null, false);
Assert.isTrue(simDogCat.getSimilarities().get(0) > simDogEColi
.getSimilarities().get(0));