OntologyAwareTransducer.java |
1 package gate.creole; 2 3 /* 4 * Copyright (c) 1998-2005, The University of Sheffield. 5 * 6 * This file is part of GATE (see http://gate.ac.uk/), and is free 7 * software, licenced under the GNU Library General Public License, 8 * Version 2, June 1991 (in the distribution as file licence.html, 9 * and also available at http://gate.ac.uk/gate/licence.html). 10 * 11 * Valentin Tablan, 13 May 2002 12 * 13 * $Id: OntologyAwareTransducer.java,v 1.5 2005/01/11 13:51:31 ian Exp $ 14 */ 15 16 import gate.Resource; 17 18 /** 19 * An ontology aware JAPE transducer. Adds the {@link #ontology} member to the 20 * {@link Transducer} class. 21 * @deprecated Ontology related functionality is now implemented in the 22 * standard JAPE Transducer {@link gate.creole.Transducer}. 23 */ 24 public class OntologyAwareTransducer extends Transducer { 25 26 /** 27 * The ontology that will be available on the RHS of JAPE rules. 28 */ 29 private gate.creole.ontology.Ontology ontology; 30 31 /** 32 * Gets the ontology used by this transducer. 33 * @return an {@link gate.creole.ontology.Ontology} value. 34 */ 35 public gate.creole.ontology.Ontology getOntology() { 36 return ontology; 37 } 38 39 /** 40 * Sets the ontology used by this transducer. 41 * @param ontology an {@link gate.creole.ontology.Ontology} value. 42 */ 43 public void setOntology(gate.creole.ontology.Ontology ontology) { 44 this.ontology = ontology; 45 } 46 47 public Resource init() throws ResourceInstantiationException { 48 Resource res = super.init(); 49 batch.setOntology(ontology); 50 return res; 51 } 52 }