Revert "w2v-server: hack for merged l2 vectors (?)"
This reverts commit de3223ec7eca7ec4a987e76b675bdca39cf7b98d.
diff --git a/w2v-server.pl b/w2v-server.pl
index 0ee5543..f29a70a 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -64,6 +64,7 @@
$mergedEnd = mergeVectors($opt_m);
}
+
if($opt_d) { # -d: dump vecs and exit
dump_vecs($opt_d);
exit;
@@ -727,7 +728,6 @@
char st[100][max_size], sep[100];
long a, b=0, c=0, cn=0;
int unmerged;
- int index = 0;
while (1) {
st[cn][b] = st1[c];
@@ -743,17 +743,11 @@
}
cn++;
for (a = 0; a < cn; a++) {
- b = 0;
- int i;
- for(i=0; i < strlen(st[a]) && st[a][i] >= '0' && st[a][i] <= '9'; i++)
- b = b*10+st[a][i]-'0';
- if(i < strlen(st[a]) || i==0) {
- if(search_backw) {
- for (b = words - 1; b >= 0; b--) if (!strcmp(&vocab[b * max_w], st[a])) break;
- } else {
- for (b = 0; b < words; b++) if (!strcmp(&vocab[b * max_w], st[a])) break;
- }
- }
+ if(search_backw) {
+ for (b = words - 1; b >= 0; b--) if (!strcmp(&vocab[b * max_w], st[a])) break;
+ } else {
+ for (b = 0; b < words; b++) if (!strcmp(&vocab[b * max_w], st[a])) break;
+ }
if (b == words) b = -1;
wl->wordi[a] = b;
fprintf(stderr, "Word: \"%s\" Position in vocabulary: %lld\n", st[a], wl->wordi[a]);