Bio::O...Handler(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ Bio::OntologyIO::Handlers::BaseSAXHandler(3pm) ✨

okay bestie, welcome to the glow-up era of this manpage πŸ’… this one's Bio::OntologyIO::Handlers::BaseSAXHandler from the User Contributed Perl Documentation collection, and it's a whole mood. let's get into it πŸ¦‹


🌸 NAME 🌸

Bio::OntologyIO::Handlers::BaseSAXHandler β€” base class for SAX Handlers πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

See description. yeah bestie that's it, that's the synopsis, we're going straight to the good part ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

This module is an abstract module, and it's out here serving as the base of any SAX Handler implementation. It tries to offer the framework that SAX handlers generally need, such as tag_stack, char_store, etc. it's giving scaffolding, it's giving foundation, it's giving "i got you, boo" 🫢

In the implementation handler, you can take advantage of this based module by the following suggestions. listen up, this part is important πŸ”₯

  1. In start_element,
sub start_element {
    my $self=shift;
    my $tag=$_[0]->{Name};
    my %args=%{$_[0]->{Attributes}};
    # Your code here.

    # Before you conclude the method, write these 2 line.
    $self->_visited_count_inc($tag);
    $self->_push_tag($tag);
}
  1. In end_element,
sub end_element {
    my $self=shift;
    my $tag=shift->{Name};
    # Your code here.

    # Before you conclude the method, write these 2 lines.
    $self->_visited_count_dec($tag);
    $self->_pop_tag;
}
  1. In characters, or any other methods where you may use the tag stack or count
sub characters {
    my $self=shift;
    my $text=shift->{Data};

    $self->_chars_hash->{$self->_top_tag} .= $text;

}
$count = $self->_visited_count('myTag');
$tag = $self->_top_tag;
not me telling you to literally write those two lines before you conclude the method πŸ’€ do it. every time. no cap.

πŸ’¬ FEEDBACK πŸ’¬

πŸ’Œ Mailing Lists πŸ’Œ

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists.

Your participation is much appreciated. fr fr, we love to see it πŸ₯Ή

bioperl-l@bioperl.org                  - General discussion
http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

πŸ«‚ Support πŸ«‚

Please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible.

tl;dr: ask the group chat, not the one person in your DMs πŸ“± the experts are literally right there and they're fast.

πŸ› Reporting Bugs πŸ›

Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web:

https://github.com/bioperl/bioperl-live/issues

πŸ‘‘ AUTHOR πŸ‘‘

Juguang Xiao, juguang@tll.org.sg ✨

πŸ“Ž APPENDIX πŸ“Ž

The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _

πŸ”– _tag_stack

  • Title: _tag_stack
  • Usage: @tags = $self->_tag_stack;
  • Function: Get an array of tags that have been accessed but not enclosed.
  • Return: β€”
  • Args: β€”

πŸ”– _push_tag

πŸ”– _pop_tag

πŸ”– _top_tag

  • Title: _top_tag
  • Usage: $top = $self->_top_tag;
  • Function: get the top tag in the tag stack.
  • Return: a tag name
  • Args: [none]

πŸ”– _chars_hash

  • Title: _chars_hash
  • Usage: $hash= $self->_chars_hash;
  • Function: return the character cache for the specific tag
  • Return: a hash reference, which is intent for character storage for tags
  • Args: [none]

πŸ”– _current_hash

πŸ”– _visited_count_inc

  • Title: _vistied_count_inc
  • Usage: $self->vistied_count_inc($tag); # the counter for the tag increase
  • Function: the counter for the tag increase
  • Return: the current count after this increment
  • Args: the tag name [scalar]

πŸ”– _visited_count_dec

  • Title: _visited_count_dec
  • Usage: $self->_visited_count_dec($tag);
  • Function: the counter for the tag decreases by one
  • Return: the current count for the specific tag after the decrement
  • Args: the tag name [scalar]

πŸ”– _visited_count

  • Title: _visited_count
  • Usage: $count = $self->_visited_count
  • Function: return the counter for the tag
  • Return: the current counter for the specific tag
  • Args: the tag name [scalar]

okay and that's the whole page bestie, you ate that πŸ’…βœ¨ this was perl v5.32.1, dated 2021-08-15, filed under Bio::O...Handler(3pm) β€” go forth and slay your SAX handlers, mwah πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from