File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -90,19 +90,19 @@ int main(int argc, char **argv) {
9090 cn ++ ;
9191 for (a = 0 ; a < cn ; a ++ ) {
9292 for (b = 0 ; b < words ; b ++ ) if (!strcmp (& vocab [b * max_w ], st [a ])) break ;
93- if (b == words ) b = 0 ;
93+ if (b == words ) b = -1 ;
9494 bi [a ] = b ;
9595 printf ("\nWord: %s Position in vocabulary: %lld\n" , st [a ], bi [a ]);
96- if (b == 0 ) {
96+ if (b == -1 ) {
9797 printf ("Out of dictionary word!\n" );
9898 break ;
9999 }
100100 }
101- if (b == 0 ) continue ;
101+ if (b == -1 ) continue ;
102102 printf ("\n Word Distance\n------------------------------------------------------------------------\n" );
103103 for (a = 0 ; a < size ; a ++ ) vec [a ] = 0 ;
104104 for (b = 0 ; b < cn ; b ++ ) {
105- if (bi [b ] == 0 ) continue ;
105+ if (bi [b ] == -1 ) continue ;
106106 for (a = 0 ; a < size ; a ++ ) vec [a ] += M [a + bi [b ] * size ];
107107 }
108108 len = 0 ;
@@ -132,4 +132,4 @@ int main(int argc, char **argv) {
132132 for (a = 0 ; a < N ; a ++ ) printf ("%50s\t\t%f\n" , bestw [a ], bestd [a ]);
133133 }
134134 return 0 ;
135- }
135+ }
You can’t perform that action at this time.
0 commit comments