Home

Awesome

efranc : Detect the language of text.

Copyright (c) 2017 G-Corp

Version: 0.0.1

Authors: Gregoire Lejeune (gregoire.lejeune@gmail.com).

Build Status

API

DATA TYPES

options() = #{whitelist => whitelist(), blacklist => blacklist(), min_length => integer()}

whitelist() = [code()]

blacklist() = [code()]

code() = string()

iso6393() = #{code => string(), part_2b => string(), part_2t => string(), part_1 => string(), scope => individual | macrolanguage | special, type => ancient | constructed | extinct | historical | living | special, ref => string(), comment => string()}

EXPORTS

efranc:detect(Text, Options) -> Lang

Types:

Text = string()<br />Options = options()<br />Lang = code() | iso6393()

detect/2 return the detected language for the Text or undefined.

efranc:detect(Text) -> Lang

Equivalent to efranc:detect(Text, #{})

efranc:detect_all(Text, Options) -> [{Lang, Weight}]

Types:

Text = string()<br />Options = options()<br />Lang = code() | iso6393()<br />Weight = float()

detect_all/2 return the list of possible detected language for the Text or undefined.

efranc:detect_all(Text) -> [{Lang, Weight}]

Equivalent to efranc:detect_all(Text, #{})

Command line tool

Build:


make script

Use :


./_build/escriptize/bin/efranc -h
Usage: efranc [-w <whitelist>] [-b <blacklist>] [-m <min_size>] [-h]

  -w, --whitelist  Whitelist
  -b, --blacklist  Blacklist
  -m, --min_size   Minimum size
  -h, --help       Display this help

Example :


./_build/escriptize/bin/efranc "Bonjour tout le monde, ceci est un example d'utilisation d'efranc en ligne de commande ! Enjoy ;)"
fra | Bonjour tout le monde, ceci est un example d'utilisation d'efranc en ligne de...

Derivation

eFranc is a port to Elang of franc.

Licence

efranc is available for use under the following license, commonly known as the 3-clause (or "modified") BSD license:

Copyright (c) 2017 G-Corp<br /> Copyright (c) 2014 Titus Wormer <tituswormer@gmail.com><br /> Copyright (c) 2008 Kent S Johnson<br /> Copyright (c) 2006 Jacob R Rideout <kde@jacobrideout.net><br /> Copyright (c) 2004 Maciej Ceglowski<br />

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Modules

<table width="100%" border="0" summary="list of modules"> <tr><td><a href="https://github.com/G-Corp/efranc/blob/master/doc/efranc.md" class="module">efranc</a></td></tr> <tr><td><a href="https://github.com/G-Corp/efranc/blob/master/doc/efranc_lang.md" class="module">efranc_lang</a></td></tr></table>