aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/vespa/searchlib/queryeval/split_float.cpp
blob: aef2a7c011d329e8e69f31f26a28d03d383a134c (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
24
25
26
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "split_float.h"
#include <cctype>

namespace search::queryeval {

SplitFloat::SplitFloat(const vespalib::string &input)
{
    bool seenText = false;
    for (size_t i = 0; i < input.size(); ++i) {
        unsigned char c = input[i];
        if (isalnum(c)) {
            if (!seenText) {
                _parts.push_back(vespalib::string());
            }
            _parts.back().push_back(c);
            seenText = true;
        } else {
            seenText = false;
        }
    }
}

}