fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 fetchpatch,
7 fetchDebianPatch,
8}:
9
10stdenv.mkDerivation {
11 pname = "cld2";
12 version = "0-unstable-2015-08-21";
13
14 src = fetchFromGitHub {
15 owner = "CLD2Owners";
16 repo = "cld2";
17 rev = "b56fa78a2fe44ac2851bae5bf4f4693a0644da7b";
18 hash = "sha256-YhXs45IbriKWKULguZM4DgfV/Fzr73VHxA1pFTXCyv8=";
19 };
20
21 patches = [
22 (fetchDebianPatch {
23 pname = "cld2";
24 version = "0.0.0-git20150806";
25 debianRevision = "10";
26 patch = "add-cmake-file.patch";
27 hash = "sha256-iLacWD4jQxid76pzGpDW3ZJ8Dyaksfj1pNTrU7qSBQM=";
28 })
29 (fetchpatch {
30 name = "fix-narrowing-errors.txt";
31 url = "https://github.com/ripjar/cld2/pull/1/commits/79be1adea78f0d376cb793f4dae8e70b100dadcc.patch";
32 hash = "sha256-i4WWYBx16kYXZ5IQPACWbS/HGsQysXre1SngYlAfNaM=";
33 })
34 ];
35
36 nativeBuildInputs = [ cmake ];
37
38 meta = {
39 homepage = "https://github.com/CLD2Owners/cld2";
40 description = "Compact Language Detector 2";
41 longDescription = ''
42 CLD2 probabilistically detects over 80 languages in Unicode UTF-8 text,
43 either plain text or HTML/XML. Legacy encodings must be converted to valid
44 UTF-8 by the caller. For mixed-language input, CLD2 returns the top three
45 languages found and their approximate percentages of the total text bytes
46 (e.g. 80% English and 20% French out of 1000 bytes of text means about 800
47 bytes of English and 200 bytes of French). Optionally, it also returns a
48 vector of text spans with the language of each identified. This may be
49 useful for applying different spelling-correction dictionaries or
50 different machine translation requests to each span. The design target is
51 web pages of at least 200 characters (about two sentences); CLD2 is not
52 designed to do well on very short text, lists of proper names, part
53 numbers, etc.
54 '';
55 license = lib.licenses.asl20;
56 maintainers = with lib.maintainers; [ chvp ];
57 platforms = lib.platforms.all;
58 };
59}