Ah.I must admit I hadn't thought of that.Thanks Olly.I'll  rewrite the code
and the tests so that an error is thrown whenever the string isn't valid
and remove the default case from all the functions.

On Mon, Mar 11, 2013 at 8:27 AM, Olly Betts <notifications@github.com>wrote:

> In xapian-core/include/xapian/weight.h:
>
> > +     *                         More normalizations for all components can be implemented by
> > +     *                         changing the backend to acquire the statistics
> > +     *                         required for the normalizations which are not
> > +     *                         currently available from Xapian::Weight.
> > +     *
> > +     *
> > +     *                         The default string is "NTN".
> > +     */
> > +
> > +    TfIdfWeight(std::string normals)
> > +    : normalizations(normals)
> > +    {
> > +    	// If the normalization string is invalid,set it to the default
> > +        // normalizations
> > +       	if (normalizations.length()!=3) {
> > +            normalizations="NTN";
>
> The result is rather inconsistent though - if you pass "LT" or "LTNX" you
> get "NTN", but if you pass "LOL" you get "LTN".
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/xapian/xapian/pull/6/files#r3311719>
> .
>