nltk.Expression.replace

Expression.replace(variable, expression, replace_bound=False, alpha_convert=True)[source]

Replace every instance of ‘variable’ with ‘expression’ :param variable: Variable The variable to replace :param expression: Expression The expression with which to replace it :param replace_bound: bool Should bound variables be replaced? :param alpha_convert: bool Alpha convert automatically to avoid name clashes?