/[hyperestraier_wrappers]/trunk/examples/gatherer.rb
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/examples/gatherer.rb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations)
Sat Sep 3 18:02:31 2005 UTC (18 years, 6 months ago) by dpavlin
Original Path: 0.0.12/examples/gatherer.rb
File size: 715 byte(s)
import of hyper_estraier_wrappers-0.0.12.tar.gz

1 dpavlin 1 #!/usr/bin/env ruby
2     """
3     the simplest implementation of a gatherer
4     """
5    
6     require 'HyperEstraier'
7    
8     # open the database
9     db = HyperEstraier::Database.new()
10     db.open('casket', HyperEstraier::Database::DBWRITER | HyperEstraier::Database::DBCREAT)
11    
12     # create a document object
13     doc = HyperEstraier::Document.new()
14    
15     # add attributes to the document object
16     doc.add_attr('@uri', "http://estraier.gov/example001.txt")
17     doc.add_attr("@title", "Over the Rainbow")
18    
19     # add the body text to the document object
20     doc.add_text("Somewhere over the rainbow. Way up high.")
21     doc.add_text("There's a land that I heard of once in a lullaby.")
22    
23     # register the document object to the database
24     db.put_doc(doc, HyperEstraier::Database::PDCLEAN)

  ViewVC Help
Powered by ViewVC 1.1.26