distance.h 585 B

12345678910111213141516171819202122232425262728
  1. #ifndef DISTANCE_H
  2. #define DISTANCE_H
  3. #include <glib.h>
  4. class EditDistance
  5. {
  6. private:
  7. int *d;
  8. int currentelements;
  9. /*Gets the minimum of three values */
  10. inline int minimum( const int a, const int b, const int c )
  11. {
  12. int min = a;
  13. if ( b < min )
  14. min = b;
  15. if ( c < min )
  16. min = c;
  17. return min;
  18. };
  19. public:
  20. EditDistance( );
  21. ~EditDistance( );
  22. int CalEditDistance( const gunichar *s, const gunichar *t, const int limit );
  23. };
  24. #endif