w2v-server: show merged vocabulary in with class "merged" (green)
diff --git a/w2v-server.pl b/w2v-server.pl
index f29a70a..d72aff8 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -731,22 +731,33 @@
while (1) {
st[cn][b] = st1[c];
+ if(merge_words > 0)
+ st[cn+1][b] = st1[c];
b++;
c++;
st[cn][b] = 0;
if (st1[c] == 0) break;
if (st1[c] == ' ' || st1[c] == '-') {
sep[cn++] = st1[c];
+ if(merge_words > 0)
+ sep[cn++] = st1[c];
b = 0;
c++;
}
}
cn++;
+ if(merge_words > 0)
+ cn++;
for (a = 0; a < cn; a++) {
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;
+ for (b = 0; b < words; b++)
+ if (!strcmp(&vocab[b * max_w], st[a])) {
+ if(merge_words > 0)
+ search_backw^=1;
+ break;
+ }
}
if (b == words) b = -1;
wl->wordi[a] = b;