re-reverted commit to use word2vec in situ
fixed file descriptors to support reading from pipes