franco

package module
v0.0.0-...-2d81ad9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2017 License: MIT Imports: 8 Imported by: 3

README

Franco GoDoc Build Status

Detect the language of text.

Supported languages

Franco supports 175 “languages”. For a complete list, check out languages list

Installation

$ go get github.com/kapsteur/franco

Usage

res := franco.DetectOne("Votre temps est limité, ne le gâchez pas en menant une existence qui n’est pas la vôtre.")
// res == {Code:"fra" Count:1}

res := franco.Detect("Votre temps est limité, ne le gâchez pas en menant une existence qui n’est pas la vôtre.")
// res == [{Code:"fra" Count:1},{spa 0.7709821779068855},{cat 0.7656434011148622},{src 0.7274083379131664}...]

Derivation

Franco is a derivative work from Franc (Js, MIT). Franc is a derivative work from [guess-language][] (Python, LGPL), [guesslanguage][] (C++, LGPL), and [Language::Guess][language-guess] (Perl, GPL). Their creators granted me the rights to distribute franc under the MIT license: respectively, [Kent S. Johnson][grant-3], [Jacob R. Rideout][grant-2], and [Maciej Ceglowski][grant-1].

License

MIT © Garry POUPIN

Documentation

Index

Constants

View Source
const EXPRESSION_DATA = `` /* 5171-byte string literal not displayed */
View Source
const MAX_DIFFERENCE = float64(300)
View Source
const MAX_LENGTH = 2048
View Source
const MIN_LENGTH = 3
View Source
const SCRIPT_DATA = `` /* 216472-byte string literal not displayed */

Variables

This section is empty.

Functions

func Detect

func Detect(value string) tuples

Get a list of probable languages the given value is written in.

func DetectOne

func DetectOne(value string) tuple

Get the most probable language for the given value.

func DetectOneWithFilters

func DetectOneWithFilters(value string, whitelist []string, blacklist []string) tuple

Get the most probable language for the given value.

func DetectWithFilters

func DetectWithFilters(value string, whitelist []string, blacklist []string) tuples

Get a list of probable languages the given value is written in.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL