#!/usr/bin/perl
use strict;
use warnings;
my $copyright = <<'EOF';
/* Copyright (C) 2020 Dipanshu Garg
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, see
 * <https://www.gnu.org/licenses/>.
 */
EOF

use Tokeniseise;

my $hdr = Tokeniseise->new('weight/wdf-norm-dispatch.h', 'Map string to wdf normalisation code', $copyright, 'XAPIAN_INCLUDED_WDF_NORM_DISPATCH_H', 'wdf_norm', 1, 'false');
for my $enum (qw/
    NONE
    BOOLEAN
    SQUARE
    LOG
    PIVOTED
    LOG_AVERAGE
    AUG_LOG
    SQRT
    AUG_AVERAGE
    MAX
    AUG /)
{
    $hdr->add($enum, "static_cast<unsigned char>(Xapian::TfIdfWeight::wdf_norm::$enum)");
}

$hdr->write('false', 'wdf_norm_tab');
