classifier 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +361 -273
- data/README +6 -5
- data/Rakefile +12 -2
- data/bin/summarize.rb +11 -0
- data/doc/classes/Array.html +139 -0
- data/doc/classes/Array.src/M000003.html +18 -0
- data/doc/classes/Classifier.html +5 -5
- data/doc/classes/Classifier/Bayes.html +43 -43
- data/doc/classes/Classifier/Bayes.src/{M000023.html → M000038.html} +0 -0
- data/doc/classes/Classifier/Bayes.src/{M000024.html → M000039.html} +0 -0
- data/doc/classes/Classifier/Bayes.src/{M000025.html → M000040.html} +0 -0
- data/doc/classes/Classifier/Bayes.src/{M000026.html → M000041.html} +0 -0
- data/doc/classes/Classifier/Bayes.src/{M000027.html → M000042.html} +0 -0
- data/doc/classes/Classifier/Bayes.src/{M000028.html → M000043.html} +0 -0
- data/doc/classes/Classifier/Bayes.src/{M000029.html → M000044.html} +0 -0
- data/doc/classes/Classifier/ContentNode.html +23 -28
- data/doc/classes/Classifier/ContentNode.src/M000046.html +19 -0
- data/doc/classes/Classifier/ContentNode.src/{M000032.html → M000047.html} +1 -1
- data/doc/classes/Classifier/ContentNode.src/{M000033.html → M000048.html} +1 -1
- data/doc/classes/Classifier/ContentNode.src/M000049.html +49 -0
- data/doc/classes/Classifier/LSI.html +158 -68
- data/doc/classes/Classifier/LSI.src/M000022.html +6 -17
- data/doc/classes/Classifier/LSI.src/{M000012.html → M000023.html} +2 -2
- data/doc/classes/Classifier/LSI.src/{M000013.html → M000024.html} +3 -2
- data/doc/classes/Classifier/LSI.src/{M000014.html → M000025.html} +1 -1
- data/doc/classes/Classifier/LSI.src/M000026.html +19 -0
- data/doc/classes/Classifier/LSI.src/{M000015.html → M000027.html} +1 -1
- data/doc/classes/Classifier/LSI.src/{M000016.html → M000028.html} +1 -1
- data/doc/classes/Classifier/LSI.src/M000029.html +19 -0
- data/doc/classes/Classifier/LSI.src/M000030.html +43 -0
- data/doc/classes/Classifier/LSI.src/M000031.html +23 -0
- data/doc/classes/Classifier/LSI.src/{M000018.html → M000032.html} +7 -3
- data/doc/classes/Classifier/LSI.src/{M000019.html → M000033.html} +6 -2
- data/doc/classes/Classifier/LSI.src/{M000020.html → M000034.html} +2 -4
- data/doc/classes/Classifier/LSI.src/{M000021.html → M000035.html} +1 -1
- data/doc/classes/Classifier/LSI.src/M000036.html +31 -0
- data/doc/classes/Classifier/LSI.src/M000037.html +21 -0
- data/doc/classes/Classifier/WordList.html +37 -22
- data/doc/classes/Classifier/WordList.src/{M000007.html → M000017.html} +2 -2
- data/doc/classes/Classifier/WordList.src/{M000008.html → M000018.html} +1 -1
- data/doc/classes/Classifier/WordList.src/{M000009.html → M000019.html} +1 -1
- data/doc/classes/Classifier/WordList.src/M000020.html +18 -0
- data/doc/classes/Classifier/WordList.src/{M000010.html → M000021.html} +1 -1
- data/doc/classes/GSL.html +2 -1
- data/doc/classes/GSL/Matrix.html +126 -0
- data/doc/classes/GSL/Vector.html +10 -10
- data/doc/classes/GSL/Vector.src/{M000005.html → M000015.html} +0 -0
- data/doc/classes/GSL/Vector.src/{M000006.html → M000016.html} +0 -0
- data/doc/classes/Matrix.html +184 -0
- data/doc/classes/Matrix.src/M000004.html +18 -0
- data/doc/classes/Matrix.src/M000005.html +76 -0
- data/doc/classes/Matrix.src/M000006.html +18 -0
- data/doc/classes/Object.html +7 -7
- data/doc/classes/Object.src/{M000001.html → M000007.html} +1 -1
- data/doc/classes/String.html +90 -20
- data/doc/classes/String.src/{M000002.html → M000008.html} +0 -0
- data/doc/classes/String.src/{M000003.html → M000009.html} +0 -0
- data/doc/classes/String.src/{M000004.html → M000010.html} +0 -0
- data/doc/classes/String.src/M000011.html +18 -0
- data/doc/classes/String.src/M000012.html +18 -0
- data/doc/classes/String.src/M000013.html +18 -0
- data/doc/classes/String.src/M000014.html +18 -0
- data/doc/classes/Vector.html +154 -0
- data/doc/classes/Vector.src/M000001.html +22 -0
- data/doc/classes/Vector.src/M000002.html +25 -0
- data/doc/created.rid +1 -1
- data/doc/files/README.html +14 -8
- data/doc/files/lib/classifier/bayes_rb.html +1 -1
- data/doc/files/lib/classifier/{string_extensions_rb.html → extensions/string_rb.html} +5 -5
- data/doc/files/lib/classifier/extensions/vector_rb.html +120 -0
- data/doc/files/lib/classifier/extensions/vector_serialize_rb.html +1 -1
- data/doc/files/lib/classifier/extensions/word_hash_rb.html +1 -1
- data/doc/files/lib/classifier/lsi/content_node_rb.html +2 -2
- data/doc/files/lib/classifier/lsi/summary_rb.html +115 -0
- data/doc/files/lib/classifier/{extensions → lsi}/word_list_rb.html +3 -3
- data/doc/files/lib/classifier/lsi_rb.html +5 -3
- data/doc/files/lib/classifier_rb.html +2 -2
- data/doc/fr_class_index.html +4 -0
- data/doc/fr_file_index.html +4 -2
- data/doc/fr_method_index.html +49 -34
- data/doc/index.html +2 -2
- data/lib/classifier.rb +1 -1
- data/lib/classifier/{string_extensions.rb → extensions/string.rb} +0 -0
- data/lib/classifier/extensions/vector.rb +106 -0
- data/lib/classifier/extensions/vector_serialize.rb +6 -0
- data/lib/classifier/lsi.rb +101 -31
- data/lib/classifier/lsi/content_node.rb +28 -23
- data/lib/classifier/lsi/summary.rb +31 -0
- data/lib/classifier/{extensions → lsi}/word_list.rb +7 -2
- data/test/{string_extensions → extensions}/word_hash_test.rb +0 -0
- data/test/lsi/lsi_test.rb +36 -1
- metadata +68 -41
- data/doc/classes/Classifier/ContentNode.src/M000031.html +0 -21
- data/doc/classes/Classifier/ContentNode.src/M000034.html +0 -41
- data/doc/classes/Classifier/LSI.src/M000011.html +0 -20
- data/doc/classes/Classifier/LSI.src/M000017.html +0 -32
data/README
CHANGED
@@ -12,13 +12,14 @@ Classifier is a general module to allow Bayesian and other types of classificati
|
|
12
12
|
If you install Classifier from source, you'll need to install Martin Porter's stemmer algorithm with RubyGems as follows:
|
13
13
|
gem install stemmer
|
14
14
|
|
15
|
-
|
15
|
+
If you would like to speed up LSI classification by at least 10x, please install the following libraries:
|
16
16
|
GNU GSL:: http://www.gnu.org/software/gsl
|
17
17
|
rb-gsl:: http://rb-gsl.rubyforge.org
|
18
18
|
|
19
|
+
Notice that LSI will work without these libraries, but as soon as they are installed, Classifier will make use of them. No configuration changes are needed, we like to keep things ridiculously easy for you.
|
20
|
+
|
19
21
|
== Bayes
|
20
|
-
A Bayesian classifier by Lucas Carlson. Bayesian Classifiers are accurate, fast,
|
21
|
-
and have modest memory requirements.
|
22
|
+
A Bayesian classifier by Lucas Carlson. Bayesian Classifiers are accurate, fast, and have modest memory requirements.
|
22
23
|
|
23
24
|
=== Usage
|
24
25
|
require 'classifier'
|
@@ -45,7 +46,7 @@ Using Madeleine, your application can persist the learned data over time.
|
|
45
46
|
* http://www.paulgraham.com/spam.html
|
46
47
|
|
47
48
|
== LSI
|
48
|
-
|
49
|
+
A Latent Semantic Indexer by David Fayram. Latent Semantic Indexing engines
|
49
50
|
are not as fast or as small as Bayesian classifiers, but are more flexible, providing
|
50
51
|
fast search and clustering detection as well as semantic analysis of the text that
|
51
52
|
theoretically simulates human learning.
|
@@ -82,5 +83,5 @@ with more than just simple strings.
|
|
82
83
|
* Lucas Carlson (mailto:lucas@rufy.com)
|
83
84
|
* David Fayram II (mailto:dfayram@lensmen.net)
|
84
85
|
|
85
|
-
This library is released under the terms of the GNU
|
86
|
+
This library is released under the terms of the GNU LGPL. See LICENSE for more details.
|
86
87
|
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rake/rdoctask'
|
|
5
5
|
require 'rake/gempackagetask'
|
6
6
|
require 'rake/contrib/rubyforgepublisher'
|
7
7
|
|
8
|
-
PKG_VERSION = "1.
|
8
|
+
PKG_VERSION = "1.3.0"
|
9
9
|
|
10
10
|
PKG_FILES = FileList[
|
11
11
|
"lib/**/*", "bin/*", "test/**/*", "[A-Z]*", "Rakefile", "doc/**/*"
|
@@ -31,6 +31,7 @@ end
|
|
31
31
|
# Genereate the RDoc documentation
|
32
32
|
desc "Create documentation"
|
33
33
|
Rake::RDocTask.new("doc") { |rdoc|
|
34
|
+
rdoc.title = "Ruby Classifier - Bayesian and LSI classification library"
|
34
35
|
rdoc.rdoc_dir = 'doc'
|
35
36
|
rdoc.rdoc_files.include('README')
|
36
37
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
@@ -76,10 +77,19 @@ spec = Gem::Specification.new do |s|
|
|
76
77
|
end
|
77
78
|
|
78
79
|
Rake::GemPackageTask.new(spec) do |pkg|
|
79
|
-
pkg.need_zip =
|
80
|
+
pkg.need_zip = true
|
80
81
|
pkg.need_tar = true
|
81
82
|
end
|
82
83
|
|
84
|
+
desc "Report code statistics (KLOCs, etc) from the application"
|
85
|
+
task :stats do
|
86
|
+
require 'code_statistics'
|
87
|
+
CodeStatistics.new(
|
88
|
+
["Library", "lib"],
|
89
|
+
["Units", "test"]
|
90
|
+
).to_s
|
91
|
+
end
|
92
|
+
|
83
93
|
desc "Publish new documentation"
|
84
94
|
task :publish do
|
85
95
|
`ssh rufy update-classifier-doc`
|
data/bin/summarize.rb
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Array</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Array</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/classifier/extensions/vector_rb.html">
|
59
|
+
lib/classifier/extensions/vector.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Object.html">
|
69
|
+
Object
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div id="method-list">
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
89
|
+
|
90
|
+
<div class="name-list">
|
91
|
+
<a href="#M000003">sum</a>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
|
98
|
+
<!-- if includes -->
|
99
|
+
|
100
|
+
<div id="section">
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<!-- if method_list -->
|
110
|
+
<div id="methods">
|
111
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
112
|
+
|
113
|
+
<div id="method-M000003" class="method-detail">
|
114
|
+
<a name="M000003"></a>
|
115
|
+
|
116
|
+
<div class="method-heading">
|
117
|
+
<a href="Array.src/M000003.html" target="Code" class="method-signature"
|
118
|
+
onclick="popupCode('Array.src/M000003.html');return false;">
|
119
|
+
<span class="method-name">sum</span><span class="method-args">()</span>
|
120
|
+
</a>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div class="method-description">
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
|
127
|
+
|
128
|
+
</div>
|
129
|
+
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
|
134
|
+
<div id="validator-badges">
|
135
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
136
|
+
</div>
|
137
|
+
|
138
|
+
</body>
|
139
|
+
</html>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>sum (Array)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/classifier/extensions/vector.rb, line 10</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sum</span>
|
15
|
+
<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">sum</span>,<span class="ruby-identifier">term</span><span class="ruby-operator">|</span> <span class="ruby-identifier">sum</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">term</span> }.<span class="ruby-identifier">to_f</span>
|
16
|
+
<span class="ruby-keyword kw">end</span></pre>
|
17
|
+
</body>
|
18
|
+
</html>
|
data/doc/classes/Classifier.html
CHANGED
@@ -62,14 +62,14 @@
|
|
62
62
|
<a href="../files/lib/classifier/lsi_rb.html">
|
63
63
|
lib/classifier/lsi.rb
|
64
64
|
</a>
|
65
|
-
<br />
|
66
|
-
<a href="../files/lib/classifier/extensions/word_list_rb.html">
|
67
|
-
lib/classifier/extensions/word_list.rb
|
68
|
-
</a>
|
69
65
|
<br />
|
70
66
|
<a href="../files/lib/classifier/lsi/content_node_rb.html">
|
71
67
|
lib/classifier/lsi/content_node.rb
|
72
68
|
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../files/lib/classifier/lsi/word_list_rb.html">
|
71
|
+
lib/classifier/lsi/word_list.rb
|
72
|
+
</a>
|
73
73
|
<br />
|
74
74
|
</td>
|
75
75
|
</tr>
|
@@ -92,7 +92,7 @@
|
|
92
92
|
<tr><td valign="top">Copyright:</td><td>Copyright © 2005 David Fayram II
|
93
93
|
|
94
94
|
</td></tr>
|
95
|
-
<tr><td valign="top">License:</td><td>
|
95
|
+
<tr><td valign="top">License:</td><td>LGPL
|
96
96
|
|
97
97
|
</td></tr>
|
98
98
|
</table>
|
@@ -88,14 +88,14 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
94
|
-
<a href="#
|
95
|
-
<a href="#
|
96
|
-
<a href="#
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
91
|
+
<a href="#M000044">add_category</a>
|
92
|
+
<a href="#M000045">append_category</a>
|
93
|
+
<a href="#M000041">classifications</a>
|
94
|
+
<a href="#M000042">classify</a>
|
95
|
+
<a href="#M000043">method_missing</a>
|
96
|
+
<a href="#M000038">new</a>
|
97
|
+
<a href="#M000039">train</a>
|
98
|
+
<a href="#M000040">untrain</a>
|
99
99
|
</div>
|
100
100
|
</div>
|
101
101
|
|
@@ -117,12 +117,12 @@
|
|
117
117
|
<div id="methods">
|
118
118
|
<h3 class="section-bar">Public Class methods</h3>
|
119
119
|
|
120
|
-
<div id="method-
|
121
|
-
<a name="
|
120
|
+
<div id="method-M000038" class="method-detail">
|
121
|
+
<a name="M000038"></a>
|
122
122
|
|
123
123
|
<div class="method-heading">
|
124
|
-
<a href="Bayes.src/
|
125
|
-
onclick="popupCode('Bayes.src/
|
124
|
+
<a href="Bayes.src/M000038.html" target="Code" class="method-signature"
|
125
|
+
onclick="popupCode('Bayes.src/M000038.html');return false;">
|
126
126
|
<span class="method-name">new</span><span class="method-args">(*categories)</span>
|
127
127
|
</a>
|
128
128
|
</div>
|
@@ -140,12 +140,12 @@ initialized and given a training method. E.g.,
|
|
140
140
|
|
141
141
|
<h3 class="section-bar">Public Instance methods</h3>
|
142
142
|
|
143
|
-
<div id="method-
|
144
|
-
<a name="
|
143
|
+
<div id="method-M000044" class="method-detail">
|
144
|
+
<a name="M000044"></a>
|
145
145
|
|
146
146
|
<div class="method-heading">
|
147
|
-
<a href="Bayes.src/
|
148
|
-
onclick="popupCode('Bayes.src/
|
147
|
+
<a href="Bayes.src/M000044.html" target="Code" class="method-signature"
|
148
|
+
onclick="popupCode('Bayes.src/M000044.html');return false;">
|
149
149
|
<span class="method-name">add_category</span><span class="method-args">(category)</span>
|
150
150
|
</a>
|
151
151
|
</div>
|
@@ -166,8 +166,8 @@ at initialization.
|
|
166
166
|
</div>
|
167
167
|
</div>
|
168
168
|
|
169
|
-
<div id="method-
|
170
|
-
<a name="
|
169
|
+
<div id="method-M000045" class="method-detail">
|
170
|
+
<a name="M000045"></a>
|
171
171
|
|
172
172
|
<div class="method-heading">
|
173
173
|
<span class="method-name">append_category</span><span class="method-args">(category)</span>
|
@@ -175,17 +175,17 @@ at initialization.
|
|
175
175
|
|
176
176
|
<div class="method-description">
|
177
177
|
<p>
|
178
|
-
Alias for <a href="Bayes.html#
|
178
|
+
Alias for <a href="Bayes.html#M000044">add_category</a>
|
179
179
|
</p>
|
180
180
|
</div>
|
181
181
|
</div>
|
182
182
|
|
183
|
-
<div id="method-
|
184
|
-
<a name="
|
183
|
+
<div id="method-M000041" class="method-detail">
|
184
|
+
<a name="M000041"></a>
|
185
185
|
|
186
186
|
<div class="method-heading">
|
187
|
-
<a href="Bayes.src/
|
188
|
-
onclick="popupCode('Bayes.src/
|
187
|
+
<a href="Bayes.src/M000041.html" target="Code" class="method-signature"
|
188
|
+
onclick="popupCode('Bayes.src/M000041.html');return false;">
|
189
189
|
<span class="method-name">classifications</span><span class="method-args">(text)</span>
|
190
190
|
</a>
|
191
191
|
</div>
|
@@ -200,17 +200,17 @@ Returns the scores in each category the provided <tt>text</tt>. E.g.,
|
|
200
200
|
</pre>
|
201
201
|
<p>
|
202
202
|
The largest of these scores (the one closest to 0) is the one picked out by
|
203
|
-
<a href="Bayes.html#
|
203
|
+
<a href="Bayes.html#M000042">classify</a>
|
204
204
|
</p>
|
205
205
|
</div>
|
206
206
|
</div>
|
207
207
|
|
208
|
-
<div id="method-
|
209
|
-
<a name="
|
208
|
+
<div id="method-M000042" class="method-detail">
|
209
|
+
<a name="M000042"></a>
|
210
210
|
|
211
211
|
<div class="method-heading">
|
212
|
-
<a href="Bayes.src/
|
213
|
-
onclick="popupCode('Bayes.src/
|
212
|
+
<a href="Bayes.src/M000042.html" target="Code" class="method-signature"
|
213
|
+
onclick="popupCode('Bayes.src/M000042.html');return false;">
|
214
214
|
<span class="method-name">classify</span><span class="method-args">(text)</span>
|
215
215
|
</a>
|
216
216
|
</div>
|
@@ -227,12 +227,12 @@ the categories given in the initializer. E.g.,
|
|
227
227
|
</div>
|
228
228
|
</div>
|
229
229
|
|
230
|
-
<div id="method-
|
231
|
-
<a name="
|
230
|
+
<div id="method-M000043" class="method-detail">
|
231
|
+
<a name="M000043"></a>
|
232
232
|
|
233
233
|
<div class="method-heading">
|
234
|
-
<a href="Bayes.src/
|
235
|
-
onclick="popupCode('Bayes.src/
|
234
|
+
<a href="Bayes.src/M000043.html" target="Code" class="method-signature"
|
235
|
+
onclick="popupCode('Bayes.src/M000043.html');return false;">
|
236
236
|
<span class="method-name">method_missing</span><span class="method-args">(name, *args)</span>
|
237
237
|
</a>
|
238
238
|
</div>
|
@@ -240,7 +240,7 @@ the categories given in the initializer. E.g.,
|
|
240
240
|
<div class="method-description">
|
241
241
|
<p>
|
242
242
|
Provides training and untraining methods for the categories specified in <a
|
243
|
-
href="Bayes.html#
|
243
|
+
href="Bayes.html#M000038">Bayes#new</a> For example:
|
244
244
|
</p>
|
245
245
|
<pre>
|
246
246
|
b = Classifier::Bayes.new 'This', 'That', 'the_other'
|
@@ -252,12 +252,12 @@ href="Bayes.html#M000023">Bayes#new</a> For example:
|
|
252
252
|
</div>
|
253
253
|
</div>
|
254
254
|
|
255
|
-
<div id="method-
|
256
|
-
<a name="
|
255
|
+
<div id="method-M000039" class="method-detail">
|
256
|
+
<a name="M000039"></a>
|
257
257
|
|
258
258
|
<div class="method-heading">
|
259
|
-
<a href="Bayes.src/
|
260
|
-
onclick="popupCode('Bayes.src/
|
259
|
+
<a href="Bayes.src/M000039.html" target="Code" class="method-signature"
|
260
|
+
onclick="popupCode('Bayes.src/M000039.html');return false;">
|
261
261
|
<span class="method-name">train</span><span class="method-args">(category, text)</span>
|
262
262
|
</a>
|
263
263
|
</div>
|
@@ -265,7 +265,7 @@ href="Bayes.html#M000023">Bayes#new</a> For example:
|
|
265
265
|
<div class="method-description">
|
266
266
|
<p>
|
267
267
|
Provides a general training method for all categories specified in <a
|
268
|
-
href="Bayes.html#
|
268
|
+
href="Bayes.html#M000038">Bayes#new</a> For example:
|
269
269
|
</p>
|
270
270
|
<pre>
|
271
271
|
b = Classifier::Bayes.new 'This', 'That', 'the_other'
|
@@ -276,12 +276,12 @@ href="Bayes.html#M000023">Bayes#new</a> For example:
|
|
276
276
|
</div>
|
277
277
|
</div>
|
278
278
|
|
279
|
-
<div id="method-
|
280
|
-
<a name="
|
279
|
+
<div id="method-M000040" class="method-detail">
|
280
|
+
<a name="M000040"></a>
|
281
281
|
|
282
282
|
<div class="method-heading">
|
283
|
-
<a href="Bayes.src/
|
284
|
-
onclick="popupCode('Bayes.src/
|
283
|
+
<a href="Bayes.src/M000040.html" target="Code" class="method-signature"
|
284
|
+
onclick="popupCode('Bayes.src/M000040.html');return false;">
|
285
285
|
<span class="method-name">untrain</span><span class="method-args">(category, text)</span>
|
286
286
|
</a>
|
287
287
|
</div>
|
@@ -289,7 +289,7 @@ href="Bayes.html#M000023">Bayes#new</a> For example:
|
|
289
289
|
<div class="method-description">
|
290
290
|
<p>
|
291
291
|
Provides a untraining method for all categories specified in <a
|
292
|
-
href="Bayes.html#
|
292
|
+
href="Bayes.html#M000038">Bayes#new</a> Be very careful with this method.
|
293
293
|
</p>
|
294
294
|
<p>
|
295
295
|
For example:
|