|
41 | 41 | @property (nonatomic, copy) NSString* language; |
42 | 42 |
|
43 | 43 | /** |
44 | | - * The path to the tessdata file, if it was specified in a call to initWithLanguage:configDictionary:configFileNames:cachesRelatedDataPath:engineMode: as a cachesRelatedDataPath |
45 | | - * Otherwise it's supposed that the tessdata folder is located in the application bundle |
| 44 | + * The absolute path to the tessdata folder, which may exist in either the |
| 45 | + * application bundle or in the Caches directory depending on the argument to |
| 46 | + * `cachesRelatedDataPath` in the designated initializer. |
46 | 47 | */ |
47 | 48 | @property (nonatomic, readonly, copy) NSString *absoluteDataPath; |
48 | 49 |
|
|
112 | 113 | */ |
113 | 114 | @property (nonatomic, readonly) NSString *recognizedText; |
114 | 115 |
|
115 | | -/* |
116 | | -* Make an HTML-formatted string with hOCR markup from the internal data structures. |
117 | | -* page_number is 0-based but will appear in the output as 1-based. |
118 | | -*/ |
| 116 | +/** |
| 117 | + * Make an HTML-formatted string with hOCR markup from the internal Tesseract |
| 118 | + * data structures. |
| 119 | + * page_number is 0-based but will appear in the output as 1-based. |
| 120 | + * |
| 121 | + * @param pageNumber The page number within the image of interest. If you |
| 122 | + * aren't using a multipage image or don't know what this |
| 123 | + * means, use `0` for `pageNumber`. |
| 124 | + * |
| 125 | + * @return The HTML-formatted string with hOCR markup. |
| 126 | + */ |
119 | 127 | - (NSString *)recognizedHOCRForPageNumber:(int)pageNumber; |
120 | 128 |
|
121 | 129 | /** |
|
174 | 182 |
|
175 | 183 | /** |
176 | 184 | * Retrieve Tesseract's recognition result based on a provided resolution. |
177 | | - * For, example for the pageIteratorLevel == G8PageIteratorLevelSymbol it returns |
| 185 | + * For example, the pageIteratorLevel == G8PageIteratorLevelSymbol returns |
178 | 186 | * an array of `G8RecognizedBlock`'s representing the characters recognized |
179 | 187 | * in the target image, including the bounding boxes for each character. |
180 | 188 | * |
|
183 | 191 | * resolution options. |
184 | 192 | * |
185 | 193 | * @return An array of `G8RecognizedBlock`'s, each containing a confidence |
186 | | - * value and a bounding box for the text it represents. See G8RecognizedBlock.h for more |
187 | | - * information about the available fields for this data structure. |
| 194 | + * value and a bounding box for the text it represents. See |
| 195 | + * G8RecognizedBlock.h for more information about the available fields |
| 196 | + * for this data structure. |
188 | 197 | */ |
189 | 198 | - (NSArray *)recognizedBlocksByIteratorLevel:(G8PageIteratorLevel)pageIteratorLevel; |
190 | 199 |
|
|
237 | 246 | /** |
238 | 247 | * Initialize Tesseract with the provided language and engine mode. |
239 | 248 | * |
240 | | - * @param language The language to use in recognition. See `language`. |
241 | | - * @param configDictionary A dictionary of the config variables |
242 | | - * @param configFileNames An array of file names containing key-value config pairs. All the config |
243 | | - * variables can be init only and debug time both. Furthermore they could be |
244 | | - * specified at the same time, in such case tesseract will get variables from |
245 | | - * every file and dictionary all together. |
246 | | - * The files are searched into two folders, which are tessdata/tessconfigs and tessdata/configs |
247 | | - * @param cachesRelatedPath If the cachesRelatedDataPath is specified, the whole content of the tessdata from the |
248 | | - * application bundle is copied to the Library/Caches/cachesRelatedDataPath/tessdata |
249 | | - * and tesseract is initialized with that path. |
250 | | - * @param engineMode The engine mode to use in recognition. See `engineMode`. |
| 249 | + * @param language The language to use in recognition. See |
| 250 | + * `language`. |
| 251 | + * @param configDictionary A dictionary of config variables to set. |
| 252 | + * @param configFileNames An array of file names containing key-value |
| 253 | + * config pairs. Config settings can be set at |
| 254 | + * initialization or run-time. Furthermore, they |
| 255 | + * could be specified at the same time, in which |
| 256 | + * case Tesseract will get variables from every |
| 257 | + * config file as well as the dictionary. |
| 258 | + * The config files must exist in one of two |
| 259 | + * possible folders: tessdata/tessconfigs or |
| 260 | + * tessdata/configs. |
| 261 | + * @param cachesRelatedPath If the cachesRelatedDataPath is specified, the |
| 262 | + * whole contents of the tessdata folder in the |
| 263 | + * application bundle will be copied to |
| 264 | + * Library/Caches/cachesRelatedDataPath/tessdata |
| 265 | + * and Tesseract will be set to use that path. |
| 266 | + * @param engineMode The engine mode to use in recognition. See |
| 267 | + * `engineMode`. |
251 | 268 | * |
252 | 269 | * @return The initialized Tesseract object, or `nil` if there was an error. |
253 | 270 | */ |
|
268 | 285 | - (void)setVariableValue:(NSString *)value forKey:(NSString *)key; |
269 | 286 |
|
270 | 287 | /** |
271 | | - * Returns a Tesseract variable for the given key. See G8TesseractParameters.h for the available |
272 | | - * options. |
| 288 | + * Returns a Tesseract variable for the given key. See G8TesseractParameters.h |
| 289 | + * for the available options. |
273 | 290 | * |
274 | 291 | * @param key The option to get. |
275 | 292 | * |
276 | | - * @return returns the variable value for the given key, if it's beeb set. nil otherwise. |
| 293 | + * @return Returns the variable value for the given key, if it's been set. |
| 294 | + * nil otherwise. |
277 | 295 | */ |
278 | 296 | - (NSString*)variableValueForKey:(NSString *)key; |
279 | 297 |
|
|
0 commit comments