Package org.nlpub.watset.util
Class NetworkXFormat
java.lang.Object
org.nlpub.watset.util.NetworkXFormat
Utilities for handling pickled NetworkX graphs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <V> org.jgrapht.Graph<V,org.jgrapht.graph.DefaultWeightedEdge> load(net.razorvine.pickle.objects.ClassDict nx) Reconstruct aGraphobject from the unpickled NetworkX graph.static net.razorvine.pickle.objects.ClassDictparse(InputStream stream) Unpickle the NetworkX graph from the input stream.
-
Method Details
-
parse
Unpickle the NetworkX graph from the input stream.- Parameters:
stream- the input stream with pickled data- Returns:
- an unpickled NetworkX graph
- Throws:
IOException- if an I/O error occurs
-
load
public static <V> org.jgrapht.Graph<V,org.jgrapht.graph.DefaultWeightedEdge> load(net.razorvine.pickle.objects.ClassDict nx) Reconstruct aGraphobject from the unpickled NetworkX graph.Please be careful with the type of the nodes.
- Type Parameters:
V- the type of nodes in the graph- Parameters:
nx- the unpickled NetworkX graph- Returns:
- a graph represented in the unpickled graph
-