view EditDistance.hpp @ 52:725b0d776f3c

Fix a lot of problems with BitArray and reorganize which functions are located in header and file.
author Tom Fredrik Blenning Klaussen <bfg@blenning.no>
date Thu, 13 Sep 2012 23:23:14 +0200
parents 4c283daa42c7
children 7b7e84356b39
line wrap: on
line source

#ifndef EDITDISTANCE_HPP
#define EDITDISTANCE_HPP

#include "DBCache.hpp"
#include "OrderedPair.hpp"
#include "ThreadSafeLookup.hpp"
#include "UniqueString.hpp"

#include <QtCore/QHash>
#include <QtCore/QMap>
#include <QtCore/QString>

class EditDistance {
protected:
  //typedef ThreadSafeLookup<OrderedPair<QString>, int> cacheType;
  typedef DBCache<OrderedPair<UniqueString>, int, true> cacheType;
  //typedef QMap<OrderedPair<QString>, int> cacheType;
  //typedef QHash<OrderedPair<QString>, int> cacheType;
public:
  static int Compute(QString a, QString b, bool removeDiacritics = false);
  static void removeDiacriticsNoCopy(QString& in);
  static QString removeDiacritics(const QString& in);

  //static cacheType cache;
  static cacheType* cache;
};

#endif //EDITDISTANCE_HPP