Class LeastCommonSubsumerFinder


  • public class LeastCommonSubsumerFinder
    extends Object
    Implements the Least Common Subsumer (LSO) class. The LSO of two concepts c1 and c2 is "the most specific concept which is an ancestor of both c1 and c2".
    Author:
    Kleanthi Georgala (georgala@informatik.uni-leipzig.de)
    • Constructor Detail

      • LeastCommonSubsumerFinder

        public LeastCommonSubsumerFinder()
    • Method Detail

      • getDepth

        public int getDepth()
      • getSynsetsDistance

        public int getSynsetsDistance()
      • getLeastCommonSubsumer

        public void getLeastCommonSubsumer​(ArrayList<ArrayList<edu.mit.jwi.item.ISynsetID>> synset1Tree,
                                           ArrayList<ArrayList<edu.mit.jwi.item.ISynsetID>> synset2Tree)
        Computes the LSO between two concepts using their hypernym paths. For each pair of hypernym paths, it traverses both the paths simultaneously, starting from the root and until they share no more common concepts. Then it calculates the path length between the two concepts, as the number of the concepts that they do not have in common. In case 1) there is no LSO found until now, or 2) the new common concept is located deeper in the hierarchy, or 3) the new common concept has the same depth as the previous one but a smaller distance between the two concepts, the algorithm sets as the new common concept as the LSO.
        Parameters:
        synset1Tree - , the hypernym paths of the first concept
        synset2Tree - , the hypernym paths of the second concept