private void setProperty(String key, String value) { if (value != null) { properties.setProperty(key, value); } else { properties.remove(key); } }
/** Property keys converted to all uppercase. */ private boolean parseProperty(String line, Properties properties) { final int index = line.indexOf(':'); if (index < 0) return false; final String key = line.substring(0, index).trim(); final String value = line.substring(index + 1).trim(); properties.setProperty(key.toUpperCase(), value); return true; }
/** * Set the value of Tesseract's internal parameter. * * @param key variable name, e.g., <code>tessedit_create_hocr</code>, <code> * tessedit_char_whitelist</code>, etc. * @param value value for corresponding variable, e.g., "1", "0", "0123456789", etc. */ public void setTessVariable(String key, String value) { prop.setProperty(key, value); }
/** * Enables hocr output. * * @param hocr to enable or disable hocr output */ public void setHocr(boolean hocr) { this.hocr = hocr; prop.setProperty("tessedit_create_hocr", hocr ? "1" : "0"); }