Changeset 73644644566a2ef9791d80ee31ab66770be83046
- Timestamp:
- 04/27/08 21:33:05 (8 months ago)
- Author:
- David Balmain <dbalmain@…>
- Parents:
- 15dee3043d3e551973defb68d67022123989c1fa
- Children:
- 56424f8d1cfd0e927e5e8f9e0c4329531221a966
- git-committer:
- David Balmain <dbalmain@gmail.com> / 2008-04-27T21:33:05Z+1000
- Message:
-
Fixed bug in sloppy PhraseQuery
Phrase positions wheren't being sorted consistantly causing inconsistant search
results.
- Location:
- c
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r0c11a5
|
r736446
|
|
| 117 | 117 | static bool pp_less_than(const PhPos *pp1, const PhPos *pp2) |
| 118 | 118 | { |
| 119 | | /* docs will all be equal when this method is used */ |
| 120 | | return pp1->position < pp2->position; |
| 121 | | /* |
| 122 | | if (PP(p)->doc == PP(p)->doc) { |
| 123 | | return PP(p)->position < PP(p)->position; |
| | 119 | if (pp1->position == pp2->position) { |
| | 120 | return pp1->offset > pp2->offset; |
| 124 | 121 | } |
| 125 | 122 | else { |
| 126 | | return PP(p)->doc < PP(p)->doc; |
| 127 | | } |
| 128 | | */ |
| | 123 | return pp1->position < pp2->position; |
| | 124 | } |
| 129 | 125 | } |
| 130 | 126 | |
| … |
… |
|
| 235 | 231 | return raw_score * sim_decode_norm( |
| 236 | 232 | self->similarity, |
| 237 | | phsc->norms[phsc->phrase_pos[phsc->pp_first_idx]->doc]); |
| | 233 | phsc->norms[self->doc]); |
| 238 | 234 | } |
| 239 | 235 | |
| … |
… |
|
| 279 | 275 | phsc_skip_to(self, doc_num); |
| 280 | 276 | |
| 281 | | phrase_freq = (self->doc == doc_num) ? phsc->freq : (float)0.0; |
| | 277 | phrase_freq = (self->doc == doc_num) ? phsc->freq : 0.0f; |
| 282 | 278 | return expl_new(sim_tf(self->similarity, phrase_freq), |
| 283 | 279 | "tf(phrase_freq=%f)", phrase_freq); |
-
|
r15dee3
|
r736446
|
|
| 259 | 259 | |
| 260 | 260 | dptr = suite->head; |
| 261 | | fprintf(stdout, "%-15s\t\tTotal\tFail\tFailed %%\n", "Failed Tests"); |
| | 261 | fprintf(stdout, "%-24sTotal\tFail\tFailed %%\n", "Failed Tests"); |
| 262 | 262 | fprintf(stdout, "===================================================\n"); |
| 263 | 263 | while (dptr != NULL) { |
-
|
r2142bb
|
r736446
|
|
| 162 | 162 | {"20050930", "word1", |
| 163 | 163 | "cat1/", ".123"}, |
| 164 | | {"20051001", "word1 word2 the quick brown fox", |
| | 164 | {"20051001", "word1 word2 the quick brown fox the quick brown fox", |
| 165 | 165 | "cat1/sub1", "0.954"}, |
| 166 | 166 | {"20051002", "word1 word3", |