use strict;
use warnings;
use feature 'say';
-use lib '/Users/tla/Projects/cpanmods/Text-SenseClusters-1.03/lib';
+use lib '/home/tla/cpanmods/Text-SenseClusters-1.03/lib';
use Text::SenseClusters::Simat;
use Text::Tradition;
use Text::WagnerFischer qw/distance/;
# Get our arguments
my( $traditionfile, $threshold ) = @ARGV;
-$threshold = 0.9 unless $threshold;
+$threshold = 0.99 unless $threshold;
# Load up a tradition
my $t;
my ( $matrix ) = make_matrix( $t );
# For each relationship in the graph, see how it compares to other node pairs
-# rated > .9
+# rated > $threshold
foreach my $pair ( $c->relationships ) {
my $rel = $c->get_relationship( $pair );
my( $rx, $ry ) = map { $c->reading( $_ ) } sort @$pair;
- next if $rx->rank > 100;
- next if $ry->rank > 100;
say STDERR "Checking relationship $rx -- $ry, of type " . $rel->type;
my $matches = 0;
my %analyzed;
my $rct = 0;
foreach my $rx ( $c->readings ) {
- next if $rx->rank > 100;
next if $rx->is_meta();
# Have to compare each reading with each other, so do this only once
$analyzed{"$rx"} = 1;
$rct++;
say STDERR "Looking at reading $rct ( $rx )";
foreach my $ry ( $c->readings ) {
- next if $ry->rank > 100;
next if $ry->is_meta();
next if $analyzed{"$ry"};
return $cosine_values;
}
-
-sub calc_similarity {
- my( $matrix, $vecindex ) = @_;
-
- my $values = {};
- foreach my $val ( sort { $a <=> $b } keys %$values ) {
- my $pairlist = join( ', ', @{$values->{$val}} );
- say "$val: $pairlist";
- }
-}
\ No newline at end of file