Changeset 4759
- Timestamp:
- 2003-06-23T14:27:08+12:00 (21 years ago)
- Location:
- trunk/gsdl/perllib/classify
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/AZCompactList.pm
r4225 r4759 51 51 52 52 my $doclevel_list = 53 [ { 'name' => "top",53 [ { 'name' => "top", 54 54 'desc' => "Whole document." } , 55 { 'name' => "section", 56 'desc' => "By sections." } 57 ]; 55 { 'name' => "section", 56 'desc' => "By sections." } ]; 58 57 59 58 my $arguments = 60 [ {'name' => "metadata",59 [ { 'name' => "metadata", 61 60 'desc' => "Metadata field used for classification. List will be sorted by this element.", 62 61 'type' => "metadata", 63 'reqd' => "yes" } 64 {'name' => "buttonname",65 'desc' => "Button name for this classification. Defaults to metadata name.",62 'reqd' => "yes" }, 63 { 'name' => "buttonname", 64 'desc' => "Button name for this classification.", 66 65 'type' => "string", 67 'reqd' => "no" } , 68 { 'name' => "mingroup", 66 'deft' => "Metadata element specified with -metadata", 67 'reqd' => "no" }, 68 { 'name' => "removeprefix", 69 'desc' => "A prefix to ignore in the Metadata values for the field when sorting.", 70 'type' => "string", 71 'deft' => "", 72 'reqd' => "no" }, 73 { 'name' => "mingroup", 69 74 'desc' => "The smallest value that will cause a group in the hierarchy to form.", 70 75 'type' => "int", 71 'reqd' => "no" } , 72 { 'name' => "minnesting", 76 'deft' => "2", 77 'reqd' => "no" }, 78 { 'name' => "minnesting", 73 79 'desc' => "The smallest value that will cause a list to converted into nested list.", 74 80 'type' => "int", 75 'reqd' => "no" } , 76 { 'name' => "mincompact", 77 'desc' => "Used in compact list.", 81 'deft' => "20", 82 'reqd' => "no" }, 83 { 'name' => "mincompact", 84 'desc' => "Minimum number of documents to be displayed per page.", 78 85 'type' => "int", 79 'reqd' => "no" } , 80 { 'name' => "maxcompact", 81 'desc' => "Used in compact list.", 86 'deft' => "10", 87 'reqd' => "no" }, 88 { 'name' => "maxcompact", 89 'desc' => "Maximum number of documents to be displayed per page.", 82 90 'type' => "int", 83 'reqd' => "no" } , 84 { 'name' => "doclevel", 91 'deft' => "30", 92 'reqd' => "no" }, 93 { 'name' => "doclevel", 85 94 'desc' => "Level to process document at.", 86 95 'type' => "enum", 87 96 'list' => $doclevel_list, 88 'reqd' => "no" } , 89 { 'name' => "onlyfirst", 97 'deft' => "top", 98 'reqd' => "no" }, 99 { 'name' => "onlyfirst", 90 100 'desc' => "Control whether all or only first metadata value used from array of metadata.", 91 101 'type' => "flag", 92 'reqd' => "no" } 93 ]; 102 'reqd' => "no" }, 103 { 'name' => "freqsort", 104 'desc' => "Sort by node frequency rather than alpha-numeric.", 105 'type' => "flag"}, 106 { 'name' => "recopt", 107 'desc' => "?", 108 'type' => "string", 109 'deft' => "" } ]; 94 110 95 111 my $options = -
trunk/gsdl/perllib/classify/AZList.pm
r3727 r4759 36 36 } 37 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" } ]; 38 my $arguments = 39 [ { 'name' => "metadata", 40 'desc' => "Metadata field used for classification. List will be sorted by this element.", 41 'type' => "metadata", 42 'reqd' => "yes" } , 43 { 'name' => "buttonname", 44 'desc' => "Button name for this classification.", 45 'type' => "string", 46 'deft' => "Metadata element specified with -metadata", 47 'reqd' => "no" }, 48 { 'name' => "removeprefix", 49 'desc' => "A prefix to ignore in the Metadata values for the field when sorting.", 50 'type' => "string", 51 'deft' => "", 52 'reqd' => "no" } ]; 50 53 51 54 my $options = { 'name' => "AZList", 52 53 54 55 'desc' => "Classifier plugin for sorting alphabetically", 56 'inherits' => "Yes", 57 'args' => $arguments }; 55 58 56 59 sub print_usage { -
trunk/gsdl/perllib/classify/AZSectionList.pm
r3540 r4759 46 46 47 47 my $arguments = 48 [ {'name' => "metadata",48 [ { 'name' => "metadata", 49 49 'desc' => "Metadata field used for classification. List will be sorted by this element.", 50 50 'type' => "metadata", 51 'reqd' => "yes" } 52 {'name' => "buttonname",53 'desc' => "Button name for this classification. Defaults to metadata name.",51 'reqd' => "yes" }, 52 { 'name' => "buttonname", 53 'desc' => "Button name for this classification.", 54 54 'type' => "string", 55 ' reqd' => "no" }56 ];55 'deft' => "Metadata element specified with -metadata", 56 'reqd' => "no" } ]; 57 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 }; 58 my $options = { 'name' => "AZSectionList", 59 '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.", 60 'inherits' => "Yes", 61 'args' => $arguments }; 63 62 64 63 sub print_usage { … … 84 83 my $self = new AZList($class, @_); 85 84 86 87 88 85 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 86 my $option_list = $self->{'option_list'}; 87 push( @{$option_list}, $options ); 89 88 90 89 return bless $self, $class; -
trunk/gsdl/perllib/classify/BasClas.pm
r3540 r4759 55 55 56 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 ]; 57 [ { 'name' => "0", 58 'desc' => "No output." }, 59 { 'name' => "1", 60 'desc' => "A little bit of output." }, 61 { 'name' => "2", 62 'desc' => "Some output." }, 63 { 'name' => "3", 64 'desc' => "Lots of output." } ]; 66 65 67 66 my $arguments = 68 [ { 'name' => "verbosity", 69 'desc' => "", 67 [ { 'name' => "builddir", 68 'desc' => "Where to put the built indexes.", 69 'type' => "string", 70 'deft' => "" }, 71 { 'name' => "outhandle", 72 'desc' => "The file handle to write output to.", 73 'type' => "string", 74 'deft' => "STDERR" }, 75 { 'name' => "verbosity", 76 'desc' => "Controls the quantity of output.", 70 77 'type' => "enum", 71 78 'list' => $verbosity_list, … … 73 80 'reqd' => "no" } ]; 74 81 75 my $options = 76 { 'name' => "BasClas", 77 'desc' => "Base class for all the classifiers.", 78 'inherits' => "No", 79 'args' => $arguments }; 82 my $options = { 'name' => "BasClas", 83 'desc' => "Base class for all the classifiers.", 84 'inherits' => "No", 85 'args' => $arguments }; 80 86 81 87 sub print_xml_usage { 82 83 84 88 my $self = shift (@_); 89 print STDERR "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n"; 90 $self->print_xml(); 85 91 } 86 92 87 93 sub print_xml { 88 94 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 } 95 my $option_list = $self->{'option_list'}; 96 my $option = pop( @{$option_list} ); 97 if(defined $option) 98 { 99 print STDERR "<ClassInfo>\n"; 100 print STDERR " <Name>$option->{'name'}</Name>\n"; 101 print STDERR " <Desc>$option->{'desc'}</Desc>\n"; 102 print STDERR " <Inherits>$option->{'inherits'}</Inherits>\n"; 103 print STDERR " <Arguments>\n"; 104 if(defined $option->{'args'}) 105 { 106 my $args = $option->{'args'}; 107 my $x; 108 foreach $x ( @{$args} ) 109 { 110 print STDERR " <Option>\n"; 111 print STDERR " <Name>$x->{'name'}</Name>\n"; 112 print STDERR " <Desc>$x->{'desc'}</Desc>\n"; 113 print STDERR " <Type>$x->{'type'}</Type>\n"; 114 print STDERR " <Required>$x->{'reqd'}</Required>\n"; 115 if(defined $x->{'list'}) 116 { 117 print STDERR " <List>\n"; 118 my $list = $x->{'list'}; 119 my $y; 120 foreach $y ( @{$list} ) 121 { 122 print STDERR " <Value>\n"; 123 print STDERR " <Name>$y->{'name'}</Name>\n"; 124 print STDERR " <Desc>$y->{'desc'}</Desc>\n"; 125 print STDERR " </Value>\n"; 126 } 127 # Special case of 'input_encoding' 128 if( $x->{'name'} =~ m/^input_encoding$/i ) { 129 my $e = $encodings::encodings; 130 foreach my $enc (sort {$e->{$a}->{'name'} cmp $e->{$b}->{'name'}} keys (%$e)) { 131 print STDERR " <Value>\n"; 132 print STDERR " <Name>$enc</Name>\n"; 133 print STDERR " <Desc>$e->{$enc}->{'name'}</Desc>\n"; 134 print STDERR " </Value>\n"; 135 } 136 } 137 print STDERR " </List>\n"; 138 } 139 if(defined $x->{'deft'}) 140 { 141 print STDERR " <Default>$x->{'deft'}</Default>\n"; 142 } 143 print STDERR " </Option>\n"; 144 } 145 } 146 if(defined $option_list) { 147 $self->print_xml(); 148 } 149 150 print STDERR " </Arguments>\n"; 151 print STDERR "</ClassInfo>\n"; 152 } 153 } 154 155 156 sub new_print_usage 157 { 158 local $self = shift(@_); 159 160 # Print the usage message for a classifier (recursively) 161 local $descoffset = $self->determine_description_offset(0); 162 $self->print_classifier_usage($descoffset, 1); 163 } 164 165 166 sub determine_description_offset 167 { 168 local $self = shift(@_); 169 local $maxoffset = shift(@_); 170 171 local $optionlistref = $self->{'option_list'}; 172 local @optionlist = @$optionlistref; 173 local $classifieroptions = pop(@$optionlistref); 174 return $maxoffset if (!defined($classifieroptions)); 175 176 # Find the length of the longest option string of this classifier 177 local $classifierargs = $classifieroptions->{'args'}; 178 if (defined($classifierargs)) { 179 foreach $option (@$classifierargs) { 180 local $optionname = $option->{'name'}; 181 local $optiontype = $option->{'type'}; 182 183 local $optiondescoffset = 3 + length($optionname); 184 if ($optiontype ne "flag") { 185 $optiondescoffset = $optiondescoffset + 2 + length($optiontype) + 1; 186 } 187 188 # Remember the longest 189 if ($optiondescoffset > $maxoffset) { 190 $maxoffset = $optiondescoffset; 191 } 192 } 193 } 194 195 # Recurse up the classifier hierarchy 196 $maxoffset = $self->determine_description_offset($maxoffset); 197 $self->{'option_list'} = \@optionlist; 198 return $maxoffset; 199 } 200 201 202 sub print_classifier_usage 203 { 204 local $self = shift(@_); 205 local $descoffset = shift(@_); 206 local $isleafclass = shift(@_); 207 208 local $optionlistref = $self->{'option_list'}; 209 local @optionlist = @$optionlistref; 210 local $classifieroptions = pop(@$optionlistref); 211 return if (!defined($classifieroptions)); 212 213 local $classifiername = $classifieroptions->{'name'}; 214 local $classifierargs = $classifieroptions->{'args'}; 215 216 # Produce the usage information using the data structure above 217 if ($isleafclass) { 218 print STDERR " usage: classify $classifiername [options]\n\n"; 219 } 220 221 # Display the classifier options, if there are some 222 if (defined($classifierargs)) { 223 # Calculate the column offset of the option descriptions 224 local $optiondescoffset = $descoffset + 2; # 2 spaces between options & descriptions 225 226 if ($isleafclass) { 227 print STDERR " specific options:\n"; 228 } 229 else { 230 print STDERR " general options (from $classifiername):\n"; 231 } 232 233 # Display the classifier options 234 foreach $option (@$classifierargs) { 235 # Display option name 236 local $optionname = $option->{'name'}; 237 print STDERR " -$optionname"; 238 local $optionstringlength = length(" -$optionname"); 239 240 # Display option type, if the option is not a flag 241 local $optiontype = $option->{'type'}; 242 if ($optiontype ne "flag") { 243 print STDERR " <$optiontype>"; 244 $optionstringlength = $optionstringlength + length(" <$optiontype>"); 245 } 246 247 # Display the option description 248 local $optiondesc = $option->{'desc'}; 249 &display_text_in_column($optiondesc, $optiondescoffset, $optionstringlength, 80); 250 251 # Show the default value for the option, if there is one 252 local $optiondefault = $option->{'deft'}; 253 if (defined($optiondefault)) { 254 print STDERR " " x $optiondescoffset; 255 print STDERR "Default: " . $optiondefault . "\n"; 256 } 257 258 # If the option has a list of possible values, display these 259 local $optionvalueslist = $option->{'list'}; 260 if (defined($optionvalueslist)) { 261 print STDERR "\n"; 262 foreach $optionvalue (@$optionvalueslist) { 263 local $optionvaluename = $optionvalue->{'name'}; 264 print STDERR " " x $optiondescoffset; 265 print STDERR "$optionvaluename:"; 266 267 local $optionvaluedesc = $optionvalue->{'desc'}; 268 &display_text_in_column($optionvaluedesc, ($optiondescoffset + 2), 269 $optiondescoffset + length($optionvaluename), 80); 270 } 271 } 272 273 # Special case for 'input_encoding' 274 if ($optionname =~ m/^input_encoding$/i) { 275 my $e = $encodings::encodings; 276 foreach $enc (sort {$e->{$a}->{'name'} cmp $e->{$b}->{'name'}} keys (%$e)) { 277 local $encodingname = $enc; 278 print STDERR " " x $optiondescoffset; 279 print STDERR "$encodingname:"; 280 281 local $encodingdesc = $e->{$enc}->{'name'}; 282 &display_text_in_column($encodingdesc, ($optiondescoffset + 2), 283 $optiondescoffset + length($encodingname), 80); 284 } 285 } 286 287 # Add a blank line to separate options 288 print STDERR "\n"; 289 } 290 } 291 292 # Recurse up the classifier hierarchy 293 $self->print_classifier_usage($descoffset, 0); 294 $self->{'option_list'} = \@optionlist; 295 } 296 297 298 sub display_text_in_column 299 { 300 local ($text, $columnbeg, $firstlineoffset, $columnend) = @_; 301 302 # Spaces are put *before* words, so treat the column beginning as 1 smaller than it is 303 $columnbeg = $columnbeg - 1; 304 305 # Add some padding (if needed) for the first line 306 local $linelength = $columnbeg; 307 if ($firstlineoffset < $columnbeg) { 308 print STDERR " " x ($columnbeg - $firstlineoffset); 309 } 310 else { 311 $linelength = $firstlineoffset; 312 } 313 314 # Break the text into words, and display one at a time 315 local @words = split(/ /, $text); 316 317 foreach $word (@words) { 318 # Unescape '<' and '>' characters 319 $word =~ s/</</g; 320 $word =~ s/>/>/g; 321 322 # If printing this word would except the column end, start a new line 323 if (($linelength + length($word)) >= $columnend) { 324 print STDERR "\n"; 325 print STDERR " " x $columnbeg; 326 $linelength = $columnbeg; 327 } 328 329 # Write the word 330 print STDERR " $word"; 331 $linelength = $linelength + length(" $word"); 332 } 333 334 print STDERR "\n"; 335 } 336 148 337 149 338 sub print_general_usage { -
trunk/gsdl/perllib/classify/Browse.pm
r3540 r4759 35 35 } 36 36 37 my $options = 38 { 'name' => "Browse", 39 'desc' => "", 40 'inherits' => "Yes" }; 37 my $options = { 'name' => "Browse", 38 'desc' => "", 39 'inherits' => "Yes" }; 41 40 42 41 sub print_usage { … … 51 50 my $self = new BasClas($class, @_); 52 51 53 54 55 56 52 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 53 my $option_list = $self->{'option_list'}; 54 push( @{$option_list}, $options ); 55 57 56 # classifier information 58 57 $self->{'collection'} = $ENV{'GSDLCOLLECTION'}; -
trunk/gsdl/perllib/classify/DateList.pm
r3540 r4759 44 44 } 45 45 46 my $arguments = 47 [ {'name' => "bymonth",46 my $arguments = 47 [ { 'name' => "bymonth", 48 48 'desc' => "Classify by year and month.", 49 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 }; 50 'reqd' => "no" } ]; 51 52 my $options = { 'name' => "DateList", 53 'desc' => "Classifier plugin for sorting by date. Always sorts by 'Date' metadata. Date is assumed to be in the form yyyymmdd.", 54 'inherits' => "Yes", 55 'args' => $arguments }; 58 56 59 57 sub print_usage { -
trunk/gsdl/perllib/classify/HTML.pm
r3540 r4759 42 42 43 43 my $arguments = 44 [ {'name' => "url",44 [ { 'name' => "url", 45 45 'desc' => "The url of the web page to link to.", 46 46 'type' => "string", 47 47 'reqd' => "yes" } , 48 {'name' => "buttonname",49 'desc' => "The title field for this classification. If not included title field 'Browse'.",48 { 'name' => "buttonname", 49 'desc' => "The title field for this classification.", 50 50 'type' => "string", 51 ' reqd' => "no" }52 ];51 'deft' => "Browse", 52 'reqd' => "no" } ]; 53 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 }; 54 my $options = { 'name' => "HTML", 55 'desc' => "Creates an empty classification that's simply a link to a web page.", 56 'inherits' => "Yes", 57 'args' => $arguments }; 59 58 60 59 sub print_usage { … … 75 74 my $self = new BasClas($class, @_); 76 75 77 78 79 80 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 ); 79 81 80 my ($title, $url); 82 81 -
trunk/gsdl/perllib/classify/Hierarchy.pm
r3728 r4759 55 55 } 56 56 57 my $arguments = 58 [ {'name' => "metadata",59 'desc' => "Metadata field used for classification. List will be sorted by this element .",57 my $arguments = 58 [ { 'name' => "metadata", 59 'desc' => "Metadata field used for classification. List will be sorted by this element, unless -sort is used.", 60 60 'type' => "metadata", 61 'reqd' => "yes" } 62 {'name' => "buttonname",63 'desc' => "Button name for this classification. Defaults to metadata name.",61 'reqd' => "yes" }, 62 { 'name' => "buttonname", 63 'desc' => "Title field for this classification.", 64 64 'type' => "string", 65 'reqd' => "no" } , 66 { 'name' => "hfile", 65 'deft' => "Metadata element specified with -metadata", 66 'reqd' => "no" }, 67 { 'name' => "hfile", 67 68 'desc' => "The classification structure file.", 68 69 'type' => "string", 69 'reqd' => "yes" } , 70 { 'name' => "sort", 71 'desc' => "Metadata field to sort by (defaults to none).", 70 'deft' => "", 71 'reqd' => "yes" }, 72 { 'name' => "sort", 73 'desc' => "Metadata field to sort by. Use '-sort nosort' for no sorting.", 72 74 'type' => "string", 73 'reqd' => "no" } , 74 { 'name' => "hlist_at_top", 75 'deft' => "Metadata field specified with -metadata", 76 'reqd' => "no" }, 77 { 'name' => "hlist_at_top", 75 78 'desc' => "Display the first level of the classification horizontally.", 76 79 'type' => "flag", 77 'reqd' => "no" } 78 ]; 80 'reqd' => "no" } ]; 79 81 80 82 my $options = -
trunk/gsdl/perllib/classify/List.pm
r3728 r4759 50 50 51 51 my $arguments = 52 [ {'name' => "metadata",52 [ { 'name' => "metadata", 53 53 'desc' => "Metadata field used for classification. List will be sorted by this element.", 54 54 'type' => "metadata", 55 55 'reqd' => "yes" } , 56 {'name' => "buttonname",57 'desc' => "Button name for this classification. Defaults to metadata name.",56 { 'name' => "buttonname", 57 'desc' => "Button name for this classification.", 58 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.", 59 'deft' => "Metadata element specified with -metadata", 60 'reqd' => "no" }, 61 { 'name' => "sort", 62 'desc' => "Metadata field to sort by. If not set, sorts in build (random) order.", 62 63 '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 64 'deft' => "Metadata field specified with -metadata", 65 'reqd' => "no" } ]; 66 67 my $options = { 'name' => "List", 68 'desc' => "Simple list classifier plugin.", 69 'inherits' => "Yes", 70 'args' => $arguments }; 72 71 73 72 sub print_usage { … … 92 91 my $self = new BasClas($class, @_); 93 92 94 95 96 97 93 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 94 my $option_list = $self->{'option_list'}; 95 push( @{$option_list}, $options ); 96 98 97 my ($metaname, $title, $sortname, $list); 99 98 -
trunk/gsdl/perllib/classify/Phind.pm
r3540 r4759 84 84 } 85 85 86 my $arguments = 87 [ {'name' => "text",88 'desc' => "The text used to build the phrase hierarchy (default: 'section:Title,section:text').",86 my $arguments = 87 [ { 'name' => "text", 88 'desc' => "The text used to build the phrase hierarchy.", 89 89 'type' => "string", 90 'reqd' => "no" } , 91 { 'name' => "title", 92 'desc' => "The metadata field used to describe each document (default: 'Title').", 90 'deft' => "section:Title,section:text", 91 'reqd' => "no" }, 92 { 'name' => "title", 93 'desc' => "The metadata field used to describe each document.", 93 94 'type' => "metadata", 94 'reqd' => "no" } , 95 { 'name' => "button", 96 'desc' => "The label for the classifier screen and button in navigation bar (default: 'Phrase').", 95 'deft' => "Title", 96 'reqd' => "no" }, 97 { 'name' => "button", 98 'desc' => "The label for the classifier screen and button in navigation bar.", 97 99 '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').", 100 'deft' => "Phrase", 101 'reqd' => "no" }, 102 { 'name' => "language", 103 '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.", 101 104 '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 'deft' => "en", 106 'reqd' => "no" }, 107 { 'name' => "savephrases", 108 '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.", 105 109 '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).", 110 'deft' => "", 111 'reqd' => "no" }, 112 { 'name' => "builddir", 113 'desc' => "Where to put the built indexes.", 114 'type' => "string", 115 'deft' => "" }, 116 { 'name' => "suffixmode", 117 '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.", 109 118 '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).", 119 'deft' => "1", 120 'reqd' => "no" }, 121 { 'name' => "thesaurus", 122 'desc' => "Name of a thesaurus stored in Phind format in the collection's etc directory.", 113 123 'type' => "string", 114 'reqd' => "no" } , 115 { 'name' => "untidy", 124 'deft' => "", 125 'reqd' => "no" }, 126 { 'name' => "untidy", 116 127 'desc' => "Don't remove working files.", 117 128 '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 }; 129 'reqd' => "no" } ]; 130 131 my $options = { 'name' => "Phind", 132 'desc' => "The Phind clasifier plugin.", 133 'inherits' => "Yes", 134 'args' => $arguments }; 126 135 127 136 sub print_usage { -
trunk/gsdl/perllib/classify/SectionList.pm
r3540 r4759 40 40 41 41 my $arguments = 42 [ {'name' => "metadata",42 [ { 'name' => "metadata", 43 43 'desc' => "Metadata field used for classification. List will be sorted by this element.", 44 44 'type' => "metadata", 45 45 'reqd' => "yes" } , 46 {'name' => "buttonname",47 'desc' => "Button name for this classification. Defaults to metadata name.",46 { 'name' => "buttonname", 47 'desc' => "Button name for this classification.", 48 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.", 49 'deft' => "Metadata element specified with -metadata", 50 'reqd' => "no" }, 51 { 'name' => "sort", 52 'desc' => "Metadata field to sort by. If not set, sorts in build (random) order.", 52 53 'type' => "string", 53 ' reqd' => "no" }54 ];54 'deft' => "Metadata field specified with -metadata", 55 'reqd' => "no" } ]; 55 56 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 }; 57 my $options = { '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 }; 61 61 62 62 sub print_usage {
Note:
See TracChangeset
for help on using the changeset viewer.