File indexing completed on 2025-07-06 04:48:11
0001 /* 0002 SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org> 0003 SPDX-License-Identifier: LGPL-2.0-or-later 0004 */ 0005 0006 #ifndef KITINERARY_NAMEOPTIMIZER_H 0007 #define KITINERARY_NAMEOPTIMIZER_H 0008 0009 class QString; 0010 class QVariant; 0011 0012 namespace KItinerary { 0013 0014 class Person; 0015 0016 /** Searches a given text for a better form of a given Person object. 0017 * Useful to improve ASCII-only or all uppercase names extracted from 0018 * ticket barcodes for example. 0019 */ 0020 class NameOptimizer 0021 { 0022 public: 0023 static Person optimizeName(const QString &text, const Person &person); 0024 static QVariant optimizeNameRecursive(const QString &text, QVariant object); 0025 0026 private: 0027 static QString optimizeNameString(const QString &text, const QString &name); 0028 }; 0029 0030 } 0031 0032 #endif // KITINERARY_NAMEOPTIMIZER_H