acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / cl / cld2 / package.nix
blobbf28b160f2bab7f11585e2adddc538241f3be643
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , fetchpatch
6 }:
8 stdenv.mkDerivation {
9   pname = "cld2";
10   version = "unstable-2015-08-21";
12   src = fetchFromGitHub {
13     owner = "CLD2Owners";
14     repo = "cld2";
15     rev = "b56fa78a2fe44ac2851bae5bf4f4693a0644da7b";
16     hash = "sha256-YhXs45IbriKWKULguZM4DgfV/Fzr73VHxA1pFTXCyv8=";
17   };
19   patches = [
20     (fetchpatch {
21       name = "add-cmakelists.txt";
22       url = "https://github.com/CLD2Owners/cld2/pull/65/commits/9cfac02c2ac7802ab7079560b38a474473c45f51.patch";
23       hash = "sha256-uOjmUk8kMFl+wED44ErXoLRyblhgDwFx9K1Wj65Omh8=";
24     })
25   ];
27   nativeBuildInputs = [ cmake ];
29   meta = with lib; {
30     homepage = "https://github.com/CLD2Owners/cld2";
31     description = "Compact Language Detector 2";
32     longDescription = ''
33       CLD2 probabilistically detects over 80 languages in Unicode UTF-8 text,
34       either plain text or HTML/XML. Legacy encodings must be converted to valid
35       UTF-8 by the caller. For mixed-language input, CLD2 returns the top three
36       languages found and their approximate percentages of the total text bytes
37       (e.g. 80% English and 20% French out of 1000 bytes of text means about 800
38       bytes of English and 200 bytes of French). Optionally, it also returns a
39       vector of text spans with the language of each identified. This may be
40       useful for applying different spelling-correction dictionaries or
41       different machine translation requests to each span. The design target is
42       web pages of at least 200 characters (about two sentences); CLD2 is not
43       designed to do well on very short text, lists of proper names, part
44       numbers, etc.
45     '';
46     license = licenses.asl20;
47     maintainers = with maintainers; [ chvp ];
48     platforms = platforms.all;
49   };