view EditDistance.hpp @ 18:fcb7a71a22c1

Make it possible to turn off asserting for the RBTree template header.
author Tom Fredrik Blenning Klaussen <bfg@blenning.no>
date Wed, 29 Aug 2012 20:04:05 +0200
parents 06166d6c083b
children fda70a362ed5
line wrap: on
line source

#ifndef EDITDISTANCE_HPP
#define EDITDISTANCE_HPP

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

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

#include "ThreadSafeLookup.hpp"

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 QString removeDiacritics(QString in);

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

#endif //EDITDISTANCE_HPP