Files
nixpkgs/pkgs/by-name/uc/ucto/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

85 lines
2.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
gitUpdater,
autoreconfHook,
libtool,
pkg-config,
autoconf-archive,
libxml2,
icu60,
bzip2,
libtar,
ticcutils,
libfolia,
uctodata,
frog,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ucto";
version = "0.9.6";
src = fetchFromGitHub {
owner = "LanguageMachines";
repo = "ucto";
tag = "v${finalAttrs.version}";
hash = "sha256-DFQ4ePE3n3zg0mrqUNHzE3Hi81n1IurYjhh6YVAghEE=";
};
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
bzip2
libtool
autoconf-archive
icu60
libtar
libxml2
ticcutils
libfolia
uctodata
# TODO textcat from libreoffice? Pulls in X11 dependencies?
];
postInstall = ''
# ucto expects the data files installed in the same prefix
mkdir -p $out/share/ucto/;
for f in ${uctodata}/share/ucto/*; do
echo "Linking $f"
ln -s $f $out/share/ucto/;
done;
'';
passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests = {
/**
Reverse dependencies. Does not respect overrides.
*/
reverseDependencies = lib.recurseIntoAttrs {
inherit frog;
};
};
};
meta = with lib; {
description = "Rule-based tokenizer for natural language";
mainProgram = "ucto";
homepage = "https://languagemachines.github.io/ucto/";
license = licenses.gpl3;
platforms = platforms.all;
maintainers = with maintainers; [ roberth ];
longDescription = ''
Ucto tokenizes text files: it separates words from punctuation, and splits sentences. It offers several other basic preprocessing steps such as changing case that you can all use to make your text suited for further processing such as indexing, part-of-speech tagging, or machine translation.
Ucto comes with tokenisation rules for several languages and can be easily extended to suit other languages. It has been incorporated for tokenizing Dutch text in Frog, a Dutch morpho-syntactic processor.
'';
};
})