nodejieba-plus 3.5.8

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 (130) hide show
  1. package/.github/FUNDING.yml +12 -0
  2. package/.github/workflows/github_release.yml +61 -0
  3. package/.github/workflows/npm_publish.yml +24 -0
  4. package/.github/workflows/stale-issues.yml +24 -0
  5. package/.github/workflows/test.yml +42 -0
  6. package/.gitmodules +3 -0
  7. package/.npmignore +15 -0
  8. package/CHANGELOG.md +360 -0
  9. package/CONTRIBUTING.md +78 -0
  10. package/LICENSE +21 -0
  11. package/README.md +349 -0
  12. package/binding.gyp +63 -0
  13. package/index.js +77 -0
  14. package/lib/index.cpp +3 -0
  15. package/lib/nodejieba.cpp +218 -0
  16. package/lib/nodejieba.h +28 -0
  17. package/lib/utils.h +47 -0
  18. package/package.json +48 -0
  19. package/submodules/cppjieba/.github/workflows/cmake.yml +51 -0
  20. package/submodules/cppjieba/.github/workflows/stale-issues.yml +24 -0
  21. package/submodules/cppjieba/.gitmodules +3 -0
  22. package/submodules/cppjieba/CHANGELOG.md +305 -0
  23. package/submodules/cppjieba/CMakeLists.txt +42 -0
  24. package/submodules/cppjieba/LICENSE +20 -0
  25. package/submodules/cppjieba/README.md +280 -0
  26. package/submodules/cppjieba/deps/limonp/.github/workflows/cmake.yml +43 -0
  27. package/submodules/cppjieba/deps/limonp/.gitmodules +0 -0
  28. package/submodules/cppjieba/deps/limonp/CHANGELOG.md +160 -0
  29. package/submodules/cppjieba/deps/limonp/CMakeLists.txt +61 -0
  30. package/submodules/cppjieba/deps/limonp/LICENSE +20 -0
  31. package/submodules/cppjieba/deps/limonp/README.md +38 -0
  32. package/submodules/cppjieba/deps/limonp/include/limonp/ArgvContext.hpp +70 -0
  33. package/submodules/cppjieba/deps/limonp/include/limonp/Closure.hpp +206 -0
  34. package/submodules/cppjieba/deps/limonp/include/limonp/Colors.hpp +31 -0
  35. package/submodules/cppjieba/deps/limonp/include/limonp/Condition.hpp +38 -0
  36. package/submodules/cppjieba/deps/limonp/include/limonp/Config.hpp +103 -0
  37. package/submodules/cppjieba/deps/limonp/include/limonp/ForcePublic.hpp +7 -0
  38. package/submodules/cppjieba/deps/limonp/include/limonp/LocalVector.hpp +139 -0
  39. package/submodules/cppjieba/deps/limonp/include/limonp/Logging.hpp +90 -0
  40. package/submodules/cppjieba/deps/limonp/include/limonp/NonCopyable.hpp +21 -0
  41. package/submodules/cppjieba/deps/limonp/include/limonp/StdExtension.hpp +157 -0
  42. package/submodules/cppjieba/deps/limonp/include/limonp/StringUtil.hpp +386 -0
  43. package/submodules/cppjieba/deps/limonp/test/CMakeLists.txt +8 -0
  44. package/submodules/cppjieba/deps/limonp/test/demo.cpp +40 -0
  45. package/submodules/cppjieba/deps/limonp/test/testdata/1.conf +5 -0
  46. package/submodules/cppjieba/deps/limonp/test/testdata/StdExtension.data +3 -0
  47. package/submodules/cppjieba/deps/limonp/test/testdata/dict.gbk +50 -0
  48. package/submodules/cppjieba/deps/limonp/test/testdata/dict.utf8 +50 -0
  49. package/submodules/cppjieba/deps/limonp/test/testdata/io_testfile +2 -0
  50. package/submodules/cppjieba/deps/limonp/test/testdata/jieba.dict.0.1.utf8 +93 -0
  51. package/submodules/cppjieba/deps/limonp/test/testdata/jieba.dict.0.utf8 +93 -0
  52. package/submodules/cppjieba/deps/limonp/test/testdata/jieba.dict.1.utf8 +67 -0
  53. package/submodules/cppjieba/deps/limonp/test/testdata/jieba.dict.2.utf8 +64 -0
  54. package/submodules/cppjieba/deps/limonp/test/unittest/CMakeLists.txt +30 -0
  55. package/submodules/cppjieba/deps/limonp/test/unittest/TArgvContext.cpp +16 -0
  56. package/submodules/cppjieba/deps/limonp/test/unittest/TCastFloat.cpp +19 -0
  57. package/submodules/cppjieba/deps/limonp/test/unittest/TClosure.cpp +85 -0
  58. package/submodules/cppjieba/deps/limonp/test/unittest/TColorPrint.cpp +20 -0
  59. package/submodules/cppjieba/deps/limonp/test/unittest/TConfig.cpp +17 -0
  60. package/submodules/cppjieba/deps/limonp/test/unittest/TLocalVector.cpp +41 -0
  61. package/submodules/cppjieba/deps/limonp/test/unittest/TLogging.cpp +12 -0
  62. package/submodules/cppjieba/deps/limonp/test/unittest/TStdExtension.cpp +95 -0
  63. package/submodules/cppjieba/deps/limonp/test/unittest/TStringUtil.cpp +183 -0
  64. package/submodules/cppjieba/deps/limonp/test/unittest/gtest_main.cpp +39 -0
  65. package/submodules/cppjieba/dict/README.md +31 -0
  66. package/submodules/cppjieba/dict/hmm_model.utf8 +34 -0
  67. package/submodules/cppjieba/dict/idf.utf8 +258826 -0
  68. package/submodules/cppjieba/dict/jieba.dict.utf8 +348982 -0
  69. package/submodules/cppjieba/dict/pos_dict/char_state_tab.utf8 +6653 -0
  70. package/submodules/cppjieba/dict/pos_dict/prob_emit.utf8 +166 -0
  71. package/submodules/cppjieba/dict/pos_dict/prob_start.utf8 +259 -0
  72. package/submodules/cppjieba/dict/pos_dict/prob_trans.utf8 +5222 -0
  73. package/submodules/cppjieba/dict/stop_words.utf8 +1534 -0
  74. package/submodules/cppjieba/dict/user.dict.utf8 +4 -0
  75. package/submodules/cppjieba/include/cppjieba/DictTrie.hpp +381 -0
  76. package/submodules/cppjieba/include/cppjieba/FullSegment.hpp +93 -0
  77. package/submodules/cppjieba/include/cppjieba/HMMModel.hpp +129 -0
  78. package/submodules/cppjieba/include/cppjieba/HMMSegment.hpp +190 -0
  79. package/submodules/cppjieba/include/cppjieba/Jieba.hpp +169 -0
  80. package/submodules/cppjieba/include/cppjieba/KeywordExtractor.hpp +153 -0
  81. package/submodules/cppjieba/include/cppjieba/MPSegment.hpp +137 -0
  82. package/submodules/cppjieba/include/cppjieba/MixSegment.hpp +109 -0
  83. package/submodules/cppjieba/include/cppjieba/PosTagger.hpp +77 -0
  84. package/submodules/cppjieba/include/cppjieba/PreFilter.hpp +54 -0
  85. package/submodules/cppjieba/include/cppjieba/QuerySegment.hpp +89 -0
  86. package/submodules/cppjieba/include/cppjieba/SegmentBase.hpp +48 -0
  87. package/submodules/cppjieba/include/cppjieba/SegmentTagged.hpp +23 -0
  88. package/submodules/cppjieba/include/cppjieba/TextRankExtractor.hpp +190 -0
  89. package/submodules/cppjieba/include/cppjieba/Trie.hpp +200 -0
  90. package/submodules/cppjieba/include/cppjieba/Unicode.hpp +231 -0
  91. package/submodules/cppjieba/test/CMakeLists.txt +4 -0
  92. package/submodules/cppjieba/test/load_test.cpp +54 -0
  93. package/submodules/cppjieba/test/testdata/curl.res +1 -0
  94. package/submodules/cppjieba/test/testdata/extra_dict/jieba.dict.small.utf8 +109750 -0
  95. package/submodules/cppjieba/test/testdata/gbk_dict/hmm_model.gbk +34 -0
  96. package/submodules/cppjieba/test/testdata/gbk_dict/jieba.dict.gbk +348982 -0
  97. package/submodules/cppjieba/test/testdata/jieba.dict.0.1.utf8 +93 -0
  98. package/submodules/cppjieba/test/testdata/jieba.dict.0.utf8 +93 -0
  99. package/submodules/cppjieba/test/testdata/jieba.dict.1.utf8 +67 -0
  100. package/submodules/cppjieba/test/testdata/jieba.dict.2.utf8 +64 -0
  101. package/submodules/cppjieba/test/testdata/load_test.urls +2 -0
  102. package/submodules/cppjieba/test/testdata/review.100 +100 -0
  103. package/submodules/cppjieba/test/testdata/review.100.res +200 -0
  104. package/submodules/cppjieba/test/testdata/server.conf +19 -0
  105. package/submodules/cppjieba/test/testdata/testlines.gbk +9 -0
  106. package/submodules/cppjieba/test/testdata/testlines.utf8 +8 -0
  107. package/submodules/cppjieba/test/testdata/userdict.2.utf8 +1 -0
  108. package/submodules/cppjieba/test/testdata/userdict.english +2 -0
  109. package/submodules/cppjieba/test/testdata/userdict.utf8 +8 -0
  110. package/submodules/cppjieba/test/testdata/weicheng.utf8 +247 -0
  111. package/submodules/cppjieba/test/unittest/CMakeLists.txt +33 -0
  112. package/submodules/cppjieba/test/unittest/gtest_main.cpp +39 -0
  113. package/submodules/cppjieba/test/unittest/jieba_test.cpp +166 -0
  114. package/submodules/cppjieba/test/unittest/keyword_extractor_test.cpp +79 -0
  115. package/submodules/cppjieba/test/unittest/pos_tagger_test.cpp +41 -0
  116. package/submodules/cppjieba/test/unittest/pre_filter_test.cpp +43 -0
  117. package/submodules/cppjieba/test/unittest/segments_test.cpp +256 -0
  118. package/submodules/cppjieba/test/unittest/textrank_test.cpp +86 -0
  119. package/submodules/cppjieba/test/unittest/trie_test.cpp +177 -0
  120. package/submodules/cppjieba/test/unittest/unicode_test.cpp +43 -0
  121. package/test/debug_split +0 -0
  122. package/test/debug_split2 +0 -0
  123. package/test/debug_split3 +0 -0
  124. package/test/load_dict_test.js +14 -0
  125. package/test/missing_binding_test.js +42 -0
  126. package/test/test.js +366 -0
  127. package/test/testdata/userdict.utf8 +1 -0
  128. package/tsconfig.json +59 -0
  129. package/types/index.d.ts +30 -0
  130. package/typescript_demo.ts +38 -0
@@ -0,0 +1,12 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: yanyiwu # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ otechie: # Replace with a single Otechie username
12
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,61 @@
1
+ name: GitHub Release
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ tag:
7
+ description: 'Release tag (e.g. v3.5.5)'
8
+ required: true
9
+ type: string
10
+ push:
11
+ tags:
12
+ - 'v*'
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: ${{ matrix.os }}
17
+ permissions:
18
+ contents: write
19
+ strategy:
20
+ matrix:
21
+ os: [ubuntu-latest, ubuntu-22.04-arm, windows-latest, macos-latest]
22
+ node-version: [16.x, 18.x, 20.x, 22.x, 24.x]
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ with:
27
+ submodules: recursive
28
+ ref: ${{ inputs.tag || github.ref_name }}
29
+ - name: Use Node.js ${{ matrix.node-version }}
30
+ uses: actions/setup-node@v4
31
+ with:
32
+ node-version: ${{ matrix.node-version }}
33
+ - name: Use Python 3.11
34
+ uses: actions/setup-python@v5
35
+ with:
36
+ python-version: '3.11'
37
+ - name: Install build deps (Linux)
38
+ if: startsWith(matrix.os, 'ubuntu')
39
+ run: |
40
+ sudo apt-get update
41
+ sudo apt-get install -y build-essential python3
42
+ - run: npm ci
43
+ - run: npm test
44
+ - name: Package Binary
45
+ run: |
46
+ npm install -g @mapbox/node-pre-gyp
47
+ npx @mapbox/node-pre-gyp package
48
+
49
+ - name: Upload Binary
50
+ uses: softprops/action-gh-release@v1
51
+ env:
52
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53
+ with:
54
+ tag_name: ${{ inputs.tag || github.ref_name }}
55
+ name: ${{ inputs.tag || github.ref_name }}
56
+ draft: false
57
+ prerelease: false
58
+ generate_release_notes: true
59
+ fail_on_unmatched_files: false
60
+ files: |
61
+ ./build/stage/**/*.tar.gz
@@ -0,0 +1,24 @@
1
+ name: NPM Publish
2
+ on:
3
+ push:
4
+ tags:
5
+ - 'v[0-9]+.[0-9]+.[0-9]+'
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ with:
16
+ submodules: recursive
17
+ - uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '20'
20
+ registry-url: 'https://registry.npmjs.org'
21
+ - run: npm ci
22
+ - run: npm publish --provenance --access public
23
+ env:
24
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,24 @@
1
+ name: Close Stale Issues
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '10 13 20 */3 *' # Run Every 3 Monthly on the 20th day of the month at 13:10 UTC
6
+
7
+ jobs:
8
+ stale:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ issues: write
12
+ pull-requests: write
13
+
14
+ steps:
15
+ - uses: actions/stale@v5
16
+ with:
17
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
18
+ stale-issue-message: 'This issue has not been updated for over 1 year and will be marked as stale. If the issue still exists, please comment or update the issue, otherwise it will be closed after 7 days.'
19
+ close-issue-message: 'This issue has been automatically closed due to inactivity. If the issue still exists, please reopen it.'
20
+ days-before-issue-stale: 365
21
+ days-before-issue-close: 7
22
+ stale-issue-label: 'Stale'
23
+ exempt-issue-labels: 'pinned,security'
24
+ operations-per-run: 100
@@ -0,0 +1,42 @@
1
+ # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2
+ # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3
+
4
+ name: test
5
+
6
+ on:
7
+ workflow_dispatch:
8
+ push:
9
+ pull_request:
10
+
11
+ jobs:
12
+ build:
13
+
14
+ runs-on: ${{ matrix.os }}
15
+
16
+ strategy:
17
+ matrix:
18
+ node-version: [16.x, 18.x, 20.x, 22.x, 24.x]
19
+ # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
20
+ os: [ubuntu-latest, ubuntu-22.04-arm, macos-latest, windows-latest]
21
+
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+ with:
26
+ submodules: recursive
27
+ - name: Use Node.js ${{ matrix.node-version }}
28
+ uses: actions/setup-node@v4
29
+ with:
30
+ node-version: ${{ matrix.node-version }}
31
+ cache: 'npm'
32
+ - name: Use Python 3.11
33
+ uses: actions/setup-python@v5
34
+ with:
35
+ python-version: '3.11'
36
+ - name: Install build deps (Linux)
37
+ if: startsWith(matrix.os, 'ubuntu')
38
+ run: |
39
+ sudo apt-get update
40
+ sudo apt-get install -y build-essential python3
41
+ - run: npm ci
42
+ - run: npm test
package/.gitmodules ADDED
@@ -0,0 +1,3 @@
1
+ [submodule "submodules/cppjieba"]
2
+ path = submodules/cppjieba
3
+ url = https://github.com/yanyiwu/cppjieba.git
package/.npmignore ADDED
@@ -0,0 +1,15 @@
1
+ *.swp
2
+ .*.swp
3
+ npm-debug.log
4
+ node_modules
5
+
6
+ build
7
+
8
+ # don't need these in the npm package.
9
+ html/*.png
10
+
11
+ # don't ignore .npmignore files
12
+ # these are used in some tests.
13
+ !.npmignore
14
+
15
+ *.pyc
package/CHANGELOG.md ADDED
@@ -0,0 +1,360 @@
1
+ # CHANGELOG
2
+
3
+ ## v3.4.3
4
+
5
+ + 8723bbb [submodule/cppjieba] from v5.1.3 to v5.4.0
6
+ + 7787450 Update stale-issues.yml: 3y -> 1y
7
+ + 90d5b6b [github/actions] stale 5 years -> 3 years
8
+ + b69d1fe [github/actions] stale issues
9
+ + 5241ef1 [.github][npm publish] upgrade */v2 to */v4 and node-version 18->20
10
+
11
+ ## v3.4.2
12
+
13
+ + 9bc3979 [package] clean unused deps
14
+ + e8988c5 git rm .travis.yml
15
+ + 839f203 Merge pull request #236 from yanyiwu/dependabot/npm_and_yarn/js-yaml-3.14.1
16
+ + 26f0872 Bump js-yaml from 3.6.1 to 3.14.1
17
+ + 1788029 Merge pull request #235 from yanyiwu/dependabot/npm_and_yarn/multi-037252cf8f
18
+ + 641b2d7 Bump minimist, coveralls and mocha
19
+ + e01e1c4 [CI] GitHub Release: publish --release instead of draft
20
+
21
+ ## v3.4.1
22
+
23
+ + [demo] using nodejieba-demo instead of test/demo.js
24
+ + git submodule update --remote to upgrade cppjieba from v5.1.2 to v5.1.3
25
+
26
+ ## v3.4.0
27
+
28
+ + package-lock.json updated by 'npm install'
29
+ + npm outdated; npm update;
30
+
31
+ ## v3.3.1
32
+
33
+ + [CI] fix github/actions:auto-release
34
+
35
+ ## v3.3.0
36
+
37
+ + [CI] auto github/release by node-pre-gyp-github
38
+ + [github/actions] CI add windows,macos, node-22, removed node-16
39
+
40
+ ## v3.2.0
41
+
42
+ + [submodule] rm dict and deps, use submodules/cppjieba instead
43
+
44
+ ## v3.1.1
45
+
46
+ + Using GitHub Actions Workflow to Publish NPM Package
47
+
48
+ ## v3.1.0
49
+
50
+ + Merged [pull request 220](https://github.com/yanyiwu/nodejieba/pull/220)
51
+ + Merged [pull request 212](https://github.com/yanyiwu/nodejieba/pull/212)
52
+ + Merged [pull request 210](https://github.com/yanyiwu/nodejieba/pull/210)
53
+ + Merged [pull request 207](https://github.com/yanyiwu/nodejieba/pull/207)
54
+ + Merged [pull request 206](https://github.com/yanyiwu/nodejieba/pull/206)
55
+ + Merged [pull request 204](https://github.com/yanyiwu/nodejieba/pull/204)
56
+
57
+ ## v2.6.0
58
+
59
+ + Merged [pull request 202](https://github.com/yanyiwu/nodejieba/pull/202)
60
+
61
+ ## v2.5.2
62
+
63
+ + Merged [pull request 193](https://github.com/yanyiwu/nodejieba/pull/193)
64
+
65
+ ## v2.5.1
66
+
67
+ + Merged [pull request 179](https://github.com/yanyiwu/nodejieba/pull/179)
68
+ + Since v2.5.0, [node-addon-api](https://github.com/nodejs/node-addon-api) is used, and only Node.js versions 10.0.0 and above are supported. There was an error in the previous description in the v2.5.0 version.
69
+
70
+ ## v2.5.0
71
+
72
+ + merged [pull request 177](https://github.com/yanyiwu/nodejieba/pull/177)
73
+ + only supports Node.js 7.0.0 and above.
74
+
75
+ ## v2.4.2
76
+
77
+ + merged [pull request 173](https://github.com/yanyiwu/nodejieba/pull/173)
78
+
79
+ ## v2.4.1
80
+
81
+ + upgrade deps/limonp -> v0.6.3
82
+ + upgrade deps/cppjieba -> v5.0.3
83
+ + merged [pull request 148](https://github.com/yanyiwu/nodejieba/pull/148)
84
+
85
+ ## v2.4.0
86
+
87
+ + revert commit-6600629 to be compatiable with cppjieba.
88
+ + upgrade deps/limonp -> v0.6.2
89
+ + upgrade deps/cppjieba -> v5.0.2
90
+
91
+ ## v2.3.5
92
+
93
+ + merged [pull request 143](https://github.com/yanyiwu/nodejieba/pull/143)
94
+ + add release deployment in travis
95
+
96
+ ## v2.3.3
97
+
98
+ + merged [pull request 142](https://github.com/yanyiwu/nodejieba/pull/142)
99
+
100
+ ## v2.3.2
101
+
102
+ + merged [pull request 140](https://github.com/yanyiwu/nodejieba/pull/140)
103
+
104
+ ## v2.3.1
105
+
106
+ + merged [pull request 132](https://github.com/yanyiwu/nodejieba/pull/132)
107
+
108
+ ## v2.3.0
109
+
110
+ + merged [pull request 125](https://github.com/yanyiwu/nodejieba/pull/125)
111
+
112
+ ## v2.2.7
113
+
114
+ + support typescript [pull request 118](https://github.com/yanyiwu/nodejieba/pull/118)
115
+
116
+ ## v2.2.6
117
+
118
+ + fix bug [pull request 113](https://github.com/yanyiwu/nodejieba/pull/113)
119
+
120
+ ## v2.2.5
121
+
122
+ + fix bug [pull request 89](https://github.com/yanyiwu/nodejieba/pull/89)
123
+
124
+ ## v2.2.4
125
+
126
+ + support "tag" in insertWord function. [pull request 71](https://github.com/yanyiwu/nodejieba/pull/71)
127
+
128
+ ## v2.2.3
129
+
130
+ + update cppjieba -> 4a755dff to try fixing [issue 65](https://github.com/yanyiwu/nodejieba/issues/65)
131
+
132
+ ## v2.2.2
133
+
134
+ + upgrade cppjieba -> v4.8.1
135
+ + (word freq tag) format in user dict has been supported.
136
+
137
+ ## v2.2.1
138
+
139
+ + fix bug in v2.2.0 about 'cutSmall'
140
+
141
+ ## v2.2.0
142
+
143
+ + add api `cutSmall` to cut words in specific word length limit
144
+
145
+ ## v2.1.0
146
+
147
+ + function `tag,extract` return objects, instead of strings.
148
+ + fix issue [issue 58](https://github.com/yanyiwu/nodejieba/issues/58)
149
+
150
+ ## v2.0.0
151
+
152
+ + Upgrade cppjieba -> v4.8.0
153
+ + rewrite `cut` function:
154
+ + add `cutAll` for old `cut(s, "FULL")` function.
155
+ + add `cutHMM` for old `cut(s, "HMM")` function.
156
+ + add `cutForSearch` for old `cut(s, "Query")` function.
157
+
158
+ ## v1.4.11
159
+
160
+ + Upgrade dependencies
161
+
162
+ + "nan": "~2.2.0" -> "~2.3.0"
163
+
164
+ + Upgrade devDependencies
165
+
166
+ + "mocha": "~2.3.4" -> "~2.4.5"
167
+ + "should": "~8.0.2" -> "~8.3.1"
168
+
169
+ + Upgrade deps/
170
+
171
+ + cppjieba -> v4.7.0
172
+ + limonp -> v0.6.1
173
+
174
+ ## v1.4.10
175
+
176
+ Upgrade to fix potential trouble:
177
+
178
+ + limonp -> v0.5.6
179
+ + cppjieba -> v4.5.2
180
+
181
+ ## v1.4.9
182
+
183
+ Upgrade limonp and cppjieba to fix [issue48](https://github.com/yanyiwu/nodejieba/issues/48)
184
+
185
+ * limonp -> v0.5.4
186
+ * cppjieba -> v4.5.0
187
+
188
+ ## v1.4.8
189
+
190
+ Upgrade:
191
+
192
+ * cppjieba -> v4.4.1 to fix bug, see details in [CppJieba ChangeLog v4.4.1](https://github.com/yanyiwu/cppjieba/blob/master/ChangeLog.md#v441)
193
+
194
+ ## v1.4.7
195
+
196
+ Upgrade:
197
+
198
+ * limonp -> v0.5.3, fix incompatibility problem in Windows.
199
+
200
+ ## v1.4.6
201
+
202
+ Change source codes layout
203
+
204
+ * lib/jieba/limonp -> deps/limonp
205
+ * lib/jieba -> deps/cppjieba
206
+
207
+ Upgrade:
208
+
209
+ * limonp -> v0.5.2, fix incompatibility problem of [issue45](https://github.com/yanyiwu/nodejieba/issues/45)
210
+ * cppjieba -> v4.3.2
211
+
212
+ ## v1.4.5
213
+
214
+ * 修复多余日志输出的问题。
215
+
216
+ ## v1.4.4
217
+
218
+ * 升级 [cppjieba] 到最新版本 v4.2.1
219
+
220
+ ## v1.4.3
221
+
222
+ * 升级 [cppjieba] 到最新版本 v4.1.2
223
+
224
+ ## v1.4.2
225
+
226
+ * 升级 package.json 里面的依赖库。
227
+
228
+ ## v1.4.1
229
+
230
+ * [enhancement issue]: https://github.com/yanyiwu/nodejieba/issues/39
231
+
232
+ ## v1.4.0
233
+
234
+ * 对MP算法的分词方式新增一个粒度参数,解决[issue29]关于细粒度分词的问题。
235
+
236
+ ## v1.3.0
237
+
238
+ * 合并 [pr37], 修复 [issue36] 。 放弃对旧版本 `node.js v0.11` 的支持。
239
+
240
+ ## v1.2.2
241
+
242
+ * 修复依赖的nan版本的问题。
243
+
244
+ ## v1.2.1
245
+
246
+ * 修复load函数重复调用时内存没有释放的问题。
247
+
248
+ ## v1.2.0
249
+
250
+ * 同时支持【不配置词典文件直接使用】和【灵活配置词典】的需求。
251
+
252
+ ## v1.1.0
253
+
254
+ * 新增支持动态增加词库的API函数: `insertWord`
255
+
256
+ ## v1.0.3
257
+
258
+ * Merge Pull Request [pr28],显示声明依赖的是 node 后缀的文件,解决一些库重写了 require 的问题。
259
+
260
+ ## v1.0.2
261
+
262
+ * 修复在 windows 上编译不通过的问题,提升兼容性。
263
+
264
+ ## v1.0.1
265
+
266
+ * 修复在iojs v2.2.1 上编译不通过的问题,提升兼容性。
267
+
268
+ ## v1.0.0
269
+
270
+ * 使用[cppjieba] v3.0.0 版本,使用更简洁的接口函数,可以使用参数指定切词方法。
271
+ * `require("nodejieba")` 时自动载入词典,用户无需再烦心字典的事情,实现即插即用。
272
+ * 听从 [issue23] 的建议,废除异步调用的接口,现在的接口函数都是同步调用函数,分别是 `cut`, `tag`, `extract` 。因为分词毕竟是CPU密集型的事情,没必要使用异步调用。
273
+
274
+ ## v0.2.13
275
+
276
+ * 升级[nan]到 `^v1.8.0` 以支持 `iojs-v2.x`
277
+
278
+ ## v0.2.12
279
+
280
+ * 新增以下默认词典地址,让使用者不需要自己写词典的相对地址。
281
+ * nodejieba.DEFAULT_DICT
282
+ * nodejieba.DEFAULT_HMM_DICT
283
+ * nodejieba.DEFAULT_USER_DICT
284
+ * nodejieba.DEFAULT_IDF_DICT
285
+ * nodejieba.DEFAULT_STOP_WORD_DICT
286
+
287
+ ## v0.2.11
288
+
289
+ * 更新 [cppjieba] 。
290
+ * 打印更详细的初始化错误日志信息。
291
+
292
+ ## v0.2.10
293
+
294
+ * 避免一些在Mac系统下的词典载入日志,更干净的用户体验。
295
+
296
+ ## v0.2.9
297
+
298
+ * 支持vs2012编译。
299
+
300
+ ## v0.2.8(deleted)
301
+
302
+ * 支持vs2012编译。
303
+
304
+ ## v0.2.7
305
+
306
+ * 关键词抽取支持自定义词典(可选参数)。
307
+
308
+ ## v0.2.6
309
+
310
+ * 修复不同Node版本的兼容性问题,在v0.11.13下测试通过。
311
+ * 支持自定义词典(可选参数)。
312
+ * 增加关键词抽取功能。
313
+
314
+ ## v0.2.5
315
+
316
+ * 增加词性标注功能
317
+
318
+ ## v0.2.4
319
+
320
+ * 更新 package 兼容更低版本的 npm
321
+
322
+ ## v0.2.3
323
+
324
+ * 更新 cppjieba ,减少内存使用。
325
+
326
+ ## v0.2.2
327
+
328
+ * 在queryLoadDict 函数中增加query模式的粒度阈值作为可选参数。
329
+
330
+ ## v0.2.1
331
+
332
+ * 增加搜索引擎分词模式,分别对应的调用函数是 `queryLoadDict, queryCutSync, queryCut`。
333
+
334
+ ## v0.2.0
335
+
336
+ * 将原来的 cut 阻塞分词模式改为非阻塞模式
337
+ * 阻塞分词模型的函数名为 cutSync
338
+
339
+ ## v0.1.4
340
+
341
+ * 修复关于较低版本编译器需要使用`tr1/unordered_map`导致和`node-gyp`编译选项`-fno-rtti`冲突的编译错误问题。
342
+
343
+ ## v0.1.3
344
+
345
+ * 更新[cppjieba],支持更低版本的g++。
346
+
347
+ ## v0.1.2
348
+
349
+ * 更新[cppjieba],使用`less_memory`这个branch来减少Trie树内存的开销。
350
+
351
+ ## v0.1.1
352
+
353
+ * 依照node的c++扩展的常规写法,对cppjieba进行简单的包装,并已`npm publish`
354
+
355
+ [cppjieba]:http://github.com/yanyiwu/cppjieba.git
356
+ [nan]:https://github.com/nodejs/nan/
357
+ [issue23]:https://github.com/yanyiwu/nodejieba/issues/23
358
+ [pr28]:https://github.com/yanyiwu/nodejieba/pull/28
359
+ [issue36]:https://github.com/yanyiwu/nodejieba/issues/36
360
+ [issue29]:https://github.com/yanyiwu/nodejieba/issues/29
@@ -0,0 +1,78 @@
1
+ # 贡献指南
2
+
3
+ 感谢您考虑为NodeJieba项目做出贡献!以下是一些指导原则,帮助您更好地参与项目开发。
4
+
5
+ ## 开发环境设置
6
+
7
+ 1. 克隆仓库并安装依赖:
8
+
9
+ ```bash
10
+ git clone --recursive https://github.com/yanyiwu/nodejieba.git
11
+ cd nodejieba
12
+ npm install
13
+ ```
14
+
15
+ 2. 运行测试确保一切正常:
16
+
17
+ ```bash
18
+ npm test
19
+ ```
20
+
21
+ ## 提交代码
22
+
23
+ 1. 创建一个新的分支进行开发:
24
+
25
+ ```bash
26
+ git checkout -b feature/your-feature-name
27
+ ```
28
+
29
+ 2. 进行代码修改
30
+ 3. 确保所有测试通过:
31
+
32
+ ```bash
33
+ npm test
34
+ ```
35
+
36
+ 4. 提交您的更改:
37
+
38
+ ```bash
39
+ git commit -m "描述您的更改"
40
+ ```
41
+
42
+ 5. 推送到您的分支:
43
+
44
+ ```bash
45
+ git push origin feature/your-feature-name
46
+ ```
47
+
48
+ 6. 创建一个Pull Request
49
+
50
+ ## 代码风格
51
+
52
+ - 遵循项目现有的代码风格
53
+ - 对于JavaScript代码,使用2个空格缩进
54
+ - 对于C++代码,遵循现有的代码风格
55
+
56
+ ## 测试
57
+
58
+ - 为新功能添加测试用例
59
+ - 确保所有测试通过
60
+
61
+ ## 文档
62
+
63
+ - 更新README.md以反映您的更改
64
+ - 为新功能添加文档注释
65
+
66
+ ## 版本发布
67
+
68
+ 版本发布由项目维护者负责。如果您认为应该发布新版本,请在Issue中提出。
69
+
70
+ ## 许可证
71
+
72
+ 通过贡献代码,您同意您的贡献将在MIT许可证下发布。
73
+
74
+ ## 问题和讨论
75
+
76
+ 如果您有任何问题或想法,请在GitHub Issues中提出。
77
+
78
+ 感谢您的贡献!
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 Yanyi Wu
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 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,
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 THE
21
+ SOFTWARE.