Package org.nlpub.watset.graph
Class NodeWeightings
- java.lang.Object
-
- org.nlpub.watset.graph.NodeWeightings
-
public final class NodeWeightings extends Object
Useful implementations ofNodeWeighting.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNodeWeightings.LabelNodeWeighting<V,E>A trivial and not particularly useful node weighting approach that assigns the current node label as the weight.static classNodeWeightings.LinearNodeWeighting<V,E>The node weighting approach that chooses the label with the highest total edge weight in the neighborhood divided by the neighbor node degree.static classNodeWeightings.LogNodeWeighting<V,E>The node weighting approach that chooses the label with the highest total edge weight in the neighborhood divided by the logarithm of the neighbor node degree.static classNodeWeightings.TopNodeWeighting<V,E>The node weighting approach that chooses the label with the highest total edge weight in the neighborhood.static classNodeWeightings.WeightingModeWeighting modes.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V,E>
NodeWeighting<V,E>label()A static factory method providing a convenient way to create an instance ofNodeWeightings.LabelNodeWeighting.static <V,E>
NodeWeighting<V,E>linear()A static factory method providing a convenient way to create an instance ofNodeWeightings.LinearNodeWeighting.static <V,E>
NodeWeighting<V,E>log()A static factory method providing a convenient way to create an instance ofNodeWeightings.LogNodeWeighting.static <V,E>
NodeWeighting<V,E>parse(String mode)Construct a node weighting instance corresponding to the givenmode.static <V,E>
NodeWeighting<V,E>top()A static factory method providing a convenient way to create an instance ofNodeWeightings.TopNodeWeighting.
-
-
-
Method Detail
-
label
public static <V,E> NodeWeighting<V,E> label()
A static factory method providing a convenient way to create an instance ofNodeWeightings.LabelNodeWeighting.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Returns:
- an instance of
NodeWeightings.LabelNodeWeighting
-
top
public static <V,E> NodeWeighting<V,E> top()
A static factory method providing a convenient way to create an instance ofNodeWeightings.TopNodeWeighting.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Returns:
- an instance of
NodeWeightings.TopNodeWeighting
-
log
public static <V,E> NodeWeighting<V,E> log()
A static factory method providing a convenient way to create an instance ofNodeWeightings.LogNodeWeighting.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Returns:
- an instance of
NodeWeightings.LogNodeWeighting
-
linear
public static <V,E> NodeWeighting<V,E> linear()
A static factory method providing a convenient way to create an instance ofNodeWeightings.LinearNodeWeighting.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Returns:
- an instance of
NodeWeightings.LinearNodeWeighting
-
parse
public static <V,E> NodeWeighting<V,E> parse(String mode)
Construct a node weighting instance corresponding to the givenmode.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Parameters:
mode- the mode identifier- Returns:
- an instance of
NodeWeighting - See Also:
NodeWeightings.WeightingMode
-
-