Esempio n. 1
0
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.")
Esempio n. 2
0
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.")
Esempio n. 3
0
 def bxcomp2(L, R, P):
     A = featureless(L.left.left)
     return A | A
Esempio n. 4
0
 def bxcomp2(L, R, P):
     A = featureless(L.left.left)
     return A | A