void generalInit(ECString path) { struct rlimit core_limits; core_limits.rlim_cur = 0; core_limits.rlim_max = 0; setrlimit( RLIMIT_CORE, &core_limits ); struct rlimit stack_limits; stack_limits.rlim_cur = 0; stack_limits.rlim_max = 0; getrlimit( RLIMIT_STACK, &stack_limits ); if (stack_limits.rlim_cur < stack_limits.rlim_max) { stack_limits.rlim_cur = stack_limits.rlim_max; setrlimit( RLIMIT_STACK, &stack_limits ); } if (!endsWith(path, "/")) { path += "/"; } Term::init( path ); readHeadInfo(path); InputTree::init(); UnitRules* ur = new UnitRules; ur->readData(path); Bchart::unitRules = ur; Bchart::readTermProbs(path); MeChart::init(path); Bchart::setPosStarts(); ChartBase::midFactor = (1.0 - (.3684 *ChartBase::endFactor))/(1.0 - .3684); if(Feature::isLM or Feature::useExtraConditioning) ClassRule::readCRules(path); }
void generalInit(ECString path) { struct rlimit core_limits; core_limits.rlim_cur = 0; core_limits.rlim_max = 0; setrlimit( RLIMIT_CORE, &core_limits ); struct rlimit stack_limits; stack_limits.rlim_cur = 0; stack_limits.rlim_max = 0; getrlimit( RLIMIT_STACK, &stack_limits ); if (stack_limits.rlim_cur < stack_limits.rlim_max) { stack_limits.rlim_cur = stack_limits.rlim_max; setrlimit( RLIMIT_STACK, &stack_limits ); } // load locale settings from the environment setlocale(LC_ALL, ""); path = sanitizePath(path); Term::init( path ); readHeadInfo(path); InputTree::init(); UnitRules* ur = new UnitRules; ur->readData(path); Bchart::unitRules = ur; Bchart::readTermProbs(path); MeChart::init(path); Bchart::setPosStarts(); ChartBase::midFactor = (1.0 - (.3684 *ChartBase::endFactor))/(1.0 - .3684); if(Feature::isLM or Feature::useExtraConditioning) ClassRule::readCRules(path); }