public int Init(string datapath,
            string language,
            OcrEngineMode oem,
            string configs,
            int configs_size,
            List<string> vars_vec,
            List<string> vars_values,            
            bool set_only_init_params)
        {
            //       if (tesseract_ != NULL &&
             //(datapath_ == NULL || language_ == NULL ||
             // *datapath_ != datapath || last_oem_requested_ != oem ||
             // (*language_ != Language && tesseract_->lang != Language)))
             //       {
             //           tesseract_->end_tesseract();
             //           delete tesseract_;
             //           tesseract_ = NULL;
             //       }
            if (tesseract != null &&
                (string.IsNullOrEmpty(datapath) || string.IsNullOrEmpty(language) ||
                this.datapath != datapath || !last_oem_requested.Equals(oem) ||
                (this.language != language && tesseract.Language != language)))
            {
                tesseract.end_tesseract();
                tesseract = null;
            }

            return 0;
        }
        public void SetPageSegMode(PageSegMode mode)
        {
            if (this.tesseract == null)
            {
                this.tesseract = new Tesseract();
            }

            tesseract.set_value(mode);
        }