python3Packages.nltk.dataDir: init
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 ])}" ];`
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
python3Packages,
|
||||
}:
|
||||
lib.makeOverridable (
|
||||
{ ... }@nltkDataPkgs:
|
||||
f:
|
||||
pkgs.symlinkJoin {
|
||||
inherit (python3Packages.nltk) meta;
|
||||
name = "nltk-data-dir";
|
||||
|
||||
paths = f nltkDataPkgs;
|
||||
}
|
||||
) python3Packages.nltk.data
|
||||
@@ -41,6 +41,7 @@ buildPythonPackage rec {
|
||||
|
||||
passthru = {
|
||||
data = pkgs.nltk-data;
|
||||
dataDir = pkgs.callPackage ./data-dir.nix { };
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
|
||||
Reference in New Issue
Block a user