ADTF  3.18.4
fuzzy_match.h
Go to the documentation of this file.
1 
8 /*
9  * This file depends on Qt which is licensed under LGPLv3.
10  * See ADTF_DIR/3rdparty/qt5 and doc/license for detailed information.
11  */
12 
13 #pragma once
14 
15 #include <adtf_utils.h>
16 
17 #include <QLocale>
18 #include <QString>
19 
20 namespace adtf
21 {
22 namespace ui
23 {
24 namespace widget
25 {
26 namespace osborn
27 {
33 {
34  public:
35  struct cParameters
36  {
37  QLocale::Language m_oLanguage = QLocale::C;
38  QString m_strText;
39  QString m_strSearchText;
40  bool m_bCaseSensitive = false;
41  // initialized with "empirical" value. Controls the max char difference weight.
42  uint64_t m_nMaxCharDiffWeight = 10;
43  };
44 
45  cFuzzyMatch(const cParameters& oParameters);
46 
47  int64_t GetScore() const;
48 
49  private:
55  int64_t ComputeScore(const QString& strA, const QString& strB);
56 
57  private:
58  cParameters m_oParameters;
59  int64_t m_nScore{};
60 };
61 }
62 using cFuzzySearch = osborn::cFuzzyMatch;
63 
64 }
65 }
66 }
Copyright © Audi Electronics Venture GmbH.
cFuzzyMatch implements a modified Smith-Waterman algorithm (local alignment).
Definition: fuzzy_match.h:33
int64_t ComputeScore(const QString &strA, const QString &strB)
cFuzzyMatch implements a modified Smith-Waterman algorithm (local alignment).
Namespace for entire ADTF SDK.