LANGIDENT(1p)

πŸ“¦
version 0.56 Β· 2 versions
  • 0.56 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.56 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… 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. πŸ™ˆ
  • -E ENCODING β€” Pick an input encoding. Defaults to UTF-8.
# use ISO-8859-1 (latin1)
langident -E ISO-8859-1 file
  • -e METHODS β€” 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. 🌍
  • -m NUMBER β€” 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 -a switch. like, -m said "not today" to -a.
  • -o LANGUAGES β€” Only work with the languages you specify.
# identify between Portuguese and English only
langident -o pt,en *
  • -p β€” Also show percentages. πŸ’―
  • -s SIZE β€” 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 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