src/test/java/eu/digitisation/output/ErrorMeasureTest.java
@Test
    public void testWer() throws Exception {
        System.out.println("wer");
        System.out.println("cer");
        URL resourceUrl1 = getClass().getResource("/text1.txt");
        File file1 = new File(resourceUrl1.toURI());
        //String encoding1 = "utf8";
        URL resourceUrl2 = getClass().getResource("/text2.txt");
        File file2 = new File(resourceUrl2.toURI());
        //String encoding2 = "utf8";
        Text c1= new Text(file1);
        Text c2 = new Text(file2);
        double expResult = 1.5;
        double result = ErrorMeasure.wer(c1.toString(), c2.toString());
        assertEquals(expResult, result, 0.001);

        String s1 = "one two three one two one";
        String s2 = "one two three four";
        expResult = 0.5;  // 1 replaced + 2 deleted out of 6 words
        result = ErrorMeasure.wer(s1, s2);
        assertEquals(expResult, result, 0.01);
    }
/**
     * Test of wer method, of class ErrorMeasure.
     *
     * @throws java.lang.Exception
     */
Test of wer method, of class ErrorMeasure.
Test of wer method of class ErrorMeasure .
@Test
    public void testWer() throws Exception {
        System.out.println("wer");
        System.out.println("cer");
        URL resourceUrl1 = getClass().getResource("/text1.txt");
        File file1 = new File(resourceUrl1.toURI());
        URL resourceUrl2 = getClass().getResource("/text2.txt");
        File file2 = new File(resourceUrl2.toURI());
        Text c1= new Text(file1);
        Text c2 = new Text(file2);
        double expResult = 1.5;
        double result = ErrorMeasure.wer(c1.toString(), c2.toString());
        assertEquals(expResult, result, 0.001);
        String s1 = "one two three one two one";
        String s2 = "one two three four";
        expResult = 0.5;  
        result = ErrorMeasure.wer(s1, s2);
        assertEquals(expResult, result, 0.01);
    }
@ Test public void testWer ( ) throws Exception { System . out . println ( "wer" ) ; System . out . println ( "cer" ) ; URL resourceUrl1 = getClass ( ) . getResource ( "/text1.txt" ) ; File file1 = new File ( resourceUrl1 . toURI ( ) ) ; URL resourceUrl2 = getClass ( ) . getResource ( "/text2.txt" ) ; File file2 = new File ( resourceUrl2 . toURI ( ) ) ; Text c1 = new Text ( file1 ) ; Text c2 = new Text ( file2 ) ; double expResult = 1.5 ; double result = ErrorMeasure . wer ( c1 . toString ( ) , c2 . toString ( ) ) ; assertEquals ( expResult , result , 0.001 ) ; String s1 = "one two three one two one" ; String s2 = "one two three four" ; expResult = 0.5 ; result = ErrorMeasure . wer ( s1 , s2 ) ; assertEquals ( expResult , result , 0.01 ) ; }
Test of wer method, of class ErrorMeasure.
Test of wer method of class ErrorMeasure .
//String encoding1 = "utf8"; //String encoding2 = "utf8"; // 1 replaced + 2 deleted out of 6 words