1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 python,
6 isPy3k,
7}:
8
9buildPythonPackage rec {
10 pname = "jieba";
11 version = "0.42.1";
12 format = "setuptools";
13
14 # no tests in PyPI tarball
15 src = fetchFromGitHub {
16 owner = "fxsjy";
17 repo = "jieba";
18 rev = "v${version}";
19 sha256 = "028vmd6sj6wn9l1ilw7qfmlpyiysnlzdgdlhwxs6j4fvq0gyrwxk";
20 };
21
22 # UnicodeEncodeError
23 doCheck = isPy3k;
24
25 # Citing https://github.com/fxsjy/jieba/issues/384: "testcases is in a mess"
26 # So just picking random ones that currently work
27 checkPhase = ''
28 ${python.interpreter} test/test.py
29 ${python.interpreter} test/test_tokenize.py
30 '';
31
32 meta = with lib; {
33 description = "Chinese Words Segementation Utilities";
34 homepage = "https://github.com/fxsjy/jieba";
35 license = licenses.mit;
36 teams = [ teams.tts ];
37 };
38}