1
0
Fork 0

ATIS: evaluate airport abbreviations case-insensitively

The apt.dat file contains inconsistent case for many airport name abbreviations,
e.g. MUNI/Muni and intl/Intl.  Evaluate the abbreviations in lower-case when
expanding them in order to avoid missing any.
This commit is contained in:
Dave Luff 2010-12-30 16:20:40 +00:00
parent 9a987a3709
commit c4ae902d75

View file

@ -42,6 +42,8 @@
#include <boost/tuple/tuple.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/case_conv.hpp>
#include <simgear/misc/sg_path.hxx>
@ -256,7 +258,12 @@ int FGATIS::GenTransmission(const int regen, const int special) {
// make things nicer for the text-to-speech system:
for (MSS::const_iterator replace = _remap.begin();
replace != _remap.end(); replace++) {
if (word == replace->first) {
// Due to inconsistent capitalisation in the apt.dat file, we need
// to do a case-insensitive comparison here.
string tmp1 = word, tmp2 = replace->first;
boost::algorithm::to_lower(tmp1);
boost::algorithm::to_lower(tmp2);
if (tmp1 == tmp2) {
word = replace->second;
break;
}