comparison common/EditDistance.h @ 11:98047b91b09d classical-rdf

* Add "proper" composer name matching from user input. Needs to be faster though
author Chris Cannam
date Thu, 18 Feb 2010 18:16:43 +0000
parents
children a1d67e136c30
comparison
equal deleted inserted replaced
10:d35e5d769c87 11:98047b91b09d
1
2 #ifndef _EDIT_DISTANCE_H_
3 #define _EDIT_DISTANCE_H_
4
5 #include <alloca.h>
6
7 #include <QString>
8
9 namespace ClassicalData {
10
11 class EditDistance
12 {
13 public:
14 enum TranspositionMode {
15 NoTransposition,
16 RestrictedTransposition
17 };
18
19 EditDistance(TranspositionMode tm = RestrictedTransposition,
20 int editPenalty = 1,
21 int suffixPenalty = 1,
22 bool normalise = true) :
23 m_transpositionMode(tm),
24 m_editPenalty(editPenalty),
25 m_suffixPenalty(suffixPenalty),
26 m_normalise(normalise) { }
27
28 int calculate(QString a, QString b);
29
30 private:
31 TranspositionMode m_transpositionMode;
32 int m_editPenalty;
33 int m_suffixPenalty;
34 bool m_normalise;
35 };
36
37 }
38
39 #endif
40
41