Lingua...amadoir(3pm)

πŸ“¦
version 0.7 Β· 4 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– Lingua::GA::Gramadoir β€” the vibe ✨

okay bestie, so this is Lingua::GA::Gramadoir, a 3pm Perl module, and it's literally the whole brain behind An GramadΓ³ir β€” the open-source grammar + style checker for the Irish language πŸ‘‘ (iykyk, it's a whole legend in the low-resource NLP world).


🌸 SYNOPSIS 🌸

  use Lingua::GA::Gramadoir;

  my $gr = new Lingua::GA::Gramadoir;

  my $errors = $gr->grammatical_errors( $text );
  foreach my $error (@$errors) {
        # process $error appropriately
  }

πŸ¦‹ DESCRIPTION πŸ¦‹

This module is where all the segmentation, spell checking, part-of-speech tagging, and grammar checking code lives β€” the exact same code that powers "An GramadΓ³ir", an open-source grammar and style checker you can use with vim, emacs, OpenOffice, or straight up through a command-line interface. An GramadΓ³ir is intended as a platform for the development of sophisticated natural language processing tools for languages with limited computational resources πŸ’… β€” like, genuinely doing the most for languages that big tech forgot about, periodt.

🚨 the way that this matters: the Perl code in here is generated automatically from a higher-level representation of the grammatical rules, so do not edit it directly. fr fr. If you wanna help improve the lexicon or the rule sets, download the developers' pack from the An Gramadóir web site: <http://borel.slu.edu/gramadoir/> 🫢

✨ CONSTRUCTOR ✨

  • new %PARAMS β€” Constructs an instance of the grammar checker and loads the lexicon into memory. It should only be called once πŸ‘‘. Options may be specified by passing a hash containing any of the following keys:
    • fix_spelling => 0 β€” Suggest replacements for misspelled or unknown words. πŸ”
    • use_ignore_file => 0 β€” Read a file containing words to be ignored when checking spelling and grammar. πŸ™ˆ
    • unigram_tagging => 1 β€” Resolve ambiguous part of speech according to frequency. This should be set to false only for debugging purposes, because the pattern matching for grammatical errors relies on complete disambiguation β€” turn this off and the whole vibe check fails, no cap πŸ’€.
    • interface_language => "" β€” Specify the language of output messages (not necessarily the language of the text to be checked). With the default value, Locale::Maketext attempts to determine the correct language to use based on things like your environment variables 🌈.
    • input_encoding => 'ISO-8859-1' β€” Specify the encoding for all texts passed to one of the module's exported functions. There is no currently no way to change the encoding of the data returned by the exported functions (always encoded as perl strings) πŸŽ€.

πŸ’… METHODS πŸ’…

  • get_sentences TEXT β€” Splits the input TEXT up into sentences and returns a reference to an array containing the sentences βœ‚οΈ.
  • tokenize TEXT β€” Splits the input TEXT up into orthographic words and returns a reference to an array containing the words πŸ“.
  • spell_check TEXT β€” Returns a reference to an array containing the misspelled words appearing in the input text πŸ‘€.
  • all_possible_tags WORD β€” Takes the input WORD and returns it with (XML-style) markup indicating all of its possible parts of speech 🏷️.
  • add_tags TEXT β€” Takes the input TEXT and returns a reference to an array of sentences with (XML-style) disambiguated part-of-speech tags. Does not do any grammatical rule checking. so close but not quite the full thing 😭
  • xml_stream TEXT β€” Takes the input TEXT and returns it as well-formed XML (encoded as perl strings, not utf-8) with full grammatical markup ✨. Error messages are not localized. This function should only be exported for debugging/development purposes. Use grammatical_errors (which is basically xml_stream plus some whittling down) as an interface with other programs β€” that's the one you actually want, bestie 🫢.
  • grammatical_errors TEXT β€” Returns the grammatical errors in the input TEXT as a reference to an array, one error per element of the array, with each error given in a simple XML format usable by other applications πŸ”₯. Error messages are localized according to locale settings as determined by Locale::Maketext 🌍.

πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’€ BUGS πŸ’€

okay so ngl, the grammar checker does not attempt a full parse of the input sentences, nor does it attempt to exploit any semantic information. There are, therefore, certain constructs that cannot be dealt with correctly 😭. See <http://borel.slu.edu/gramadoir/bugs.html> for a detailed discussion and specific examples β€” go read it, it's giving receipts.


πŸŽ€ AUTHOR πŸŽ€

Kevin P. Scannell, <kscanne@gmail.com>. an icon, honestly πŸ‘‘


Copyright (C) 2004, 2005, 2007 Kevin P. Scannell

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available 🌈.


and that's the whole page, bestie πŸ¦‹ β€” this was perl v5.32.0, dated 2021-01-09, straight from the Lingua::GA::Gramadoir(3pm) User Contributed Perl Documentation. slay, stay grammatical πŸ’–βœ¨

πŸ“¦ where this page comes from