Class BabelSynsetRelation

java.lang.Object
it.uniroma1.lcl.babelnet.BabelSynsetRelation
All Implemented Interfaces:
SynsetRelation
Direct Known Subclasses:
BabelSynsetIDRelation

public class BabelSynsetRelation extends Object implements SynsetRelation
Class that models a relation to a synset ID in the BabelNet network.
Author:
navigli, vannella
  • Constructor Details

    • BabelSynsetRelation

      public BabelSynsetRelation(it.uniroma1.lcl.jlt.util.Language language, BabelPointer pointer, String target)
      Builds a synset relation
      Parameters:
      language - the relation language
      pointer - the relation type
      target - the target offset
    • BabelSynsetRelation

      @Deprecated public BabelSynsetRelation(it.uniroma1.lcl.jlt.util.Language language, BabelPointer pointer, String target, double weight, double normalizedWeight)
      Deprecated.
      For removal.
      Builds a synset relation
      Parameters:
      language - the relation language
      pointer - the relation type
      target - the target offset
      weight - the relation weight
      normalizedWeight - the relation normalized weight
  • Method Details

    • getLanguage

      public it.uniroma1.lcl.jlt.util.Language getLanguage()
      Returns the relation language
      Returns:
      the relation language
    • getPointer

      public BabelPointer getPointer()
      Returns the relation type
      Returns:
      the relation type
    • getWeight

      @Deprecated public double getWeight()
      Deprecated.
      For removal.
      Getter for the weight of the relation
      Returns:
      the weight of this edge.
    • setWeight

      @Deprecated public void setWeight(double weight)
      Deprecated.
      For removal.
      Parameters:
      weight - the relation weight
    • getNormalizedWeight

      @Deprecated public double getNormalizedWeight()
      Deprecated.
      For removal.
      Getter for the weight normalized across all relations of the same knowledge source, namely such that \sum_{e \in E_out^{WN/WIKI}} w(e) = 1
      Returns:
      the normalized weight of this edge.
    • setNormalizedWeight

      @Deprecated public void setNormalizedWeight(double normalizedWeight)
      Deprecated.
      For removal.
      Sets the relation normalized weight
      Parameters:
      normalizedWeight - the normalized weight
    • getTarget

      public String getTarget()
      Gets the target ID.
      Returns:
      String
    • getBabelSynsetIDTarget

      public BabelSynsetID getBabelSynsetIDTarget()
      Gets the target as a BabelSynsetID
      Returns:
      the target BabelSynsetID
    • fromString

      public static BabelSynsetRelation fromString(String edge)
      Creates a new instance of BabelSynsetRelation from an input record in the same format as found in BabelNetIndexField.RELATION
      Parameters:
      edge - the String representation of the edge
      Returns:
      creates a BabelSynsetRelation from a string representation.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object