From 0e88969f0a62b43a9102e6b38161377efd380d55 Mon Sep 17 00:00:00 2001 From: Guillermo Date: Mon, 3 Oct 2016 01:31:40 -0400 Subject: [PATCH] rearrange docs --- README.md | 71 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 3373e81..c246c91 100644 --- a/README.md +++ b/README.md @@ -48,10 +48,6 @@ walp # Docs -* [Tesseract Remote File Options](#tesseract-remote-file-options) - + [Tesseract.coreUrl](#tesseractcoreurl) - + [Tesseract.workerUrl](#tesseractworkerurl) - + [Tesseract.langUrl](#tesseractlangurl) * [Tesseract.recognize(image: ImageLike[, options]) -> [TesseractJob](#tesseractjob)](#tesseractrecognizeimage-imagelike-options---tesseractjob) + [Simple Example:](#simple-example) + [More Complicated Example:](#more-complicated-example) @@ -61,37 +57,10 @@ walp + [TesseractJob.progress(callback: function) -> TesseractJob](#tesseractjobprogresscallback-function---tesseractjob) + [TesseractJob.then(callback: function) -> TesseractJob](#tesseractjobthencallback-function---tesseractjob) + [TesseractJob.error(callback: function) -> TesseractJob](#tesseractjoberrorcallback-function---tesseractjob) - -## Tesseract Remote File Options -### Tesseract.coreUrl -A string specifying the location of the [tesseract.js-core library](https://github.com/naptha/tesseract.js-core), with default value 'https://cdn.rawgit.com/naptha/tesseract.js-core/master/index.js'. Set this string before calling `Tesseract.recognize` and `Tesseract.detect` if you want Tesseract.js to use a different file. - -For example: -```javascript -Tesseract.coreUrl = 'https://absolute-path-to/tesseract.js-core/index.js' -``` - -### Tesseract.workerUrl -A string specifying the location of the [tesseract.worker.js](./dist/tesseract.worker.js) file, with default value 'https://cdn.rawgit.com/naptha/tesseract.js/8b915dc/dist/tesseract.worker.js'. Set this string before calling `Tesseract.recognize` and `Tesseract.detect` if you want Tesseract.js to use a different file. - -For example: -```javascript -Tesseract.workerUrl = 'https://absolute-path-to/tesseract.worker.js' -``` - - -### Tesseract.langUrl -A string specifying the location of the tesseract language files, with default value 'https://cdn.rawgit.com/naptha/tessdata/gh-pages/3.02/'. Language file urls are calculated according to the formula `Tesseract.langUrl + lang + '.traineddata.gz'`. Set this string before calling `Tesseract.recognize` and `Tesseract.detect` if you want Tesseract.js to use different language files. - -In the following exampple, Tesseract.js will download the language file from 'https://absolute-path-to/lang/folder/rus.traineddata.gz': -```javascript -Tesseract.langUrl = 'https://absolute-path-to/lang/folder/' - -Tesseract.recognize('#my-im', { - lang: 'rus' -}) -``` - +* [Tesseract Remote File Options](#tesseract-remote-file-options) + + [Tesseract.coreUrl](#tesseractcoreurl) + + [Tesseract.workerUrl](#tesseractworkerurl) + + [Tesseract.langUrl](#tesseractlangurl) @@ -233,6 +202,38 @@ progress is: { Sets `callback` as the function that will be called if the job fails. - `callback` is a function with the signature `callback(erros)` where `error` is a json object. +## Tesseract Remote File Options +### Tesseract.coreUrl +A string specifying the location of the [tesseract.js-core library](https://github.com/naptha/tesseract.js-core), with default value 'https://cdn.rawgit.com/naptha/tesseract.js-core/master/index.js'. Set this string before calling `Tesseract.recognize` and `Tesseract.detect` if you want Tesseract.js to use a different file. + +For example: +```javascript +Tesseract.coreUrl = 'https://absolute-path-to/tesseract.js-core/index.js' +``` + +### Tesseract.workerUrl +A string specifying the location of the [tesseract.worker.js](./dist/tesseract.worker.js) file, with default value 'https://cdn.rawgit.com/naptha/tesseract.js/8b915dc/dist/tesseract.worker.js'. Set this string before calling `Tesseract.recognize` and `Tesseract.detect` if you want Tesseract.js to use a different file. + +For example: +```javascript +Tesseract.workerUrl = 'https://absolute-path-to/tesseract.worker.js' +``` + + +### Tesseract.langUrl +A string specifying the location of the tesseract language files, with default value 'https://cdn.rawgit.com/naptha/tessdata/gh-pages/3.02/'. Language file urls are calculated according to the formula `Tesseract.langUrl + lang + '.traineddata.gz'`. Set this string before calling `Tesseract.recognize` and `Tesseract.detect` if you want Tesseract.js to use different language files. + +In the following exampple, Tesseract.js will download the language file from 'https://absolute-path-to/lang/folder/rus.traineddata.gz': +```javascript +Tesseract.langUrl = 'https://absolute-path-to/lang/folder/' + +Tesseract.recognize('#my-im', { + lang: 'rus' +}) +``` + + + # Contributing ## Development