Mercurial > dedupe
comparison EditDistance.hpp @ 0:a3834af36579
Working with memory backend.
| author | Tom Fredrik Blenning Klaussen <bfg@blenning.no> |
|---|---|
| date | Mon, 20 Aug 2012 15:49:48 +0200 |
| parents | |
| children | 06166d6c083b |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:a3834af36579 |
|---|---|
| 1 #ifndef EDITDISTANCE_HPP | |
| 2 #define EDITDISTANCE_HPP | |
| 3 | |
| 4 #include "OrderedPair.hpp" | |
| 5 | |
| 6 #include <QtCore/QString> | |
| 7 #include <QtCore/QMap> | |
| 8 #include <QtCore/QHash> | |
| 9 | |
| 10 #include "ThreadSafeLookup.hpp" | |
| 11 | |
| 12 class EditDistance { | |
| 13 protected: | |
| 14 typedef ThreadSafeLookup<OrderedPair<QString>, int> cacheType; | |
| 15 //typedef QMap<OrderedPair<QString>, int> cacheType; | |
| 16 //typedef QHash<OrderedPair<QString>, int> cacheType; | |
| 17 public: | |
| 18 static int Compute(QString a, QString b, bool removeDiacritics = false); | |
| 19 static QString removeDiacritics(QString in); | |
| 20 | |
| 21 static cacheType cache; | |
| 22 }; | |
| 23 | |
| 24 #endif //EDITDISTANCE_HPP |
