From 2f690a9306791669e66e97c968ac8b92b5822481 Mon Sep 17 00:00:00 2001 From: Pavel Sobolev Date: Tue, 26 Sep 2023 12:47:09 +0300 Subject: [PATCH] python3Packages.sentence-splitter: init at 1.4 --- .../sentence-splitter/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/sentence-splitter/default.nix diff --git a/pkgs/development/python-modules/sentence-splitter/default.nix b/pkgs/development/python-modules/sentence-splitter/default.nix new file mode 100644 index 000000000000..a544a006ce80 --- /dev/null +++ b/pkgs/development/python-modules/sentence-splitter/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub + +, pytestCheckHook +, regex +}: + +buildPythonPackage rec { + pname = "sentence-splitter"; + version = "1.4"; + + disabled = pythonOlder "3.5"; + + src = fetchFromGitHub { + owner = "mediacloud"; + repo = "sentence-splitter"; + rev = version; + hash = "sha256-FxRi8fhKB9++lCTFpCAug0fxjkSVTKChLY84vkshR34="; + }; + + propagatedBuildInputs = [ + regex + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "sentence_splitter" + ]; + + meta = with lib; { + description = "Text to sentence splitter using heuristic algorithm by Philipp Koehn and Josh Schroeder"; + homepage = "https://github.com/mediacloud/sentence-splitter"; + license = licenses.lgpl3Plus; + maintainers = with maintainers; [ paveloom ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 94fb3ef5d862..a057296f0eb8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11793,6 +11793,8 @@ self: super: with self; { inherit (pkgs) sentencepiece; }; + sentence-splitter = callPackage ../development/python-modules/sentence-splitter { }; + sentence-transformers = callPackage ../development/python-modules/sentence-transformers { }; sentinel = callPackage ../development/python-modules/sentinel { };