source: trunk/indexers/lucene-gs/src/org/greenstone/LuceneWrapper/IndexXML.java@ 8521

Last change on this file since 8521 was 8521, checked in by davidb, 19 years ago

java bridge from how greensotne likes to do indexing and querying to lucenes classes

  • Property svn:keywords set to Author Date Id Revision
File size: 863 bytes
Line 
1
2/**
3 *
4 * @author [email protected]
5 * @author [email protected]
6 * @version
7 */
8
9import java.io.File;
10
11public class IndexXML extends Object {
12
13 String doc_tag_level_ = null;
14 File out_dir_ = null;
15 Indexer indexer_ = null;
16
17 public IndexXML(String doc_tag_level, File out_dir)
18 {
19 doc_tag_level_ = doc_tag_level;
20 out_dir_ = out_dir;
21 }
22
23 public void init()
24 {
25 indexer_ = new Indexer(doc_tag_level_, out_dir_, true);
26 }
27
28 public void finish()
29 {
30 indexer_.finish();
31 }
32
33 public void indexFile(File file)
34 {
35 String name = file.getName();
36 name = name.substring(0, name.lastIndexOf('.'));
37 System.out.println("Indexing "+file.getPath()+" with id "+name);
38 indexer_.index(name, file);
39 }
40
41 public void indexFile(String xml_text)
42 {
43 indexer_.index(xml_text);
44 }
45
46}
Note: See TracBrowser for help on using the repository browser.