bayon 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/bayonext.cpp +2 -2
- data/ext/bayonext_internal.h +4 -0
- data/ext/extconf.rb +3 -0
- data/lib/bayon.rb +19 -0
- metadata +15 -6
data/ext/bayonext.cpp
CHANGED
@@ -184,8 +184,8 @@ class CBayonAnalyzer {
|
|
184
184
|
Data_Get_Struct(self, CBayonAnalyzer, p);
|
185
185
|
|
186
186
|
if(p->analyzer_->get_next_result(cluster)) {
|
187
|
-
|
188
|
-
cluster.sorted_documents(pairs);
|
187
|
+
documents pairs;
|
188
|
+
cluster.sorted_documents(pairs);
|
189
189
|
VALUE docids = rb_ary_new2(pairs.size());
|
190
190
|
|
191
191
|
for(documents::const_iterator i = pairs.begin(); i != pairs.end(); i++) {
|
data/ext/bayonext_internal.h
CHANGED
data/ext/extconf.rb
CHANGED
data/lib/bayon.rb
CHANGED
@@ -45,7 +45,26 @@ module Bayon
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
+
def delete_document(label)
|
49
|
+
@documents.delete_if {|l, f| l == label }
|
50
|
+
end
|
51
|
+
|
52
|
+
def [](label)
|
53
|
+
label, features = @documents.assoc(label)
|
54
|
+
return features
|
55
|
+
end
|
56
|
+
|
57
|
+
def labels
|
58
|
+
@documents.map {|l, f| l }
|
59
|
+
end
|
60
|
+
|
61
|
+
def clear
|
62
|
+
@documents.clear
|
63
|
+
end
|
64
|
+
|
48
65
|
def do_clustering(method = Analyzer::REPEATED_BISECTION)
|
66
|
+
return [] if @documents.empty?
|
67
|
+
|
49
68
|
analyzer = Analyzer.new
|
50
69
|
analyzer.set_cluster_size_limit(@cluster_size_limit) if @cluster_size_limit
|
51
70
|
analyzer.set_eval_limit(@eval_limit) if @eval_limit
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bayon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 4
|
9
|
+
version: 0.1.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- winebarrel
|
@@ -9,7 +14,7 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-05-27 00:00:00 +09:00
|
13
18
|
default_executable:
|
14
19
|
dependencies: []
|
15
20
|
|
@@ -30,6 +35,8 @@ files:
|
|
30
35
|
- COPYING
|
31
36
|
has_rdoc: true
|
32
37
|
homepage: http://bayon.rubyforge.org
|
38
|
+
licenses: []
|
39
|
+
|
33
40
|
post_install_message:
|
34
41
|
rdoc_options:
|
35
42
|
- --title
|
@@ -40,20 +47,22 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
40
47
|
requirements:
|
41
48
|
- - ">="
|
42
49
|
- !ruby/object:Gem::Version
|
50
|
+
segments:
|
51
|
+
- 0
|
43
52
|
version: "0"
|
44
|
-
version:
|
45
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
54
|
requirements:
|
47
55
|
- - ">="
|
48
56
|
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 0
|
49
59
|
version: "0"
|
50
|
-
version:
|
51
60
|
requirements: []
|
52
61
|
|
53
62
|
rubyforge_project: bayon
|
54
|
-
rubygems_version: 1.3.
|
63
|
+
rubygems_version: 1.3.6
|
55
64
|
signing_key:
|
56
|
-
specification_version:
|
65
|
+
specification_version: 3
|
57
66
|
summary: Ruby bindings for bayon.
|
58
67
|
test_files: []
|
59
68
|
|