# $language.detect

(Tries to) detect the language and encoding of a string

Usage

    language.detect(<text: string>)

Description
Tries to detect the language and encoding of the string specified as [text]. The accuracy of the detection mainly depends on the length of the supplied text. Good results can be achieved with some thousands characters. This command is exported by the "language" module.
Syntax Specification

    <hash> language.detect(<text: string>)

Examples

    %dati = $language.detect("I'm a lord and i speak perfect english.");
    if(%dati{"error"} != "")echo "Language detection failed: " %dati{"error"};
    %count = %dati{"matchcount"};
    for(%i=0;%i<%count;%i++)
    {
    echo "LANGUAGE " %i " : " %dati{"matches"}[%i]{"language"};
    echo "ENCODING " %i " : " %dati{"matches"}[%i]{"encoding"};
    echo "SCORE " %i " : "%dati{"matches"}[%i]{"score"};
    }
    echo "ACCURACY: " %dati{"accuracy"};

Index, Functions

KVIrc 4.2.0.6190 Documentation
Generated by root at Mon Jul 22 18:18:08 2013