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