Last active
June 30, 2024 14:22
-
-
Save trikitrok/87cbd99c4358f31776f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::vector<std::string> NumbersExtractor::filterOutNotNumericTokens(const std::vector<std::string> & tokens) const { | |
std::vector<std::string> numericTokens; | |
for (unsigned int i = 0; i < tokens.size(); ++i) { | |
std::string token = tokens[i]; | |
if (isNotAnInteger(token)) { | |
continue; | |
} | |
numericTokens.push_back(tokens[i]); | |
return numericTokens; | |
} | |
bool NumbersExtractor::isNotAnInteger(const std::string & str) const { | |
return ! StringUtils::isAnInteger(str); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment