public override Dictionary <object, CCGCategory> CanUnify(CCGCategory other) { PrimitiveCategory primitiveCategory = (PrimitiveCategory)other; if (!other.IsPrimitive()) { return(null); } if (other.IsVar()) { return new Dictionary <object, CCGCategory>() { { other, this } } } ; if (primitiveCategory.Categ == Categ) { foreach (var item in Restrictions) { if (!primitiveCategory.Restrictions.Contains(item)) { return(null); } } return(new Dictionary <object, CCGCategory>()); } return(null); }
public override Dictionary <object, CCGCategory> CanUnify(CCGCategory other) { if (other.IsVar()) { return new Dictionary <object, CCGCategory>() { { other, this } } } ; FunctionalCategory functionalCategory = (FunctionalCategory)other; if (other.IsFunction()) { var sa = Result.CanUnify(functionalCategory.Result); var sd = Dir.CanUnify(functionalCategory.Dir); if (sa != null && sd != null) { var sb = Arg.Substitute(sa).CanUnify(functionalCategory.Arg.Substitute(sa)); if (sb != null) { foreach (var item in sb) { sa.Add(item.Key, item.Value); } } } } return(null); }
public override Dictionary <object, CCGCategory> CanUnify(CCGCategory other) { if (other.IsPrimitive() || !PrimOnly) { return(new Dictionary <object, CCGCategory>() { { this, other } }); } return(null); }
public abstract Dictionary <object, CCGCategory> CanUnify(CCGCategory other);
public FunctionalCategory(CCGCategory result, CCGCategory arg, CCGCategory dir) { Result = result; Arg = arg; Dir = dir; }