derekovecs: add corpus name(s) to heading and page title
diff --git a/w2v-server.pl b/w2v-server.pl
index 8701f90..2c57554 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -28,6 +28,7 @@
our $opt_G;
my %marked;
+my $title="";
my $training_args="";
my $mergedEnd=0;
my %cache;
@@ -56,12 +57,14 @@
$training_args = <FILE>;
}
close(FILE);
+ $title = fname2corpusname($ARGV[0]);
}
my $have_sprofiles = load_sprofiles($ARGV[0]);
if($opt_m) {
$mergedEnd = mergeVectors($opt_m);
+ $title = "<span class=\"merged\">" . $title . "</span> vs. " . fname2corpusname($opt_m);
}
@@ -101,6 +104,13 @@
$c->reply->static($url);
};
+sub fname2corpusname {
+ ($_) = @_;
+ s@.*/@@;
+ s@\..*@@;
+ return $_;
+}
+
sub getClassicCollocatorsCached {
my ($c, $word) = @_;
if(!$cccache{$word}) {
@@ -220,7 +230,7 @@
$csv_data .= "\n";
return $c->render(text=>$csv_data);
} else {
- $c->render(template=>"index", word=>$word, cutoff=>$cutoff, no_nbs=>$no_nbs, no_iterations => $no_iterations, epsilon=> $epsilon, perplexity=> $perplexity, show_som=>$som, searchBaseVocabFirst=>$searchBaseVocabFirst, sort=>$sort, training_args=>$training_args, mergedEnd=> $mergedEnd, haveSProfiles=> $have_sprofiles, dedupe=> $dedupe, marked=>\%marked, lists=> \@lists, collocators=> $res->{syntagmatic});
+ $c->render(template=>"index", title=>$title, word=>$word, cutoff=>$cutoff, no_nbs=>$no_nbs, no_iterations => $no_iterations, epsilon=> $epsilon, perplexity=> $perplexity, show_som=>$som, searchBaseVocabFirst=>$searchBaseVocabFirst, sort=>$sort, training_args=>$training_args, mergedEnd=> $mergedEnd, haveSProfiles=> $have_sprofiles, dedupe=> $dedupe, marked=>\%marked, lists=> \@lists, collocators=> $res->{syntagmatic});
}
};