| 1 | package Plucene::SearchEngine::Index::DOC; | ||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | our $VERSION = '0.001'; # VERSION | |||||||||
| 5 | # ABSTRACT: a Plucene backend for indexing Microsoft Word documents | ||||||||||
| 6 | 1 | ▶ | use parent qw(Plucene::SearchEngine::Index::Text); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use IPC::Run3; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use File::Temp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 1 | __PACKAGE__->register_handler('application/doc', '.doc'); | |||||||||
| 12 | |||||||||||
| 13 | |||||||||||
| 14 | 0 | ▶ | sub gather_data_from_file { | ||||||||
|
Subroutine
gather_data_from_file: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 15 | 0 | my ($self, $filename) = @_; | |||||||||
| 16 | 0 | ▶ | return unless $filename =~ m/\.doc$/; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | |||||||||||
| 18 | 0 | my $tmp_txt = File::Temp->new(); | |||||||||
| 19 | 0 | run3 ['antiword', $filename], | |||||||||
| 20 | \undef, # stdin is /dev/null | ||||||||||
| 21 | $tmp_txt, # some temporary file | ||||||||||
| 22 | undef; # inherit the parent's stderr | ||||||||||
| 23 | 0 | $self->gather_data_from_file( $tmp_txt->filename ); | |||||||||
| 24 | 0 | return $self; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 1 | 1; | |||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||