⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 normsreader.pm

📁 外国人写的Perl搜索引擎程序
💻 PM
字号:
package KinoSearch::Index::NormsReader;use strict;use warnings;use KinoSearch::Util::ToolSet;use base qw( KinoSearch::Util::Class );BEGIN {    __PACKAGE__->init_instance_vars(        # constructor params / members        instream => undef,        max_doc  => undef,        bytes    => undef,    );}sub init_instance {    my $self = shift;    confess("Internal error: max_doc is required")        unless defined $self->{max_doc};}# return a reference to a byte-array of normssub get_bytes {    my $self = shift;    $self->_ensure_read;    return \$self->{bytes};}# Lazily read in the raw array of norms.sub _ensure_read {    my $self = shift;    if ( !defined $self->{bytes} ) {        $self->{bytes} = $self->{instream}->lu_read( 'a' . $self->{max_doc} );    }}sub close { shift->{instream}->close }1;__END__=begin devdocs=head1 NAMEKinoSearch::Index::NormsReader - read field normalization data=head1 DESCRIPTIONNormsReader accesses the encoded norms which are built up, one byte perdocument, for indexed fields.=head1 SEE ALSOL<KinoSearch::Search::Similarity|KinoSearch::Search::Similarity>=head1 TODOMake "fake" norms possible, for fields where the norm is useless, like uniqueid fields.=head1 COPYRIGHTCopyright 2005-2007 Marvin Humphrey=head1 LICENSE, DISCLAIMER, BUGS, etc.See L<KinoSearch|KinoSearch> version 0.163.=end devdocs=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -