aboutsummaryrefslogtreecommitdiffstats
path: root/tests/data/README.md
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-11-25 11:44:31 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-11-25 11:44:31 +0100
commit8cd8204a7464968280f9c72105edc585c2cf0a4f (patch)
tree2bb6cf2e033d8964a8dbc5827635fde8bf3de962 /tests/data/README.md
parentee705e9adf6bde2b8eed7c2b6edae360e595cad2 (diff)
downloadfuzzycat-8cd8204a7464968280f9c72105edc585c2cf0a4f.tar.gz
fuzzycat-8cd8204a7464968280f9c72105edc585c2cf0a4f.zip
add more test cases
Diffstat (limited to 'tests/data/README.md')
-rw-r--r--tests/data/README.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/data/README.md b/tests/data/README.md
index 4788f1b..42ea394 100644
--- a/tests/data/README.md
+++ b/tests/data/README.md
@@ -15,3 +15,41 @@ If you add lines to this file, the test suite will pick it up automatically.
7kzrmoajzzedxgdvbltgqihszu,bd4crw4p7ber7pzhpoyw2c77bi,Status.STRONG,OK.SLUG_TITLE_AUTHOR_MATCH,
```
+## Helpers
+
+Going from a query to the combination of idents (with
+[esdump](https://github.com/miku/esdump), [jq](https://stedolan.github.io/jq/),
+[makecomb.py](https://gist.github.com/miku/c1220715060babc2374a440bd742a410):
+
+```
+$ esdump -q '"Calcifying+extracellular+mucus+substances"' | \
+ jq -rC '.hits.hits[]._id' | makecomb.py | awk '{print $1","$2}'
+
+5lk635o65nc2tnkus3pkf2ggeq,hqrvhbvocvaabg6nr5p43tl3uq
+5lk635o65nc2tnkus3pkf2ggeq,zfwf3tefajc6zdxa47vgilm7wm
+hqrvhbvocvaabg6nr5p43tl3uq,zfwf3tefajc6zdxa47vgilm7wm
+```
+
+Where `makecomb.py` turns lines into pairs.
+
+```
+$ curl -sL https://git.io/JkDwC > ~/bin/makecomb.py && chmod +x ~/bin/makecomb.py
+```
+
+Short script.
+
+```python
+#!/usr/bin/env python
+import fileinput
+import itertools
+
+vs = set()
+for line in fileinput.input():
+ line = line.strip()
+ if not line:
+ continue
+ vs.add(line)
+
+for a, b in itertools.combinations(sorted(vs), r=2):
+ print("{}\t{}".format(a, b))
+```