2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
pytestCheckHook,
|
|
|
|
buildPythonPackage,
|
|
|
|
cython_0,
|
|
|
|
mecab,
|
|
|
|
setuptools-scm,
|
|
|
|
ipadic,
|
|
|
|
unidic,
|
|
|
|
unidic-lite,
|
2023-08-22 20:05:09 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fugashi";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.3.0";
|
2023-08-22 20:05:09 +00:00
|
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "polm";
|
|
|
|
repo = "fugashi";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-4i7Q+TtXTQNSJ1EIcS8KHrVPdCJAgZh86Y6lB8772XU=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cython_0
|
|
|
|
mecab
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2023-08-22 20:05:09 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
ipadic
|
|
|
|
pytestCheckHook
|
|
|
|
] ++ passthru.optional-dependencies.unidic-lite;
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
unidic-lite = [ unidic-lite ];
|
|
|
|
unidic = [ unidic ];
|
|
|
|
};
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
cd fugashi
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "fugashi" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A Cython MeCab wrapper for fast, pythonic Japanese tokenization and morphological analysis";
|
|
|
|
homepage = "https://github.com/polm/fugashi";
|
|
|
|
changelog = "https://github.com/polm/fugashi/releases/tag/${version}";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ laurent-f1z1 ];
|
|
|
|
};
|
|
|
|
}
|