lib/TypedFeatureStructure.js
function featureIsUnifiable(feature) {
        logger.debug('TypedFeatureStructure.unifiable: checking feature: ' + feature + fs2.features[feature]);
        if (fs1.features[feature]) {
          // If feature of fs2 is a back pointer we want it to overrule feature
          // of the fs1.
          if (newStackb.indexOf(fs2.features[feature].id) > -1) {
            fs1.addAuxFeature(feature, fs2.features[feature], signature);
          }
          // One of the features should be not a back pointer because
          // otherwise we are checking for unification multiple times
          if ((newStacka.indexOf(fs1.features[feature].id) === -1) ||
            (newStackb.indexOf(fs2.features[feature].id) === -1)) {
            var unifiable = fs1.features[feature].unifiable(fs2.features[feature], signature, newStacka, newStackb);
            logger.debug('TypedFeatureStructure.unifiable: checking feature: ' + feature +
              ' with result: ' + unifiable);
            return (unifiable);
          }
          else {
            return (true);
          }
        }
        else {
          fs1.addAuxFeature(feature, fs2.features[feature], signature);
          return (true);
        }
      }
function featureIsUnifiable(feature) {
        logger.debug('TypedFeatureStructure.unifiable: checking feature: ' + feature + fs2.features[feature]);
        if (fs1.features[feature]) {
          // If feature of fs2 is a back pointer we want it to overrule feature
          // of the fs1.
          if (newStackb.indexOf(fs2.features[feature].id) > -1) {
            fs1.addAuxFeature(feature, fs2.features[feature], signature);
          }
          // One of the features should be not a back pointer because
          // otherwise we are checking for unification multiple times
          if ((newStacka.indexOf(fs1.features[feature].id) === -1) ||
            (newStackb.indexOf(fs2.features[feature].id) === -1)) {
            var unifiable = fs1.features[feature].unifiable(fs2.features[feature], signature, newStacka, newStackb);
            logger.debug('TypedFeatureStructure.unifiable: checking feature: ' + feature +
              ' with result: ' + unifiable);
            return (unifiable);
          }
          else {
            return (true);
          }
        }
        else {
          fs1.addAuxFeature(feature, fs2.features[feature], signature);
          return (true);
        }
      }
function featureIsUnifiable ( feature ) { logger . debug ( 'TypedFeatureStructure.unifiable: checking feature: ' + feature + fs2 . features [ feature ] ) ; if ( fs1 . features [ feature ] ) { // If feature of fs2 is a back pointer we want it to overrule feature // of the fs1. if ( newStackb . indexOf ( fs2 . features [ feature ] . id ) > - 1 ) { fs1 . addAuxFeature ( feature , fs2 . features [ feature ] , signature ) ; } // One of the features should be not a back pointer because // otherwise we are checking for unification multiple times if ( ( newStacka . indexOf ( fs1 . features [ feature ] . id ) === - 1 ) || ( newStackb . indexOf ( fs2 . features [ feature ] . id ) === - 1 ) ) { var unifiable = fs1 . features [ feature ] . unifiable ( fs2 . features [ feature ] , signature , newStacka , newStackb ) ; logger . debug ( 'TypedFeatureStructure.unifiable: checking feature: ' + feature + ' with result: ' + unifiable ) ; return ( unifiable ) ; } else { return ( true ) ; } } else { fs1 . addAuxFeature ( feature , fs2 . features [ feature ] , signature ) ; return ( true ) ; } }
Checks if a feature of two features structures can be unified
Checks if a feature of two features structures can be unified