Detect which human language a document uses from OCaml, from the Nu Html validator
languages unicode ocaml

disable jsoo builds for now

+60 -105
-13
dune-project
··· 25 25 (odoc :with-doc) 26 26 (alcotest (and :with-test (>= 1.7.0))))) 27 27 28 - (package 29 - (name langdetect-js) 30 - (synopsis "Language detection for browsers via js_of_ocaml/wasm_of_ocaml") 31 - (description 32 - "Browser-compatible language detection compiled with js_of_ocaml. \ 33 - Provides a JavaScript API for detecting languages in web applications. \ 34 - Supports both JS and WebAssembly output for optimal performance.") 35 - (depends 36 - (ocaml (>= 5.1.0)) 37 - (langdetect (= :version)) 38 - (brr (>= 0.0.6)) 39 - (js_of_ocaml (>= 6.0.0)) 40 - (js_of_ocaml-compiler (>= 6.0.0))))
-34
langdetect-js.opam
··· 1 - # This file is generated by dune, edit dune-project instead 2 - opam-version: "2.0" 3 - synopsis: "Language detection for browsers via js_of_ocaml/wasm_of_ocaml" 4 - description: 5 - "Browser-compatible language detection compiled with js_of_ocaml. Provides a JavaScript API for detecting languages in web applications. Supports both JS and WebAssembly output for optimal performance." 6 - maintainer: ["Anil Madhavapeddy <anil@recoil.org>"] 7 - authors: ["Anil Madhavapeddy"] 8 - license: "MIT" 9 - homepage: "https://tangled.org/anil.recoil.org/ocaml-langdetect" 10 - bug-reports: "https://tangled.org/anil.recoil.org/ocaml-langdetect/issues" 11 - depends: [ 12 - "dune" {>= "3.20"} 13 - "ocaml" {>= "5.1.0"} 14 - "langdetect" {= version} 15 - "brr" {>= "0.0.6"} 16 - "js_of_ocaml" {>= "6.0.0"} 17 - "js_of_ocaml-compiler" {>= "6.0.0"} 18 - "odoc" {with-doc} 19 - ] 20 - build: [ 21 - ["dune" "subst"] {dev} 22 - [ 23 - "dune" 24 - "build" 25 - "-p" 26 - name 27 - "-j" 28 - jobs 29 - "@install" 30 - "@runtest" {with-test} 31 - "@doc" {with-doc} 32 - ] 33 - ] 34 - x-maintenance-intent: ["(latest)"]
+60 -58
lib/js/dune
··· 1 1 ; Langdetect JavaScript Library 2 2 ; Compiled with js_of_ocaml for browser use 3 + ; 4 + ; Build rules temporarily disabled - code kept in place 3 5 4 - (library 5 - (name langdetect_js) 6 - (public_name langdetect-js) 7 - (libraries langdetect brr) 8 - (modes byte) ; js_of_ocaml requires bytecode 9 - (modules langdetect_js)) 6 + ; (library 7 + ; (name langdetect_js) 8 + ; (public_name langdetect-js) 9 + ; (libraries langdetect brr) 10 + ; (modes byte) ; js_of_ocaml requires bytecode 11 + ; (modules langdetect_js)) 10 12 11 13 ; Standalone JavaScript file for direct browser use 12 14 13 - (executable 14 - (name langdetect_js_main) 15 - (libraries langdetect_js) 16 - (js_of_ocaml (javascript_files)) 17 - (modes js wasm) 18 - (modules langdetect_js_main)) 15 + ; (executable 16 + ; (name langdetect_js_main) 17 + ; (libraries langdetect_js) 18 + ; (js_of_ocaml (javascript_files)) 19 + ; (modes js wasm) 20 + ; (modules langdetect_js_main)) 19 21 20 22 ; Browser-based test runner 21 23 22 - (executable 23 - (name langdetect_js_tests) 24 - (libraries langdetect_js) 25 - (js_of_ocaml (javascript_files)) 26 - (modes js wasm) 27 - (modules langdetect_js_tests)) 24 + ; (executable 25 + ; (name langdetect_js_tests) 26 + ; (libraries langdetect_js) 27 + ; (js_of_ocaml (javascript_files)) 28 + ; (modes js wasm) 29 + ; (modules langdetect_js_tests)) 28 30 29 31 ; Copy to nice filenames (JS) 30 32 31 - (rule 32 - (targets langdetect.js) 33 - (deps langdetect_js_main.bc.js) 34 - (action 35 - (copy %{deps} %{targets}))) 33 + ; (rule 34 + ; (targets langdetect.js) 35 + ; (deps langdetect_js_main.bc.js) 36 + ; (action 37 + ; (copy %{deps} %{targets}))) 36 38 37 - (rule 38 - (targets langdetect-tests.js) 39 - (deps langdetect_js_tests.bc.js) 40 - (action 41 - (copy %{deps} %{targets}))) 39 + ; (rule 40 + ; (targets langdetect-tests.js) 41 + ; (deps langdetect_js_tests.bc.js) 42 + ; (action 43 + ; (copy %{deps} %{targets}))) 42 44 43 45 ; Copy to nice filenames (WASM) 44 46 ; Note: requires wasm_of_ocaml-compiler to be installed 45 47 46 - (rule 47 - (targets langdetect.wasm.js) 48 - (deps langdetect_js_main.bc.wasm.js) 49 - (action 50 - (copy %{deps} %{targets}))) 48 + ; (rule 49 + ; (targets langdetect.wasm.js) 50 + ; (deps langdetect_js_main.bc.wasm.js) 51 + ; (action 52 + ; (copy %{deps} %{targets}))) 51 53 52 - (rule 53 - (targets langdetect-tests.wasm.js) 54 - (deps langdetect_js_tests.bc.wasm.js) 55 - (action 56 - (copy %{deps} %{targets}))) 54 + ; (rule 55 + ; (targets langdetect-tests.wasm.js) 56 + ; (deps langdetect_js_tests.bc.wasm.js) 57 + ; (action 58 + ; (copy %{deps} %{targets}))) 57 59 58 60 ; Install web assets to share/langdetect-js/ 59 61 ; Includes HTML demo, JS files, WASM loaders, and WASM assets with source maps 60 62 61 - (install 62 - (package langdetect-js) 63 - (section share) 64 - (files 65 - langdetect.html 66 - ; JS files (work standalone in browsers) 67 - langdetect.js 68 - langdetect-tests.js 69 - ; WASM loaders (in same dir so relative asset paths work) 70 - langdetect_js_main.bc.wasm.js 71 - langdetect_js_tests.bc.wasm.js 72 - ; WASM assets - must be in langdetect-js/ so relative paths from loaders work 73 - (glob_files_rec 74 - (langdetect_js_main.bc.wasm.assets/* 75 - with_prefix 76 - langdetect_js_main.bc.wasm.assets)) 77 - (glob_files_rec 78 - (langdetect_js_tests.bc.wasm.assets/* 79 - with_prefix 80 - langdetect_js_tests.bc.wasm.assets)))) 63 + ; (install 64 + ; (package langdetect-js) 65 + ; (section share) 66 + ; (files 67 + ; langdetect.html 68 + ; ; JS files (work standalone in browsers) 69 + ; langdetect.js 70 + ; langdetect-tests.js 71 + ; ; WASM loaders (in same dir so relative asset paths work) 72 + ; langdetect_js_main.bc.wasm.js 73 + ; langdetect_js_tests.bc.wasm.js 74 + ; ; WASM assets - must be in langdetect-js/ so relative paths from loaders work 75 + ; (glob_files_rec 76 + ; (langdetect_js_main.bc.wasm.assets/* 77 + ; with_prefix 78 + ; langdetect_js_main.bc.wasm.assets)) 79 + ; (glob_files_rec 80 + ; (langdetect_js_tests.bc.wasm.assets/* 81 + ; with_prefix 82 + ; langdetect_js_tests.bc.wasm.assets))))