Skip to content

Commit

Permalink
TIKA-1476: Added default configuration file
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/tika/trunk@1640189 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
dameikle committed Nov 17, 2014
1 parent b6fda2a commit ccc1fc0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
* parseContext.set(TesseractOCRConfig.class, config);<br>
* </p>
*
* Parameters can also be set by creating the TesseractOCRConfig.properties file
* and placing it in the package org/apache/tika/parser/ocr on the classpath. An
* example file can be found in the test resources folder:
* <code>tika-parsers/src/test/resources/test-properties/TesseractOCRConfig-full.properties</code>.
* Parameters can also be set by either editing the existing TesseractOCRConfig.properties file in,
* tika-parser/src/main/resources/org/apache/tika/parser/ocr, or overriding it by creating your own
* and placing it in the package org/apache/tika/parser/ocr on the classpath.
*
*/
public class TesseractOCRConfig implements Serializable{
Expand Down Expand Up @@ -206,7 +205,7 @@ private int getProp(Properties properties, String property, int defaultMissing)
try {
return Integer.parseInt(p);
} catch (Throwable ex) {
throw new RuntimeException(String.format("Cannot parse TesseractOCRConfig variable $s, invalid integer value", property), ex);
throw new RuntimeException(String.format("Cannot parse TesseractOCRConfig variable %s, invalid integer value", property), ex);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

tesseractPath=
language=eng
pageSegMode=1
maxFileSizeToOcr=2147483647
minFileSizeToOcr=0
timeout=120

0 comments on commit ccc1fc0

Please sign in to comment.