Revive -d option to dump vecs as ascii file
Change-Id: Ib78b6ad00af74aaf410544f8c872ac6cf67e90e8
diff --git a/script/derekovecs-server b/script/derekovecs-server
index 3531910..b09ffcf 100755
--- a/script/derekovecs-server
+++ b/script/derekovecs-server
@@ -1,7 +1,7 @@
#!/usr/local/bin/perl
our $VERSION = '0.90';
-use IDS::DeReKoVecs::Read qw(init_net load_sprofiles getCollocationAssociation getClassicCollocatorsCached getSimilarProfiles getSimilarProfilesCached getBiggestMergedDifferences filter_garbage get_neighbours getWordNumber);
+use IDS::DeReKoVecs::Read;
use Mojolicious::Lite;
use Mojo::JSON qw(decode_json encode_json to_json);
use base 'Mojolicious::Plugin';
@@ -62,7 +62,20 @@
my $title="";
my $training_args="";
-getopts('d:D:Gil:p:m:n:M:C');
+getopts('d:D:Gil:p:m:n:M:C') or usage();
+
+sub usage() {
+ print STDERR <<EOF;
+non-server mode usage: MOJO_CONFIG=`pwd`/example.conf $0 [-h] [-d <file>]
+-h : this (help) message
+-d file : dump binary vecs as ascii text to <file>
+
+server-mode invocation:
+
+MOJO_CONFIG=`pwd`/example.conf morbo $0
+EOF
+ exit;
+}
if($opt_M) {
open my $handle, '<:encoding(UTF-8)', $opt_M