def typeraise(x, t, dir, strip_features=True): ''' Performs the typeraising X -> T|(T|X). ''' if strip_features: T, X = featureless(t), featureless(x) else: T, X = t, x if dir == TR_FORWARD: return T / (T | X) elif dir == TR_BACKWARD: return T | (T / X) elif dir == TR_TOPICALISATION: return T / (T / X) else: raise MungeException("Invalid typeraise direction.")
def typeraise(x, t, dir, strip_features=True): ''' Performs the typeraising X -> T|(T|X). ''' if strip_features: T, X = featureless(t), featureless(x) else: T, X = t, x if dir == TR_FORWARD: return T/(T|X) elif dir == TR_BACKWARD: return T|(T/X) elif dir == TR_TOPICALISATION: return T/(T/X) else: raise MungeException("Invalid typeraise direction.")
def bxcomp2(L, R, P): A = featureless(L.left.left) return A | A