1{ lib 2, buildPythonPackage 3, regex 4, langcodes 5, ftfy 6, msgpack 7, mecab-python3 8, jieba 9, pytestCheckHook 10, isPy27 11, fetchFromGitHub 12}: 13 14buildPythonPackage rec { 15 pname = "wordfreq"; 16 version = "2.5.1"; 17 disabled = isPy27; 18 19 src = fetchFromGitHub { 20 owner = "LuminosoInsight"; 21 repo = "wordfreq"; 22 rev = "v${version}"; 23 sha256 = "1lw7kbsydd89hybassnnhqnj9s5ch9wvgd6pla96198nrq9mj7fw"; 24 }; 25 26 propagatedBuildInputs = [ 27 regex 28 langcodes 29 ftfy 30 msgpack 31 mecab-python3 32 jieba 33 ]; 34 35 postPatch = '' 36 substituteInPlace setup.py --replace "regex ==" "regex >=" 37 ''; 38 39 checkInputs = [ pytestCheckHook ]; 40 disabledTests = [ 41 # These languages require additional dictionaries that aren't packaged 42 "test_languages" 43 "test_japanese" 44 "test_korean" 45 ]; 46 47 meta = with lib; { 48 description = "A library for looking up the frequencies of words in many languages, based on many sources of data"; 49 homepage = "https://github.com/LuminosoInsight/wordfreq/"; 50 license = licenses.mit; 51 maintainers = with maintainers; [ ixxie ]; 52 }; 53}