::----------------------------------------------------------
::请参考
:: http://www.kaiyuanba.cn/html/1/131/227/7891.htm
:: http://blog.wudilabs.org/entry/f25efc5f/
:: author: zhangtao/20140823 /QQ:406878851
::----------------------------------------------------------
@echo
@set NAME=heilongjiang

@if not exist %NAME%.box ( goto LABLE_MAKEBOX ) else ( goto LABLE_TRIAN )

:LABLE_MAKEBOX
@echo -------begin,make box -----------
@pause
tesseract %NAME%.tif %NAME% -l heilongjiang batch.nochop makebox
@if not exist %NAME%.box goto END_FLAG
@echo -------end,make box ,ok-----------
@pause
exit


:LABLE_TRIAN
@echo -------begin,train -----------
@pause
@echo -1-------------
tesseract %NAME%.tif %NAME% nobatch box.train
@if not exist %NAME%.tr goto END_FLAG
@echo -2-------------
unicharset_extractor %NAME%.box
mftraining -U unicharset -O %NAME%.unicharset  %NAME%.tr
@if not exist %NAME%.unicharset goto END_FLAG
@echo -3-------------
cntraining %NAME%.tr
@rename normproto  %NAME%.normproto
@rename Microfeat  %NAME%.Microfeat
@rename inttemp    %NAME%.inttemp
@rename pffmtable  %NAME%.pffmtable
@echo -4-------------
combine_tessdata %NAME%.
@if not exist %NAME%.traineddata goto END_FLAG
@echo -----------------------------
@echo %NAME%.traineddata
@echo ------end,succ---------------
@pause
exit

:END_FLAG
@echo -------end,failed,-----------
@pause
exit