1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 isPy3k,
6 pythonAtLeast,
7 cython,
8 numpy,
9}:
10
11buildPythonPackage rec {
12 pname = "pkuseg";
13 version = "0.0.25";
14 format = "setuptools";
15
16 disabled = !isPy3k || pythonAtLeast "3.9";
17
18 src = fetchPypi {
19 inherit pname version;
20 sha256 = "148yp0l7h8cflxag62pc1iwj5b5liyljnaxwfjaiqwl96vwjn0fx";
21 };
22
23 # Does not seem to have actual tests, but unittest discover
24 # recognizes some non-tests as tests and fails.
25 doCheck = false;
26
27 nativeBuildInputs = [ cython ];
28
29 propagatedBuildInputs = [ numpy ];
30
31 pythonImportsCheck = [ "pkuseg" ];
32
33 meta = with lib; {
34 description = "Toolkit for multi-domain Chinese word segmentation";
35 homepage = "https://github.com/lancopku/pkuseg-python";
36 license = licenses.unfree;
37 };
38}