I made some changes that seem to fix the scoring.  The changes are mostly going 
through the objects and keeping the score a double until it is compared.  I also 
changed the log statement to log(1.0 + score).  I'm not sure how to extract a patch, 
so here's the diff's for each file.

Terry Luedtke
National Library of Medicine

diff -r htdig-3.2.0b2.orig/htcommon/DocumentRef.h htdig-3.2.0b2/htcommon/DocumentRef.h
67c67
<     int                       DocScore()                      {return docScore;}
---
>     double                    DocScore()                      {return docScore;}
92c92
<     void              DocScore(int s)                 {docScore = s;}
---
>     void              DocScore(double s)              {docScore = s;}
159c159
<     int                       docScore;
---
>     double                    docScore;

diff -r htdig-3.2.0b2.orig/htsearch/Display.cc htdig-3.2.0b2/htsearch/Display.cc
862a863,864
>  
> 
865a868
>         if(debug) cerr << "generateStars: doc, min, max " << ref->DocScore() << ", " 
><< minScore << ", " << maxScore <<endl;
873a877,878
>     if(debug) cerr << "generateStars: nStars " << nStars << " of " << maxStars 
><<endl;
> 
1124c1129
<       if (date_factor != 0.0 || backlink_factor != 0.0)
---
>       if (date_factor != 0.0)
1127a1133
>         }
1128a1135,1136
>       if (backlink_factor != 0.0)
>       {
1135,1136d1142
<           if (score <= 1.0)
<             score = 1.0;
1147c1153,1154
<       thisMatch->setScore(1.0 + log(score));
---
>       score = log(1.0 + score);
>       thisMatch->setScore(score);


diff -r htdig-3.2.0b2.orig/htsearch/ResultMatch.cc 
htdig-3.2.0b2/htsearch/ResultMatch.cc
81a82,83
>     double score1 = m1->getScore();
>     double score2 = m2->getScore();
83c85,92
<     return m2->getScore() - m1->getScore();
---
>     if(score1 == score2)
>        return 0;
>     else if(score1 < score2)
>        return 1;
>     else
>        return -1;
> 
>     //    return m2->getScore() - m1->getScore();


diff -r htdig-3.2.0b2.orig/htsearch/ResultMatch.h htdig-3.2.0b2/htsearch/ResultMatch.h
41c41
<       void                    setScore(float s)       {score = s;}
---
>       void                    setScore(double s)      {score = s;}
44c44
<       int                             getScore()      {return (int) score;}
---
>       double                          getScore()      {return score;}
77c77
<       float                   score;
---
>       double                  score;



------------------------------------
To unsubscribe from the htdig3-dev mailing list, send a message to
[EMAIL PROTECTED]
You will receive a message to confirm this.


Reply via email to