summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/tlpkg/dev/keyword-search/parse-texcatalogue-keywords61
-rw-r--r--Master/tlpkg/dev/keyword-search/tlmgr-interface.txt9
2 files changed, 36 insertions, 34 deletions
diff --git a/Master/tlpkg/dev/keyword-search/parse-texcatalogue-keywords b/Master/tlpkg/dev/keyword-search/parse-texcatalogue-keywords
index 281542022cc..25cb5617a45 100755
--- a/Master/tlpkg/dev/keyword-search/parse-texcatalogue-keywords
+++ b/Master/tlpkg/dev/keyword-search/parse-texcatalogue-keywords
@@ -24,21 +24,16 @@ if (@ARGV) {
$tcfile = "texcatalogue.xml";
}
-my %seikaku;
-my %kw_pkg;
-my %cz_pkg;
+my %taxonomy;
parse_texcatalogue($tcfile);
$Data::Dumper::Indent = 1;
-print Data::Dumper->Dump([\%seikaku, \%kw_pkg, \%cz_pkg],
- ["seikaku", "kw_pkg", "cz_pkg"]), $/;
+print Data::Dumper->Dump([\%taxonomy], ["taxonomy"]), $/;
# how to read in!!!
-#my $seikaku;
-#my $kw_pkg;
-#my $cz_pkg;
+#my $taxonomy;
#my $foo = `cat tc-dump`;
# the no strict "vars" is *ABSOLUT* necessary otherwise the file is not
# evaluated, no idea why!
@@ -46,13 +41,13 @@ print Data::Dumper->Dump([\%seikaku, \%kw_pkg, \%cz_pkg],
#eval "$foo";
#use strict "vars";
#
-#print_keywords($kw_pkg);
+#print_keywords($taxonomy->{'by-taxonomy'}{'keywords'});
#print "\n===================\nprimary characterizations\n";
-#walk_cz_tree($cz_pkg->{'primary'}, "PRIM");
+#walk_cz_tree($taxonomy->{'by-taxonomy'}{'primary'}, "PRIM");
#print "\n===================\nsecondary characterizations\n";
-#walk_cz_tree($cz_pkg->{'secondary'}, "SEC");
-#print "\n===================\nby-function characterizations\n";
-#walk_cz_tree($cz_pkg->{'by-function'}, "BFUNC");
+#walk_cz_tree($taxonomy->{'by-taxonomy'}{'secondary'}, "SEC");
+#print "\n===================\nfunctionality characterizations\n";
+#walk_cz_tree($cz_pkg->{'by-taxonomy'}{'functionality'}, "BFUNC");
##### only subs from here ##########
@@ -69,16 +64,16 @@ sub parse_texcatalogue {
die "Failed to parse texcatalogue.xml: $!";
# format of the data
- # $seikaku{'keyword'}{$package} = [ $kwi, $kwii,...];
- # $seikaku{'primary'}{$package} = $primchar;
- # $seikaku{'secondary'}{$package'} = $secchar;
- # $seikaku{'by-function'}{$package} = [ $bfi, $bfii, ...];
+ # $taxonomy{'by-package'}{'keyword'}{$package} = [ $kwi, $kwii,...];
+ # $taxonomy{'by-package'}{'primary'}{$package} = $primchar;
+ # $taxonomy{'by-package'}{'secondary'}{$package'} = $secchar;
+ # $taxonomy{'by-package'}{'functionality'}{$package} = [ $bfi, $bfii, ...];
#
# post processing gives
- # $kw_pkg{$keyword} = [ $pkg1, $pkg2, ...];
- # $cz_pkg{'primary'}{$level1}{$level2}...{'_packages_'} = [ $pkg1, $pkg2, ...];
- # $cz_pkg{'secondary'}{$level1}{$level2}...{'_packages_'} = [ $pkg1, $pkg2, ...];
- # $cz_pkg{'by-function'}{$level1}{$level2}...{'_packages_'} = [ $pkg1, $pkg2, ...];
+ # $taxonomy{'by-taxonomy'}{'keyword'}{$keyword} = [ $pkg1, $pkg2, ...];
+ # $taxonomy{'by-taxonomy'}{'primary'}{$level1}{$level2}...{'_packages_'} = [ $pkg1, $pkg2, ...];
+ # $taxonomy{'by-taxonomy'}{'secondary'}{$level1}{$level2}...{'_packages_'} = [ $pkg1, $pkg2, ...];
+ # $taxonomy{'by-taxonomy'}{'functionality'}{$level1}{$level2}...{'_packages_'} = [ $pkg1, $pkg2, ...];
foreach my $e ($parser->find('/fullcat/catalogue/entry')->get_nodelist) {
@@ -87,7 +82,7 @@ sub parse_texcatalogue {
my $n = $parser->find('./keyword',$e);
for my $kw ($n->get_nodelist) {
my $kwval = $parser->find('./@keyword',$kw)->string_value();
- push @{$seikaku{'keyword'}{$pkg}}, $kwval;
+ push @{$taxonomy{'by-package'}{'keyword'}{$pkg}}, $kwval;
#print "keyword = $kwval\n";
}
$n = $parser->find('./characterization',$e);
@@ -98,10 +93,10 @@ sub parse_texcatalogue {
my $czval = $czvalnl->value();
if (($czdim eq "primary") || ($czdim eq "secondary")) {
# assume only one primary and one secondary function
- $seikaku{$czdim}{$pkg} = $czval;
+ $taxonomy{'by-package'}{$czdim}{$pkg} = $czval;
} else {
- # assume that it is always "by-function"
- push @{$seikaku{'by-function'}{$pkg}}, $czval;
+ # assume that it is always "functionality"
+ push @{$taxonomy{'by-package'}{'functionality'}{$pkg}}, $czval;
}
#print "char dim = $czdim val=$czval\n";
}
@@ -110,22 +105,22 @@ sub parse_texcatalogue {
#
# do the keyword reshuffling
- for my $pkg (keys %{$seikaku{'keyword'}}) {
- for my $kw (@{$seikaku{'keyword'}{$pkg}}) {
- push @{$kw_pkg{$kw}}, $pkg;
+ for my $pkg (keys %{$taxonomy{'by-package'}{'keyword'}}) {
+ for my $kw (@{$taxonomy{'by-package'}{'keyword'}{$pkg}}) {
+ push @{$taxonomy{'by-taxonomy'}{'keyword'}{$kw}}, $pkg;
}
}
parse_characterizations('primary');
parse_characterizations('secondary');
- parse_characterizations('by-function');
+ parse_characterizations('functionality');
}
sub parse_characterizations {
my $what = shift;
- $cz_pkg{$what} = {};
- for my $pkg (keys %{$seikaku{$what}}) {
- my $value = $seikaku{$what}{$pkg};
+ $taxonomy{'by-taxonomy'}{$what} = {};
+ for my $pkg (keys %{$taxonomy{'by-package'}{$what}}) {
+ my $value = $taxonomy{'by-package'}{$what}{$pkg};
my @charlist;
if (!ref($value)) {
@charlist = ($value);
@@ -136,7 +131,7 @@ sub parse_characterizations {
# split the primary into levels sep by >
my @levels = split(' > ', $prim);
my $currentpointer;
- $currentpointer = $cz_pkg{$what};
+ $currentpointer = $taxonomy{'by-taxonomy'}{$what};
for my $l (@levels) {
if (!defined($currentpointer->{$l})) {
$currentpointer->{$l} = {};
diff --git a/Master/tlpkg/dev/keyword-search/tlmgr-interface.txt b/Master/tlpkg/dev/keyword-search/tlmgr-interface.txt
index c6405c490d8..2b955040470 100644
--- a/Master/tlpkg/dev/keyword-search/tlmgr-interface.txt
+++ b/Master/tlpkg/dev/keyword-search/tlmgr-interface.txt
@@ -2,7 +2,14 @@ How to interface tlmgr search with keywords
new search interface:
-tlmgr search <options> <terms>
+tlmgr search <options> <literal>
+ searches the normal way, i.e., pkg names, short/long desc
+tlmgr search <options> --file <literal>
+ searches the current --file way, i.e., the list of files of a package
+tlmgr search <options> --taxonomy <literal>
+ searches the taxonomy (keyword, functionality, characterization)
+tlmgr search <options> --extended <terms>
+ allows full searching (will maybe implemented later)
<options> ::= --global | --word | --list [keywords|functions|characterizations]