Package org.nlpub.watset.util
Class Word2VecFormat
- java.lang.Object
-
- org.nlpub.watset.util.Word2VecFormat
-
public final class Word2VecFormat extends Object
Utilities for handling the Word2Vec text format for node embeddings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWord2VecFormat.SpaceStrategySpace character handling strategy.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V> voidwrite(BufferedWriter writer, List<NodeEmbedding<V>> embeddings, Word2VecFormat.SpaceStrategy spaceStrategy)Write the file in the Word2Vec format representing the node embeddings.
-
-
-
Field Detail
-
SPACES
public static final Pattern SPACES
A pattern that matches a space.
-
-
Method Detail
-
write
public static <V> void write(BufferedWriter writer, List<NodeEmbedding<V>> embeddings, Word2VecFormat.SpaceStrategy spaceStrategy) throws IOException
Write the file in the Word2Vec format representing the node embeddings.- Type Parameters:
V- the type of nodes in the graph- Parameters:
writer- the writerembeddings- the embeddingsspaceStrategy- the space handling strategy- Throws:
IOException- if an I/O error occurs
-
-