Skip to content

Commit

Permalink
bug correction
Browse files Browse the repository at this point in the history
  • Loading branch information
rccarrasco committed Feb 22, 2014
1 parent 315a0f0 commit 2aeb0f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 68 deletions.
6 changes: 3 additions & 3 deletions src/main/java/eu/digitisation/deprecated/TextContent.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class TextContent {
* @param file the input file
* @param filter optional CharFilter (optional; can be null)
* @param encoding the text encoding for text files (optional; can be null)
* @throws eu.digitisation.io.WarningException
* @throws eu.digitisation.input.WarningException
*/
public TextContent(File file, CharFilter filter, String encoding)
throws WarningException {
Expand Down Expand Up @@ -120,7 +120,7 @@ public TextContent(File file, CharFilter filter, String encoding)
*
* @param file the input file
* @param filter optional CharFilter (optional; can be null)
* @throws eu.digitisation.io.WarningException
* @throws eu.digitisation.input.WarningException
*/
public TextContent(File file, CharFilter filter)
throws WarningException {
Expand All @@ -132,7 +132,7 @@ public TextContent(File file, CharFilter filter)
*
* @param s
* @param filter
* @throws eu.digitisation.io.WarningException
* @throws eu.digitisation.input.WarningException
*/
public TextContent(String s, CharFilter filter) throws WarningException {
builder = new StringBuilder();
Expand Down
15 changes: 7 additions & 8 deletions src/test/java/eu/digitisation/output/ErrorMeasureTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
*/
package eu.digitisation.output;

import eu.digitisation.output.ErrorMeasure;
import eu.digitisation.distance.EdOp;
import eu.digitisation.distance.StringEditDistance;
import eu.digitisation.text.StringNormalizer;
import eu.digitisation.deprecated.TextContent;
import eu.digitisation.math.BiCounter;
import eu.digitisation.text.StringNormalizer;
import eu.digitisation.text.Text;
import java.io.File;
import java.net.URL;
import static org.junit.Assert.assertEquals;
Expand All @@ -46,7 +45,7 @@ public void testMerge() throws Exception {
File file = new File(resourceUrl.toURI());
String encoding = "utf8";
String expResult = "mi en hora buena";
String result = new TextContent(file, null, encoding).toString();
String result = new Text(file).toString();
assertEquals(expResult, result);
}

Expand All @@ -64,8 +63,8 @@ public void testCer() throws Exception {
URL resourceUrl2 = getClass().getResource("/text2.txt");
File file2 = new File(resourceUrl2.toURI());
//String encoding2 = "utf8";
TextContent c1 = new TextContent(file1, null, null);
TextContent c2 = new TextContent(file2, null, null);
Text c1 = new Text(file1);
Text c2 = new Text(file2);
String s1 = StringNormalizer.reduceWS(c1.toString());
String s2 = StringNormalizer.reduceWS(c2.toString());
double expResult = 3.0 / 14;
Expand All @@ -88,8 +87,8 @@ public void testWer() throws Exception {
URL resourceUrl2 = getClass().getResource("/text2.txt");
File file2 = new File(resourceUrl2.toURI());
//String encoding2 = "utf8";
TextContent c1 = new TextContent(file1, null);
TextContent c2 = new TextContent(file2, null);
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);
Expand Down
57 changes: 0 additions & 57 deletions src/test/java/eu/digitisation/text/TextContentTest.java

This file was deleted.

0 comments on commit 2aeb0f0

Please sign in to comment.