LinguisticVariable::~LinguisticVariable() {
     for (int i = numberOfTerms() - 1; i >= 0; --i) {
         delete removeTerm(i);
     }
 }
예제 #2
0
void LanguageModel::addTerm(char *term, offset termFrequency, offset documentCount) {
	LocalLock lock(this);
	removeTerm(term);
	updateTerm(term, termFrequency, documentCount);
} // end of addTerm(char*, offset, offset)
 LinguisticTerm* LinguisticVariable::removeTerm(const std::string& name) {
     int index = indexOf(name);
     return index == -1 ? NULL : removeTerm(index);
 }