guesslanguage

package module
v0.0.0-...-b9ec074 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2014 License: MIT Imports: 5 Imported by: 6

README

guesslanguage Build Status

This is a Go version of python guess-language.

guesslanguage provides a simple way to detect the natural language of unicode string and detects over 60 languages listed in the models directory.

Supported Go versions

guesslanguage is regularly tested against Go 1.1, 1.2, 1.3 and tip.

Usage

Install in your ${GOPATH} using go get -u github.com/endeveit/guesslanguage

Then call it:

package main

import (
	"fmt"
	"github.com/endeveit/guesslanguage"
)

func main() {
	lang, err := guesslanguage.Guess("This is a test of the language checker.")

	// Output:
	// en
	if err != nil {
		fmt.Println(lang)
	}
}

Documentation

Overview

Package guesslanguage provides a simple way to detect language of unicode string.

Source code and project home: https://github.com/endeveit/guesslanguage

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Guess

func Guess(text string) (result string, err error)

Return the ISO 639-1 language code.

func GuessId

func GuessId(text string) int

Return the language IANA ID.

func GuessName

func GuessName(text string) string

Return the language name (in English).

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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