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