Changeset 6968
- Timestamp:
- 2004-03-08T15:39:43+13:00 (20 years ago)
- Location:
- trunk/gsdl/perllib/classify
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/classify/AZCompactList.pm
r6940 r6968 62 62 'reqd' => "yes" }, 63 63 { 'name' => "buttonname", 64 'desc' => "{ AZCompactList.buttonname}",64 'desc' => "{BasClas.buttonname}", 65 65 'type' => "string", 66 66 'deft' => "{BasClas.metadata.deft}", … … 127 127 'args' => $arguments }; 128 128 129 # sub print_usage {130 # print STDERR "131 # usage: classify AZCompactList -metadata X [options]132 # options:133 # -metadata X (required) Metadata field used for classification134 # -buttonname X Title to use on web pages (defaults to metadata)135 # -removeprefix regex pattern to remove from metadata before sorting136 # -doclevel top|section (Defaults to top)137 # -freqsort Sort by node frequency rather than alpha-numeric138 # -mingroup N Minimum num of documents required to form a new group139 # -minnesting N Minimum list size to become a nested list140 # -mincompact N Used in compact list141 # -maxcompact N Used in compact list142 # -onlyfirst Only use the first value if metadata is repeated.143 # -recopt144 # ";145 # }146 129 147 130 sub new { … … 153 136 push( @{$option_list}, $options ); 154 137 138 if ($self->{'info_only'}) { 139 # created from classinfo.pl - don't need to parse the arguments 140 return bless $self, $class; 141 } 155 142 156 143 my ($metaname, $title, $removeprefix, $removesuffix); -
trunk/gsdl/perllib/classify/AZCompactSectionList.pm
r6408 r6968 29 29 my $option_list = $self->{'option_list'}; 30 30 push( @{$option_list}, $options ); 31 32 #if ($self->{'info_only'}) { 33 # created from classinfo.pl - don't need to parse the arguments 34 #return bless $self, $class; 35 #} 31 36 32 37 return bless $self, $class; -
trunk/gsdl/perllib/classify/AZList.pm
r6961 r6968 43 43 'reqd' => "yes" } , 44 44 { 'name' => "buttonname", 45 'desc' => "{ AZList.buttonname}",45 'desc' => "{BasClas.buttonname}", 46 46 'type' => "string", 47 47 'deft' => "{BasClas.metadata.deft}", … … 73 73 push( @{$option_list}, $options ); 74 74 75 if ($self->{'info_only'}) { 76 # created from classinfo.pl - don't need to parse the arguments 77 return bless $self, $class; 78 } 75 79 my ($metadata, $title, $removeprefix, $removesuffix); 76 80 -
trunk/gsdl/perllib/classify/AZSectionList.pm
r6940 r6968 51 51 'reqd' => "yes" }, 52 52 { 'name' => "buttonname", 53 'desc' => "{ AZList.buttonname}",53 'desc' => "{BasClas.buttonname}", 54 54 'type' => "string", 55 55 'deft' => "{BasClas.metadata.deft}", … … 62 62 'args' => $arguments }; 63 63 64 # sub print_usage {65 # print STDERR "66 # usage: classify AZSectionList [options]67 # options:68 69 # -metadata X (required) Metadata field used for classification,70 # list will be sorted by this element.71 72 # -buttonname X (OPTIONAL) Title field for this classification.73 # if not included title field will be Metaname.74 75 # -removeprefix regex A prefix to ignore in the Metadata values76 # for the field when sorting.77 # This is very similar to AZList except it sorts by section level metadata78 # (excluding the top level) instead of just top level metadata.79 # ";80 # }81 64 82 65 sub new { … … 87 70 my $option_list = $self->{'option_list'}; 88 71 push( @{$option_list}, $options ); 72 73 #if ($self->{'info_only'}) { 74 # created from classinfo.pl - don't need to parse the arguments 75 # return bless $self, $class; 76 #} 89 77 90 78 return bless $self, $class; -
trunk/gsdl/perllib/classify/BasClas.pm
r6956 r6968 219 219 220 220 $self->{'option_list'} = [ $options ]; 221 my $gsdlinfo; 221 222 222 223 # general options available to all classifiers … … 226 227 q^verbosity/\d/2^, \$self->{'verbosity'}, 227 228 q^ignore_namespace^, \$self->{'ignore_namespace'}, 229 q^gsdlinfo^, \$gsdlinfo, 228 230 "allow_extra_options")) { 229 231 … … 233 235 } 234 236 237 if ($gsdlinfo) { 238 # created from classinfo.pl - set this so subclasses don't need to 239 # parse the arguments 240 $self->{'info_only'} = 1; 241 } 235 242 return bless $self, $class; 236 243 } -
trunk/gsdl/perllib/classify/Browse.pm
r6408 r6968 40 40 'inherits' => "yes" }; 41 41 42 # sub print_usage {43 # print STDERR "44 # usage: classify Browse45 # This classifier has no options (yet).46 # ";47 # }48 42 49 43 sub new { … … 54 48 my $option_list = $self->{'option_list'}; 55 49 push( @{$option_list}, $options ); 50 51 if ($self->{'info_only'}) { 52 # created from classinfo.pl - don't need to parse the arguments 53 return bless $self, $class; 54 } 56 55 57 56 # classifier information -
trunk/gsdl/perllib/classify/Collage.pm
r6808 r6968 24 24 ########################################################################### 25 25 26 # simple list classifier plugin 27 # options are: 28 # metadata=Metaname -- (optional) all documents with Metaname metadata 29 # will be included in list. if not included all documents 30 # will be included in list. 31 # sort=Meta -- (optional) sort documents in list alphabetically by 32 # Meta. by default it will sort by Metaname, if neither 33 # are set documents will be in build (random) order. 34 # Meta may be Filename to sort by original filename or 35 # nosort to force not to sort 36 # buttonname=Title -- (optional) the title field for this classification. 37 # if not included title field will be Metaname. 38 # if metadata is also not included title will be 'List' 39 40 # 12/05/02 Added usage datastructure - John Thompson 26 package Collage; 41 27 42 28 use BasClas; 43 package Collage;44 45 29 use sorttools; 46 30 … … 51 35 my $arguments = 52 36 [ { 'name' => "buttonname", 53 'desc' => "{ Collage.buttonname}",37 'desc' => "{BasClas.buttonname}", 54 38 'type' => "string", 55 'deft' => " Metadata element specified with -metadata",39 'deft' => "Collage", 56 40 'reqd' => "no" }]; 57 41 … … 61 45 'args' => $arguments }; 62 46 63 # sub print_usage {64 # print STDERR "65 # usage: classify List [options]66 # options:67 68 # -buttonname X (optional) Title field for this classification.69 # if not included title field will be Metaname.70 # ";71 # }72 47 73 48 sub new { … … 75 50 my $self = new BasClas($class, @_); 76 51 77 # 14-05-02 To allow for proper inheritance of arguments - John Thompson78 52 my $option_list = $self->{'option_list'}; 79 53 push( @{$option_list}, $options ); 54 55 if ($self->{'info_only'}) { 56 # created from classinfo.pl - don't need to parse the arguments 57 return bless $self, $class; 58 } 80 59 81 60 my ($title, $list); -
trunk/gsdl/perllib/classify/DateList.pm
r6635 r6968 86 86 my $option_list = $self->{'option_list'}; 87 87 push( @{$option_list}, $options ); 88 89 if ($self->{'info_only'}) { 90 # created from classinfo.pl - don't need to parse the arguments 91 return bless $self, $class; 92 } 88 93 89 94 $self->{'list'} = {}; -
trunk/gsdl/perllib/classify/HTML.pm
r6408 r6968 26 26 # html classifier plugin - creates an empty classification 27 27 # that's simply a link to a web page 28 # options are:29 # buttonname=Title -- (optional) the title field for this classification.30 # if not included title field 'Browse'31 # url=url -- the url of the web page to link to32 33 # 12/05/02 Added usage datastructure - John Thompson34 28 35 29 package HTML; … … 47 41 'reqd' => "yes" } , 48 42 { 'name' => "buttonname", 49 'desc' => "{ HTML.buttonname}",43 'desc' => "{BasClas.buttonname}", 50 44 'type' => "string", 51 45 'deft' => "Browse", … … 58 52 'args' => $arguments }; 59 53 60 # sub print_usage {61 # print STDERR "62 # usage: classify AZList [options]63 # options:64 # -url X The url of the web page to link to.65 # -buttonname X (optional) the title field for this classification.66 # The default is 'Browse'67 68 # HTML classifier plugin - creates classifier that is a link to a web page69 70 # ";71 # }72 54 73 55 sub new { -
trunk/gsdl/perllib/classify/Hierarchy.pm
r6761 r6968 25 25 26 26 # classifier plugin for generating hierarchical classifications 27 28 # options for this classifier are:29 # -hfile file.txt - classification file30 # -metadata Metaname - metadata field to test against file.txt31 # -sort Meta - this option is optional (genious;-). by default this32 # classifier will sort documents within each section33 # alphabetically by Title. sort=nosort prevents sorting34 # (i.e. documents will end up in build order), sort=Meta35 # will sort each field alphabetically by Meta (Meta may36 # also be 'Filename' to sort by the original filename).37 # -buttonname Title - another optional field. this is what will end up in the38 # Title field for this classification. if not present it39 # defaults to Metaname40 # -hlist_at_top - use a horizontal list for the top level (i.e. display it41 # like an AZList classification)42 27 43 28 # 12/05/02 Added usage datastructure - John Thompson … … 66 51 'reqd' => "yes" }, 67 52 { 'name' => "buttonname", 68 'desc' => "{ Hierarchy.buttonname}",53 'desc' => "{BasClas.buttonname}", 69 54 'type' => "string", 70 55 'deft' => "{BasClas.metadata.deft}", … … 87 72 'args' => $arguments }; 88 73 89 # sub print_usage {90 # print STDERR "91 # usage: classify Hierarchy [options]92 # options:93 94 # -buttonname X Title field for this classification.95 # Defaults to metadata name.96 97 # -metadata X Metadata field used for classification,98 # list will be sorted by this element,99 # unless -sort is used.100 101 # -hfile X The classification structure file102 103 # -sort X Metadata field to sort by (defaults to -metadata)104 # use '-sort nosort' for no sorting.105 106 # -hlist_at_top Display the first level of the classification107 # horizontally.108 # ";109 # }110 111 74 112 75 sub new { … … 114 77 my $self = new BasClas($class, @_); 115 78 116 # 14-05-02 To allow for proper inheritance of arguments - John Thompson117 79 my $option_list = $self->{'option_list'}; 118 80 push( @{$option_list}, $options ); 119 81 82 if ($self->{'info_only'}) { 83 # created from classinfo.pl - don't need to parse the arguments 84 return bless $self, $class; 85 } 86 120 87 my ($hfile, $metadata, $sortname, $title, $hlist_at_top); 121 88 -
trunk/gsdl/perllib/classify/List.pm
r6957 r6968 42 42 'reqd' => "no" }, 43 43 { 'name' => "buttonname", 44 'desc' => "{ List.buttonname}",44 'desc' => "{BasClas.buttonname}", 45 45 'type' => "string", 46 46 'deft' => "{BasClas.metadata.deft}", … … 66 66 my $option_list = $self->{'option_list'}; 67 67 push( @{$option_list}, $options ); 68 69 if ($self->{'info_only'}) { 70 # created from classinfo.pl - don't need to parse the arguments 71 return bless $self, $class; 72 } 68 73 69 74 my ($metadata, $title, $sortname, $list); -
trunk/gsdl/perllib/classify/Phind.pm
r6408 r6968 94 94 'deft' => "Title", 95 95 'reqd' => "no" }, 96 { 'name' => "button ",97 'desc' => "{ Phind.button}",96 { 'name' => "buttonname", 97 'desc' => "{BasClas.buttonname}", 98 98 'type' => "string", 99 99 'deft' => "Phrase", … … 134 134 'args' => $arguments }; 135 135 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 # "; }175 136 176 137 # Phrase delimiter symbols - these should be abstracted out someplace … … 193 154 push( @{$option_list}, $options ); 194 155 156 if ($self->{'info_only'}) { 157 # created from classinfo.pl - don't need to parse the arguments 158 return bless $self, $class; 159 } 160 195 161 my $out = $self->{'outhandle'}; 196 162 … … 210 176 q^text/.*/section:Title,section:text^, \$self->{'indexes'}, 211 177 q^title/.*/Title^, \$self->{'titlefield'}, 212 q^button /.*/Phrase^, \$self->{'buttonname'},178 q^buttonname/.*/Phrase^, \$self->{'buttonname'}, 213 179 q^language/.*/en^, \$language, 214 180 q^builddir/.*/^, \$builddir,
Note:
See TracChangeset
for help on using the changeset viewer.