rbbt 1.1.8 → 1.2.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.
Files changed (47) hide show
  1. data/README.rdoc +12 -12
  2. data/bin/rbbt_config +2 -3
  3. data/install_scripts/norm/Rakefile +4 -4
  4. data/install_scripts/organisms/{tair.Rakefile → Ath.Rakefile} +4 -3
  5. data/install_scripts/organisms/{cgd.Rakefile → Cal.Rakefile} +0 -0
  6. data/install_scripts/organisms/{worm.Rakefile → Cel.Rakefile} +0 -0
  7. data/install_scripts/organisms/{human.Rakefile → Hsa.Rakefile} +4 -8
  8. data/install_scripts/organisms/{mgi.Rakefile → Mmu.Rakefile} +0 -0
  9. data/install_scripts/organisms/{rgd.Rakefile → Rno.Rakefile} +0 -0
  10. data/install_scripts/organisms/{sgd.Rakefile → Sce.Rakefile} +0 -0
  11. data/install_scripts/organisms/{pombe.Rakefile → Spo.Rakefile} +0 -0
  12. data/install_scripts/organisms/rake-include.rb +15 -19
  13. data/lib/rbbt.rb +0 -3
  14. data/lib/rbbt/ner/rnorm.rb +2 -2
  15. data/lib/rbbt/sources/go.rb +48 -3
  16. data/lib/rbbt/sources/organism.rb +12 -17
  17. data/lib/rbbt/util/open.rb +27 -27
  18. data/lib/rbbt/util/tmpfile.rb +16 -0
  19. data/tasks/install.rake +1 -1
  20. data/test/rbbt/bow/test_bow.rb +33 -0
  21. data/test/rbbt/bow/test_classifier.rb +72 -0
  22. data/test/rbbt/bow/test_dictionary.rb +91 -0
  23. data/test/rbbt/ner/rnorm/test_cue_index.rb +57 -0
  24. data/test/rbbt/ner/rnorm/test_tokens.rb +70 -0
  25. data/test/rbbt/ner/test_abner.rb +17 -0
  26. data/test/rbbt/ner/test_banner.rb +17 -0
  27. data/test/rbbt/ner/test_dictionaryNER.rb +122 -0
  28. data/test/rbbt/ner/test_regexpNER.rb +33 -0
  29. data/test/rbbt/ner/test_rner.rb +126 -0
  30. data/test/rbbt/ner/test_rnorm.rb +47 -0
  31. data/test/rbbt/sources/test_biocreative.rb +38 -0
  32. data/test/rbbt/sources/test_biomart.rb +31 -0
  33. data/test/rbbt/sources/test_entrez.rb +49 -0
  34. data/test/rbbt/sources/test_go.rb +24 -0
  35. data/test/rbbt/sources/test_organism.rb +59 -0
  36. data/test/rbbt/sources/test_polysearch.rb +27 -0
  37. data/test/rbbt/sources/test_pubmed.rb +29 -0
  38. data/test/rbbt/util/test_arrayHash.rb +257 -0
  39. data/test/rbbt/util/test_filecache.rb +37 -0
  40. data/test/rbbt/util/test_index.rb +31 -0
  41. data/test/rbbt/util/test_misc.rb +20 -0
  42. data/test/rbbt/util/test_open.rb +97 -0
  43. data/test/rbbt/util/test_simpleDSL.rb +57 -0
  44. data/test/rbbt/util/test_tmpfile.rb +21 -0
  45. data/test/test_helper.rb +4 -0
  46. data/test/test_rbbt.rb +11 -0
  47. metadata +39 -12
@@ -0,0 +1,57 @@
1
+ require File.dirname(__FILE__) + '/../../test_helper'
2
+ require 'rbbt/util/simpleDSL'
3
+ require 'test/unit'
4
+
5
+ class TestDSL < Test::Unit::TestCase
6
+ class Test < SimpleDSL
7
+
8
+ def action(name, *args, &block)
9
+ @actions[name] = args.first
10
+ end
11
+
12
+ def initialize(file=nil,&block)
13
+ @actions = {}
14
+ super(:action, file, &block)
15
+ end
16
+
17
+ def actions
18
+ @actions
19
+ end
20
+
21
+ end
22
+
23
+ def setup
24
+
25
+ @parser = Test.new do
26
+ action1 "Hello"
27
+ action2 "Good bye"
28
+ end
29
+ end
30
+
31
+ def test_config
32
+ config = <<-EOC
33
+ action1("Hello")
34
+ action2("Good bye")
35
+ EOC
36
+
37
+ assert_equal(@parser.config(:action),config)
38
+ end
39
+
40
+ def test_actions
41
+ assert_equal({:action1=>"Hello", :action2=>"Good bye"}, @parser.actions)
42
+ end
43
+
44
+ def test_method_missing
45
+ assert_raise(NoMethodError){@parser.cues}
46
+ end
47
+
48
+ def test_parse
49
+ @parser.parse :action do
50
+ action3 "Back again"
51
+ end
52
+
53
+ assert_equal({:action1 =>"Hello", :action2 =>"Good bye", :action3 =>"Back again"}, @parser.actions)
54
+
55
+ end
56
+
57
+ end
@@ -0,0 +1,21 @@
1
+ require File.dirname(__FILE__) + '/../../test_helper'
2
+ require 'rbbt/util/tmpfile'
3
+ require 'test/unit'
4
+
5
+ class TestTmpFile < Test::Unit::TestCase
6
+
7
+ def test_tmp_file
8
+ assert(TmpFile.tmp_file("test") =~ /tmp\/test\d+$/)
9
+ end
10
+
11
+ def test_do_tmp_file
12
+ content = "Hello World!"
13
+ TmpFile.with_file(content) do |file|
14
+ assert_equal content, File.open(file).read
15
+ end
16
+ end
17
+
18
+
19
+ end
20
+
21
+
@@ -0,0 +1,4 @@
1
+ require 'test/unit'
2
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+
data/test/test_rbbt.rb ADDED
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestRbbt < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def test_truth
9
+ assert true
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-05 00:00:00 +01:00
12
+ date: 2010-02-15 00:00:00 +01:00
13
13
  default_executable: rbbt_config
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -74,6 +74,7 @@ extra_rdoc_files:
74
74
  - LICENSE
75
75
  - README.rdoc
76
76
  files:
77
+ - bin/rbbt_config
77
78
  - install_scripts/classifier/R/classify.R
78
79
  - install_scripts/classifier/Rakefile
79
80
  - install_scripts/get_abner.sh
@@ -89,16 +90,16 @@ files:
89
90
  - install_scripts/norm/config/cue_default.rb
90
91
  - install_scripts/norm/config/tokens_default.rb
91
92
  - install_scripts/norm/functions.sh
93
+ - install_scripts/organisms/Ath.Rakefile
94
+ - install_scripts/organisms/Cal.Rakefile
95
+ - install_scripts/organisms/Cel.Rakefile
96
+ - install_scripts/organisms/Hsa.Rakefile
97
+ - install_scripts/organisms/Mmu.Rakefile
92
98
  - install_scripts/organisms/Rakefile
93
- - install_scripts/organisms/cgd.Rakefile
94
- - install_scripts/organisms/human.Rakefile
95
- - install_scripts/organisms/mgi.Rakefile
96
- - install_scripts/organisms/pombe.Rakefile
99
+ - install_scripts/organisms/Rno.Rakefile
100
+ - install_scripts/organisms/Sce.Rakefile
101
+ - install_scripts/organisms/Spo.Rakefile
97
102
  - install_scripts/organisms/rake-include.rb
98
- - install_scripts/organisms/rgd.Rakefile
99
- - install_scripts/organisms/sgd.Rakefile
100
- - install_scripts/organisms/tair.Rakefile
101
- - install_scripts/organisms/worm.Rakefile
102
103
  - install_scripts/wordlists/consonants
103
104
  - install_scripts/wordlists/stopwords
104
105
  - lib/rbbt.rb
@@ -159,5 +160,31 @@ rubygems_version: 1.3.5
159
160
  signing_key:
160
161
  specification_version: 3
161
162
  summary: Bioinformatics and text mining toolbox
162
- test_files: []
163
-
163
+ test_files:
164
+ - test/test_rbbt.rb
165
+ - test/rbbt/bow/test_bow.rb
166
+ - test/rbbt/bow/test_classifier.rb
167
+ - test/rbbt/bow/test_dictionary.rb
168
+ - test/rbbt/sources/test_organism.rb
169
+ - test/rbbt/sources/test_biomart.rb
170
+ - test/rbbt/sources/test_pubmed.rb
171
+ - test/rbbt/sources/test_polysearch.rb
172
+ - test/rbbt/sources/test_biocreative.rb
173
+ - test/rbbt/sources/test_entrez.rb
174
+ - test/rbbt/sources/test_go.rb
175
+ - test/rbbt/ner/test_rner.rb
176
+ - test/rbbt/ner/test_dictionaryNER.rb
177
+ - test/rbbt/ner/test_banner.rb
178
+ - test/rbbt/ner/test_rnorm.rb
179
+ - test/rbbt/ner/test_regexpNER.rb
180
+ - test/rbbt/ner/test_abner.rb
181
+ - test/rbbt/ner/rnorm/test_cue_index.rb
182
+ - test/rbbt/ner/rnorm/test_tokens.rb
183
+ - test/rbbt/util/test_misc.rb
184
+ - test/rbbt/util/test_tmpfile.rb
185
+ - test/rbbt/util/test_arrayHash.rb
186
+ - test/rbbt/util/test_filecache.rb
187
+ - test/rbbt/util/test_simpleDSL.rb
188
+ - test/rbbt/util/test_open.rb
189
+ - test/rbbt/util/test_index.rb
190
+ - test/test_helper.rb