Comparing Strings With Metrics in Haskell

I wrote a module for String distance metrics two years ago in Haskell. You find this code at github.com.

The module

defines two global helper functions, intListToInt to convert a list of integers into a number, e.g. [1, 2, 3, 4] to 1234:

and commonPrefix to determine the common prefix shared by two strings:

The module exports three functions to compare strings with metrics: jaroWinkler, levenshtein and cologneMethod. The function cologneMethod implements the Kölner Verfahren which is designed for the german language, while Jaro Winkler and Levenshtein can be used in general.

To test these functions, here is a little program:

Ralf Bensmann

Ralf Bensmann

Software Architect, Trainer, Author
Java Standard and Enterprise Edition
Clojure, Groovy & Grails
OpenOffice, LibreOffice

Archive

2012 (3)
2011 (43)
2010 (34)
Posterous theme by Cory Watilo