LANGIDENT(1)

πŸ“¦
version 0.56 Β· 2 versions
, in fedora 43

✨ 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 to UTF-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 -a switch. -a said "show everything", -m said "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 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