Skip to content

Commit

Permalink
修复word2vec缓存问题:#718
Browse files Browse the repository at this point in the history
  • Loading branch information
hankcs committed Dec 19, 2017
1 parent 28a790c commit e704dae
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ void reduceVocab()
DataInputStream oldCache = new DataInputStream(new FileInputStream(cacheFile));
while (oldCache.available() >= 4)
{
int id = table[oldCache.readInt()];
int oldId = oldCache.readInt();
if (oldId < 0)
{
cache.writeInt(oldId);
continue;
}
int id = table[oldId];
if (id == -4) continue;
cache.writeInt(id);
}
Expand Down

0 comments on commit e704dae

Please sign in to comment.