tt

command module
v0.0.0-...-064b225 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2016 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

##tt a token tester

cli tool to calculate the difference, intersection, or union on large newline delimited files

tt uses maps and optionally scalable bloom filters to quickly test the existence of a member in a set. bloom filters provide a way to process files larger than the memory consumed by the map implementation.

##Usage:

jason@mba ~: go get github.com/jasonmoo/tt

jason@mba ~: tt
Usage: tt -[i,d,u] [-trim] [-match "regex"] [-capture "regex"] [-large [-estimated_lines N]] file1 file2[ file3..]
	-buffer_size=1048576: buffered io chunk size
	-capture="": only process captured data
	-d=false: calculate the difference
	-devnull=false: do not output tokens, just counts
	-estimated_lines=0: estimate used to size bloom filters (set this to avoid prescan)
	-i=false: calculate the intersection
	-large=false: use bloom filters for large data size (may be lossy)
	-match="": only process matching lines
	-trim=false: trim each line
	-u=false: calculate the union

Example

jason@mba ~: wc -l /usr/share/dict/*
      39 /usr/share/dict/README
     150 /usr/share/dict/connectives
    1308 /usr/share/dict/propernames
  235886 /usr/share/dict/web2
   76205 /usr/share/dict/web2a
  235886 /usr/share/dict/words
  549474 total

# outputs for different actions on /usr/share/dict files

jason@mba ~: tt -u -devnull /usr/share/dict/{web2*,words}
	tt starting up
	** Token Report **
	Lines scanned:  547977
	Tokens emitted:  312091
	Time:  250.914739ms
jason@mba ~: tt -d -devnull /usr/share/dict/{web2*,words}
	tt starting up
	** Token Report **
	Lines scanned:  547977
	Tokens emitted:  312091
	Time:  632.523386ms
jason@mba ~: tt -i -devnull /usr/share/dict/{web2*,words}
	tt starting up
	** Token Report **
	Lines scanned:  547977
	Tokens emitted:  0
	Time:  501.008685ms
jason@mba ~: tt -i -devnull /usr/share/dict/*
	tt starting up
	** Token Report **
	Lines scanned:  549474
	Tokens emitted:  0
	Time:  395.460469ms

LICENSE

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址