/* * loc_context.jape * * Copyright (c) 1998-2001, The University of Sheffield. * * This file is part of GATE (see http://gate.ac.uk/), and is free * software, licenced under the GNU Library General Public License, * Version 2, June 1991 (in the distribution as file licence.html, * and also available at http://gate.ac.uk/gate/licence.html). * * Diana Maynard, 02 Aug 2001 * * $Id: loc_context.jape,v 1.1 2004/09/10 13:33:24 akshay Exp $ */ Phase: Loc_Context Input: Unknown Token Location Break Control Options: control = appelt Rule: LocConjLoc1 Priority: 10 ( {Unknown.kind == PN} ):loc ( {Token.category == CC} ({Token.category == DT} )? {Location} ) --> { gate.AnnotationSet loc = (gate.AnnotationSet) bindings.get("loc"); gate.FeatureMap features = Factory.newFeatureMap(); features.put("rule ", "LocConjLoc1"); annotations.add(loc.firstNode(), loc.lastNode(), "Location", features); annotations.removeAll(loc); } Rule: LocConjLoc2 Priority: 10 ( {Location} {Token.category == CC} ({Token.category == DT} )? ) ( {Unknown.kind == PN} ):loc --> { gate.AnnotationSet loc = (gate.AnnotationSet) bindings.get("loc"); gate.FeatureMap features = Factory.newFeatureMap(); features.put("rule ", "LocConjLoc2"); annotations.add(loc.firstNode(), loc.lastNode(), "Location", features); annotations.removeAll(loc); } Rule: UnknownLocRegion Priority: 50 ( ({Token.string == "at"}| {Token.string == "in"} ) ) ( {Unknown} ):loc ( {Token.string == ","} {Location.locType == region} ) --> { gate.AnnotationSet loc = (gate.AnnotationSet) bindings.get("loc"); gate.FeatureMap features = Factory.newFeatureMap(); features.put("rule ", "UnknownLocRegion"); annotations.add(loc.firstNode(), loc.lastNode(), "Location", features); annotations.removeAll(loc); } Rule: InLoc Priority: 10 // in sunny Chelmsford ( {Token.string == "in"} ({Token.category == JJ})? ) ( {Unknown} ):loc --> { gate.AnnotationSet loc = (gate.AnnotationSet) bindings.get("loc"); gate.FeatureMap features = Factory.newFeatureMap(); features.put("rule ", "InLoc"); annotations.add(loc.firstNode(), loc.lastNode(), "Location", features); annotations.removeAll(loc); }