yanser 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,64 @@
1
+ require 'test/unit'
2
+ require 'yanapi/term_query'
3
+ require 'fakeweb'
4
+
5
+ class TestTermQuery < Test::Unit::TestCase
6
+ def setup
7
+ @params = {
8
+ :query => 'Auto',
9
+ :appid => 'YahooDemo'
10
+ }
11
+ end
12
+ def teardown
13
+ end
14
+
15
+ # questionSearch needs a unique :query
16
+ def test_missing_query
17
+ @params.delete(:query)
18
+ assert_raises(YANAPI::Error) do
19
+ q = YANAPI::TermQuery.new(@params)
20
+ end
21
+ end
22
+
23
+ # parameters can be only: query|search_in|category_query|category_name|
24
+ # region|date_range|sort|appid|type|start|results|output|callback
25
+ def test_parameters_semantics
26
+ assert_nothing_raised {q = YANAPI::TermQuery.new(@params)}
27
+ @params[:trash] = 'trash'
28
+ assert_raises(YANAPI::Error) do
29
+ q = YANAPI::TermQuery.new(@params)
30
+ end
31
+ end
32
+
33
+ # validates presense of query
34
+ # validates uniqueness of query
35
+ # validates the range of :start
36
+ # validates the range of :results
37
+ # validates the :region semantics
38
+ # validates the :type uniqueness and semantics
39
+ # validates uniqueness of the :date_range and its semantics
40
+ # validates semantics of all possible parameter names
41
+
42
+ def test_start_range
43
+ end
44
+
45
+ def test_result_range
46
+ end
47
+
48
+ def test_region_semantics
49
+
50
+ end
51
+
52
+ # ?? not sure
53
+ def test_type_uniqueness
54
+ end
55
+
56
+ def test_type_semantics
57
+ end
58
+
59
+ def test_date_uniqueness
60
+ end
61
+
62
+ def test_date_semantics
63
+ end
64
+ end #TestTermQuery
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: yanser
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Andrei Beliankou
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-04-06 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: yanapi
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 25
30
+ segments:
31
+ - 0
32
+ - 1
33
+ - 1
34
+ version: 0.1.1
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: YANSER (Yahoo! ANSwers harvestER) is a convinient search tool providing access to the Yahoo! Answers Q&A collection. Based on YANAPI it provides a simple CLI and helps to search for Questions and Answers which contain a set of key words, belong to a specific semantic domain or are posted by a certain user. Yanser is a research tool in the field of Computational Linguistics.
38
+ email: a.belenkow@uni-trier.de
39
+ executables:
40
+ - yanser
41
+ extensions: []
42
+
43
+ extra_rdoc_files:
44
+ - README.rdoc
45
+ - LICENSE
46
+ files:
47
+ - lib/tester.rb
48
+ - lib/yanser.rb
49
+ - lib/option_parser.rb
50
+ - lib/version.rb
51
+ - bin/yanser
52
+ - README.rdoc
53
+ - LICENSE
54
+ - Rakefile
55
+ - README
56
+ - test/test_option_parser.rb
57
+ - test/yanapi/test_query.rb
58
+ - test/yanapi/test_term_query.rb
59
+ - test/test_yanser.rb
60
+ - test/data/bad_xml.txt
61
+ - test/data/empty_result.txt
62
+ - test/data/error_code.txt
63
+ - test/data/response_with_error.txt
64
+ - test/data/successfull_response.txt
65
+ has_rdoc: true
66
+ homepage: http://www.uni-trier.de/index.php?id=34451
67
+ licenses: []
68
+
69
+ post_install_message:
70
+ rdoc_options:
71
+ - -m
72
+ - README.rdoc
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ none: false
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ hash: 61
81
+ segments:
82
+ - 1
83
+ - 8
84
+ - 5
85
+ version: 1.8.5
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ none: false
88
+ requirements:
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ hash: 3
92
+ segments:
93
+ - 0
94
+ version: "0"
95
+ requirements: []
96
+
97
+ rubyforge_project: yanser
98
+ rubygems_version: 1.3.7
99
+ signing_key:
100
+ specification_version: 3
101
+ summary: Yanser is a convinient search tool providing access to the Yahoo! Answers Q/A collection.
102
+ test_files:
103
+ - test/test_option_parser.rb
104
+ - test/test_yanser.rb