LuceneReader.java
01 /*
02  *  LuceneReader.java
03  *
04  *  Niraj Aswani, 19/March/07
05  *
06  *  $Id: LuceneReader.html,v 1.0 2007/03/19 16:22:01 niraj Exp $
07  */
08 package gate.creole.annic.lucene;
09 
10 import java.io.*;
11 import java.util.ArrayList;
12 
13 /**
14  * A Reader that stores the document to read and the token stream
15  * associated with it.
16  
17  @author niraj
18  
19  */
20 public class LuceneReader extends BufferedReader {
21 
22   /**
23    * Gate document
24    */
25   gate.Document gateDoc;
26 
27   /**
28    * Token Stream.
29    */
30   ArrayList tokenStream;
31 
32   /**
33    * Constructor
34    
35    @param gateDoc
36    @param tokenStream
37    */
38   public LuceneReader(gate.Document gateDoc, ArrayList tokenStream) {
39     super(new StringReader(""));
40     this.gateDoc = gateDoc;
41     this.tokenStream = tokenStream;
42   }
43 
44   /**
45    * Gets the document object
46    
47    @return
48    */
49   public gate.Document getDocument() {
50     return this.gateDoc;
51   }
52 
53   /**
54    * Gets the token stream associated with this reader
55    
56    @return
57    */
58   public ArrayList getTokenStream() {
59     return this.tokenStream;
60   }
61 }