acts_as_estraier_doc 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,100 @@
1
+ = Pure Ruby Interface of Hyper Estraier
2
+
3
+ Hyper Estraier is a full-text search system for communities.
4
+
5
+ == Introduction
6
+
7
+ This is a package implementing the node API of {Hyper Estraier}[http://fallabs.com/hyperestraier/]. This is a pure ruby package. So, it works on Linux, Mac OS X, Windows, and so on. It does not depend on the core library of Hyper Estraier. Applications are implemented as clients of node servers running on local or remote machines. This package requires Ruby 1.8.4 or later versions.
8
+
9
+ Though Hyper Estraier itself is released under the terms of the GNU LGPL, this package is released under the terms of a BSD-style license.
10
+
11
+ == Setting
12
+
13
+ Get the package of the latest version of Hyper Estraier.
14
+
15
+ Extract the package and enter the sub directory `rubypure' and perform installation.
16
+
17
+ cd rubypure
18
+ ./configure
19
+ make
20
+ su
21
+ make install
22
+
23
+ The package `estraierpure' should be required in each source file of application programs and include the module `EstraierPure' at pleasure.
24
+
25
+ == Example of Gatherer
26
+
27
+ The following is the simplest implementation of a gatherer.
28
+
29
+ require "estraierpure"
30
+ include EstraierPure
31
+
32
+ # create and configure the node connecton object
33
+ node = Node::new
34
+ node.set_url("http://localhost:1978/node/test1")
35
+ node.set_auth("admin", "admin")
36
+
37
+ # create a document object
38
+ doc = Document::new
39
+
40
+ # add attributes to the document object
41
+ doc.add_attr("@uri", "http://estraier.gov/example.txt")
42
+ doc.add_attr("@title", "Over the Rainbow")
43
+
44
+ # add the body text to the document object
45
+ doc.add_text("Somewhere over the rainbow. Way up high.")
46
+ doc.add_text("There's a land that I heard of once in a lullaby.")
47
+
48
+ # register the document object to the node
49
+ unless node.put_doc(doc)
50
+ STDERR.printf("error: %d\n", node.status)
51
+ end
52
+
53
+ ==Example of Searcher
54
+
55
+ The following is the simplest implementation of a searcher.
56
+
57
+ require "estraierpure"
58
+ include EstraierPure
59
+
60
+ # create and configure the node connecton object
61
+ node = Node::new
62
+ node.set_url("http://localhost:1978/node/test1")
63
+
64
+ # create a search condition object
65
+ cond = Condition::new
66
+
67
+ # set the search phrase to the search condition object
68
+ cond.set_phrase("rainbow AND lullaby")
69
+
70
+ # get the result of search
71
+ nres = node.search(cond, 0);
72
+ if nres
73
+ # for each document in the result
74
+ for i in 0...nres.doc_num
75
+ # get a result document object
76
+ rdoc = nres.get_doc(i)
77
+ # display attributes
78
+ value = rdoc.attr("@uri")
79
+ printf("URI: %s\n", value) if value
80
+ value = rdoc.attr("@title")
81
+ printf("Title: %s\n", value) if value
82
+ # display the snippet text */
83
+ printf("%s", rdoc.snippet)
84
+ end
85
+ else
86
+ STDERR.printf("error: %d\n", node.status)
87
+ end
88
+
89
+ == License
90
+
91
+ Copyright (C) 2004-2006 Mikio Hirabayashi
92
+ All rights reserved.
93
+
94
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
95
+
96
+ - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
97
+ - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
98
+ - Neither the name of Mikio Hirabayashi nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
99
+
100
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: acts_as_estraier_doc
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Takatoshi MORIYAMA
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-04-10 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: activerecord
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 2
31
+ - 0
32
+ version: "2.0"
33
+ type: :runtime
34
+ version_requirements: *id001
35
+ description: Acts as EstraierDoc
36
+ email:
37
+ - hawk@at-exit.com
38
+ executables: []
39
+
40
+ extensions: []
41
+
42
+ extra_rdoc_files: []
43
+
44
+ files:
45
+ - .gitignore
46
+ - Gemfile
47
+ - LICENSE
48
+ - README.md
49
+ - Rakefile
50
+ - acts_as_estraier_doc.gemspec
51
+ - lib/acts_as_estraier_doc.rb
52
+ - lib/acts_as_estraier_doc/version.rb
53
+ - lib/estraierpure_ext.rb
54
+ - vendor/estraierpure.rb
55
+ - vendor/overview
56
+ homepage: ""
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options: []
61
+
62
+ require_paths:
63
+ - lib
64
+ - vendor
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ hash: 3
71
+ segments:
72
+ - 0
73
+ version: "0"
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ hash: 3
80
+ segments:
81
+ - 0
82
+ version: "0"
83
+ requirements: []
84
+
85
+ rubyforge_project:
86
+ rubygems_version: 1.7.2
87
+ signing_key:
88
+ specification_version: 3
89
+ summary: Acts as EstraierDoc
90
+ test_files: []
91
+