Changeset 4786
- Timestamp:
- 2003-06-24T14:52:26+12:00 (21 years ago)
- Location:
- trunk/gsdl/perllib/classify
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/AZCompactList.pm
r4759 r4786 115 115 'args' => $arguments }; 116 116 117 sub print_usage {118 print STDERR "119 usage: classify AZCompactList -metadata X [options]120 options:121 -metadata X (required) Metadata field used for classification122 -buttonname X Title to use on web pages (defaults to metadata)123 -removeprefix regex pattern to remove from metadata before sorting124 -doclevel top|section (Defaults to top)125 -freqsort Sort by node frequency rather than alpha-numeric126 -mingroup N Minimum num of documents required to form a new group127 -minnesting N Minimum list size to become a nested list128 -mincompact N Used in compact list129 -maxcompact N Used in compact list130 -onlyfirst Only use the first value if metadata is repeated.131 -recopt132 ";133 }117 # sub print_usage { 118 # print STDERR " 119 # usage: classify AZCompactList -metadata X [options] 120 # options: 121 # -metadata X (required) Metadata field used for classification 122 # -buttonname X Title to use on web pages (defaults to metadata) 123 # -removeprefix regex pattern to remove from metadata before sorting 124 # -doclevel top|section (Defaults to top) 125 # -freqsort Sort by node frequency rather than alpha-numeric 126 # -mingroup N Minimum num of documents required to form a new group 127 # -minnesting N Minimum list size to become a nested list 128 # -mincompact N Used in compact list 129 # -maxcompact N Used in compact list 130 # -onlyfirst Only use the first value if metadata is repeated. 131 # -recopt 132 # "; 133 # } 134 134 135 135 sub new { … … 168 168 169 169 print STDERR "\nIncorrect options passed to $class, check your collect.cfg file\n"; 170 &print_usage();170 $self->print_txt_usage(); 171 171 die "\n"; 172 172 } -
trunk/gsdl/perllib/classify/AZList.pm
r4759 r4786 57 57 'args' => $arguments }; 58 58 59 sub print_usage {60 print STDERR "61 usage: classify AZList [options]62 options:59 # sub print_usage { 60 # print STDERR " 61 # usage: classify AZList [options] 62 # options: 63 63 64 -metadata X (required) Metadata field used for classification.65 List will be sorted by this element.66 67 -buttonname X (optional) Button name for this classification.68 defaults to metadata name.69 70 -removeprefix regex (optional) A prefix to ignore in the Metadata values71 for the field when sorting.72 ";73 }64 # -metadata X (required) Metadata field used for classification. 65 # List will be sorted by this element. 66 67 # -buttonname X (optional) Button name for this classification. 68 # defaults to metadata name. 69 70 # -removeprefix regex (optional) A prefix to ignore in the Metadata values 71 # for the field when sorting. 72 # "; 73 # } 74 74 75 75 sub new { … … 90 90 91 91 print STDERR "\nIncorrect options passed to $class, check your collect.cfg file\n"; 92 &print_usage();92 $self->print_txt_usage(); 93 93 die "\n"; 94 94 } 95 95 96 96 if (!defined $metaname) { 97 &print_usage;97 $self->print_txt_usage(); 98 98 print STDERR "AZList used with no metadata name\n"; 99 99 die "\n"; -
trunk/gsdl/perllib/classify/AZSectionList.pm
r4759 r4786 61 61 'args' => $arguments }; 62 62 63 sub print_usage {64 print STDERR "65 usage: classify AZSectionList [options]66 options:63 # sub print_usage { 64 # print STDERR " 65 # usage: classify AZSectionList [options] 66 # options: 67 67 68 -metadata X (required) Metadata field used for classification,69 list will be sorted by this element.68 # -metadata X (required) Metadata field used for classification, 69 # list will be sorted by this element. 70 70 71 -buttonname X (OPTIONAL) Title field for this classification.72 if not included title field will be Metaname.71 # -buttonname X (OPTIONAL) Title field for this classification. 72 # if not included title field will be Metaname. 73 73 74 -removeprefix regex A prefix to ignore in the Metadata values75 for the field when sorting.76 This is very similar to AZList except it sorts by section level metadata77 (excluding the top level) instead of just top level metadata.78 ";79 }74 # -removeprefix regex A prefix to ignore in the Metadata values 75 # for the field when sorting. 76 # This is very similar to AZList except it sorts by section level metadata 77 # (excluding the top level) instead of just top level metadata. 78 # "; 79 # } 80 80 81 81 sub new { -
trunk/gsdl/perllib/classify/BasClas.pm
r4778 r4786 210 210 # } 211 211 212 # print_usage should be overridden for any sub-classes213 212 # sub print_usage { 214 213 # print STDERR " … … 238 237 print STDERR "(general options are those available to all classifiers).\n"; 239 238 print STDERR "Check your collect.cfg configuration file.\n"; 240 # &print_general_usage($plugin_name);241 239 &print_txt_usage(); 242 240 die "\n"; -
trunk/gsdl/perllib/classify/Browse.pm
r4759 r4786 39 39 'inherits' => "Yes" }; 40 40 41 sub print_usage {42 print STDERR "43 usage: classify Browse44 This classifier has no options (yet).45 ";46 }41 # sub print_usage { 42 # print STDERR " 43 # usage: classify Browse 44 # This classifier has no options (yet). 45 # "; 46 # } 47 47 48 48 sub new { -
trunk/gsdl/perllib/classify/DateList.pm
r4759 r4786 55 55 'args' => $arguments }; 56 56 57 sub print_usage {58 print STDERR "59 usage: classify DateList [options]60 options:61 -bymonth [or bymonth=1] Classify by year and month62 63 Classifier plugin for sorting by date.64 Always sorts by 'Date' metadata.65 Date is assumed to be in the form yyyymmdd (all digits).66 By default dates are split by year - this should change.67 68 Any errors are Dana's problem.69 ";70 }57 # sub print_usage { 58 # print STDERR " 59 # usage: classify DateList [options] 60 # options: 61 # -bymonth [or bymonth=1] Classify by year and month 62 63 # Classifier plugin for sorting by date. 64 # Always sorts by 'Date' metadata. 65 # Date is assumed to be in the form yyyymmdd (all digits). 66 # By default dates are split by year - this should change. 67 68 # Any errors are Dana's problem. 69 # "; 70 # } 71 71 72 72 sub new { … … 74 74 my $self = new BasClas($class, @_); 75 75 76 77 78 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 79 80 80 $self->{'list'} = {}; … … 82 82 q^bymonth^, \$self->{'bymonth'}, 83 83 "allow_extra_options")) { 84 &print_usage();85 84 $self->print_txt_usage(); 85 die "\n"; 86 86 } 87 87 return bless $self, $class; -
trunk/gsdl/perllib/classify/HTML.pm
r4759 r4786 57 57 'args' => $arguments }; 58 58 59 sub print_usage {60 print STDERR "61 usage: classify AZList [options]62 options:63 -url X The url of the web page to link to.64 -buttonname X (optional) the title field for this classification.65 The default is 'Browse'59 # sub print_usage { 60 # print STDERR " 61 # usage: classify AZList [options] 62 # options: 63 # -url X The url of the web page to link to. 64 # -buttonname X (optional) the title field for this classification. 65 # The default is 'Browse' 66 66 67 HTML classifier plugin - creates classifier that is a link to a web page67 # HTML classifier plugin - creates classifier that is a link to a web page 68 68 69 ";70 }69 # "; 70 # } 71 71 72 72 sub new { … … 86 86 87 87 print STDERR "\nIncorrect options passed to $class, check your collect.cfg file\n"; 88 &print_usage();88 $self->print_txt_usage(); 89 89 die "\n"; 90 90 } -
trunk/gsdl/perllib/classify/Hierarchy.pm
r4759 r4786 86 86 'args' => $arguments }; 87 87 88 sub print_usage {89 print STDERR "90 usage: classify Hierarchy [options]91 options:92 93 -buttonname X Title field for this classification.94 Defaults to metadata name.95 96 -metadata X Metadata field used for classification,97 list will be sorted by this element,98 unless -sort is used.99 100 -hfile X The classification structure file101 102 -sort X Metadata field to sort by (defaults to -metadata)103 use '-sort nosort' for no sorting.104 105 -hlist_at_top Display the first level of the classification106 horizontally.107 ";108 }88 # sub print_usage { 89 # print STDERR " 90 # usage: classify Hierarchy [options] 91 # options: 92 93 # -buttonname X Title field for this classification. 94 # Defaults to metadata name. 95 96 # -metadata X Metadata field used for classification, 97 # list will be sorted by this element, 98 # unless -sort is used. 99 100 # -hfile X The classification structure file 101 102 # -sort X Metadata field to sort by (defaults to -metadata) 103 # use '-sort nosort' for no sorting. 104 105 # -hlist_at_top Display the first level of the classification 106 # horizontally. 107 # "; 108 # } 109 109 110 110 … … 151 151 if (!-e $subjectfile) { 152 152 my $outhandle = $self->{'outhandle'}; 153 &print_usage;153 $self->print_txt_usage(); 154 154 print STDERR "\nHierarchy Error: Can't locate subject file $hfile\n"; 155 155 print STDERR "This file should be in $collfile or $subjectfile\n"; … … 175 175 if(defined $self->{'construction_error'} || !defined $self->{'metaname'} || !defined $self->{'subjectfile'}) { 176 176 print STDERR "Error: " , $self->{'construction_error'} , "\n"; 177 &print_usage;177 $self->print_txt_usage(); 178 178 die "\n"; 179 179 } -
trunk/gsdl/perllib/classify/List.pm
r4759 r4786 70 70 'args' => $arguments }; 71 71 72 sub print_usage {73 print STDERR "74 usage: classify List [options]75 options:76 77 -metadata X Metadata field used for classification,78 list will be sorted by this element.79 80 -buttonname X (optional) Title field for this classification.81 if not included title field will be Metaname.82 83 -sort X (optional) Sort documents in list by this metadata field.84 By default it will sort by Metaname, or (if this is not85 set) in build (random) order.86 ";87 }72 # sub print_usage { 73 # print STDERR " 74 # usage: classify List [options] 75 # options: 76 77 # -metadata X Metadata field used for classification, 78 # list will be sorted by this element. 79 80 # -buttonname X (optional) Title field for this classification. 81 # if not included title field will be Metaname. 82 83 # -sort X (optional) Sort documents in list by this metadata field. 84 # By default it will sort by Metaname, or (if this is not 85 # set) in build (random) order. 86 # "; 87 # } 88 88 89 89 sub new { … … 104 104 105 105 print STDERR "\nIncorrect options passed to $class, check your collect.cfg file\n"; 106 &print_usage();106 $self->print_txt_usage(); 107 107 die "\n"; 108 108 } -
trunk/gsdl/perllib/classify/Phind.pm
r4759 r4786 28 28 29 29 # The Phind clasifier plugin. 30 # Options are dexcribed in the print_usage function.31 30 # Type "classinfo.pl Phind" at the command line for a summary. 32 31 … … 134 133 'args' => $arguments }; 135 134 136 sub print_usage {137 print STDERR "138 usage: classify Phind [options]139 140 options:141 -text Fields The text used to build the phrase hierarchy.142 (default: 'section:Title,section:text')143 144 -title Title The metadata field used to describe each document.145 (default: 'Title')146 147 -button Name The label for the classifier screen and button in148 navigation bar.149 (default: 'Phrase')150 151 -language Regex Language or languages to use building hierarchy.152 Languages are identified by two-letter country codes153 like en (English), es (Spanish), and fr (French).154 Language is a regular expression, so 'en|fr' (English or155 French) and '..' (match any language) are valid.156 (default: 'en'.)157 158 -savephrases File If set, the phrase infomation will be stored in159 the given file as text. It is probably a good idea160 to use an absolute path.161 (default: not set)162 163 -suffixmode N The smode parameter to the phrase extraction program. A164 value of 0 means that stopwords are ignored, and of 1165 means that stopwords are used.166 (default: 1)167 168 -thesaurus Name Name of a thesaurus stored in Phind format in the169 collection's etc directory.170 (default: not set)171 172 -untidy Don't remove working files.173 174 "; }135 # sub print_usage { 136 # print STDERR " 137 # usage: classify Phind [options] 138 139 # options: 140 # -text Fields The text used to build the phrase hierarchy. 141 # (default: 'section:Title,section:text') 142 143 # -title Title The metadata field used to describe each document. 144 # (default: 'Title') 145 146 # -button Name The label for the classifier screen and button in 147 # navigation bar. 148 # (default: 'Phrase') 149 150 # -language Regex Language or languages to use building hierarchy. 151 # Languages are identified by two-letter country codes 152 # like en (English), es (Spanish), and fr (French). 153 # Language is a regular expression, so 'en|fr' (English or 154 # French) and '..' (match any language) are valid. 155 # (default: 'en'.) 156 157 # -savephrases File If set, the phrase infomation will be stored in 158 # the given file as text. It is probably a good idea 159 # to use an absolute path. 160 # (default: not set) 161 162 # -suffixmode N The smode parameter to the phrase extraction program. A 163 # value of 0 means that stopwords are ignored, and of 1 164 # means that stopwords are used. 165 # (default: 1) 166 167 # -thesaurus Name Name of a thesaurus stored in Phind format in the 168 # collection's etc directory. 169 # (default: not set) 170 171 # -untidy Don't remove working files. 172 173 # "; } 175 174 176 175 # Phrase delimiter symbols - these should be abstracted out someplace … … 189 188 my $self = new BasClas($class, @_); 190 189 191 192 193 190 # 14-05-02 To allow for proper inheritance of arguments - John Thompson 191 my $option_list = $self->{'option_list'}; 192 push( @{$option_list}, $options ); 194 193 195 194 my $out = $self->{'outhandle'}; … … 220 219 221 220 print STDERR "\nIncorrect options passed to $class, check your collect.cfg file\n"; 222 &print_usage();221 $self->print_txt_usage(); 223 222 die "\n"; 224 223 } -
trunk/gsdl/perllib/classify/SectionList.pm
r4759 r4786 60 60 'args' => $arguments }; 61 61 62 sub print_usage {63 print STDERR "64 usage: classify SectionList [options]65 options:62 # sub print_usage { 63 # print STDERR " 64 # usage: classify SectionList [options] 65 # options: 66 66 67 -metadata X Metadata field used for classification,68 list will be sorted by this element.67 # -metadata X Metadata field used for classification, 68 # list will be sorted by this element. 69 69 70 -buttonname X (optional) Title field for this classification.71 if not included title field will be Metaname.70 # -buttonname X (optional) Title field for this classification. 71 # if not included title field will be Metaname. 72 72 73 -sort X (optional) Sort documents in list by this metadata field.74 By default it will sort by Metaname, or (if this is not75 set) in build (random) order.73 # -sort X (optional) Sort documents in list by this metadata field. 74 # By default it will sort by Metaname, or (if this is not 75 # set) in build (random) order. 76 76 77 Same as List classifier but includes all sections of document78 (excluding top level) rather than just top level document.79 ";80 }77 # Same as List classifier but includes all sections of document 78 # (excluding top level) rather than just top level document. 79 # "; 80 # } 81 81 82 82 sub new { … … 84 84 my $self = new List($class, @_); 85 85 86 87 88 89 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 ); 89 90 90 return bless $self, $class; 91 91 }
Note:
See TracChangeset
for help on using the changeset viewer.