Setting up Optional Dictionaries (Diff Dictionaries)
Set the system dictionaries to be embedded in the engine. NGKOCR Ver.1.0 provides the following six optional dictionaries:
Dictionary Name | Record File Name | Key File Name | Content |
---|
diff0 | diff0.dbf | diff0.kef | Kaisho-style characters |
diff1 | diff1.dbf | diff1.kef | Faded characters |
diff2 | diff2.dbf | diff2.kef | Blurry characters |
diff3 | diff3.dbf | diff3.kef | Numbers |
diff4 | diff4.dbf | diff4.kef | Letters |
diff5 | diff5.dbf | diff5.kef | Kana characters |
int msetdiffdict(char* dbfname);
Input
char* dbfname; Path name of the optional (diff) dictionary without the file extension
Return value
0.................Normal completion
BUFFER_OVERFLOW...The number of embedded dictionaries exceeds JOCRMAXDICT
※Even in the case of an error, up to JOCRMAXDICT (12 in NGKOCR ver1.0) dictionaries are set.
※Dynamic dictionary reconfiguration is not possible.
※Re-initialization should be done by deleting the instance and reconstructing it.
Example
#include "ocrdef.h"
#include "ocrco.h"
#include "cjocrstock.h"
#include "cjocrdict98.h"
#include "errcode.h"
...
....
CJocrDict* pjocrdict = new CJocrDict;
pjocrdict->msetsystemdict("c:\\dic\\feature\\system");
pjocrdict->msetsystemdict("c:\\dic\\feature\\systemfat");
pjocrdict->msetdiffdict("c:\\dic\\feature\\diff0");
pjocrdict->msetdiffdict("c:\\dic\\feature\\diff1");
pjocrdict->msetdiffdict("c:\\dic\\feature\\diff2");
pjocrdict->msetdiffdict("c:\\dic\\feature\\diff3");
pjocrdict->msetdiffdict("c:\\dic\\feature\\diff4");
pjocrdict->msetdiffdict("c:\\dic\\feature\\diff5");
int ret = pjocrdict->mloaddict();
if(ret == 0) {
printf("Dictionary loaded successfully");
}
else {
printf("Dictionary load error");
}
delete pjocrdict;