treat 2.0.3 → 2.0.4

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 (36) hide show
  1. data/lib/treat/config/data/languages/agnostic.rb +6 -3
  2. data/lib/treat/config/data/languages/english.rb +1 -1
  3. data/lib/treat/config/data/workers/extractors.rb +8 -0
  4. data/lib/treat/loaders/stanford.rb +2 -0
  5. data/lib/treat/version.rb +1 -1
  6. data/lib/treat/workers/extractors/distance/levenshtein.rb +35 -0
  7. data/lib/treat/workers/extractors/name_tag/stanford.rb +4 -1
  8. data/lib/treat/workers/extractors/similarity/jaro_winkler.rb +38 -0
  9. data/lib/treat/workers/extractors/similarity/tf_idf.rb +19 -3
  10. data/lib/treat/workers/extractors/time/chronic.rb +6 -41
  11. data/lib/treat/workers/extractors/time/kronic.rb +20 -0
  12. data/lib/treat/workers/extractors/time/nickel.rb +0 -15
  13. data/lib/treat/workers/extractors/time/ruby.rb +2 -33
  14. data/lib/treat/workers/lexicalizers/taggers/stanford.rb +11 -10
  15. data/lib/treat/workers/processors/parsers/stanford.rb +60 -112
  16. data/spec/entities/collection.rb +29 -25
  17. data/spec/entities/document.rb +45 -44
  18. data/spec/entities/entity.rb +295 -294
  19. data/spec/entities/phrase.rb +21 -17
  20. data/spec/entities/token.rb +43 -40
  21. data/spec/entities/word.rb +5 -1
  22. data/spec/entities/zone.rb +26 -22
  23. data/spec/helper.rb +7 -2
  24. data/spec/learning/data_set.rb +145 -141
  25. data/spec/learning/export.rb +46 -42
  26. data/spec/learning/problem.rb +114 -110
  27. data/spec/learning/question.rb +46 -42
  28. data/spec/treat.rb +41 -37
  29. data/spec/workers/agnostic.rb +2 -2
  30. data/spec/workers/english.rb +12 -12
  31. metadata +7 -8
  32. data/files/21552208.html +0 -786
  33. data/files/nethttp-cheat-sheet-2940.html +0 -393
  34. data/lib/treat/workers/extractors/similarity/levenshtein.rb +0 -36
  35. data/spec/sandbox.rb +0 -294
  36. data/spec/workers/examples/english/mathematicians/euler.html +0 -21
@@ -1,27 +1,31 @@
1
- describe Treat::Entities::Phrase do
1
+ module Treat::Specs::Entities
2
2
 
3
- describe "Buildable" do
3
+ describe Treat::Entities::Phrase do
4
4
 
5
- describe "#build" do
5
+ describe "Buildable" do
6
6
 
7
- context "when supplied with a sentence" do
7
+ describe "#build" do
8
+
9
+ context "when supplied with a sentence" do
10
+
11
+ it "creates a sentence with the text" do
12
+ sentence = "This is a sentence."
13
+ s = Treat::Entities::Phrase.build(sentence)
14
+ s.type.should eql :sentence
15
+ s.to_s.should eql sentence
16
+ end
8
17
 
9
- it "creates a sentence with the text" do
10
- sentence = "This is a sentence."
11
- s = Treat::Entities::Phrase.build(sentence)
12
- s.type.should eql :sentence
13
- s.to_s.should eql sentence
14
18
  end
15
19
 
16
- end
20
+ context "when supplied with a phrase" do
17
21
 
18
- context "when supplied with a phrase" do
22
+ it "creates a phrase with the text" do
23
+ phrase = "this is a phrase"
24
+ p = Treat::Entities::Phrase.build(phrase)
25
+ p.type.should eql :phrase
26
+ p.to_s.should eql phrase
27
+ end
19
28
 
20
- it "creates a phrase with the text" do
21
- phrase = "this is a phrase"
22
- p = Treat::Entities::Phrase.build(phrase)
23
- p.type.should eql :phrase
24
- p.to_s.should eql phrase
25
29
  end
26
30
 
27
31
  end
@@ -30,4 +34,4 @@ describe Treat::Entities::Phrase do
30
34
 
31
35
  end
32
36
 
33
- end
37
+ end
@@ -1,55 +1,58 @@
1
1
  #encoding: utf-8
2
- describe Treat::Entities::Token do
2
+ module Treat::Specs::Entities
3
3
 
4
- describe "Buildable" do
4
+ describe Treat::Entities::Token do
5
5
 
6
- describe "#build" do
6
+ describe "Buildable" do
7
7
 
8
- context "when supplied with a word" do
9
- it "creates a word with the text" do
10
- t = Treat::Entities::Token.build('word')
11
- t.should be_an_instance_of Treat::Entities::Word
12
- t.to_s.should eql 'word'
8
+ describe "#build" do
9
+
10
+ context "when supplied with a word" do
11
+ it "creates a word with the text" do
12
+ t = Treat::Entities::Token.build('word')
13
+ t.should be_an_instance_of Treat::Entities::Word
14
+ t.to_s.should eql 'word'
15
+ end
13
16
  end
14
- end
15
17
 
16
- context "when supplied with a number or a string representing a numerical quantity" do
17
- it "creates a number" do
18
- t = Treat::Entities::Token.build(2)
19
- t2 = Treat::Entities::Token.build(2.2)
20
- t3 = Treat::Entities::Token.build('2')
21
- t4 = Treat::Entities::Token.build('2.2')
22
- t.should be_an_instance_of Treat::Entities::Number
23
- t2.should be_an_instance_of Treat::Entities::Number
24
- t3.should be_an_instance_of Treat::Entities::Number
25
- t4.should be_an_instance_of Treat::Entities::Number
26
- t.to_i.should eql 2
27
- t2.to_i.should eql 2
28
- t3.to_i.should eql 2
29
- t4.to_i.should eql 2
30
- t.to_f.should eql 2.0
31
- t2.to_f.should eql 2.2
32
- t3.to_f.should eql 2.0
33
- t4.to_f.should eql 2.2
18
+ context "when supplied with a number or a string representing a numerical quantity" do
19
+ it "creates a number" do
20
+ t = Treat::Entities::Token.build(2)
21
+ t2 = Treat::Entities::Token.build(2.2)
22
+ t3 = Treat::Entities::Token.build('2')
23
+ t4 = Treat::Entities::Token.build('2.2')
24
+ t.should be_an_instance_of Treat::Entities::Number
25
+ t2.should be_an_instance_of Treat::Entities::Number
26
+ t3.should be_an_instance_of Treat::Entities::Number
27
+ t4.should be_an_instance_of Treat::Entities::Number
28
+ t.to_i.should eql 2
29
+ t2.to_i.should eql 2
30
+ t3.to_i.should eql 2
31
+ t4.to_i.should eql 2
32
+ t.to_f.should eql 2.0
33
+ t2.to_f.should eql 2.2
34
+ t3.to_f.should eql 2.0
35
+ t4.to_f.should eql 2.2
36
+ end
34
37
  end
35
- end
36
38
 
37
- context "when supplied with a punctuation character" do
38
- it "creates a punctuation with the text" do
39
- t = Treat::Entities::Token.build('.')
40
- t.should be_an_instance_of Treat::Entities::Punctuation
39
+ context "when supplied with a punctuation character" do
40
+ it "creates a punctuation with the text" do
41
+ t = Treat::Entities::Token.build('.')
42
+ t.should be_an_instance_of Treat::Entities::Punctuation
43
+ end
41
44
  end
42
- end
43
45
 
44
- context "when supplied with a symbol character" do
45
- it "creates a symbol with the text" do
46
- t = Treat::Entities::Token.build('¨')
47
- t.should be_an_instance_of Treat::Entities::Symbol
46
+ context "when supplied with a symbol character" do
47
+ it "creates a symbol with the text" do
48
+ t = Treat::Entities::Token.build('¨')
49
+ t.should be_an_instance_of Treat::Entities::Symbol
50
+ end
48
51
  end
52
+
49
53
  end
50
-
54
+
51
55
  end
52
56
 
53
57
  end
54
-
55
- end
58
+ end
@@ -1,3 +1,7 @@
1
- describe Treat::Entities::Word do
1
+ module Treat::Specs::Entities
2
+
3
+ describe Treat::Entities::Word do
4
+
5
+ end
2
6
 
3
7
  end
@@ -1,43 +1,47 @@
1
- describe Treat::Entities::Zone do
1
+ module Treat::Specs::Entities
2
2
 
3
- describe "Buildable" do
3
+ describe Treat::Entities::Zone do
4
4
 
5
- describe "#build" do
5
+ describe "Buildable" do
6
6
 
7
- context "when called with a section of text" do
7
+ describe "#build" do
8
8
 
9
- it "creates a section with the text" do
9
+ context "when called with a section of text" do
10
10
 
11
- section = "A title\nFollowed by a fake sentence."
12
- s = Treat::Entities::Zone.build(section)
13
- s.should be_an_instance_of Treat::Entities::Section
11
+ it "creates a section with the text" do
12
+
13
+ section = "A title\nFollowed by a fake sentence."
14
+ s = Treat::Entities::Zone.build(section)
15
+ s.should be_an_instance_of Treat::Entities::Section
16
+
17
+ end
14
18
 
15
19
  end
16
20
 
17
- end
21
+ context "when called with a paragraph of text" do
18
22
 
19
- context "when called with a paragraph of text" do
23
+ it "creates a paragraph with the text" do
24
+ paragraph = "Sentence 1. Sentence 2. Sentence 3."
25
+ p = Treat::Entities::Zone.build(paragraph)
26
+ p.should be_instance_of Treat::Entities::Paragraph
27
+ end
20
28
 
21
- it "creates a paragraph with the text" do
22
- paragraph = "Sentence 1. Sentence 2. Sentence 3."
23
- p = Treat::Entities::Zone.build(paragraph)
24
- p.should be_instance_of Treat::Entities::Paragraph
25
29
  end
26
30
 
27
- end
31
+ context "when called with a very short text" do
28
32
 
29
- context "when called with a very short text" do
33
+ it "creates a title with the text" do
34
+ title = "A title!"
35
+ p = Treat::Entities::Zone.build(title)
36
+ p.should be_instance_of Treat::Entities::Title
37
+ end
30
38
 
31
- it "creates a title with the text" do
32
- title = "A title!"
33
- p = Treat::Entities::Zone.build(title)
34
- p.should be_instance_of Treat::Entities::Title
35
39
  end
36
40
 
37
41
  end
38
42
 
39
43
  end
40
-
41
- end
42
44
 
45
+ end
46
+
43
47
  end
data/spec/helper.rb CHANGED
@@ -7,7 +7,7 @@ module Treat::Specs
7
7
  require 'rspec'
8
8
 
9
9
  # Some configuration options for devel.
10
-
10
+ =begin
11
11
  Treat.databases.mongo.db = 'treat_test'
12
12
  Treat.libraries.stanford.model_path =
13
13
  '/ruby/stanford-core-nlp-minimal/models/'
@@ -17,6 +17,11 @@ module Treat::Specs
17
17
  '/ruby/punkt/models/'
18
18
  Treat.libraries.reuters.model_path =
19
19
  '/ruby/reuters/models/'
20
+ =end
21
+ # Mimic the ./lib structure.
22
+ module Entities; end
23
+ module Workers; end
24
+ module Learning; end
20
25
 
21
26
  ModuleFiles = ['entities/*.rb', 'learning/*.rb']
22
27
 
@@ -40,7 +45,7 @@ module Treat::Specs
40
45
  end
41
46
 
42
47
  # Run specs for the core classes.
43
- def self.run_core_specs
48
+ def self.run_library_specs
44
49
  files = ModuleFiles.map do |d|
45
50
  Dir.glob(Treat.paths.spec + d)
46
51
  end
@@ -1,174 +1,178 @@
1
- describe Treat::Learning::DataSet do
2
-
3
- before do
4
- @question = Treat::Learning::Question.new(:is_key_sentence, :sentence, 0, :continuous)
5
- @feature = Treat::Learning::Feature.new(:word_count, 0)
6
- @problem = Treat::Learning::Problem.new(@question, @feature)
7
- @tag = Treat::Learning::Tag.new(:paragraph_length, 0,
8
- "->(e) { e.parent_paragraph.word_count }")
9
- @paragraph = Treat::Entities::Paragraph.new(
10
- "Ranga and I went to the store. Meanwhile, Ryan was sleeping.")
11
- @paragraph.do :segment, :tokenize
12
- @sentence = @paragraph.sentences[0]
13
- @data_set = Treat::Learning::DataSet.new(@problem)
14
- end
1
+ module Treat::Specs::Learning
2
+
3
+ describe Treat::Learning::DataSet do
4
+
5
+ before do
6
+ @question = Treat::Learning::Question.new(:is_key_sentence, :sentence, 0, :continuous)
7
+ @feature = Treat::Learning::Feature.new(:word_count, 0)
8
+ @problem = Treat::Learning::Problem.new(@question, @feature)
9
+ @tag = Treat::Learning::Tag.new(:paragraph_length, 0,
10
+ "->(e) { e.parent_paragraph.word_count }")
11
+ @paragraph = Treat::Entities::Paragraph.new(
12
+ "Ranga and I went to the store. Meanwhile, Ryan was sleeping.")
13
+ @paragraph.apply :segment, :tokenize
14
+ @sentence = @paragraph.sentences[0]
15
+ @data_set = Treat::Learning::DataSet.new(@problem)
16
+ end
15
17
 
16
- describe "#initialize" do
17
- context "when supplied with a problem" do
18
- it "should initialize an empty data set" do
19
- data_set = Treat::Learning::DataSet.new(@problem)
20
- data_set.items.should eql []
21
- data_set.problem.should eql @problem
18
+ describe "#initialize" do
19
+ context "when supplied with a problem" do
20
+ it "should initialize an empty data set" do
21
+ data_set = Treat::Learning::DataSet.new(@problem)
22
+ data_set.items.should eql []
23
+ data_set.problem.should eql @problem
24
+ end
22
25
  end
23
- end
24
- context "when supplied with an improper argument" do
25
- it "should raise an error" do
26
- # The argument to initialize should be a Problem.
27
- expect { data_set = Treat::Learning::DataSet.new("foo") }.to raise_error
26
+ context "when supplied with an improper argument" do
27
+ it "should raise an error" do
28
+ # The argument to initialize should be a Problem.
29
+ expect { data_set = Treat::Learning::DataSet.new("foo") }.to raise_error
30
+ end
28
31
  end
29
32
  end
30
- end
31
33
 
32
- describe "#self.build" do
34
+ describe "#self.build" do
33
35
 
34
- end
36
+ end
35
37
 
36
- describe "#==(other_data_set)" do
37
- context "when supplied with an equivalent data set" do
38
- it "returns true" do
39
- data_set1 = Treat::Learning::DataSet.new(@problem)
40
- data_set2 = Treat::Learning::DataSet.new(@problem)
41
- data_set1.should == data_set2
42
- data_set1 << @sentence
43
- data_set2 << @sentence
44
- data_set1.should == data_set2
38
+ describe "#==(other_data_set)" do
39
+ context "when supplied with an equivalent data set" do
40
+ it "returns true" do
41
+ data_set1 = Treat::Learning::DataSet.new(@problem)
42
+ data_set2 = Treat::Learning::DataSet.new(@problem)
43
+ data_set1.should == data_set2
44
+ data_set1 << @sentence
45
+ data_set2 << @sentence
46
+ data_set1.should == data_set2
47
+ end
45
48
  end
46
- end
47
49
 
48
- context "when supplied with a non-equivalent data set" do
49
- it "returns false" do
50
- # Get two slightly different problems.
51
- question1 = Treat::Learning::Question.new(
52
- :is_key_sentence, :sentence, 0, :continuous)
53
- question2 = Treat::Learning::Question.new(
54
- :is_key_word, :sentence, 0, :continuous)
55
- problem1 = Treat::Learning::Problem.new(question1, @feature)
56
- problem2 = Treat::Learning::Problem.new(question2, @feature)
57
- # Then the problems shouldn't be equal anymore.
58
- problem1.should_not == problem2
59
- # Create data sets with the different problems.
60
- data_set1 = Treat::Learning::DataSet.new(problem1)
61
- data_set2 = Treat::Learning::DataSet.new(problem2)
62
- # Then the data sets shouldn't be equal anymore.
63
- data_set1.should_not == data_set2
64
- # Create two data sets with the same problems.
65
- data_set1 = Treat::Learning::DataSet.new(@problem)
66
- data_set2 = Treat::Learning::DataSet.new(@problem)
67
- # Then these should be equal.
68
- data_set1.should == data_set2
69
- # But when different items are added
70
- data_set1 << Treat::Entities::Sentence.new(
71
- "This sentence is not the same as the other.").tokenize
72
- data_set2 << Treat::Entities::Sentence.new(
73
- "This sentence is similar to the other.").tokenize
74
- # They shouldn't be equal anymore.
75
- data_set1.should_not == data_set2
50
+ context "when supplied with a non-equivalent data set" do
51
+ it "returns false" do
52
+ # Get two slightly different problems.
53
+ question1 = Treat::Learning::Question.new(
54
+ :is_key_sentence, :sentence, 0, :continuous)
55
+ question2 = Treat::Learning::Question.new(
56
+ :is_key_word, :sentence, 0, :continuous)
57
+ problem1 = Treat::Learning::Problem.new(question1, @feature)
58
+ problem2 = Treat::Learning::Problem.new(question2, @feature)
59
+ # Then the problems shouldn't be equal anymore.
60
+ problem1.should_not == problem2
61
+ # Create data sets with the different problems.
62
+ data_set1 = Treat::Learning::DataSet.new(problem1)
63
+ data_set2 = Treat::Learning::DataSet.new(problem2)
64
+ # Then the data sets shouldn't be equal anymore.
65
+ data_set1.should_not == data_set2
66
+ # Create two data sets with the same problems.
67
+ data_set1 = Treat::Learning::DataSet.new(@problem)
68
+ data_set2 = Treat::Learning::DataSet.new(@problem)
69
+ # Then these should be equal.
70
+ data_set1.should == data_set2
71
+ # But when different items are added
72
+ data_set1 << Treat::Entities::Sentence.new(
73
+ "This sentence is not the same as the other.").tokenize
74
+ data_set2 << Treat::Entities::Sentence.new(
75
+ "This sentence is similar to the other.").tokenize
76
+ # They shouldn't be equal anymore.
77
+ data_set1.should_not == data_set2
78
+ end
76
79
  end
80
+
77
81
  end
78
82
 
79
- end
83
+ describe "#merge" do
84
+ context "when supplied with two data sets refering to the same problem" do
85
+ it "merges the two together" do
86
+ # Create two data sets with the same problem.
87
+ data_set1 = Treat::Learning::DataSet.new(@problem)
88
+ data_set2 = Treat::Learning::DataSet.new(@problem)
89
+ # Add a sentence to each data set.
90
+ data_set1 << Treat::Entities::Sentence.new(
91
+ "This sentence is not the same as the other.").tokenize
92
+ data_set2 << Treat::Entities::Sentence.new(
93
+ "This sentence is similar to the other.").tokenize
94
+ # Merge the two data sets together.
95
+ data_set1.merge(data_set2)
96
+ # Check if the merge has occured properly.
97
+ data_set1.items.size.should eql 2
98
+ data_set1.items[1].should eql data_set2.items[0]
99
+ end
100
+ end
80
101
 
81
- describe "#merge" do
82
- context "when supplied with two data sets refering to the same problem" do
83
- it "merges the two together" do
84
- # Create two data sets with the same problem.
85
- data_set1 = Treat::Learning::DataSet.new(@problem)
86
- data_set2 = Treat::Learning::DataSet.new(@problem)
87
- # Add a sentence to each data set.
88
- data_set1 << Treat::Entities::Sentence.new(
89
- "This sentence is not the same as the other.").tokenize
90
- data_set2 << Treat::Entities::Sentence.new(
91
- "This sentence is similar to the other.").tokenize
92
- # Merge the two data sets together.
93
- data_set1.merge(data_set2)
94
- # Check if the merge has occured properly.
95
- data_set1.items.size.should eql 2
96
- data_set1.items[1].should eql data_set2.items[0]
102
+ context "when supplied with two data sets refering to different problems" do
103
+ it "raises an error" do
104
+ # Get two slightly different questions.
105
+ question1 = Treat::Learning::Question.new(
106
+ :is_key_sentence, :sentence, 0, :continuous)
107
+ question2 = Treat::Learning::Question.new(
108
+ :is_key_word, :sentence, 0, :continuous)
109
+ # Create two problems with the different questions.
110
+ problem1 = Treat::Learning::Problem.new(question1, @feature)
111
+ problem2 = Treat::Learning::Problem.new(question2, @feature)
112
+ # Create two data sets with the different problems.
113
+ data_set1 = Treat::Learning::DataSet.new(problem1)
114
+ data_set2 = Treat::Learning::DataSet.new(problem2)
115
+ # Add elements to each of the data sets.
116
+ data_set1 << Treat::Entities::Sentence.new(
117
+ "This sentence is not the same as the other.").tokenize
118
+ data_set2 << Treat::Entities::Sentence.new(
119
+ "This sentence is similar to the other.").tokenize
120
+ # Try to merge them; but this should fail.
121
+ expect { data_set1.merge(data_set2) }.to raise_error
122
+ end
97
123
  end
98
124
  end
99
-
100
- context "when supplied with two data sets refering to different problems" do
101
- it "raises an error" do
102
- # Get two slightly different questions.
103
- question1 = Treat::Learning::Question.new(
104
- :is_key_sentence, :sentence, 0, :continuous)
105
- question2 = Treat::Learning::Question.new(
106
- :is_key_word, :sentence, 0, :continuous)
107
- # Create two problems with the different questions.
108
- problem1 = Treat::Learning::Problem.new(question1, @feature)
109
- problem2 = Treat::Learning::Problem.new(question2, @feature)
110
- # Create two data sets with the different problems.
111
- data_set1 = Treat::Learning::DataSet.new(problem1)
112
- data_set2 = Treat::Learning::DataSet.new(problem2)
113
- # Add elements to each of the data sets.
114
- data_set1 << Treat::Entities::Sentence.new(
115
- "This sentence is not the same as the other.").tokenize
116
- data_set2 << Treat::Entities::Sentence.new(
117
- "This sentence is similar to the other.").tokenize
118
- # Try to merge them; but this should fail.
119
- expect { data_set1.merge(data_set2) }.to raise_error
125
+
126
+ describe "#<<(entity)" do
127
+ context "when supplied with a proper entity" do
128
+ it "exports the features and tags and adds them to the data set" do
129
+ problem = Treat::Learning::Problem.new(@question, @feature, @tag)
130
+ data_set = Treat::Learning::DataSet.new(problem)
131
+ data_set << @sentence
132
+ data_set.items.tap { |e| e[0][:id] = 0 }.
133
+ should eql [{:tags=>[11], :features=>[7, 0], :id=>0}]
134
+ end
120
135
  end
121
136
  end
122
- end
123
137
 
124
- describe "#<<(entity)" do
125
- context "when supplied with a proper entity" do
126
- it "exports the features and tags and adds them to the data set" do
127
- problem = Treat::Learning::Problem.new(@question, @feature, @tag)
128
- data_set = Treat::Learning::DataSet.new(problem)
129
- data_set << @sentence
130
- data_set.items.tap { |e| e[0][:id] = 0 }.
131
- should eql [{:tags=>[11], :features=>[7, 0], :id=>0}]
138
+ describe "#serialize" do
139
+ context "when asked to use a given adapter" do
140
+ it "calls the corresponding #to_something method" do
141
+
142
+ end
132
143
  end
133
144
  end
134
- end
135
145
 
136
- describe "#serialize" do
137
- context "when asked to use a given adapter" do
138
- it "calls the corresponding #to_something method" do
139
-
146
+ describe "#to_marshal, #self.from_marshal" do
147
+ context "when asked to successively serialize and deserialize data" do
148
+ it "completes a round trip without losing information" do
149
+ problem = Treat::Learning::Problem.new(@question, @feature, @tag)
150
+ data_set = Treat::Learning::DataSet.new(problem)
151
+ data_set << @sentence
152
+ data_set.to_marshal(file: 'test.dump')
153
+ Treat::Learning::DataSet.from_marshal(
154
+ file: 'test.dump').should == data_set
155
+ FileUtils.rm('test.dump')
156
+ end
140
157
  end
141
158
  end
142
- end
143
159
 
144
- describe "#to_marshal, #self.from_marshal" do
145
- context "when asked to successively serialize and deserialize data" do
146
- it "completes a round trip without losing information" do
147
- problem = Treat::Learning::Problem.new(@question, @feature, @tag)
148
- data_set = Treat::Learning::DataSet.new(problem)
149
- data_set << @sentence
150
- data_set.to_marshal(file: 'test.dump')
151
- Treat::Learning::DataSet.from_marshal(
152
- file: 'test.dump').should == data_set
153
- FileUtils.rm('test.dump')
154
- end
160
+ describe "#to_mongo" do
161
+
155
162
  end
156
- end
157
163
 
158
- describe "#to_mongo" do
159
-
160
- end
164
+ describe "#self.unserialize" do
165
+ context "when asked to use a given adapter" do
166
+ it "calls the corresponding #to_something method" do
161
167
 
162
- describe "#self.unserialize" do
163
- context "when asked to use a given adapter" do
164
- it "calls the corresponding #to_something method" do
165
-
168
+ end
166
169
  end
167
170
  end
168
- end
169
171
 
170
- describe "#self.from_mongo" do
172
+ describe "#self.from_mongo" do
173
+
174
+ end
171
175
 
172
176
  end
173
177
 
174
- end
178
+ end