osrm-backend/src/extractor/suffix_table.cpp
Konstantin Käfer 1309dd2a0f
Switch profiles from Lua to library interface
There's now an abstracted interface and no direct calls to Lua anymore.

fixes #1974
2016-07-22 15:03:57 +02:00

27 lines
670 B
C++

#include "extractor/suffix_table.hpp"
#include "extractor/scripting_environment.hpp"
#include <boost/algorithm/string.hpp>
namespace osrm
{
namespace extractor
{
SuffixTable::SuffixTable(ScriptingEnvironment &scripting_environment)
{
std::vector<std::string> suffixes_vector = scripting_environment.GetNameSuffixList();
for (auto &suffix : suffixes_vector)
boost::algorithm::to_lower(suffix);
suffix_set.insert(std::begin(suffixes_vector), std::end(suffixes_vector));
}
bool SuffixTable::isSuffix(const std::string &possible_suffix) const
{
return suffix_set.count(possible_suffix) > 0;
}
} /* namespace extractor */
} /* namespace osrm */