コード例 #1
0
 @Override
 public Alignment rematch(Alignment a) {
   Alignment maps = new Alignment();
   for (Mapping m : a) {
     int sId = m.getSourceId();
     int tId = m.getTargetId();
     maps.add(sId, tId, mapTwoTerms(sId, tId));
   }
   return maps;
 }
コード例 #2
0
 @Override
 public Alignment extendAlignment(Alignment a, double thresh) {
   input = a;
   Alignment maps = new Alignment();
   for (int i = 0; i < input.size(); i++) {
     Mapping m = input.get(i);
     Set<Integer> sourceSuperClasses = rels.getSuperClasses(m.getSourceId(), true);
     Set<Integer> targetSuperClasses = rels.getSuperClasses(m.getTargetId(), true);
     for (Integer s : sourceSuperClasses) {
       if (input.containsSource(s) || maps.containsSource(s)) continue;
       for (Integer t : targetSuperClasses) {
         if (input.containsTarget(t) || maps.containsTarget(t)) continue;
         double sim = mapTwoTerms(s, t);
         if (sim >= thresh) maps.add(s, t, sim);
       }
     }
   }
   return maps;
 }