优化
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ public class WeightOcrBatchService {
|
||||
if (candidate == null || candidate.text() == null) {
|
||||
continue;
|
||||
}
|
||||
String text = candidate.text().strip().replaceAll("[\\p{Cc}\\p{Cf}]+", " ");
|
||||
String text = candidate.text().replaceAll("[\\p{Cc}\\p{Cf}]+", " ").strip();
|
||||
if (text.isBlank()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ class WeightOcrBatchServiceTest {
|
||||
assertThat(result.recognized()).isEqualTo(1);
|
||||
assertThat(result.results().get(0).status()).isEqualTo(Status.RECOGNIZED);
|
||||
assertThat(result.results().get(0).confidence()).isEqualByComparingTo("0.50972");
|
||||
assertThat(result.results().get(0).ocrRawText()).isEqualTo("12.35\nKG ");
|
||||
assertThat(result.results().get(0).ocrRawText()).isEqualTo("12.35\nKG");
|
||||
Path batchOutput = outputRoot.resolve(result.outputDirectory());
|
||||
assertThat(batchOutput.resolve("cropped/weight.jpg")).isRegularFile();
|
||||
assertThat(batchOutput.resolve("raw/weight.json")).isRegularFile();
|
||||
|
||||
Reference in New Issue
Block a user