view common/EditDistance.h @ 30:8bed05455706

* Make classical code build
author Chris Cannam
date Tue, 16 Mar 2010 17:36:28 +0000
parents 7d8a6167febb
children
line wrap: on
line source

#ifndef _EDIT_DISTANCE_H_
#define _EDIT_DISTANCE_H_

#include <alloca.h>

#include <QString>

namespace ClassicalData {

class EditDistance
{
public:
    enum TranspositionMode {
	NoTransposition,
	RestrictedTransposition
    };

    EditDistance(TranspositionMode tm = RestrictedTransposition) :
	m_transpositionMode(tm) { }

    int calculate(QString a, QString b, int threshold = 0);

private:
    TranspositionMode m_transpositionMode;
    int m_editPenalty;
    int m_suffixPenalty;
    bool m_normalise;
};

}

#endif