[Debtags-commits] [svn] r1052 - in tagcoll/trunk: . src
Enrico Zini
enrico at costa.debian.org
Mon Aug 1 22:40:23 UTC 2005
Author: enrico
Date: Mon Aug 1 22:40:22 2005
New Revision: 1052
Modified:
tagcoll/trunk/README
tagcoll/trunk/src/tagcoll.cc
tagcoll/trunk/src/taggrep.cc
Log:
Implemented --remove-unfaceted
Modified: tagcoll/trunk/README
==============================================================================
--- tagcoll/trunk/README (original)
+++ tagcoll/trunk/README Mon Aug 1 22:40:22 2005
@@ -84,6 +84,7 @@
These are the TODO-list items completed so far::
+ + Implemented --remove-unfaceted option
(older completed items are archived in the DONE file)
Modified: tagcoll/trunk/src/tagcoll.cc
==============================================================================
--- tagcoll/trunk/src/tagcoll.cc (original)
+++ tagcoll/trunk/src/tagcoll.cc Mon Aug 1 22:40:22 2005
@@ -56,6 +56,8 @@
#include <tagcoll/Serializer.h>
#include <tagcoll/TagcollReverser.h>
+#include <tagcoll/UnfacetedRemover.h>
+
#include <algorithm>
using namespace std;
@@ -290,6 +292,7 @@
opts.add("flatten", 0, "flatten-threshold", "set the number of total items below which a branch is flattened when using the \"hierarchy\" command (defaults to 0, meaning \"don't flatten\")", "num");
opts.add("filter", 'f', "filter", "filter out the tags with cardinality less than the given value (defaults to not filter; currently only works when building hierarchies)", "num");
opts.add("untagged-tag", 0, "untagged-tag", "set item name to use for associating untagged items when using the \"reverse\" command. If not specified, untagged items are not included in the output.", "tag");
+ opts.add("remove-unfaceted", 0, "remove-unfaceted", "while parsing, remove all tags with no facet part.");
//opts.add("verbose", 'v', "verbose", "enable verbose output");
//opts.add("debug", 0, "debug", "enable debugging output (including verbose output)");
@@ -375,6 +378,10 @@
}
}
+ UnfacetedRemover<string> unfaceted_remover;
+ if (opts.get("remove-unfaceted").defined())
+ filters.appendFilter(&unfaceted_remover);
+
InputMerger<string, string> merger;
filters.setConsumer(&merger);
readCollection(file1, filters);
Modified: tagcoll/trunk/src/taggrep.cc
==============================================================================
--- tagcoll/trunk/src/taggrep.cc (original)
+++ tagcoll/trunk/src/taggrep.cc Mon Aug 1 22:40:22 2005
@@ -123,7 +123,7 @@
FilterChain<string, string> filters;
- ExpressionFilter<string> filter;
+ ExpressionFilter<string, string> filter;
if (!filter.setExpression(expression))
{
fprintf(stderr, "Error in tag expression `%.*s'.\n", PFSTR(expression));
@@ -132,7 +132,7 @@
filters.appendFilter(&filter);
if (opts.get("invert-match").defined())
- filter.setMatchType(ExpressionFilter<string>::INVERTED);
+ filter.setMatchType(ExpressionFilter<string, string>::INVERTED);
Serializer<string, string> serializer;
if (opts.get("quiet").defined())
More information about the Debtags-commits
mailing list