Re: Omega: Missing support for newer weighting schemes
Vivek Pal <[email protected]> Fri, 14 Apr 2017 00:32:26 +0530
| Newsgroups | gmane.comp.search.xapian.devel |
|---|---|
| Message-ID | <CAGxcUfyefoG3FaSb7dZhyLOnE+_BabAqaQ8qdosPdroHyJyv9w@mail.gmail.com> |
>> Also, turns out that parse_params method is identical to unserialise() method >> in each Weight subclass so why not simply use unserialise method rather than >> implementing the same functionality that it provides under a different name >> like parse_params to avoid code duplication? > > They're conceptually similar, but unserialise() takes a binary serialisation > of the parameters (so it can easily and compactly pass floating point values > exactly), whereas here we need to parse an ASCII string representation of > the parameters. Ah, yes indeed. Thanks for clearing that up. >> In fact, the following code works just fine for all tests: >> >> enq.set_weighting_scheme(*wt->unserialise(p)); > > Currently omega has no test coverage for parsing of weighting schemes, so the > tests passing doesn't mean this works correctly. > > (We only added any tests of the omega CGI about 18 months ago, and at present > we really only have tests of changes since then - feature tests for new > features and regression tests for bug fixes). Oh, didn't realise there were no tests for this functionality. Probably, the next thing would be to write some tests afterwards. Thanks, Vivek