2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2020-07-18 16:06:22 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, isPy3k
|
2022-01-13 20:06:32 +00:00
|
|
|
, pythonAtLeast
|
2020-07-18 16:06:22 +00:00
|
|
|
, cython
|
|
|
|
, numpy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pkuseg";
|
|
|
|
version = "0.0.25";
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
disabled = !isPy3k || pythonAtLeast "3.9";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "148yp0l7h8cflxag62pc1iwj5b5liyljnaxwfjaiqwl96vwjn0fx";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Does not seem to have actual tests, but unittest discover
|
|
|
|
# recognizes some non-tests as tests and fails.
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ numpy ];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pkuseg" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Toolkit for multi-domain Chinese word segmentation";
|
|
|
|
homepage = "https://github.com/lancopku/pkuseg-python";
|
|
|
|
license = licenses.unfree;
|
|
|
|
};
|
|
|
|
}
|