summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/wordfreq/default.nix
blob: 391d8de10f29ff7bf8143463f109f71184225b50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  lib,
  buildPythonPackage,
  poetry-core,
  regex,
  langcodes,
  ftfy,
  msgpack,
  mecab-python3,
  jieba,
  pytestCheckHook,
  fetchFromGitHub,
}:

buildPythonPackage rec {
  pname = "wordfreq";
  version = "3.0.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "rspeer";
    repo = "wordfreq";
    tag = "v${version}";
    hash = "sha256-ANOBbQWLB35Vz6oil6QZDpsNpKHeKUJnDKA5Q9JRVdE=";
  };

  nativeBuildInputs = [ poetry-core ];

  propagatedBuildInputs = [
    regex
    langcodes
    ftfy
    msgpack
    mecab-python3
    jieba
  ];

  nativeCheckInputs = [ pytestCheckHook ];
  disabledTests = [
    # These languages require additional dictionaries that aren't packaged
    "test_languages"
    "test_japanese"
    "test_korean"
  ];

  meta = {
    description = "Library for looking up the frequencies of words in many languages, based on many sources of data";
    homepage = "https://github.com/rspeer/wordfreq/";
    license = lib.licenses.mit;
  };
}