| 1 | ######################### -*- Mode: Perl -*- ######################### | ||
| 2 | ## | ||
| 3 | ## File : HySpirit.pm | ||
| 4 | ## | ||
| 5 | ## Author : Norbert Goevert | ||
| 6 | ## Created On : Mon Nov 9 16:54:39 1998 | ||
| 7 | ## Last Modified : Time-stamp: <2000-11-10 10:14:45 goevert> | ||
| 8 | ## | ||
| 9 | ## Description : | ||
| 10 | ## | ||
| 11 | ## $Id: HySpirit.pm,v 1.27 2003/06/13 12:29:30 goevert Exp $ | ||
| 12 | ## | ||
| 13 | ###################################################################### | ||
| 14 | |||
| 15 | |||
| 16 | use strict; | ||
| 17 | |||
| 18 | |||
| 19 | ## ################################################################### | ||
| 20 | ## package RePrec::Searchresult::HySpirit | ||
| 21 | ## ################################################################### | ||
| 22 | |||
| 23 | package RePrec::Searchresult::HySpirit; | ||
| 24 | |||
| 25 | |||
| 26 | use base qw(RePrec::Searchresult); | ||
| 27 | |||
| 28 | use Carp; | ||
| 29 | |||
| 30 | |||
| 31 | our $VERSION; | ||
| 32 | '$Name: release_0_32 $ 0_0' =~ /(\d+)[-_](\d+)/; $VERSION = sprintf '%d.%03d', $1, $2; | ||
| 33 | |||
| 34 | |||
| 35 | ## public ############################################################ | ||
| 36 | |||
| 37 | |||
| 38 | ## private ########################################################### | ||
| 39 | |||
| 40 | sub _init { | ||
| 41 | |||
| 42 | my $self = shift; | ||
| 43 | my $file = shift; | ||
| 44 | |||
| 45 | my $fh = IO::File->new($file) | ||
| 46 | or croak "Couldn't read open file `$file': $!\n"; | ||
| 47 | |||
| 48 | my(@results, $rsv, $dok); | ||
| 49 | while (<$fh>) { | ||
| 50 | next unless ($rsv, $dok) = /^(\d\.\d+)\(d(\d+)[\),]/; | ||
| 51 | push @results, [$rsv, $dok]; | ||
| 52 | } | ||
| 53 | |||
| 54 | $self->{results} = [ sort { $b->[0] <=> $a->[0] } @results ]; | ||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | 1; | ||
| 59 | __END__ |