Package org.apache.tika.parser.ocr
Class TesseractOCRConfig.RuntimeConfig
java.lang.Object
org.apache.tika.parser.ocr.TesseractOCRConfig
org.apache.tika.parser.ocr.TesseractOCRConfig.RuntimeConfig
- All Implemented Interfaces:
Serializable
- Enclosing class:
TesseractOCRConfig
Runtime-only TesseractOCRConfig that prevents modification of paths and of the
-c pass-through map. Used to enforce immutability of parser-level paths
during parse-time configuration.
This class is deserialized by ConfigDeserializer (in tika-serialization) which uses
Jackson to populate fields via setters. If the JSON contains any path fields, the
overridden setters will throw TikaConfigException. otherTesseractConfig is
refused as well: tesseract variables such as debug_file name files the
binary opens, so the map is operator configuration only.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.tika.parser.ocr.TesseractOCRConfig
TesseractOCRConfig.OUTPUT_TYPE, TesseractOCRConfig.RuntimeConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOtherTesseractConfig(String key, String value) Add a key-value pair to pass to Tesseract using its -c command line option.voidsetImageMagickPath(String imageMagickPath) voidsetTessdataPath(String tessdataPath) voidsetTesseractPath(String tesseractPath) voidsetTrustedPageSeparator(String pageSeparator) Same asTesseractOCRConfig.setPageSeparator(String)but does not perform any checks on the string.Methods inherited from class org.apache.tika.parser.ocr.TesseractOCRConfig
getColorspace, getDensity, getDepth, getFilter, getImageMagickPath, getLangs, getLanguage, getMaxFileSizeToOcr, getMinFileSizeToOcr, getOtherTesseractConfig, getOutputType, getPageSegMode, getPageSeparator, getResize, getTessdataPath, getTesseractPath, getTimeoutMillis, isApplyRotation, isEnableImagePreprocessing, isInlineContent, isPreloadLangs, isPreserveInterwordSpacing, isSkipOcr, setApplyRotation, setColorspace, setDensity, setDepth, setEnableImagePreprocessing, setFilter, setInlineContent, setLanguage, setMaxFileSizeToOcr, setMinFileSizeToOcr, setOtherTesseractConfig, setOutputType, setOutputType, setPageSegMode, setPageSeparator, setPreloadLangs, setPreserveInterwordSpacing, setResize, setSkipOcr, setTimeoutMillis
-
Constructor Details
-
RuntimeConfig
public RuntimeConfig()
-
-
Method Details
-
setTesseractPath
- Overrides:
setTesseractPathin classTesseractOCRConfig- Throws:
TikaConfigException
-
setTessdataPath
- Overrides:
setTessdataPathin classTesseractOCRConfig- Throws:
TikaConfigException
-
setImageMagickPath
- Overrides:
setImageMagickPathin classTesseractOCRConfig- Throws:
TikaConfigException
-
setTrustedPageSeparator
Description copied from class:TesseractOCRConfigSame asTesseractOCRConfig.setPageSeparator(String)but does not perform any checks on the string.- Overrides:
setTrustedPageSeparatorin classTesseractOCRConfig- Parameters:
pageSeparator-
-
addOtherTesseractConfig
Description copied from class:TesseractOCRConfigAdd a key-value pair to pass to Tesseract using its -c command line option. To see the possible options, run tesseract --print-parameters.- Overrides:
addOtherTesseractConfigin classTesseractOCRConfig- Parameters:
key-value-
-