/* * isCustomerOfRelation.jape * * Copyright (c) 2007- , DERI, National University of Ireland, Galway. * Brian Davis, 12 December 2007 * $Id: isCustomerOfRelation.jape,v 1.0 2007/12/12 20:36:00 GMT */ Phase: CompanyRelations2 Input: Company customerOf Split Options: control=all Rule: CompanytoCompanyRelation2 ( ({Company}):c1({customerOf}):v({Company}):c2 {Split} ):companytoCompanyRelation2 --> :companytoCompanyRelation2 { gate.AnnotationSet matchedCompanies=(gate.AnnotationSet) bindings.get("c1"); Annotation company1=matchedCompanies.iterator().next(); gate.AnnotationSet matchedCompanies2=(gate.AnnotationSet) bindings.get("c2"); Annotation company2=matchedCompanies2.iterator().next(); gate.AnnotationSet matchedVerb=(gate.AnnotationSet) bindings.get("v"); Annotation verb=matchedVerb.iterator().next(); gate.AnnotationSet matchedAnns= (gate.AnnotationSet) bindings.get("companytoCompanyRelation2"); gate.FeatureMap newFeatures= Factory.newFeatureMap(); newFeatures.put("Company1",company1); newFeatures.put("customerOf",verb); newFeatures.put("Company2",company2); newFeatures.put("rule","CompanytoCompanyRelation2"); annotations.add(matchedAnns.firstNode(),matchedAnns.lastNode(),"companytoCompanyRelation2", newFeatures); } /* Company 2 Company relation - buys, purchases, is a customer of */