private Distribution parseDistribution(String expr) { if ("LL".equals(expr)) { return new DistributionLL(); } else if ("SPL".equals(expr)) { return new DistributionSPL(); } else { throw new RuntimeException("Invalid distribution: " + expr); } }
/** spl/df/h2 with default parameters */ public void test() throws Exception { Similarity sim = getSimilarity("text"); assertEquals(IBSimilarity.class, sim.getClass()); IBSimilarity ib = (IBSimilarity) sim; assertEquals(DistributionSPL.class, ib.getDistribution().getClass()); assertEquals(LambdaDF.class, ib.getLambda().getClass()); assertEquals(NormalizationH2.class, ib.getNormalization().getClass()); }