NAME
Bag::Similarity::Overlap - Overlap coefficent for bags
SYNOPSIS
use Bag::Similarity::Overlap;
my $overlap = Bag::Similarity::Overlap->new;
my $similarity = $overlap->similarity('Photographer','Fotograf');
DESCRIPTION
Overlap coefficient
( A intersect B ) / min(A,B)
METHODS
Bag::Similarity::Overlap inherits all methods from Bag::Similarity and implements the following new ones.
from_bags
my $similarity = $object->from_bags(['a'],['b']);
This method expects two arrayrefs of strings as parameters. The parameters are not checked, thus can lead to funny results or uncatched divisions by zero.
If you want to use this method directly, you should catch the situation where one of the arrayrefs is empty (similarity is 0), or both are empty (similarity is 1).
SOURCE REPOSITORY
http://github.com/wollmers/Bag-Similarity
AUTHOR
Helmut Wollmersdorfer, <helmut.wollmersdorfer@gmail.com>
COPYRIGHT AND LICENSE
Copyright (C) 2013-2014 by Helmut Wollmersdorfer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.