Ticket #295: weightnames.patch

File weightnames.patch, 2.1 KB (added by Richard Boulton, 15 years ago)

Patch to change names of weighting schemes

  • include/xapian/enquire.h

     
    11221122
    11231123        /** Name of the weighting scheme.
    11241124         *
    1125          *  If the subclass is called FooWeight, this should return "Foo".
     1125         *  This should return the fully-namespaced name of the weighting
     1126         *  class, so if the subclass is called Xapian::FooWeight, this should
     1127         *  return "Xapian::FooWeight".
    11261128         */
    11271129        virtual std::string name() const = 0;
    11281130
  • matcher/scaleweight.cc

     
    3333
    3434std::string
    3535ScaleWeight::name() const {
    36     return "Scale";
     36    return "Xapian::ScaleWeight";
    3737}
    3838
    3939std::string
  • matcher/tradweight.cc

     
    4040    return new TradWeight(param_k);
    4141}
    4242
    43 string TradWeight::name() const { return "Trad"; }
     43string TradWeight::name() const { return "Xapian::TradWeight"; }
    4444
    4545string TradWeight::serialise() const {
    4646    return serialise_double(param_k);
  • matcher/bm25weight.cc

     
    4040    return new BM25Weight(k1, k2, k3, b, min_normlen);
    4141}
    4242
    43 string BM25Weight::name() const { return "BM25"; }
     43string BM25Weight::name() const { return "Xapian::BM25Weight"; }
    4444
    4545string BM25Weight::serialise() const {
    4646    string result = serialise_double(k1);
  • matcher/weight.cc

     
    5555
    5656BoolWeight::~BoolWeight() { }
    5757
    58 std::string BoolWeight::name() const { return "Bool"; }
     58std::string BoolWeight::name() const { return "Xapian::BoolWeight"; }
    5959
    6060std::string BoolWeight::serialise() const { return ""; }
    6161