PreXident / TextAn

MFF automaticky policejni analytik
Other
4 stars 3 forks source link

Learning error testing #49

Closed Blemicek closed 10 years ago

Blemicek commented 10 years ago

Is there any special reason to use this testing:

BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(ps.getErrorStream()));
String lineErr;
String linePrev = null;
while ((lineErr = bufferedReader.readLine()) != null) {
    linePrev = lineErr;
}

//...

if ((correctRun) && ((linePrev != null) && (linePrev.endsWith("Recognizer saved.")))) {
    LOG.info("Training done");
    this.bindModel(modelLocation);
} else {
    LOG.error("Training failed: {}", linePrev);
}

instead of simple:

int exitCode = ps.exitValue();
if ((correctRun) && (exitCode == 0) {
    //...
}
// or something like that

?

vlcak commented 10 years ago

This is because Training failed doesn't tell much about error, so for testing purposes, i added this functionality.

Blemicek commented 10 years ago

Ok