LANGIDENT(1)
β¨ LANGIDENT(1) β¨
okay bestie, so langident is a lil command-line icon from the User Contributed Perl Documentation section, and she is here to look at your files and go "hmm yes, I know what language this is π
". Like a language-detecting bestie who never gets it wrong (mostly).
π NAME π
langident β identifies the language files are written in. no cap, that's the whole job.
πΈ SYNOPSIS πΈ
langident [OPTIONS] file1 [file2 ...]
π¦ DESCRIPTION π¦
She identifies the language files are written in using the Perl module Lingua::Identify. That's it, that's the vibe. You hand her files, she tells you what language they're speaking. fr fr.
β¨ OPTIONS β¨
-aβ show all the results, not just the most probable language. full transparency moment β¨-cβ show the confidence level for the most probable language. It's literally the first value right after the most probable language, so keep an eye out π-dβ debug. (development only!) don't be out here using this in prod bestie π-E ENCODINGβ pick an input encoding. Defaults toUTF-8.
# use ISO-8859-1 (latin1)
langident -E ISO-8859-1 file
-e METHODSβ pick which method(s) to use. There are three ways of doing this, and honestly? all of them slay:
# simply using a method
langident -e ngrams3 file
# using several methods (separate them with a comma)
langident -e prefixes3,suffixes3
# using several methods and assign different weights to each of them
langident -e smallwords=2,prefixes=1,ngrams3=1.3
The available methods are the following: smallwords, prefixes1, prefixes2, prefixes3, prefixes4, suffixes1, suffixes2, suffixes3, suffixes4, ngrams1, ngrams2, ngrams3 and ngrams4.
-hβ display the help message and exit. self-care π«Ά-lβ list all the available languages and exit. window shopping for languages ποΈ-m NUMBERβ set the maximum number of results (languages) to display. So she shows you the N most probable languages, in descending order of probability. the leaderboard energy is immaculate.
heads up bestie: this one overrides the-aswitch.-asaid "show everything",-msaid "no <3" π
-o LANGUAGESβ only work with the languages you specify.
# identify between Portuguese and English only
langident -o pt,en *
-pβ also show percentages. numbers girlies rise π-s SIZEβ maximum size to examine.-vβ show the version and exit.
π EXAMPLES π
Use methods ngrams2 and ngrams1, assigning the double of importance to ngrams2 (that's the -e switch doing its thing); the output will include the three most probable languages (the -m switch) with its percentages (the -p switch) and also the confidence level (the -c switch) of the first result. obsessed with a fully-decorated command ngl π
β¨
$ langident -e ngrams2=2,ngrams1 -c -p -m 3 README
README:en 65.7209505939491 7.8971987481393 ga 4.11905889385895 tr 4.08487011400505
$
π TO DO π
- Add a switch to ignore HTML tags (and maybe other formats too)
(manifesting this feature bestie, it's giving future update π±)
π SEE ALSO π
Lingua::Identify(3), Text::ExtractWords(3), Text::Ngram(3), Text::Affixes(3).
A linguist and/or a shrink.
The latest CVS version of "Lingua::Identify" (which includes langident) can be attained at http://natura.di.uminho.pt/natura/viewcvs.cgi/Lingua/Identify/
ISO 639 Language Codes, at http://www.w3.org/WAI/ER/IG/ert/iso639.htm
π AUTHOR π
Jose Alves de Castro, <cog@cpan.org>
π COPYRIGHT AND LICENSE π
Copyright 2004 by Jose Alves de Castro
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page bestie!! this one's from perl v5.42.0, dated 2025-07-25, and it lives in the LANGIDENT(1) man page πβ¨ mwah, go detect some languages, ily π«Ά
π¦ where this page comes from
- fedora 43: perl-Lingua-Identify-tools 0.56-30.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms