w2v-server: new option -C to disable classic collocator caching
This is good for situations where the collocation db is still being
built.
diff --git a/w2v-server.pl b/w2v-server.pl
index 105f69a..22587b6 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -50,7 +50,7 @@
my %cccache; # classic collocator cache
my %spcache; # similar profile cache
-getopts('d:D:Gil:p:m:n:M:');
+getopts('d:D:Gil:p:m:n:M:C');
if($opt_M) {
open my $handle, '<:encoding(UTF-8)', $opt_M
@@ -146,7 +146,7 @@
if($opt_p >= 5000 && $opt_p < 5600) { # German non-reference
open PIPE, "GET http://corpora.ids-mannheim.de/openlab/derekovecs/getClassicCollocators?w=$word |";
}
- if(!$cccache{$word}) {
+ if($opt_C || !$cccache{$word}) {
$c->app->log->info("Getting classic collocates of $word.");
$cccache{$word} = getClassicCollocators($word);
$cccache{$word} =~ s/:(-?)(nan|inf)/:"${1}${2}"/g;