From c4ae902d75c98f47a7cbbd9d5170bb80a26d8a81 Mon Sep 17 00:00:00 2001 From: Dave Luff Date: Thu, 30 Dec 2010 16:20:40 +0000 Subject: [PATCH] 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. --- src/ATCDCL/atis.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ATCDCL/atis.cxx b/src/ATCDCL/atis.cxx index 357ff18a2..9181b3e01 100644 --- a/src/ATCDCL/atis.cxx +++ b/src/ATCDCL/atis.cxx @@ -42,6 +42,8 @@ #include #include +#include + #include @@ -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; }