Changeset 1710


Ignore:
Timestamp:
Jun 29, 2010, 1:21:16 AM (11 years ago)
Author:
malischewski
Message:

Fixed bug which broke weighted bigrams/trigrams costfunction. actually works now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/CostFunction/CostFunction.cs

    r1598 r1710  
    440440            input = input.ToUpper();
    441441
    442             double bigramscore = calculateNGrams(input, 2, 0, true);
    443             double trigramscore = calculateNGrams(input, 3, 0, true);
     442            double bigramscore = calculateNGrams(input, 2, 3, true); // Sinkov
     443            double trigramscore = calculateNGrams(input, 3, 3, true);
    444444            //testweise
    445             return 1.0*betaToemehArumugam * bigramscore +  betaToemehArumugam*trigramscore;
    446             // return -(4*(betaToemehArumugam * bigramscore) + 6*(betaToemehArumugam * trigramscore));
     445           
     446           // return  bigramscore + trigramscore;
     447            return (betaToemehArumugam * bigramscore) + (gammaToemehArumugam * trigramscore);
    447448            //return betaToemehArumugam * bigramscore;
    448449
Note: See TracChangeset for help on using the changeset viewer.