runtime error in creating ini file

This commit is contained in:
Hieu Hoang 2013-03-16 15:16:02 +00:00
parent 45c1dbe44a
commit 4f4e7c503d
2 changed files with 14 additions and 0 deletions

View File

@ -16,6 +16,13 @@ PT::PT(const std::string &line, int numFeatures, bool isHierarchical, const pair
outFactors = factors->second; outFactors = factors->second;
} }
if (inFactors.size() == 0) {
inFactors.push_back(0);
}
if (outFactors.size() == 0) {
outFactors.push_back(0);
}
int implementation; int implementation;
if (toks.size() > 1) if (toks.size() > 1)
implementation = Scan<int>(toks[1]); implementation = Scan<int>(toks[1]);

View File

@ -16,5 +16,12 @@ RO::RO(const std::string &line, const std::pair<Factors, Factors> *factors)
inFactors = factors->first; inFactors = factors->first;
outFactors = factors->second; outFactors = factors->second;
} }
if (inFactors.size() == 0) {
inFactors.push_back(0);
}
if (outFactors.size() == 0) {
outFactors.push_back(0);
}
} }