cld2

package module
v0.0.0-...-3787c51 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2015 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

cld2

-- import "cld2"

Package cld2 implements language detection using the Compact Language Detector.

This package includes the relevant sources from the cld2 project, so it doesn't require any external dependencies. For more information about CLD2, see https://code.google.com/p/cld2/.

Usage

func Detect
func Detect(text string) string

Detect returns the language code for detected language in the given text.

Documentation

Overview

Package cld2 implements language detection using the Compact Language Detector.

This package includes the relevant sources from the cld2 project, so it doesn't require any external dependencies. For more information about CLD2, see https://code.google.com/p/cld2/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(text string) string

Detect returns the language code for detected language in the given text.

Types

type Hints

type Hints struct {
	// contains filtered or unexported fields
}

func (*Hints) SetLanguageString

func (h *Hints) SetLanguageString(language string)

func (*Hints) SetTLD

func (h *Hints) SetTLD(tld string)

type Result

type Result struct {
	Language string
	Percent  int
}

type Results

type Results struct {
	Language         string
	Summary          [3]Result
	TextBytes        int
	IsReliable       bool
	ValidPrefixBytes int
}

func DetectSummaryCheckUTF8

func DetectSummaryCheckUTF8(text string, isPlainText bool, allowExtendedLanguages bool, hints *Hints) *Results

Jump to

Keyboard shortcuts

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