Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
57 lines (37 sloc) 1.49 KB

Detecting language

Detecting language in a single line text or article (see legend of language abbreviations used).


$ ./
No parameter has been passed. Please see usage below:

       Usage: ./ --text [text]
                 --file [path/to/filename]

       --text      plain text surrounded by quotes
       --file      name of the file containing text to pass as command arg
       --help      shows the script usage help text


$ ./ --text "This is an english sentence"

Checking if model langdetect-183.bin exists...
Found model langdetect-183.bin
Loading Language Detector model ... done (1.836s)
eng This is an english sentence

Average: 26.3 doc/s
Total: 1 doc
Runtime: 0.038s
Execution time: 2.221 seconds

Check out to find out what each of the two-letter language indicators mean

Similarly a file containing text can be passed in as:

$ ./ --file article.txt


Contributions are very welcome, please share back with the wider community (and get credited for it)!

Please have a look at the CONTRIBUTING guidelines, also have a read about our licensing policy.

Back to main page (table of contents)

You can’t perform that action at this time.