|
Matcher |
|
1 /* 2 * Matcher.java - transducer class 3 * 4 * Copyright (c) 1998-2001, 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 * Hamish Cunningham, 24/07/98 12 * 13 * $Id: Matcher.java,v 1.4 2001/09/13 12:09:50 kalina Exp $ 14 */ 15 16 17 package gate.jape; 18 19 import java.util.*; 20 import gate.annotation.*; 21 import gate.util.*; 22 import gate.*; 23 24 25 /** 26 * Interface to be implemented by classes providing matching on documents, 27 * e.g. PatternElement and LeftHandSide. 28 */ 29 public interface Matcher extends java.io.Serializable 30 { 31 /** Does this element match the document at this position? */ 32 abstract public boolean matches( 33 Document doc, int position, MutableInteger newPosition 34 ); 35 36 /** Reset: clear annotation caches etc. */ 37 abstract public void reset(); 38 39 /** Finish: replace dynamic data structures with Java arrays; called 40 * after parsing. 41 */ 42 abstract public void finish(); 43 44 } // class Matcher 45 46 47 // $Log: Matcher.java,v $ 48 // Revision 1.4 2001/09/13 12:09:50 kalina 49 // Removed completely the use of jgl.objectspace.Array and such. 50 // Instead all sources now use the new Collections, typically ArrayList. 51 // I ran the tests and I ran some documents and compared with keys. 52 // JAPE seems to work well (that's where it all was). If there are problems 53 // maybe look at those new structures first. 54 // 55 // Revision 1.3 2000/11/08 16:35:03 hamish 56 // formatting 57 // 58 // Revision 1.2 2000/10/10 15:36:36 oana 59 // Changed System.out in Out and System.err in Err; 60 // Added the DEBUG variable seted on false; 61 // Added in the header the licence; 62 // 63 // Revision 1.1 2000/02/23 13:46:08 hamish 64 // added 65 // 66 // Revision 1.1.1.1 1999/02/03 16:23:02 hamish 67 // added gate2 68 // 69 // Revision 1.4 1998/11/01 21:21:38 hamish 70 // use Java arrays in transduction where possible 71 // 72 // Revision 1.3 1998/10/29 12:09:08 hamish 73 // added serializable 74 // 75 // Revision 1.2 1998/08/12 15:39:38 hamish 76 // added padding toString methods 77 // 78 // Revision 1.1 1998/08/03 19:51:23 hamish 79 // rollback added 80
|
Matcher |
|