Exemplo n.º 1
0
void TStrParser::GetIDFWeightV(TFltV& WeightV) {
    int AlphN = GetAlphabetSize();
    WeightV.Gen(AlphN);
    for (int AlphC = 0; AlphC < AlphN; AlphC++) 
        WeightV[AlphC] = log((double)DocsParsed / WordToIdH[AlphC]);
    double MaxVal = WeightV[WeightV.GetMxValN()];
    for (int AlphC = 0; AlphC < AlphN; AlphC++) 
        WeightV[AlphC] /= MaxVal;
}