06 Aug 2020 16:38:40 UTC
- Distribution: Set-Similarity
- Module version: 0.027
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (0)
- Testers (241 / 0 / 0)
- KwaliteeBus factor: 1
- 100.00% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity24 month
- Download (19.8KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userWOLLMERS Helmut Wollmersdorferand 2 contributors
- Helmut Wollmersdorfer
- SOURCE REPOSITORY
- COPYRIGHT AND LICENSE
Set::Similarity::Overlap - Overlap coefficent for sets
use Set::Similarity::Overlap; my $overlap = Set::Similarity::Overlap->new; my $similarity = $overlap->similarity('Photographer','Fotograf');
( A intersect B ) / min(A,B)
my $similarity = $object->from_sets(['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 take care that the elements are unique. Also you should catch the situation where one of the arrayrefs is empty (similarity is 0), or both are empty (similarity is 1).
Helmut Wollmersdorfer, <email@example.com>
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.
Module Install Instructions
To install Set::Similarity, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Set::Similarity
For more information on module installation, please visit the detailed CPAN module installation guide.