Changeset 3540 for trunk/gsdl/perllib/classify
- Timestamp:
- 2002-11-18T17:43:56+13:00 (22 years ago)
- Location:
- trunk/gsdl/perllib/classify
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/AZCompactList.pm
r3529 r3540 50 50 } 51 51 52 my $doclevel_list = 53 [ { 'name' => "top", 54 'desc' => "Whole document." } , 55 { 'name' => "section", 56 'desc' => "By sections." } 57 ]; 58 59 my $arguments = 60 [ { 'name' => "metadata", 61 'desc' => "Metadata field used for classification. List will be sorted by this element.", 62 'type' => "metadata", 63 'reqd' => "yes" } , 64 { 'name' => "buttonname", 65 'desc' => "Button name for this classification. Defaults to metadata name.", 66 'type' => "string", 67 'reqd' => "no" } , 68 { 'name' => "mingroup", 69 'desc' => "The smallest value that will cause a group in the hierarchy to form.", 70 'type' => "int", 71 'reqd' => "no" } , 72 { 'name' => "minnesting", 73 'desc' => "The smallest value that will cause a list to converted into nested list.", 74 'type' => "int", 75 'reqd' => "no" } , 76 { 'name' => "mincompact", 77 'desc' => "Used in compact list.", 78 'type' => "int", 79 'reqd' => "no" } , 80 { 'name' => "maxcompact", 81 'desc' => "Used in compact list.", 82 'type' => "int", 83 'reqd' => "no" } , 84 { 'name' => "doclevel", 85 'desc' => "Level to process document at.", 86 'type' => "enum", 87 'list' => $doclevel_list, 88 'reqd' => "no" } , 89 { 'name' => "onlyfirst", 90 'desc' => "Control whether all or only first metadata value used from array of metadata.", 91 'type' => "flag", 92 'reqd' => "no" } 93 ]; 94 95 my $options = 96 { 'name' => "AZCompactList", 97 'desc' => "Classifier plugin for sorting alphabetically", 98 'inherits' => "Yes", 99 'args' => $arguments }; 100 52 101 sub print_usage { 53 102 print STDERR " … … 72 121 my $self = new BasClas($class, @_); 73 122 123 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 124 my $option_list = $self->{'option_list'}; 125 push( @{$option_list}, $options ); 126 127 74 128 my ($metaname, $title, $removeprefix); 75 129 my $mingroup = 2; -
trunk/gsdl/perllib/classify/AZList.pm
r3510 r3540 35 35 @ISA = ('BasClas'); 36 36 } 37 38 my $arguments = [ { 'name' => "metadata", 39 'desc' => "Metadata field used for classification. List will be sorted by this element.", 40 'type' => "metadata", 41 'reqd' => "yes" } , 42 { 'name' => "buttonname", 43 'desc' => "Button name for this classification. Defaults to metadata name.", 44 'type' => "string", 45 'reqd' => "no" } , 46 { 'name' => "removeprefix", 47 'desc' => "A prefix to ignore in the Metadata values for the field when sorting.", 48 'type' => "string", 49 'reqd' => "no" } ]; 50 51 my $options = { 'name' => "AZList", 52 'desc' => "Classifier plugin for sorting alphabetically", 53 'inherits' => "Yes", 54 'args' => $arguments }; 37 55 38 56 sub print_usage { … … 55 73 my $class = shift (@_); 56 74 my $self = new BasClas($class, @_); 75 76 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 77 my $option_list = $self->{'option_list'}; 78 push( @{$option_list}, $options ); 57 79 58 80 my ($metaname, $title, $removeprefix); -
trunk/gsdl/perllib/classify/AZSectionList.pm
r2954 r3540 34 34 # to the classification 35 35 36 # 12/05/02 Added usage datastructure - John Thompson 37 36 38 package AZSectionList; 37 39 … … 43 45 } 44 46 47 my $arguments = 48 [ { 'name' => "metadata", 49 'desc' => "Metadata field used for classification. List will be sorted by this element.", 50 'type' => "metadata", 51 'reqd' => "yes" } , 52 { 'name' => "buttonname", 53 'desc' => "Button name for this classification. Defaults to metadata name.", 54 'type' => "string", 55 'reqd' => "no" } 56 ]; 57 58 my $options = 59 { 'name' => "AZSectionList", 60 'desc' => "Classifier plugin for sorting alphabetically. This is very similar to AZList except it sorts by section level metadata (excluding the top level) instead of just top level metadata. The only change is to the classify() subroutine which must now iterate through each section, adding each to the classification.", 61 'inherits' => "Yes", 62 'args' => $arguments }; 63 45 64 sub print_usage { 46 65 print STDERR " 47 usage: classify AZSectionList -metadata X[options]66 usage: classify AZSectionList [options] 48 67 options: 49 68 50 -metadata X (required) Metadata field used for classification.51 List will be sorted by this element.69 -metadata X (required) Metadata field used for classification, 70 list will be sorted by this element. 52 71 53 -buttonname X Button namefor this classification.54 defaults to metadataname.72 -buttonname X (OPTIONAL) Title field for this classification. 73 if not included title field will be Metaname. 55 74 56 -removeprefix regex A prefix to ignore in the Metadata values 57 for the field when sorting. 58 75 -removeprefix regex A prefix to ignore in the Metadata values 76 for the field when sorting. 59 77 This is very similar to AZList except it sorts by section level metadata 60 78 (excluding the top level) instead of just top level metadata. … … 65 83 my $class = shift (@_); 66 84 my $self = new AZList($class, @_); 85 86 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 87 my $option_list = $self->{'option_list'}; 88 push( @{$option_list}, $options ); 67 89 68 90 return bless $self, $class; … … 91 113 # if this section doesn't contain the metadata element we're 92 114 # sorting by we won't include it in this classification 115 93 116 if (defined $metavalue && $metavalue ne "") { 94 117 if ($self->{'removeprefix'}) { 95 118 $metavalue =~ s/^$self->{'removeprefix'}//; 96 119 } 97 98 120 if ($self->{'metaname'} eq 'Creator') { 99 121 &sorttools::format_string_name_english (\$metavalue); -
trunk/gsdl/perllib/classify/BasClas.pm
r1885 r3540 50 50 # display it. 51 51 52 # 09/05/02 Added usage datastructure - John Thompson 53 52 54 use parsargv; 55 56 my $verbosity_list = 57 [ { 'name' => "0", 58 'desc' => "" } , 59 { 'name' => "1", 60 'desc' => "" } , 61 { 'name' => "2", 62 'desc' => "" } , 63 { 'name' => "3", 64 'desc' => "" } 65 ]; 66 67 my $arguments = 68 [ { 'name' => "verbosity", 69 'desc' => "", 70 'type' => "enum", 71 'list' => $verbosity_list, 72 'deft' => "2", 73 'reqd' => "no" } ]; 74 75 my $options = 76 { 'name' => "BasClas", 77 'desc' => "Base class for all the classifiers.", 78 'inherits' => "No", 79 'args' => $arguments }; 80 81 sub print_xml_usage { 82 my $self = shift (@_); 83 print STDERR "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"; 84 $self->print_xml(); 85 } 86 87 sub print_xml { 88 my $self = shift (@_); 89 my $option_list = $self->{'option_list'}; 90 my $option = pop( @{$option_list} ); 91 if(defined $option) 92 { 93 print STDERR "<ClassInfo>\n"; 94 print STDERR " <Name>$option->{'name'}</Name>\n"; 95 print STDERR " <Desc>$option->{'desc'}</Desc>\n"; 96 print STDERR " <Inherits>$option->{'inherits'}</Inherits>\n"; 97 print STDERR " <Arguments>\n"; 98 if(defined $option->{'args'}) 99 { 100 my $args = $option->{'args'}; 101 my $x; 102 foreach $x ( @{$args} ) 103 { 104 print STDERR " <Option>\n"; 105 print STDERR " <Name>$x->{'name'}</Name>\n"; 106 print STDERR " <Desc>$x->{'desc'}</Desc>\n"; 107 print STDERR " <Type>$x->{'type'}</Type>\n"; 108 print STDERR " <Required>$x->{'reqd'}</Required>\n"; 109 if(defined $x->{'list'}) 110 { 111 print STDERR " <List>\n"; 112 my $list = $x->{'list'}; 113 my $y; 114 foreach $y ( @{$list} ) 115 { 116 print STDERR " <Value>\n"; 117 print STDERR " <Name>$y->{'name'}</Name>\n"; 118 print STDERR " <Desc>$y->{'desc'}</Desc>\n"; 119 print STDERR " </Value>\n"; 120 } 121 # Special case of 'input_encoding' 122 if( $x->{'name'} =~ m/^input_encoding$/i ) { 123 my $e = $encodings::encodings; 124 foreach my $enc (sort {$e->{$a}->{'name'} cmp $e->{$b}->{'name'}} keys (%$e)) { 125 print STDERR " <Value>\n"; 126 print STDERR " <Name>$enc</Name>\n"; 127 print STDERR " <Desc>$e->{$enc}->{'name'}</Desc>\n"; 128 print STDERR " </Value>\n"; 129 } 130 } 131 print STDERR " </List>\n"; 132 } 133 if(defined $x->{'deft'}) 134 { 135 print STDERR " <Default>$x->{'deft'}</Default>\n"; 136 } 137 print STDERR " </Option>\n"; 138 } 139 } 140 if(defined $option_list) { 141 $self->print_xml(); 142 } 143 144 print STDERR " </Arguments>\n"; 145 print STDERR "</ClassInfo>\n"; 146 } 147 } 53 148 54 149 sub print_general_usage { … … 79 174 $self->{'outhandle'} = STDERR; 80 175 176 $self->{'option_list'} = [ $options ]; 177 81 178 # general options available to all classifiers 82 179 if (!parsargv::parse(\@_, -
trunk/gsdl/perllib/classify/Browse.pm
r2489 r3540 24 24 ########################################################################### 25 25 26 # 12/05/02 Added usage datastructure - John Thompson 27 26 28 use BasClas; 27 29 package Browse; … … 32 34 @ISA = ('BasClas'); 33 35 } 36 37 my $options = 38 { 'name' => "Browse", 39 'desc' => "", 40 'inherits' => "Yes" }; 34 41 35 42 sub print_usage { … … 43 50 my $class = shift (@_); 44 51 my $self = new BasClas($class, @_); 45 52 53 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 54 my $option_list = $self->{'option_list'}; 55 push( @{$option_list}, $options ); 46 56 47 57 # classifier information -
trunk/gsdl/perllib/classify/DateList.pm
r2916 r3540 33 33 # jrm21 - added option "bymonth", which splits by year and month. 34 34 35 # 12/05/02 Added usage datastructure - John Thompson 36 35 37 package DateList; 36 38 … … 41 43 @ISA = ('BasClas'); 42 44 } 45 46 my $arguments = 47 [ { 'name' => "bymonth", 48 'desc' => "Classify by year and month.", 49 'type' => "flag", 50 'reqd' => "no" } 51 ]; 52 53 my $options = 54 { 'name' => "DateList", 55 'desc' => "Classifier plugin for sorting by date. Always sorts by 'Date' metadata. Date is assumed to be in the form yyyymmdd.", 56 'inherits' => "Yes", 57 'args' => $arguments }; 43 58 44 59 sub print_usage { … … 48 63 -bymonth [or bymonth=1] Classify by year and month 49 64 50 Classifier plugin for sorting by date, and assumes that 'Date' metadata 51 exists. Date is assumed to be in the form yyyymmdd (all digits). 52 By default dates are classified by year. 53 65 Classifier plugin for sorting by date. 66 Always sorts by 'Date' metadata. 67 Date is assumed to be in the form yyyymmdd (all digits). 68 By default dates are split by year - this should change. 69 70 Any errors are Dana's problem. 54 71 "; 55 72 } … … 58 75 my $class = shift (@_); 59 76 my $self = new BasClas($class, @_); 77 78 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 79 my $option_list = $self->{'option_list'}; 80 push( @{$option_list}, $options ); 60 81 61 82 $self->{'list'} = {}; -
trunk/gsdl/perllib/classify/HTML.pm
r2022 r3540 31 31 # url=url -- the url of the web page to link to 32 32 33 # 12/05/02 Added usage datastructure - John Thompson 34 33 35 package HTML; 34 36 … … 38 40 @ISA = ('BasClas'); 39 41 } 42 43 my $arguments = 44 [ { 'name' => "url", 45 'desc' => "The url of the web page to link to.", 46 'type' => "string", 47 'reqd' => "yes" } , 48 { 'name' => "buttonname", 49 'desc' => "The title field for this classification. If not included title field 'Browse'.", 50 'type' => "string", 51 'reqd' => "no" } 52 ]; 53 54 my $options = 55 { 'name' => "HTML", 56 'desc' => "Creates an empty classification that's simply a link to a web page.", 57 'inherits' => "Yes", 58 'args' => $arguments }; 40 59 41 60 sub print_usage { … … 55 74 my $class = shift (@_); 56 75 my $self = new BasClas($class, @_); 76 77 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 78 my $option_list = $self->{'option_list'}; 79 push( @{$option_list}, $options ); 57 80 58 81 my ($title, $url); -
trunk/gsdl/perllib/classify/Hierarchy.pm
r2973 r3540 41 41 # like an AZList classification) 42 42 43 # 12/05/02 Added usage datastructure - John Thompson 44 # 12/05/02 Modified new() so as not to die on error, only on init() - John Thompson 45 43 46 package Hierarchy; 44 47 … … 52 55 } 53 56 57 my $arguments = 58 [ { 'name' => "metadata", 59 'desc' => "Metadata field used for classification. List will be sorted by this element.", 60 'type' => "metadata", 61 'reqd' => "yes" } , 62 { 'name' => "buttonname", 63 'desc' => "Button name for this classification. Defaults to metadata name.", 64 'type' => "string", 65 'reqd' => "no" } , 66 { 'name' => "hfile", 67 'desc' => "The classification structure file.", 68 'type' => "string", 69 'reqd' => "yes" } , 70 { 'name' => "sort", 71 'desc' => "Metadata field to sort by (defaults to none).", 72 'type' => "string", 73 'reqd' => "no" } , 74 { 'name' => "hlist_at_top", 75 'desc' => "Display the first level of the classification horizontally.", 76 'type' => "flag", 77 'reqd' => "no" } 78 ]; 79 80 my $options = 81 { 'name' => "Hierarchy", 82 'desc' => "Classifier plugin for generating hierarchical classifications", 83 'inherits' => "Yes" , 84 'args' => $arguments }; 85 54 86 sub print_usage { 55 87 print STDERR " … … 76 108 my $class = shift (@_); 77 109 my $self = new BasClas($class, @_); 78 110 111 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 112 my $option_list = $self->{'option_list'}; 113 push( @{$option_list}, $options ); 114 79 115 my $sortname = "Title"; 80 116 my ($hfile, $metadata, $title, $hlist_at_top); … … 88 124 "allow_extra_options")) { 89 125 90 print STDERR "\nIncorrect options passed to $class, check your collect.cfg file\n"; 91 &print_usage(); 92 die "\n"; 126 $self->{'construction_error'} = "Incorrect options passed to $class, check your collect.cfg file."; 93 127 } 94 128 95 129 if (!$metadata) { 96 &print_usage; 97 print STDERR "\nHierarchy error: no metadata supplied\n"; 98 die "\n"; 130 $self->{'construction_error'} = "Hierarchy error: no metadata supplied."; 99 131 } 100 132 … … 103 135 $sortname = undef if $sortname =~ /^nosort$/; 104 136 137 my $subjectfile; 138 105 139 if (!$hfile) { 106 &print_usage;107 print STDERR "\nHierarchy error: No -hfile supplied\n"; 108 die "\n"; 109 } 110 111 my $subjectfile = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"etc", $hfile); 112 if (!-e $subjectfile) { 113 my $collfile = $subjectfile;114 $subjectfile = &util::filename_cat($ENV{'GSDLHOME'},"etc", $hfile);115 if (!-e $subjectfile) {116 my $outhandle = $self->{'outhandle'};117 &print_usage;118 print STDERR "\nHierarchy Error: Can't locate subject file $hfile\n";119 print STDERR "This file should be in $collfile or $subjectfile\n";120 die "\n";121 }122 140 $self->{'construction_error'} = "Hierarchy error: No -hfile supplied."; 141 } 142 else 143 { 144 $subjectfile = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"etc", $hfile); 145 if (!-e $subjectfile) { 146 my $collfile = $subjectfile; 147 $subjectfile = &util::filename_cat($ENV{'GSDLHOME'},"etc", $hfile); 148 if (!-e $subjectfile) { 149 my $outhandle = $self->{'outhandle'}; 150 &print_usage; 151 print STDERR "\nHierarchy Error: Can't locate subject file $hfile\n"; 152 print STDERR "This file should be in $collfile or $subjectfile\n"; 153 die "\n"; 154 } 155 } 156 } 123 157 124 158 $self->{'descriptorlist'} = {}; # first field in subject file … … 135 169 sub init { 136 170 my $self = shift (@_); 171 172 if(defined $self->{'construction_error'} || !defined $self->{'metaname'} || !defined $self->{'subjectfile'}) { 173 print STDERR "Error: " , $self->{'construction_error'} , "\n"; 174 &print_usage; 175 die "\n"; 176 } 137 177 138 178 # read in the subject file … … 230 270 $classifyinfo->{'Title'} = $title; 231 271 $classifyinfo->{'classifytype'} = $classifytype; 232 233 272 return $classifyinfo; 234 273 } 235 274 236 275 $classifyinfo->{'contains'} = [] unless defined $classifyinfo->{'contains'}; 237 238 276 my $offset = 0; 239 277 foreach $thing (@{$classifyinfo->{'contains'}}) { 240 278 $offset ++ if defined $thing->{'OID'}; 241 279 } 242 243 while (scalar(@{$classifyinfo->{'contains'}}) < ($headOID+$offset)) { 280 281 while (scalar(@{$classifyinfo->{'contains'}}) < ($headOID+$offset)) { 244 282 push (@{$classifyinfo->{'contains'}}, $self->get_entry("", $classifytype)); 245 283 } -
trunk/gsdl/perllib/classify/List.pm
r2022 r3540 38 38 # if metadata is also not included title will be 'List' 39 39 40 # 12/05/02 Added usage datastructure - John Thompson 41 40 42 use BasClas; 41 43 package List; … … 46 48 @ISA = ('BasClas'); 47 49 } 50 51 my $arguments = 52 [ { 'name' => "metadata", 53 'desc' => "Metadata field used for classification. List will be sorted by this element.", 54 'type' => "metadata", 55 'reqd' => "yes" } , 56 { 'name' => "buttonname", 57 'desc' => "Button name for this classification. Defaults to metadata name.", 58 'type' => "string", 59 'reqd' => "no" } , 60 { 'name' => "sort", 61 'desc' => "Sort documents in list by this metadata field. By default it will sort by Metaname, or (if this is not set) in build (random) order.", 62 'type' => "string", 63 'reqd' => "no" } 64 ]; 65 66 my $options = 67 { 'name' => "List", 68 'desc' => "Simple list classifier plugin.", 69 'inherits' => "Yes", 70 'args' => $arguments }; 71 48 72 49 73 sub print_usage { … … 67 91 my $class = shift (@_); 68 92 my $self = new BasClas($class, @_); 93 94 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 95 my $option_list = $self->{'option_list'}; 96 push( @{$option_list}, $options ); 69 97 70 98 my ($metaname, $title, $sortname, $list); -
trunk/gsdl/perllib/classify/Phind.pm
r3536 r3540 31 31 # Type "classinfo.pl Phind" at the command line for a summary. 32 32 33 # 12/05/02 Added usage datastructure - John Thompson 34 33 35 package Phind; 34 36 … … 82 84 } 83 85 86 my $arguments = 87 [ { 'name' => "text", 88 'desc' => "The text used to build the phrase hierarchy (default: 'section:Title,section:text').", 89 'type' => "string", 90 'reqd' => "no" } , 91 { 'name' => "title", 92 'desc' => "The metadata field used to describe each document (default: 'Title').", 93 'type' => "metadata", 94 'reqd' => "no" } , 95 { 'name' => "button", 96 'desc' => "The label for the classifier screen and button in navigation bar (default: 'Phrase').", 97 'type' => "string", 98 'reqd' => "no" } , 99 { 'name' => "language", 100 'desc' => "Language or languages to use building hierarchy. Languages are identified by two-letter country codes like en (English), es (Spanish), and fr (French). Language is a regular expression, so 'en|fr' (English or French) and '..' (match any language) are valid (default: 'en').", 101 'type' => "language", 102 'reqd' => "no" } , 103 { 'name' => "savephrases", 104 'desc' => "If set, the phrase infomation will be stored in the given file as text. It is probably a good idea to use an absolute path (default: not set).", 105 'type' => "string", 106 'reqd' => "no" } , 107 { 'name' => "suffixmode", 108 'desc' => "The smode parameter to the phrase extraction program. A value of 0 means that stopwords are ignored, and of 1 means that stopwords are used (default: 1).", 109 'type' => "int", 110 'reqd' => "no" } , 111 { 'name' => "thesaurus", 112 'desc' => "Name of a thesaurus stored in Phind format in the collection's etc directory (default: not set).", 113 'type' => "string", 114 'reqd' => "no" } , 115 { 'name' => "untidy", 116 'desc' => "Don't remove working files.", 117 'type' => "flag", 118 'reqd' => "no" } 119 ]; 120 121 my $options = 122 { 'name' => "Phind", 123 'desc' => "The Phind clasifier plugin.", 124 'inherits' => "Yes", 125 'args' => $arguments }; 126 84 127 sub print_usage { 85 128 print STDERR " … … 114 157 (default: 1) 115 158 116 -thesaurus Name Name of a thesaurus stored in phind format in the159 -thesaurus Name Name of a thesaurus stored in Phind format in the 117 160 collection's etc directory. 118 161 (default: not set) … … 136 179 my $class = shift (@_); 137 180 my $self = new BasClas($class, @_); 181 182 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 183 my $option_list = $self->{'option_list'}; 184 push( @{$option_list}, $options ); 138 185 139 186 my $out = $self->{'outhandle'}; … … 283 330 284 331 # Extract the text from every section 285 # (In Phind, document:text and section:text are equivalent)332 # (In phind, document:text and section:text are equivalent) 286 333 if ($field eq "text") { 287 334 $data = ""; … … 331 378 # 332 379 # When get_classify_info is called, the clauses and docs.txt files have 333 # already been constructed in the phind directory. This function will380 # already been constructed in the Phind directory. This function will 334 381 # translate them into compressed, indexed MGPP files that can be read by 335 382 # the phindcgi script. It will also register our classifier so that it … … 355 402 } 356 403 357 # Construct Phind indexes404 # Construct phind indexes 358 405 my $suffixmode = $self->{'suffixmode'}; 359 406 my ($command, $status); … … 363 410 print $out "\nExtracting vocabulary and statistics\n" if $verbosity; 364 411 &extract_vocabulary($self); 365 412 366 413 # Use the suffix program to generate the phind/phrases file 367 414 print $out "\nExtracting phrases from processed text (with suffix)\n" if $verbosity; 368 415 &execute("suffix \"$phinddir\" $suffixmode $verbosity", $verbosity, $out); 369 370 416 371 417 # check that we generated some files. It's not necessarily an error if … … 375 421 print $out "\nNo phrases found for Phind classifier!\n"; 376 422 return; 377 } 423 } 378 424 379 425 # Create the phrase file and put phrase numbers in phind/phrases … … 445 491 return &convert_gml_to_tokens_EN($text); 446 492 } 493 447 494 if ($language_exp =~ /zh/) { 448 495 return &convert_gml_to_tokens_ZH($text); 449 } 496 } 450 497 451 498 $_ = $text; … … 477 524 # 2. Split the remaining text into space-delimited tokens 478 525 479 # Convert entities to their UTF8 equivalents480 s/&([^;]+);/& ghtml::getcharequiv($1,1)/gse;526 # Convert any HTML special characters (like ") to their UTF8 equivalent 527 s/&([^;]+);/&unicode::ascii2utf8(\&ghtml::getcharequiv($1,1))/gse; 481 528 482 529 # Split text at word boundaries … … 541 588 return $_; 542 589 } 590 543 591 # A version of convert_gml_to_tokens that is fine-tuned to the English language. 544 592 … … 641 689 if ($status != 0) { 642 690 print STDERR "Phind - Error executing '$command': $!\n"; 643 exit($status); # this causes the build to fail...691 exit($status); # this causes the build to fail... 644 692 } 645 693 } -
trunk/gsdl/perllib/classify/SectionList.pm
r2022 r3540 28 28 # itself 29 29 30 # 12/05/02 Added usage datastructure - John Thompson 31 30 32 package SectionList; 31 33 … … 36 38 @ISA = ('List'); 37 39 } 40 41 my $arguments = 42 [ { 'name' => "metadata", 43 'desc' => "Metadata field used for classification. List will be sorted by this element.", 44 'type' => "metadata", 45 'reqd' => "yes" } , 46 { 'name' => "buttonname", 47 'desc' => "Button name for this classification. Defaults to metadata name.", 48 'type' => "string", 49 'reqd' => "no" } , 50 { 'name' => "sort", 51 'desc' => "Sort documents in list by this metadata field. By default it will sort by Metaname, or (if this is not set) in build (random) order.", 52 'type' => "string", 53 'reqd' => "no" } 54 ]; 55 56 my $options = 57 { 'name' => "SectionList", 58 'desc' => "Same as List classifier but includes all sections of document (excluding top level) rather than just top level document itself.", 59 'inherits' => "Yes", 60 'args' => $arguments }; 38 61 39 62 sub print_usage { … … 60 83 my $class = shift (@_); 61 84 my $self = new List($class, @_); 85 86 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 87 my $option_list = $self->{'option_list'}; 88 push( @{$option_list}, $options ); 62 89 63 90 return bless $self, $class;
Note:
See TracChangeset
for help on using the changeset viewer.