Imported from https://github.com/tshev/faster-FastText