Commit 58624607 authored by Volker Krause's avatar Volker Krause

Don't block airport name disambiguation on the "international" fragment

That is often used on airport names even if it's not officially part of
the name, unnecessarily restricting the candidate set. We can't outright
ignore this though, as for some airports it's actually a necessarily
distinguishing fragment.
parent 1f7785f4
......@@ -192,6 +192,9 @@ private Q_SLOTS:
// multiple unique hits / unique hit on valid (but wrong) IATA code
QCOMPARE(KnowledgeDb::iataCodesFromName(QStringLiteral("SEOUL KR GIMPO INTERNATIONAL TERMINAL I - SKY CITY INTERNATIONAL TERMINAL")), (std::vector<IataCode>{IataCode{"GMP"}, IataCode{"ICN"}}));
// "wrong" us of "international"
QCOMPARE(KnowledgeDb::iataCodesFromName(QStringLiteral("FRANKFURT DE - FRANKFURT INTL")), (std::vector<IataCode>{IataCode{"FRA"}, IataCode{"HHN"}}));
}
void countryDataTest()
......
......@@ -151,6 +151,11 @@ static void iataCodeForNonUniqueFragments(const QStringList &fragments, std::vec
continue;
}
// ignore the imprecisely used "international" if it results in an empty set here
if (s == QLatin1String("international") && !iataIdxs.intersects(candidates)) {
continue;
}
iataIdxs &= candidates;
if (iataIdxs.isEmpty()) {
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment