aboutsummaryrefslogtreecommitdiff
path: root/tf.py
diff options
context:
space:
mode:
authorCamil Staps2017-12-15 12:47:43 +0100
committerCamil Staps2017-12-15 12:47:43 +0100
commit1ab437c62f7a4d59f93a0de9c590afbdfbc55a58 (patch)
tree7763beb22b52631817d8762570291993c1d167b0 /tf.py
parentMerge branch 'implementation' of github.com:rubigdata/IR-2017-4 into implemen... (diff)
Use queries_stopped.json in tf.py->df.py
Diffstat (limited to 'tf.py')
-rwxr-xr-xtf.py20
1 files changed, 0 insertions, 20 deletions
diff --git a/tf.py b/tf.py
deleted file mode 100755
index fc57f8b..0000000
--- a/tf.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import json
-from collections import Counter
-
-if __name__ == '__main__':
- store = dict()
- for filename in os.listdir('information-retrieval-data/'):
- with open('information-retrieval-data/' + filename) as f:
- entity = json.load(f)
- for field, values in entity.items():
- for value in values:
- if field not in store:
- store[field] = []
- store[field] += [v.lower() for v in value.split(" ")]
- for field in store:
- cnt = Counter(store[field])
- for term in cnt.items():
- print('{}\t{}\t{}'.format(field, term[0], term[1]))