
Add helper function to install NLTK data packages like `wordnet` and `punkt-tab`. Should be used in conjunction with `makeWrapperArgs`, e.g. `makeWrapperArgs = [ "--set" "NLTK_DATA" "${nltk.dataDir(d: [ d.wordnet d.punkt-tab ])}" ];`
16 lines
241 B
Nix
16 lines
241 B
Nix
{
|
|
lib,
|
|
pkgs,
|
|
python3Packages,
|
|
}:
|
|
lib.makeOverridable (
|
|
{ ... }@nltkDataPkgs:
|
|
f:
|
|
pkgs.symlinkJoin {
|
|
inherit (python3Packages.nltk) meta;
|
|
name = "nltk-data-dir";
|
|
|
|
paths = f nltkDataPkgs;
|
|
}
|
|
) python3Packages.nltk.data
|