w2v-server: read words to be marked (-M file.txt) as utf8
diff --git a/w2v-server.pl b/w2v-server.pl
index edd04a4..381e81b 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -24,13 +24,14 @@
getopt('d:il:p:m:M:');
if($opt_M) {
- open(FILE, "<$opt_M") or die "cannot open $opt_M";
- while(<FILE>) {
+ open my $handle, '<:encoding(UTF-8)', $opt_M
+ or die "Can't open '$opt_M' for reading: $!";
+ while(<$handle>) {
foreach my $mw (split /\s+/) {
$marked{$mw}=1
}
}
- close(FILE);
+ close($handle);
}
# -cbow 1 -size 200 -window 8 -negative 25 -hs 0 -sample 1e-4 -threads 40 -binary 1 -iter 15