Clone wiki

lexicon / WithoutOCR

No Tesseract dependency

If you want to build the application without OCR functionality, follow the steps bellow. By using the OCR libraries you will use ~ 9 MB more plus ~ 1 MB OCR test data for each installed dictionary. Vice versa is also true.

  1. Open AndroidManifest.xml and remove uses-library =
  2. Open source file and remove/comment the following line:

private String getTextFromOCRBitmap(Bitmap bitmap) {
	return null;
	String lang = currentDictionary == null	|| currentDictionary.source_language.length() == 0 ? "eng": currentDictionary.source_language;

	TessBaseAPI baseApi = new TessBaseAPI();
	baseApi.init(Utils.getDbDirectory(this), lang);

	String recognizedText = baseApi.getUTF8Text();
	return recognizedText;
  1. Open the res/menu/mainmenu.xml, search for '@+id/item_ocr' item and add the following property: android:visible="false"
  2. Open the file lexicon/ and remove the refference to the tess-two project:

That should be all!