-
Tim Peters authored
CosineIndex.query_weight(): rewrote to squash code duplication. No change in what it returns (it's always returned an upper bound on possible doc scores, although people probably haven't thought of it that way before). Elsewhere: consequent changes. Problems: + mhindex.py needs repair, but I can't run it. Note that its current use of query_weight isn't legitimate (the usage doesn't conform to the IIndex interface -- passing a string is passing "a sequence", but not the intended sequence <wink>). + ZCTextIndex doesn't pass query_weight() on. + We've defined no methods to help clients compute what needs to be passed to query_weight (a sequence of only the positive terms). I changed mailtest.py to cheat, but it's doing a wrong thing for negative terms. + I expect it will be impossible to shake people from the belief that 100.0 * score / query_weight is some kind of "relevance score". It isn't. So perhaps better not to expose this in ZCTextIndex.
23578a23