Skip to content

Commit f7d3858

Browse files
committed
add -b (blotonly) option to extract, refine README
1 parent 9729b20 commit f7d3858

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ documents.
77

88
Dupi is in alpha/early beta development stage. Please feel free to give it a try
99
(and [file issues](https://github.com/go-air/dupi/issues)). We have run it on
10-
several document sets successfully, but it definitely needs more testing to be deployed
11-
for commercial purposes.
10+
several document sets successfully, but it definitely needs more testing.
1211

1312
## Input
1413

@@ -29,5 +28,5 @@ Find and query for repeated chunks of text.
2928

3029
## Library Reference
3130

32-
31+
[![Go Reference](https://pkg.go.dev/badge/github.com/go-air/dupi.svg)](https://pkg.go.dev/github.com/go-air/dupi)
3332

cmd/dupi/extract.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ import (
2828

2929
type extractCmd struct {
3030
verb
31-
index *dupi.Index
32-
json *bool
33-
sigma *float64
31+
index *dupi.Index
32+
json *bool
33+
sigma *float64
34+
blotonly *bool
3435
}
3536

3637
func newExtractCmd() *extractCmd {
@@ -41,6 +42,7 @@ func newExtractCmd() *extractCmd {
4142

4243
extract.json = extract.flags.Bool("json", false, "output json")
4344
extract.sigma = extract.flags.Float64("sigma", 2.0, "explore blots within σ of average (higher=most probable dups, lower=more volume)")
45+
extract.blotonly = extract.flags.Bool("b", false, "output blots only")
4446
return extract
4547
}
4648

@@ -79,6 +81,7 @@ func (x *extractCmd) Run(args []string) error {
7981
return nil
8082
}
8183
if *x.json {
84+
8285
shp2 := shape
8386
j := 0
8487
for i := range shp2 {
@@ -100,6 +103,10 @@ func (x *extractCmd) Run(args []string) error {
100103
if len(blot.Docs) <= 1 {
101104
continue
102105
}
106+
if *x.blotonly {
107+
fmt.Printf("%x\n", blot.Blot)
108+
continue
109+
}
103110
fmt.Printf("%x", blot.Blot)
104111
for i := range blot.Docs {
105112
doc := &blot.Docs[i]

0 commit comments

Comments
 (0)