blob: 8b05c043ea9965d2751ce7bcbc8034d326c785b3 (
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 Vespa.ai. 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;
}
}
}
}
|