νάρθηξ - narthex

Modular personalized dictionary generator - [git] - [github] - [license] - by Michael Constantine Dimopoulos - <mk@mcdim.xyz>


ncom

ncom is a tool that will output different combinations (pairs) of the existing lines of the given file or stdin.

For example, with the following command:
$ cat words.txt | ncom
where words.txt contains the following:
dog
cat
1234
the program will produce this:
dog
cat
1234
dogdog
dogcat
dog1234
catdog
catcat
cat1234
1234dog
1234cat
12341234
You can have it exclude numerical bases with -n, so with this command
$ cat words.txt | ncom -n
It will output this
dog
cat
1234
dogdog
dogcat
dog1234
catdog
catcat
cat1234
and you can exclude cases where the base and the to-be-appended part the same with -b. So with this command
$ cat words.txt | ncom -b
It will, instead, output this
dog
cat
1234
dogcat
dog1234
catdog
cat1234
1234dog
1234cat
(no dogdog, catcat etc.)

Additionally, you can set some delimiters with the -d option. For example:

$ echo "fish\ntuna" | ncom -d .%
fish
tuna
fishfish
fishtuna
tunafish
tunatuna
fish.fish
fish.tuna
tuna.fish
tuna.tuna
fish%fish
fish%tuna
tuna%fish
tuna%tuna