aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/features/weighted_set_parser.h
blob: 6b649ac3b441c5a1d6977e5e8beb6e5c5559deaa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/vespalib/stllike/string.h>

namespace search::features {

/**
 * Utility for parsing a string representation of a weighted set
 * that is typically passed down with the query.
 *
 * The format of the weighted set is as follows:
 * {key1:weight1,key2:weight2,...,keyN:weightN}.
 */
class WeightedSetParser
{
public:
    template <typename OutputType>
    static void parse(const vespalib::string &input, OutputType &output);
};

}