private AfterEffect parseAfterEffect(String expr) { if ("B".equals(expr)) { return new AfterEffectB(); } else if ("L".equals(expr)) { return new AfterEffectL(); } else if ("none".equals(expr)) { return new AfterEffect.NoAfterEffect(); } else { throw new RuntimeException("Invalid afterEffect: " + expr); } }
/** LUCENE-3566 */ public void testParameterC() throws Exception { Similarity sim = getSimilarity("text_paramc"); assertEquals(DFRSimilarity.class, sim.getClass()); DFRSimilarity dfr = (DFRSimilarity) sim; assertEquals(BasicModelP.class, dfr.getBasicModel().getClass()); assertEquals(AfterEffectL.class, dfr.getAfterEffect().getClass()); assertEquals(NormalizationH2.class, dfr.getNormalization().getClass()); NormalizationH2 norm = (NormalizationH2) dfr.getNormalization(); assertEquals(7f, norm.getC(), 0.01f); }