LANGIDENT(1p)
π LANGIDENT π
okay so bestie, welcome to langident β it's a lil user-contributed Perl script, page 1p of the manual, and it does exactly one iconic thing: it identifies the language files are written in. that's it, that's the vibe. π
β¨ NAME β¨
langident β identifies the language files are written in π¦
πΈ SYNOPSIS πΈ
langident [OPTIONS] file1 [file2 ...]
π DESCRIPTION π
So like, langident looks at your files and figures out what language they're written in. It does this using the Perl module Lingua::Identify. that's the whole thing. no cap. π
π OPTIONS π
-aβ Show all results. Not just the most probable language, babes β all of them. π-cβ Show the confidence level for the most probable language. Heads up: it shows up as the first value right after the most probable language. iykyk. β¨-dβ Debug. Development only, so don't come for me if you poke at it. π-EENCODING β Pick an input encoding. Defaults toUTF-8.
# use ISO-8859-1 (latin1)
langident -E ISO-8859-1 file
-eMETHODS β Choose the method(s) to use. There are literally three ways to do this:
# 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. that's the full menu bestie, no substitutions. π
-hβ Display the help message and exit. the classic. π«Ά-lβ List all the available languages and exit. go off, polyglot icon. π-mNUMBER β Set the max number of results (languages) to display. So it shows the N most probable languages, in descending order of probability. π
Heads up: this overrides the-aswitch. like,-msaid "not today" to-a.
-oLANGUAGES β Only work with the languages you specify.
# identify between Portuguese and English only
langident -o pt,en *
-pβ Also show percentages. π―-sSIZE β Maximum size to examine.-vβ Show version and exit. short and sweet. β
π₯ EXAMPLES π₯
Use methods ngrams2 and ngrams1, assigning the double of importance to ngrams2 (that's the -e switch). The output will include the three most probable languages (that's the -m switch) with its percentages (that's the -p switch) and also the confidence level (that's the -c switch) of the first result. multitasking queen. π
$ 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 one fr fr π
π¦ SEE ALSO π¦
Lingua::Identify(3), Text::ExtractWords(3), Text::Ngram(3), Text::Affixes(3).
A linguist and/or a shrink. π (genuinely, that's what it says.)
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 page bestie!! π this whole thing is perl v5.34.0, dated 2022-05-28, and it's the LANGIDENT(1p) manual β slay, periodt. πβ¨π¦
π¦ where this page comes from
- debian bookworm: liblingua-identify-perl 0.56-2 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- debian trixie: liblingua-identify-perl 0.56-2 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu noble: liblingua-identify-perl 0.56-2 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu resolute: liblingua-identify-perl 0.56-2 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- ubuntu stonking: liblingua-identify-perl 0.56-2 Β· 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