tomoto 0.5.1-aarch64-linux → 0.6.0-aarch64-linux

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4053761cccb3218c402ba8d7da44d7c36be4a5ec4b72a4a58a8b75f53e6477c9
4
- data.tar.gz: 8487c1d06b821a54b8d6215188f2dcf0c166bde3651f40e7cf2ff46e4f8424f8
3
+ metadata.gz: 1a0f4780d3cc8f02d28a3593cad056495354acb477f812dbaa460e78e1841f01
4
+ data.tar.gz: 05b73ac4c20e51e40659894daa0039e87f188a6cd561bb66c7e369279b00c9ca
5
5
  SHA512:
6
- metadata.gz: 456710ea057157b48bc866ecfefe7fd12da2288dbc6b0dec063e173db98958a57bcdb2a06ad1c1faf46de16b1977c192f871a553741d9532f6b2cbc6bf415c36
7
- data.tar.gz: 2c7d5d1e451b35b4d7f3a6de6312cc355b5da0eb3b9b844c9c8f5ffe39f9ab2b0413e1a427730a03ab4d3f0ed9d74c7fc3bc4b6457bbff0362cb4140a1f2d2d1
6
+ metadata.gz: 10194598adcb8f7dac4e1ff624d6540e93ae7464f33dda589f183bb1f801f4cc29cc9c9533c19b3127c901f4c72574a7f726a578e22adc13acc34c05a45f81e7
7
+ data.tar.gz: 97a69acb1fa7340d960b348c003747a10edf60dd1e1e0eb50c237fbad71d2888cc937d75bb44bcb1288d6d74c0c53691a41b8afbb97bb01c6b659299de761fc9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.6.0 (2025-10-26)
2
+
3
+ - Fixed error with Rice 4.7
4
+ - Dropped support for Ruby < 3.2
5
+
1
6
  ## 0.5.1 (2024-12-26)
2
7
 
3
8
  - Fixed precompiled gem for Ruby 3.3
data/LICENSE.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  MIT License
2
2
 
3
3
  Copyright (c) 2019, bab2min
4
- Copyright (c) 2020-2023 Andrew Kane
4
+ Copyright (c) 2020-2025 Andrew Kane
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
data/ext/tomoto/dmr.cpp CHANGED
@@ -1,6 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <DMR.h>
2
5
 
3
6
  #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
4
8
 
5
9
  #include "utils.h"
6
10
 
@@ -57,7 +61,7 @@ void init_dmr(Rice::Module& m) {
57
61
  for (size_t i = 0; i < dict.size(); i++) {
58
62
  VALUE value = Rice::detail::To_Ruby<std::string>().convert(dict.toWord(i));
59
63
  Object obj(value);
60
- res.push(obj.call("force_encoding", utf8));
64
+ res.push(obj.call("force_encoding", utf8), false);
61
65
  }
62
66
  return res;
63
67
  })
data/ext/tomoto/dt.cpp CHANGED
@@ -1,6 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <DT.h>
2
5
 
3
6
  #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
4
8
 
5
9
  #include "utils.h"
6
10
 
@@ -39,9 +43,9 @@ void init_dt(Rice::Module& m) {
39
43
  for (size_t i = 0; i < self.getK(); i++) {
40
44
  Array res2;
41
45
  for (size_t j = 0; j < self.getT(); j++) {
42
- res2.push(self.getAlpha(i, j));
46
+ res2.push(self.getAlpha(i, j), false);
43
47
  }
44
- res.push(res2);
48
+ res.push(res2, false);
45
49
  }
46
50
  return res;
47
51
  })
data/ext/tomoto/gdmr.cpp CHANGED
@@ -1,6 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <GDMR.h>
2
5
 
3
6
  #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
4
8
 
5
9
  #include "utils.h"
6
10
 
data/ext/tomoto/hlda.cpp CHANGED
@@ -24,7 +24,7 @@ void init_hlda(Rice::Module& m) {
24
24
  [](tomoto::IHLDAModel& self) {
25
25
  Array res;
26
26
  for (size_t i = 0; i < self.getLevelDepth(); i++) {
27
- res.push(self.getAlpha(i));
27
+ res.push(self.getAlpha(i), false);
28
28
  }
29
29
  return res;
30
30
  })
data/ext/tomoto/hpa.cpp CHANGED
@@ -25,7 +25,7 @@ void init_hpa(Rice::Module& m) {
25
25
  Array res;
26
26
  // use <= to return k+1 elements
27
27
  for (size_t i = 0; i <= self.getK(); i++) {
28
- res.push(self.getAlpha(i));
28
+ res.push(self.getAlpha(i), false);
29
29
  }
30
30
  return res;
31
31
  });
data/ext/tomoto/lda.cpp CHANGED
@@ -1,14 +1,16 @@
1
1
  #include <fstream>
2
2
  #include <iostream>
3
+ #include <string>
4
+ #include <vector>
3
5
 
4
6
  #include <LDA.h>
5
7
 
6
8
  #include <rice/rice.hpp>
9
+ #include <rice/stl.hpp>
7
10
 
8
11
  #include "utils.h"
9
12
 
10
- class DocumentObject
11
- {
13
+ class DocumentObject {
12
14
  public:
13
15
  DocumentObject(const tomoto::DocumentBase* _doc, const tomoto::ITopicModel* _tm) : doc{ _doc }, tm{ _tm } {}
14
16
 
@@ -63,12 +65,12 @@ void init_lda(Rice::Module& m) {
63
65
  auto topic_dist = self.getTopicsByDoc(doc);
64
66
  auto topic_res = Array();
65
67
  for (size_t i = 0; i < topic_dist.size(); i++) {
66
- topic_res.push(topic_dist[i]);
68
+ topic_res.push(topic_dist[i], false);
67
69
  }
68
70
 
69
71
  auto res = Array();
70
- res.push(topic_res);
71
- res.push(ll);
72
+ res.push(topic_res, false);
73
+ res.push(ll, false);
72
74
  return res;
73
75
  })
74
76
  .define_method(
@@ -76,7 +78,7 @@ void init_lda(Rice::Module& m) {
76
78
  [](tomoto::ILDAModel& self) {
77
79
  Array res;
78
80
  for (size_t i = 0; i < self.getK(); i++) {
79
- res.push(self.getAlpha(i));
81
+ res.push(self.getAlpha(i), false);
80
82
  }
81
83
  return res;
82
84
  })
@@ -96,7 +98,7 @@ void init_lda(Rice::Module& m) {
96
98
  [](tomoto::ILDAModel& self) {
97
99
  Array res;
98
100
  for (auto const& v : self.getCountByTopic()) {
99
- res.push(v);
101
+ res.push(v, false);
100
102
  }
101
103
  return res;
102
104
  })
@@ -107,7 +109,7 @@ void init_lda(Rice::Module& m) {
107
109
  auto n = self.getNumDocs();
108
110
  for (size_t i = 0; i < n; i++) {
109
111
  auto v = DocumentObject(self.getDoc(i), &self);
110
- res.push(Object(Rice::detail::To_Ruby<DocumentObject>().convert(v)));
112
+ res.push(Object(Rice::detail::To_Ruby<DocumentObject>().convert(v)), false);
111
113
  }
112
114
  return res;
113
115
  })
@@ -182,7 +184,7 @@ void init_lda(Rice::Module& m) {
182
184
  auto dict = self.getVocabDict();
183
185
  size_t size = dict.size();
184
186
  for (size_t i = rmTop; i > 0; i--) {
185
- res.push(dict.toWord(size - i));
187
+ res.push(dict.toWord(size - i), false);
186
188
  }
187
189
  return res;
188
190
  })
@@ -210,7 +212,7 @@ void init_lda(Rice::Module& m) {
210
212
  .define_method(
211
213
  "_tw",
212
214
  [](tomoto::ILDAModel& self) {
213
- return (int)self.getTermWeight();
215
+ return static_cast<int>(self.getTermWeight());
214
216
  })
215
217
  .define_method(
216
218
  "used_vocab_df",
@@ -218,7 +220,7 @@ void init_lda(Rice::Module& m) {
218
220
  auto vocab = self.getVocabDf();
219
221
  Array res;
220
222
  for (size_t i = 0; i < self.getV(); i++) {
221
- res.push(vocab[i]);
223
+ res.push(vocab[i], false);
222
224
  }
223
225
  return res;
224
226
  })
@@ -228,7 +230,7 @@ void init_lda(Rice::Module& m) {
228
230
  auto vocab = self.getVocabCf();
229
231
  Array res;
230
232
  for (size_t i = 0; i < self.getV(); i++) {
231
- res.push(vocab[i]);
233
+ res.push(vocab[i], false);
232
234
  }
233
235
  return res;
234
236
  })
@@ -241,7 +243,7 @@ void init_lda(Rice::Module& m) {
241
243
  for (size_t i = 0; i < self.getV(); i++) {
242
244
  VALUE value = Rice::detail::To_Ruby<std::string>().convert(dict.toWord(i));
243
245
  Object obj(value);
244
- res.push(obj.call("force_encoding", utf8));
246
+ res.push(obj.call("force_encoding", utf8), false);
245
247
  }
246
248
  return res;
247
249
  })
@@ -251,7 +253,7 @@ void init_lda(Rice::Module& m) {
251
253
  auto vocab = self.getVocabDf();
252
254
  Array res;
253
255
  for (size_t i = 0; i < vocab.size(); i++) {
254
- res.push(vocab[i]);
256
+ res.push(vocab[i], false);
255
257
  }
256
258
  return res;
257
259
  })
@@ -261,7 +263,7 @@ void init_lda(Rice::Module& m) {
261
263
  auto vocab = self.getVocabCf();
262
264
  Array res;
263
265
  for (size_t i = 0; i < vocab.size(); i++) {
264
- res.push(vocab[i]);
266
+ res.push(vocab[i], false);
265
267
  }
266
268
  return res;
267
269
  })
@@ -274,7 +276,7 @@ void init_lda(Rice::Module& m) {
274
276
  for (size_t i = 0; i < dict.size(); i++) {
275
277
  VALUE value = Rice::detail::To_Ruby<std::string>().convert(dict.toWord(i));
276
278
  Object obj(value);
277
- res.push(obj.call("force_encoding", utf8));
279
+ res.push(obj.call("force_encoding", utf8), false);
278
280
  }
279
281
  return res;
280
282
  });
data/ext/tomoto/llda.cpp CHANGED
@@ -1,6 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <LLDA.h>
2
5
 
3
6
  #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
4
8
 
5
9
  #include "utils.h"
6
10
 
@@ -39,7 +43,7 @@ void init_llda(Rice::Module& m) {
39
43
  for (size_t i = 0; i < dict.size(); i++) {
40
44
  VALUE value = Rice::detail::To_Ruby<std::string>().convert(dict.toWord(i));
41
45
  Object obj(value);
42
- res.push(obj.call("force_encoding", utf8));
46
+ res.push(obj.call("force_encoding", utf8), false);
43
47
  }
44
48
  return res;
45
49
  });
data/ext/tomoto/mglda.cpp CHANGED
@@ -1,6 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <MGLDA.h>
2
5
 
3
6
  #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
4
8
 
5
9
  #include "utils.h"
6
10
 
data/ext/tomoto/plda.cpp CHANGED
@@ -1,6 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <PLDA.h>
2
5
 
3
6
  #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
4
8
 
5
9
  #include "utils.h"
6
10
 
data/ext/tomoto/slda.cpp CHANGED
@@ -1,6 +1,10 @@
1
+ #include <string>
2
+ #include <vector>
3
+
1
4
  #include <SLDA.h>
2
5
 
3
6
  #include <rice/rice.hpp>
7
+ #include <rice/stl.hpp>
4
8
 
5
9
  #include "utils.h"
6
10
 
@@ -15,8 +15,7 @@ void init_plda(Rice::Module& m);
15
15
  void init_slda(Rice::Module& m);
16
16
 
17
17
  extern "C"
18
- void Init_tomoto()
19
- {
18
+ void Init_tomoto() {
20
19
  auto m = Rice::define_module("Tomoto")
21
20
  .define_singleton_function(
22
21
  "isa",
data/ext/tomoto/utils.h CHANGED
@@ -1,27 +1,34 @@
1
1
  #pragma once
2
2
 
3
+ #include <string>
4
+ #include <vector>
5
+
3
6
  #include <rice/rice.hpp>
4
7
  #include <rice/stl.hpp>
5
8
 
6
9
  using Rice::Array;
7
10
  using Rice::Object;
8
11
 
9
- namespace Rice::detail
10
- {
12
+ namespace Rice::detail {
11
13
  template<typename T>
12
- class To_Ruby<std::vector<T>>
13
- {
14
+ class To_Ruby<std::vector<T>> {
14
15
  public:
15
- VALUE convert(std::vector<T> const & x)
16
- {
16
+ To_Ruby() = default;
17
+
18
+ explicit To_Ruby(Arg* arg) : arg_(arg) { }
19
+
20
+ VALUE convert(std::vector<T> const & x) {
17
21
  auto a = rb_ary_new2(x.size());
18
22
  for (const auto& v : x) {
19
23
  detail::protect(rb_ary_push, a, To_Ruby<T>().convert(v));
20
24
  }
21
25
  return a;
22
26
  }
27
+
28
+ private:
29
+ Arg* arg_ = nullptr;
23
30
  };
24
- }
31
+ } // namespace Rice::detail
25
32
 
26
33
  inline tomoto::RawDoc buildDoc(std::vector<std::string>& words) {
27
34
  tomoto::RawDoc doc;
Binary file
Binary file
Binary file
@@ -1,3 +1,3 @@
1
1
  module Tomoto
2
- VERSION = "0.5.1"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,16 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tomoto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Andrew Kane
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description:
14
12
  email: andrew@ankane.org
15
13
  executables: []
16
14
  extensions: []
@@ -36,7 +34,6 @@ files:
36
34
  - ext/tomoto/tomoto.cpp
37
35
  - ext/tomoto/utils.h
38
36
  - lib/tomoto.rb
39
- - lib/tomoto/3.1/tomoto.so
40
37
  - lib/tomoto/3.2/tomoto.so
41
38
  - lib/tomoto/3.3/tomoto.so
42
39
  - lib/tomoto/3.4/tomoto.so
@@ -116,7 +113,6 @@ homepage: https://github.com/ankane/tomoto-ruby
116
113
  licenses:
117
114
  - MIT
118
115
  metadata: {}
119
- post_install_message:
120
116
  rdoc_options: []
121
117
  require_paths:
122
118
  - lib
@@ -124,7 +120,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
120
  requirements:
125
121
  - - ">="
126
122
  - !ruby/object:Gem::Version
127
- version: '3.1'
123
+ version: '3.2'
128
124
  - - "<"
129
125
  - !ruby/object:Gem::Version
130
126
  version: 3.5.dev
@@ -134,8 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
130
  - !ruby/object:Gem::Version
135
131
  version: '0'
136
132
  requirements: []
137
- rubygems_version: 3.3.26
138
- signing_key:
133
+ rubygems_version: 3.6.9
139
134
  specification_version: 4
140
135
  summary: High performance topic modeling for Ruby
141
136
  test_files: []
Binary file