yai_jieba 0.1.0

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 (55) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +13 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +5 -0
  5. data/Rakefile +23 -0
  6. data/ext/jieba/dict/LICENSE +20 -0
  7. data/ext/jieba/dict/README.md +33 -0
  8. data/ext/jieba/dict/hmm_model.utf8 +34 -0
  9. data/ext/jieba/dict/idf.utf8 +258826 -0
  10. data/ext/jieba/dict/jieba.dict.utf8 +348982 -0
  11. data/ext/jieba/dict/pos_dict/char_state_tab.utf8 +6653 -0
  12. data/ext/jieba/dict/pos_dict/prob_emit.utf8 +166 -0
  13. data/ext/jieba/dict/pos_dict/prob_start.utf8 +259 -0
  14. data/ext/jieba/dict/pos_dict/prob_trans.utf8 +5222 -0
  15. data/ext/jieba/dict/stop_words.utf8 +1534 -0
  16. data/ext/jieba/dict/user.dict.utf8 +4 -0
  17. data/ext/jieba/extconf.rb +16 -0
  18. data/ext/jieba/include/cppjieba/DictTrie.hpp +285 -0
  19. data/ext/jieba/include/cppjieba/FullSegment.hpp +93 -0
  20. data/ext/jieba/include/cppjieba/HMMModel.hpp +129 -0
  21. data/ext/jieba/include/cppjieba/HMMSegment.hpp +190 -0
  22. data/ext/jieba/include/cppjieba/Jieba.hpp +169 -0
  23. data/ext/jieba/include/cppjieba/KeywordExtractor.hpp +153 -0
  24. data/ext/jieba/include/cppjieba/LICENSE +20 -0
  25. data/ext/jieba/include/cppjieba/MPSegment.hpp +137 -0
  26. data/ext/jieba/include/cppjieba/MixSegment.hpp +109 -0
  27. data/ext/jieba/include/cppjieba/PosTagger.hpp +77 -0
  28. data/ext/jieba/include/cppjieba/PreFilter.hpp +54 -0
  29. data/ext/jieba/include/cppjieba/QuerySegment.hpp +89 -0
  30. data/ext/jieba/include/cppjieba/README.md +3 -0
  31. data/ext/jieba/include/cppjieba/SegmentBase.hpp +46 -0
  32. data/ext/jieba/include/cppjieba/SegmentTagged.hpp +23 -0
  33. data/ext/jieba/include/cppjieba/TextRankExtractor.hpp +190 -0
  34. data/ext/jieba/include/cppjieba/Trie.hpp +200 -0
  35. data/ext/jieba/include/cppjieba/Unicode.hpp +227 -0
  36. data/ext/jieba/include/limonp/ArgvContext.hpp +70 -0
  37. data/ext/jieba/include/limonp/Closure.hpp +206 -0
  38. data/ext/jieba/include/limonp/Colors.hpp +31 -0
  39. data/ext/jieba/include/limonp/Condition.hpp +38 -0
  40. data/ext/jieba/include/limonp/Config.hpp +103 -0
  41. data/ext/jieba/include/limonp/ForcePublic.hpp +7 -0
  42. data/ext/jieba/include/limonp/LocalVector.hpp +139 -0
  43. data/ext/jieba/include/limonp/Logging.hpp +90 -0
  44. data/ext/jieba/include/limonp/NonCopyable.hpp +21 -0
  45. data/ext/jieba/include/limonp/StdExtension.hpp +157 -0
  46. data/ext/jieba/include/limonp/StringUtil.hpp +386 -0
  47. data/ext/jieba/jieba.c +9 -0
  48. data/ext/jieba/jieba.h +8 -0
  49. data/ext/jieba/segment.cc +140 -0
  50. data/ext/jieba/segment.h +16 -0
  51. data/lib/jieba/segment.rb +30 -0
  52. data/lib/jieba/version.rb +7 -0
  53. data/lib/jieba.rb +5 -0
  54. data/sig/jieba.rbs +4 -0
  55. metadata +99 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 4dce2f4f0ef16f7c56b7f0b5d0fd1447990bdc6165fde9dee7844d8a074a61f4
4
+ data.tar.gz: 771b0b86e6f8aaff2bf011173e0528b34e4c2dfd17c26898e9b2809b3c394f5f
5
+ SHA512:
6
+ metadata.gz: 5ab899cc24392390ae4061c43359871213692f1265343518360f320e482089c8569734a85d241919f6eee81ef054a4dbdfa4be8b3e370cda278f18a92727793c
7
+ data.tar.gz: a2f362a8d51ded707a1576286d115a07b72cf7da493ba38b008f2738b94036900a815efa0ed35e525b4178e28f755e39662f56dddc4d891eef195fdcf3841031
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ plugins:
2
+ - rubocop-rake
3
+ - rubocop-minitest
4
+
5
+ AllCops:
6
+ TargetRubyVersion: 3.1
7
+ NewCops: enable
8
+
9
+ Style/StringLiterals:
10
+ EnforcedStyle: double_quotes
11
+
12
+ Style/StringLiteralsInInterpolation:
13
+ EnforcedStyle: double_quotes
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 Yet Another AI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Jieba.rb
2
+
3
+ Ruby binding for [cppjieba](https://github.com/yanyiwu/cppjieba).
4
+
5
+ It only supports segmentation feature for now.
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+
6
+ Minitest::TestTask.create
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ require "rake/extensiontask"
13
+
14
+ desc "Build Ruby Gem"
15
+ task build: :compile
16
+
17
+ GEMSPEC = Gem::Specification.load("jieba.gemspec")
18
+
19
+ Rake::ExtensionTask.new("jieba", GEMSPEC) do |ext|
20
+ ext.lib_dir = "lib/jieba"
21
+ end
22
+
23
+ task default: %i[clobber compile test rubocop]
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,33 @@
1
+ # CppJieba字典
2
+
3
+ [yanyiwu/cppjieba v5.4.1](https://github.com/yanyiwu/cppjieba/tree/v5.4.1/include/cppjieba) under MIT license
4
+
5
+ 文件后缀名代表的是词典的编码方式。
6
+ 比如filename.utf8 是 utf8编码,filename.gbk 是 gbk编码方式。
7
+
8
+
9
+ ## 分词
10
+
11
+ ### jieba.dict.utf8/gbk
12
+
13
+ 作为最大概率法(MPSegment: Max Probability)分词所使用的词典。
14
+
15
+ ### hmm_model.utf8/gbk
16
+
17
+ 作为隐式马尔科夫模型(HMMSegment: Hidden Markov Model)分词所使用的词典。
18
+
19
+ __对于MixSegment(混合MPSegment和HMMSegment两者)则同时使用以上两个词典__
20
+
21
+
22
+ ## 关键词抽取
23
+
24
+ ### idf.utf8
25
+
26
+ IDF(Inverse Document Frequency)
27
+ 在KeywordExtractor中,使用的是经典的TF-IDF算法,所以需要这么一个词典提供IDF信息。
28
+
29
+ ### stop_words.utf8
30
+
31
+ 停用词词典
32
+
33
+