Registry / ai-ml / jieba3k

jieba3k

JSON →
library0.35.1pypypi✓ verified 21d ago

jieba3k is a Python library designed for Chinese word segmentation, aiming for Python 3 compatibility. It provides utilities to accurately cut Chinese sentences into individual words using various segmentation modes. While it served as an early Python 3 compatible version of the popular Jieba segmenter, it is now considered outdated. The current version is 0.35.1, last released in November 2014, and it does not have an active development or regular release cadence.

pip install jieba3k
INSTALL
IMPORT
SIG · JIEBA3K
J
jieba3k
ai-mlpythonv0.35.1
Install
4.5s avg
Import
4289ms
Disk
48MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.35.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 3.682s · 61.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.5s · import 4.896s · 62MB
48MB installed
● package 48MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

jieba
import jieba
import jieba3k
Despite being installed as 'jieba3k', the library provides the 'jieba' module. This can cause version conflicts or confusion if the actively maintained 'jieba' library is also intended for use.

This quickstart demonstrates basic Chinese word segmentation using Jieba3k's provided 'jieba' module. It showcases the accurate, full, and search engine segmentation modes. The `lcut` function returns a list of segmented words.

import jieba text = "我爱北京天安门" # Default: Accurate Mode seg_list_accurate = jieba.lcut(text, cut_all=False) print("Accurate Mode:", seg_list_accurate) # Full Mode seg_list_full = jieba.lcut(text, cut_all=True) print("Full Mode:", seg_list_full) # Search Engine Mode seg_list_search = jieba.lcut_for_search(text) print("Search Engine Mode:", seg_list_search)
Debug
Known issues
breakingThe `jieba3k` library is largely deprecated and is not actively maintained. Its last release was in November 2014. Users are strongly advised to use the actively maintained `jieba` library (pip install jieba) instead, which is compatible with Python 3 and receives regular updates.
fix
Migrate to the `jieba` library: `pip uninstall jieba3k` then `pip install jieba`. Update import statements if necessary (though both generally use `import jieba`).
affects: <=0.35.1
gotchaInstalling `jieba3k` will provide the `jieba` module, potentially overwriting or conflicting with an existing installation of the actively maintained `jieba` library. This can lead to unexpected behavior or version downgrades for `jieba`.
fix
Avoid installing `jieba3k` if you intend to use the `jieba` library. If both are present, prioritize `jieba` and ensure its desired version is installed last.
affects: All versions of jieba3k (0.35.1)
gotchaDue to its age and lack of maintenance, `jieba3k` may have limited compatibility with newer Python versions (beyond Python 3.4/3.5 era) and might contain unpatched bugs or performance issues.
fix
Use the modern `jieba` library for broader Python version support and ongoing improvements.
affects: All versions of jieba3k (0.35.1)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'jieba3k'
The `jieba3k` library is either not installed in the active Python environment or there's a conflict with the actively maintained `jieba` package, leading to the module not being found when attempting to import it.
fix
Install the `jieba` library (which is the modern, actively maintained version) instead of `jieba3k` using `pip install jieba`. If `jieba3k` is specifically required, ensure it's installed via `pip install jieba3k` and the correct Python environment is activated.
SyntaxError: invalid syntax (related to ur"..." or except ValueError, e:)
This error arises from Python 2 specific syntax for Unicode string literals (e.g., `ur"..."`) or exception handling (`except Exception, e`), which are incompatible with Python 3. `jieba3k` was an early Python 3 port of `jieba`, and some older versions or specific code paths might still contain these Python 2 remnants.
fix
Upgrade to the actively maintained `jieba` library, which is fully Python 3 compatible and does not use these deprecated syntaxes. If forced to use `jieba3k`, manually patching the source code to remove `ur"..."` (using `r"..."` or `"..."`) and updating exception syntax (`except ValueError as e:`) might be necessary, but is not recommended.
UnicodeDecodeError: 'gbk' codec can't decode byte 0xac in position 22: illegal multibyte sequence
This error typically occurs when attempting to read a file with a `gbk` (or another default, incorrect) encoding, but the file actually contains characters encoded in a different format, commonly UTF-8. This is a frequent issue when processing Chinese text, especially in older Python versions or libraries not explicitly handling encodings.
fix
When opening files containing Chinese text, explicitly specify the `encoding` parameter, usually to `'utf-8'` or `'utf-8-sig'`, for example: `open('your_file.txt', encoding='utf-8')`. It is also recommended to use the actively maintained `jieba` library, which generally handles encoding issues more robustly.
Upgrade
Version history
0.35.1latest on PyPI · released Nov 15, 2014
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
jieba3k — pip install jieba3k · libregistry