nltk/nltk — pull request #232 by DavidDoukhan (2012-02-22 18:31:19+00:00)
Title: adding the generalized hamming distance as a metric for evaluating text segmentation

this file correspond to the generalized hamming distance
it can be used as a metric for text segmentation
it can be used the same way as the windowdiff metric, and has the same role

this implementation is a python translation of V. Kulyukin C++ code
(co-author of the paper on generalized hamming distance)
the examples in the demo function are the same that were used in
Kulyukin implementation, and allowed to compare the good behavior
of this metric to Kulyukin implementation, considered as a reference

we had a discussion about that point with Joel Nothman on nltk-dev
we talked about merging windowdiff, generalized hamming distance, and other metrics to come (Pk) into a single module, called nltk.metrics.segmentation
I'm new in this project, and it's also the first time i'm using github.
I saw most of the modules components into single py file. I did not found natural to put windowdiff, generalized hamming distance, and other metrics to come into a single file. I would find more natural to create a subdirectory called segmentation, than a file called segmentation.py. Since most of modules are not structured that way, let me know what do you prefer.

The way the contribution is done right now has at least the advantage of backwards-compatibility .