blob: 62afeecc1a1981319953cdcfbaf8ecc88bdf0d43 (
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
27
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "split_float.h"
#include <cctype>
namespace search {
namespace 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;
}
}
}
} // namespace search::queryeval
} // namespace search
|