Search in sources :

Example 1 with NormalizationH3

use of org.apache.lucene.search.similarities.NormalizationH3 in project lucene-solr by apache.

the class TestDFRSimilarityFactory method testParameters.

/** dfr with parametrized normalization */
public void testParameters() throws Exception {
    Similarity sim = getSimilarity("text_params");
    assertEquals(DFRSimilarity.class, sim.getClass());
    DFRSimilarity dfr = (DFRSimilarity) sim;
    assertEquals(BasicModelIF.class, dfr.getBasicModel().getClass());
    assertEquals(AfterEffectB.class, dfr.getAfterEffect().getClass());
    assertEquals(NormalizationH3.class, dfr.getNormalization().getClass());
    NormalizationH3 norm = (NormalizationH3) dfr.getNormalization();
    assertEquals(900f, norm.getMu(), 0.01f);
}
Also used : DFRSimilarity(org.apache.lucene.search.similarities.DFRSimilarity) Similarity(org.apache.lucene.search.similarities.Similarity) NormalizationH3(org.apache.lucene.search.similarities.NormalizationH3) DFRSimilarity(org.apache.lucene.search.similarities.DFRSimilarity)

Example 2 with NormalizationH3

use of org.apache.lucene.search.similarities.NormalizationH3 in project lucene-solr by apache.

the class TestIBSimilarityFactory method testParameters.

/** ll/ttf/h3 with parametrized normalization */
public void testParameters() throws Exception {
    Similarity sim = getSimilarity("text_params");
    assertEquals(IBSimilarity.class, sim.getClass());
    IBSimilarity ib = (IBSimilarity) sim;
    assertEquals(DistributionLL.class, ib.getDistribution().getClass());
    assertEquals(LambdaTTF.class, ib.getLambda().getClass());
    assertEquals(NormalizationH3.class, ib.getNormalization().getClass());
    NormalizationH3 norm = (NormalizationH3) ib.getNormalization();
    assertEquals(900f, norm.getMu(), 0.01f);
}
Also used : Similarity(org.apache.lucene.search.similarities.Similarity) IBSimilarity(org.apache.lucene.search.similarities.IBSimilarity) NormalizationH3(org.apache.lucene.search.similarities.NormalizationH3) IBSimilarity(org.apache.lucene.search.similarities.IBSimilarity)

Aggregations

NormalizationH3 (org.apache.lucene.search.similarities.NormalizationH3)2 Similarity (org.apache.lucene.search.similarities.Similarity)2 DFRSimilarity (org.apache.lucene.search.similarities.DFRSimilarity)1 IBSimilarity (org.apache.lucene.search.similarities.IBSimilarity)1