With @karenzshea's name / ref split (ref. #2857) in master we want to make use of it and reduce `NewName` instructions when ever possible. This is a first step towards #2744 by using the already existing name change heuristic from the extractor now in post-processing as well. Limitations: at the moment we don't have the `SuffixTable` in post-processing; this would require us serializing and subsequently deserializing the table, passing it through from the profiles to the API.
33 lines
759 B
C++
33 lines
759 B
C++
#ifndef OSRM_EXTRACTOR_SUFFIX_LIST_HPP_
|
|
#define OSRM_EXTRACTOR_SUFFIX_LIST_HPP_
|
|
|
|
#include <string>
|
|
#include <unordered_set>
|
|
|
|
namespace osrm
|
|
{
|
|
namespace extractor
|
|
{
|
|
|
|
class ScriptingEnvironment;
|
|
|
|
// A table containing suffixes.
|
|
// At the moment, it is only a front for an unordered set. At some point we might want to make it
|
|
// country dependent and have it behave accordingly
|
|
class SuffixTable final
|
|
{
|
|
public:
|
|
SuffixTable(ScriptingEnvironment &scripting_environment);
|
|
|
|
// check whether a string is part of the know suffix list
|
|
bool isSuffix(const std::string &possible_suffix) const;
|
|
|
|
private:
|
|
std::unordered_set<std::string> suffix_set;
|
|
};
|
|
|
|
} /* namespace extractor */
|
|
} /* namespace osrm */
|
|
|
|
#endif /* OSRM_EXTRACTOR_SUFFIX_LIST_HPP_ */
|