nltk/nltk — pull request #284 by cfedermann (2012-07-10 07:55:02+00:00)
Title: Bugfix for agreement.py removing dependence on ordered coder names.

Fixed bug in `agr(self, cA, cB, i, data=None)` where a wrong order of coder/item combinations in data could cause a result of `0.0`, which affected results from `kappa()`, `pi()`, and `S()`.

Updated the `doctest` accordingly:

This would have returned a wrong value (0.0) in @785fb79 as coders are in
the wrong order. Subsequently, all values for pi(), S(), and kappa() would
have been wrong as they are computed with avg_Ao().
>>> t2 = AnnotationTask(data=[('b','1','stat'),('a','1','stat')])
>>> t2.avg_Ao()
1.0

The following, of course, also works.
>>> t3 = AnnotationTask(data=[('a','1','othr'),('b','1','othr')])
>>> t3.avg_Ao()
1.0

Please merge; feel free to adapt/change my code as you seem fit...