Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix vectordump #15

Merged
merged 2 commits into from

2 participants

@jakemannix

This should make our vectordumping nicer.

@sagemintblue
Collaborator

Looks good to me. If tested, feel free to merge.

@jakemannix jakemannix merged commit 5f43cc7 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
11 integration/src/main/java/org/apache/mahout/utils/vectors/VectorDumper.java
@@ -88,9 +88,10 @@ public int run(String[] args) throws Exception {
addOption("sizeOnly", "sz", "Dump only the size of the vector", false);
addOption("numItems", "ni", "Output at most <n> vecors", false);
addOption("vectorSize", "vs", "Truncate vectors to <vs> length when dumping (most useful when in"
- + " conjunction with -sort", false);
- addOption(buildOption("filter", "fi", "Only dump out those vectors whose name matches the filter." +
- " Multiple items may be specified by repeating the argument.", true, 1, 100, false, null));
+ + " conjunction with -sort", "100");
+ // temporarily comment out the "filter" option, as it makes help formatting broken
+// addOption(buildOption("filter", "fi", "Only dump out those vectors whose name matches the filter." +
+// " Multiple items may be specified by repeating the argument.", true, 1, 100, false, null));
if (parseArguments(args, false, true) == null) {
return -1;
@@ -176,8 +177,8 @@ public int run(String[] args) throws Exception {
writer.append("#Max Items to dump: ").append(String.valueOf(numItems)).append('\n');
}
}
- int maxIndexesPerVector = hasOption("numIndexesPerVector")
- ? Integer.parseInt(getOption("numIndexesPerVector").toString())
+ int maxIndexesPerVector = hasOption("vectorSize")
+ ? Integer.parseInt(getOption("vectorSize").toString())
: Integer.MAX_VALUE;
long itemCount = 0;
int fileCount = 0;
Something went wrong with that request. Please try again.