Ejemplo n.º 1
0
 /** Test of percentUnigramsInLM method, of class BaselineFeatures. */
 @Test
 public void testPercentUnigramsInLM() {
   System.out.println("percentUnigramsInLM");
   Configurator.setConfig(
       "eu.monnetproject.translation.langmodel", "ms", "src/test/resources/model.lm");
   Translation translation = new MockTranslation("A B C E", "1 2 3");
   double expResult = 1.0;
   double result = instance.percentUnigramsInLM(translation);
   assertEquals(expResult, result, 0.0);
 }
Ejemplo n.º 2
0
 /** Test of percentNGramsInTopBotQuartile method, of class BaselineFeatures. */
 @Test
 public void testPercentNGramsInTopBotQuartile() {
   System.out.println("percentNGramsInTopBotQuartile");
   Configurator.setConfig(
       "eu.monnetproject.translation.langmodel", "ms", "src/test/resources/model.lm");
   Translation translation = new MockTranslation("A B C", "1 2 3");
   int n = 1;
   double[] expResult = new double[] {1.0, 0.0};
   double[] result = instance.percentNGramsInTopBotQuartile(translation, n);
   assertArrayEquals(expResult, result, 0.0);
 }