Package org.hildan.ocr.reference
Object ReferenceImages
-
- All Implemented Interfaces:
public class ReferenceImages
-
-
Field Summary
Fields Modifier and Type Field Description public final static ReferenceImagesINSTANCE
-
Method Summary
Modifier and Type Method Description final List<ReferenceImage>readFrom(Path directory, String glob)Reads ReferenceImages from the given directory, associating them with text based on their names. -
-
Method Detail
-
readFrom
final List<ReferenceImage> readFrom(Path directory, String glob)
Reads ReferenceImages from the given directory, associating them with text based on their names.
If it contains no spaces, the name without extension of the image file is used as text for the image. Otherwise, only the part of the name up to the first space is used as text.
This way, more info can be added to the name after a space, which can be useful to map several images to the same text, or have images for lowercase and uppercase letters on case-insensitive file systems (for example,
"a.png"and"A upper.png".A glob pattern can be used to filter the files from the given directory.
-
-
-
-