TextFormatVectorizerUtils { public static void convertMalletEmbeddingsToBinary(File malletEmbeddings, File targetFile) throws IOException { convertMalletEmbeddingsToBinary(malletEmbeddings, false, Locale.US, targetFile); }  static Map<String, float[]> readEmbeddingFileTxt(File file, boolean hasHeader); static Map<String, float[]> readEmbeddingFileTxt(InputStream inputStream,
            boolean hasHeader); static void convertMalletEmbeddingsToBinary(File malletEmbeddings, File targetFile); static void convertMalletEmbeddingsToBinary(File malletEmbeddings, boolean aCaseless,
            Locale aLocale, File targetFile);  }
@Test public void testConvertMalletEmbeddingsToBinary() throws IOException { File modelFile = new File("src/test/resources/dummy.vec"); File targetFile = new File(testContext.getTestOutputFolder(), "binary"); Map<String, float[]> embeddings = TextFormatVectorizerUtils .readEmbeddingFileTxt(modelFile, false); TextFormatVectorizerUtils.convertMalletEmbeddingsToBinary(modelFile, targetFile); BinaryVectorizer vec = BinaryVectorizer.load(targetFile); for (String token : embeddings.keySet()) { assertTrue("Arrays to not match for token " + token, Arrays.equals(embeddings.get(token), vec.vectorize(token))); } }