Biblio...::Util(3pm)

๐ŸŒธ NAME ๐ŸŒธ

Biblio::SICI::Util โ€” literally just utility functions, bestie ๐Ÿ’–


โœจ VERSION โœจ

version 0.04 โ€” she's a lil vintage, we stan ๐ŸŽ€


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

okay so here's the whole vibe, copy-paste coded exactly:

use Biblio::Sici;
use Biblio::SICI::Util qw( titleCode_from_title calculate_check_char );

my $sici = Biblio::Sici->new();

...

if ( my $code = titleCode_from_title($title) ) {
    $sici->contribution->titleCode($code);
}

๐Ÿ’… DESCRIPTION ๐Ÿ’…

This module is basically your little helper drawer ๐Ÿงš โ€” it hands you some utility functions that are useful when you're working with SICI.

And the important part: none of them are exported by default. So if you want one, you gotta ask for it. Main character energy only, no surprise guests ๐Ÿ’€


๐Ÿ”ฅ FUNCTIONS ๐Ÿ”ฅ

โญ STRING titleCode_from_title( STRING )

So this one tries to derive the titleCode (cf. the contribution segment, iykyk) from a string that you pass in โ€” like, the title of the contribution. It's giving "let me guess your code from your title" ๐Ÿ”ฎ

ngl, the rules for building the titleCode are quite complex, so this method probably won't generate the correct code if the title has stuff in it that isn't regular english words โ€” think mathematical or chemical symbols, or characters from a non-ascii alphabet. She's doing her best but the math symbols are not her moment ๐Ÿ˜ญ

If the method manages to generate a code, it gets returned ๐Ÿซถ Otherwise the return value is undef. No code, no problem, just undef.

And here's the tea for a better shot at a standard-conformant code: the modules Text::Unidecode and Text::Undiacritic get required. If they can't be found, warnings get emitted โ€” but a code might nonetheless still be generated โœจ However! If the title is in a language other than english, the probability of generating the correct code sinks even more ๐Ÿ“‰๐Ÿ’€

๐ŸŒˆ STRING calculate_check_char( STRING )

Calculates and returns the check character. That's it, that's the job ๐Ÿ’…

โš ๏ธ But bestie, listen: it does NOT check if the string param is a valid SICI! No vibe check, no validation, she just calculates. You've been warned ๐Ÿ™ˆ

Also, a check character that's already present in the passed-in SICI will simply be ignored. Like, not her problem, she's not looking at it ๐Ÿ‘‘


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Heiko Jansen <hjansen@cpan.org> โ€” iconic, we love ๐Ÿ’–


This software is copyright (c) 2014 by Heiko Jansen.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Slay, open source ๐Ÿฆ‹


and that's the whole page, bestie โ€” this was Biblio...::Util(3pm), part of the User Contributed Perl Documentation, documented for perl v5.36.0 and dated 2023-02-06 โœจ mwah, no cap, go write some SICI code ๐Ÿ’…๐Ÿ’–

๐Ÿ“ฆ where this page comes from