Small test compilation fix (#226)

Signed-off-by: AlexDBlack <blacka101@gmail.com>
master
Alex Black 2019-09-03 14:17:53 +10:00 committed by GitHub
parent c64b340975
commit f076a8b285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -833,14 +833,14 @@ public class WordVectorSerializerTest extends BaseDL4JTest {
public void testB64_1() throws Exception {
String wordA = "night";
String wordB = "night day";
String encA = WordVectorSerializer.encodeB64(wordA);
String encB = WordVectorSerializer.encodeB64(wordB);
String encA = WordVectorSerializer.ReadHelper.encodeB64(wordA);
String encB = WordVectorSerializer.ReadHelper.encodeB64(wordB);
assertEquals(wordA, WordVectorSerializer.decodeB64(encA));
assertEquals(wordB, WordVectorSerializer.decodeB64(encB));
assertEquals(wordA, WordVectorSerializer.ReadHelper.decodeB64(encA));
assertEquals(wordB, WordVectorSerializer.ReadHelper.decodeB64(encB));
assertEquals(wordA, WordVectorSerializer.decodeB64(wordA));
assertEquals(wordB, WordVectorSerializer.decodeB64(wordB));
assertEquals(wordA, WordVectorSerializer.ReadHelper.decodeB64(wordA));
assertEquals(wordB, WordVectorSerializer.ReadHelper.decodeB64(wordB));
}

View File

@ -3241,7 +3241,7 @@ public class WordVectorSerializer {
/**
* Helper static methods to read data from input stream.
*/
private static class ReadHelper {
public static class ReadHelper {
/**
* Read a float from a data input stream Credit to:
* https://github.com/NLPchina/Word2VEC_java/blob/master/src/com/ansj/vec/Word2VEC.java
@ -3308,7 +3308,7 @@ public class WordVectorSerializer {
* @param word String
* @return String
*/
private static String encodeB64(String word) {
public static String encodeB64(String word) {
try {
return B64 + Base64.encodeBase64String(word.getBytes("UTF-8")).replaceAll("(\r|\n)", "");
} catch (Exception e) {
@ -3323,7 +3323,7 @@ public class WordVectorSerializer {
* @return String
*/
private static String decodeB64(String word) {
public static String decodeB64(String word) {
if (word.startsWith(B64)) {
String arp = word.replaceFirst(B64, "");
try {