lda-ruby 0.5.0-x86_64-linux-musl

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 (68) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +69 -0
  3. data/Gemfile +9 -0
  4. data/README.md +160 -0
  5. data/VERSION.yml +5 -0
  6. data/docs/modernization-handoff.md +233 -0
  7. data/docs/porting-strategy.md +148 -0
  8. data/docs/precompiled-platform-policy.md +81 -0
  9. data/docs/precompiled-target-evaluation.md +67 -0
  10. data/docs/release-runbook.md +192 -0
  11. data/docs/rust-orchestration-guardrails.md +50 -0
  12. data/ext/lda-ruby/cokus.c +144 -0
  13. data/ext/lda-ruby/cokus.h +27 -0
  14. data/ext/lda-ruby/extconf.rb +13 -0
  15. data/ext/lda-ruby/lda-alpha.c +96 -0
  16. data/ext/lda-ruby/lda-alpha.h +21 -0
  17. data/ext/lda-ruby/lda-data.c +67 -0
  18. data/ext/lda-ruby/lda-data.h +14 -0
  19. data/ext/lda-ruby/lda-inference.c +1023 -0
  20. data/ext/lda-ruby/lda-inference.h +63 -0
  21. data/ext/lda-ruby/lda-model.c +345 -0
  22. data/ext/lda-ruby/lda-model.h +31 -0
  23. data/ext/lda-ruby/lda.h +54 -0
  24. data/ext/lda-ruby/utils.c +119 -0
  25. data/ext/lda-ruby/utils.h +18 -0
  26. data/ext/lda-ruby-rust/Cargo.toml +12 -0
  27. data/ext/lda-ruby-rust/README.md +73 -0
  28. data/ext/lda-ruby-rust/extconf.rb +135 -0
  29. data/ext/lda-ruby-rust/include/strings.h +35 -0
  30. data/ext/lda-ruby-rust/src/lib.rs +1263 -0
  31. data/lda-ruby.gemspec +78 -0
  32. data/lib/lda-ruby/backends/base.rb +133 -0
  33. data/lib/lda-ruby/backends/native.rb +158 -0
  34. data/lib/lda-ruby/backends/pure_ruby.rb +675 -0
  35. data/lib/lda-ruby/backends/rust.rb +607 -0
  36. data/lib/lda-ruby/backends.rb +58 -0
  37. data/lib/lda-ruby/config/stopwords.yml +571 -0
  38. data/lib/lda-ruby/corpus/corpus.rb +45 -0
  39. data/lib/lda-ruby/corpus/data_corpus.rb +22 -0
  40. data/lib/lda-ruby/corpus/directory_corpus.rb +25 -0
  41. data/lib/lda-ruby/corpus/text_corpus.rb +27 -0
  42. data/lib/lda-ruby/document/data_document.rb +30 -0
  43. data/lib/lda-ruby/document/document.rb +40 -0
  44. data/lib/lda-ruby/document/text_document.rb +39 -0
  45. data/lib/lda-ruby/lda.so +0 -0
  46. data/lib/lda-ruby/rust_build_policy.rb +21 -0
  47. data/lib/lda-ruby/version.rb +5 -0
  48. data/lib/lda-ruby/vocabulary.rb +46 -0
  49. data/lib/lda-ruby.rb +413 -0
  50. data/lib/lda_ruby_rust.so +0 -0
  51. data/license.txt +504 -0
  52. data/test/backend_compatibility_test.rb +146 -0
  53. data/test/backends_selection_test.rb +100 -0
  54. data/test/benchmark_scripts_test.rb +23 -0
  55. data/test/data/docs.dat +46 -0
  56. data/test/data/sample.rb +20 -0
  57. data/test/data/wiki-test-docs.yml +123 -0
  58. data/test/gemspec_test.rb +27 -0
  59. data/test/lda_ruby_test.rb +319 -0
  60. data/test/packaged_gem_smoke_test.rb +33 -0
  61. data/test/pure_ruby_orchestration_test.rb +109 -0
  62. data/test/release_scripts_test.rb +93 -0
  63. data/test/rust_build_policy_test.rb +23 -0
  64. data/test/rust_orchestration_test.rb +911 -0
  65. data/test/simple_pipeline_test.rb +22 -0
  66. data/test/simple_yaml.rb +17 -0
  67. data/test/test_helper.rb +10 -0
  68. metadata +117 -0
@@ -0,0 +1,22 @@
1
+ require_relative "test_helper"
2
+
3
+ class SimplePipelineTest < Test::Unit::TestCase
4
+ def test_end_to_end_pipeline_on_small_corpus
5
+ corpus = Lda::Corpus.new
6
+ document1 = Lda::TextDocument.new(corpus, "Dom Cobb is a skilled thief who steals secrets from dreams.")
7
+ document2 = Lda::TextDocument.new(corpus, "Jake Sully joins the mission on Pandora and learns from the Na'vi.")
8
+
9
+ corpus.add_document(document1)
10
+ corpus.add_document(document2)
11
+ corpus.remove_word("cobb")
12
+
13
+ lda = Lda::Lda.new(corpus)
14
+ lda.verbose = false
15
+ lda.num_topics = 2
16
+ lda.em("random")
17
+
18
+ topics = lda.top_words(5)
19
+ assert_equal 2, topics.size
20
+ topics.each_value { |words| assert_equal 5, words.size }
21
+ end
22
+ end
@@ -0,0 +1,17 @@
1
+ require_relative "test_helper"
2
+
3
+ class Test::Unit::TestCase
4
+
5
+ @filename = File.join(File.dirname(__FILE__), 'data', 'wiki-test-docs.yml')
6
+ @filedocs = YAML::load_file(@filename)
7
+ @corpus = Lda::TextCorpus.new(@filename)
8
+
9
+ @lda = Lda::Lda.new(@corpus)
10
+
11
+ @lda.verbose = false
12
+ @lda.num_topics = 20
13
+ @lda.em('random')
14
+ @lda.print_topics(20)
15
+
16
+
17
+ end
@@ -0,0 +1,10 @@
1
+ require "test/unit"
2
+ require "shoulda-context"
3
+ require "yaml"
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require "lda-ruby"
8
+
9
+ class Test::Unit::TestCase
10
+ end
metadata ADDED
@@ -0,0 +1,117 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lda-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ platform: x86_64-linux-musl
6
+ authors:
7
+ - David Blei
8
+ - Jason Adams
9
+ - Rio Akasaka
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2026-05-04 00:00:00.000000000 Z
14
+ dependencies: []
15
+ description: Ruby wrapper and toolkit for Latent Dirichlet Allocation based on the
16
+ original lda-c implementation by David M. Blei.
17
+ email:
18
+ - jasonmadams@gmail.com
19
+ executables: []
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - CHANGELOG.md
24
+ - Gemfile
25
+ - README.md
26
+ - VERSION.yml
27
+ - docs/modernization-handoff.md
28
+ - docs/porting-strategy.md
29
+ - docs/precompiled-platform-policy.md
30
+ - docs/precompiled-target-evaluation.md
31
+ - docs/release-runbook.md
32
+ - docs/rust-orchestration-guardrails.md
33
+ - ext/lda-ruby-rust/Cargo.toml
34
+ - ext/lda-ruby-rust/README.md
35
+ - ext/lda-ruby-rust/extconf.rb
36
+ - ext/lda-ruby-rust/include/strings.h
37
+ - ext/lda-ruby-rust/src/lib.rs
38
+ - ext/lda-ruby/cokus.c
39
+ - ext/lda-ruby/cokus.h
40
+ - ext/lda-ruby/extconf.rb
41
+ - ext/lda-ruby/lda-alpha.c
42
+ - ext/lda-ruby/lda-alpha.h
43
+ - ext/lda-ruby/lda-data.c
44
+ - ext/lda-ruby/lda-data.h
45
+ - ext/lda-ruby/lda-inference.c
46
+ - ext/lda-ruby/lda-inference.h
47
+ - ext/lda-ruby/lda-model.c
48
+ - ext/lda-ruby/lda-model.h
49
+ - ext/lda-ruby/lda.h
50
+ - ext/lda-ruby/utils.c
51
+ - ext/lda-ruby/utils.h
52
+ - lda-ruby.gemspec
53
+ - lib/lda-ruby.rb
54
+ - lib/lda-ruby/backends.rb
55
+ - lib/lda-ruby/backends/base.rb
56
+ - lib/lda-ruby/backends/native.rb
57
+ - lib/lda-ruby/backends/pure_ruby.rb
58
+ - lib/lda-ruby/backends/rust.rb
59
+ - lib/lda-ruby/config/stopwords.yml
60
+ - lib/lda-ruby/corpus/corpus.rb
61
+ - lib/lda-ruby/corpus/data_corpus.rb
62
+ - lib/lda-ruby/corpus/directory_corpus.rb
63
+ - lib/lda-ruby/corpus/text_corpus.rb
64
+ - lib/lda-ruby/document/data_document.rb
65
+ - lib/lda-ruby/document/document.rb
66
+ - lib/lda-ruby/document/text_document.rb
67
+ - lib/lda-ruby/lda.so
68
+ - lib/lda-ruby/rust_build_policy.rb
69
+ - lib/lda-ruby/version.rb
70
+ - lib/lda-ruby/vocabulary.rb
71
+ - lib/lda_ruby_rust.so
72
+ - license.txt
73
+ - test/backend_compatibility_test.rb
74
+ - test/backends_selection_test.rb
75
+ - test/benchmark_scripts_test.rb
76
+ - test/data/docs.dat
77
+ - test/data/sample.rb
78
+ - test/data/wiki-test-docs.yml
79
+ - test/gemspec_test.rb
80
+ - test/lda_ruby_test.rb
81
+ - test/packaged_gem_smoke_test.rb
82
+ - test/pure_ruby_orchestration_test.rb
83
+ - test/release_scripts_test.rb
84
+ - test/rust_build_policy_test.rb
85
+ - test/rust_orchestration_test.rb
86
+ - test/simple_pipeline_test.rb
87
+ - test/simple_yaml.rb
88
+ - test/test_helper.rb
89
+ homepage: https://github.com/ealdent/lda-ruby
90
+ licenses:
91
+ - GPL-2.0-or-later
92
+ metadata:
93
+ homepage_uri: https://github.com/ealdent/lda-ruby
94
+ source_code_uri: https://github.com/ealdent/lda-ruby
95
+ changelog_uri: https://github.com/ealdent/lda-ruby/blob/master/CHANGELOG.md
96
+ lda_ruby_gem_variant: precompiled
97
+ lda_ruby_platform: x86_64-linux-musl
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '3.2'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubygems_version: 3.5.22
114
+ signing_key:
115
+ specification_version: 4
116
+ summary: Ruby implementation of Latent Dirichlet Allocation (LDA).
117
+ test_files: []