DlfCategoriser(3pm)

πŸ“¦ version 2.1.1, in arch rolling

πŸ’… DlfCategoriser(3pm) β€” Lire::DlfCategoriser

okay bestie, welcome to Lire::DlfCategoriser, straight out of LogReport's Lire Documentation ✨ this is the base class for analysers that produce extended DLF records. it's giving "starter kit energy" and honestly? iconic for it πŸŽ€


🌸 NAME

Lire::DlfCategoriser β€” the base class for analysers which produce extended DLF records πŸ¦‹


✨ SYNOPSIS

like, here's the whole vibe in code, no cap:

  use base qw/ Lire::DlfCategoriser /;

  sub categorise {
    my ( $self, $dlf ) = @_;

    # Adds the extended field to DLF.

    return;
  }

πŸ’– DESCRIPTION

so this package defines a base class you can use for Lire::DlfAnalyser when it writes to an ExtendedSchema 🌈 and here's the slay part: the categoriser only has to implement the categorise() method instead of the more generic analyse(). that's it. that's the whole job. lowkey the easiest inheritance of your life πŸ’…


🧚 META INFORMATION METHODS

your Lire::DlfCategoriser should implement the same meta-information methods as Lire::DlfAnalyser β€” no skipping, bestie, all of them:

  • name()
  • src_schema()
  • dst_schema()
  • title()
  • description()

πŸ”₯ IMPLEMENTATION METHODS

the categoriser does its whole thing using the initialise() and categorise() methods 🫢

⭐ analyse( $process, $config )

Lire::DlfCategoriser implements the analyse() method β€” it's already done for you, main character behaviour honestly πŸ‘‘ it will run the query on the src_schema() using the correct filter, then call categorise() on each DLF that comes back. the extended fields then get written to dst_schema() ✨ and errors? bestie, they should be reported by dying πŸ’€

🌟 initialise( $config )

this method is called before the categorise() method is called πŸŽ€

the $config parameter contains configuration data that was specified in the AnalysisJob for that analyser. to register configuration specification for your DlfCategoriser, you just need to define a configuration specification under the name analyser_name_properties β€” and that should be either a RecordSpec or ObjectSpec πŸ¦‹

πŸ’œ categorise( $dlf )

called once for each DLF record that should be categorised 🌸 the categoriser should add the extended fields directly to the $dlf hash reference. just... put them in there. go off πŸ’…

πŸ“ finalise( $config )

this method is called after all the DLF records were categorised ⭐

the $config parameter contains configuration data that was specified in the AnalysisJob for that analyser. to register configuration specification for your DlfCategoriser, you just need to define a configuration specification under the name analyser_name_properties β€” and that should be either a RecordSpec or ObjectSpec πŸŽ€

ngl the default implementation does nothing. literally nothing. it's the "seen 2:47 AM" of methods 🫠

🌈 SEE ALSO

go read these, bestie, iykyk:


πŸ¦‹ AUTHOR

Francis J. Lacoste <flacoste@logreport.org> β€” shoutout to the icon who wrote this πŸ’–


πŸŽ€ VERSION

$Id: DlfCategoriser.pm,v 1.6 2006/07/23 13:16:28 vanbaal Exp $


Copyright (C) 2004 Stichting LogReport Foundation LogReport@LogReport.org

This file is part of Lire.

Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.


and that's the whole page, bestie 🫢 this was Lire 2.1.1, dated 2025-09-28, and honestly it ate πŸ’…βœ¨

πŸ“¦ where this page comes from