2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
glibcLocales,
|
|
|
|
python,
|
|
|
|
isPy3k,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "jieba";
|
|
|
|
version = "0.42.1";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# no tests in PyPI tarball
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fxsjy";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "028vmd6sj6wn9l1ilw7qfmlpyiysnlzdgdlhwxs6j4fvq0gyrwxk";
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ glibcLocales ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# UnicodeEncodeError
|
|
|
|
doCheck = isPy3k;
|
|
|
|
|
|
|
|
# Citing https://github.com/fxsjy/jieba/issues/384: "testcases is in a mess"
|
|
|
|
# So just picking random ones that currently work
|
|
|
|
checkPhase = ''
|
|
|
|
export LC_ALL=en_US.UTF-8
|
|
|
|
${python.interpreter} test/test.py
|
|
|
|
${python.interpreter} test/test_tokenize.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Chinese Words Segementation Utilities";
|
|
|
|
homepage = "https://github.com/fxsjy/jieba";
|
|
|
|
license = licenses.mit;
|
2021-06-28 23:13:55 +00:00
|
|
|
maintainers = teams.tts.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|