From 42dc6f76cbea56da7e5c1109a051148df139f1c8 Mon Sep 17 00:00:00 2001 From: Victor Zimmermann <zimmermann@cl.uni-heidelberg.de> Date: Wed, 7 Mar 2018 14:38:26 +0100 Subject: [PATCH] Fixed formatting. --- code/absinth_nx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/absinth_nx.py b/code/absinth_nx.py index ce072f4..baef7fe 100644 --- a/code/absinth_nx.py +++ b/code/absinth_nx.py @@ -26,7 +26,7 @@ def frequencies(corpus_path, target, stop_words=[], allowed_tags=['NN','NNS','JJ max_node_ratio = len(node_freq)/max_nodes max_edge_ratio = len(edge_freq)/max_edges ratios = [file_ratio, max_node_ratio, max_edge_ratio] - print('~ {}%\tNodes: {}\tEdges: {}.'.format(int((max(ratios))*100), len(node_freq), len(edge_freq))) + print(' ~{}%\tNodes: {}\tEdges: {}.'.format(int((max(ratios))*100), len(node_freq), len(edge_freq))) if len(node_freq) > max_nodes: return node_freq, edge_freq @@ -273,14 +273,14 @@ if __name__ == '__main__': H = root_hubs(G, edge_freq) for h in H: mfn = sorted(G.adj[h], key=lambda key: edge_freq[h,key] if h < key else edge_freq[key, h], reverse=True)[:6] - print('{}: {}\n'.format(h, mfn)) + print(' {}: {}\n'.format(h, mfn)) print('[A] Building Minimum Spanning Tree.\n') T = components(G, H, target) print('[A] Disambiguating Results...') D = disambiguate(T, H, results[key]) - print('Mapping:', D, '\n') + print(' Mapping:', D, '\n') print('[A] Writing to file '+target+'.absinth.\n\n') for d in D: -- GitLab