Commit 2bb0c04b authored by opitz's avatar opitz
Browse files

small bugfix and new argument : subcat - use subcategories instead of categories

parent 9a0c54b5
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ parser.add_argument('-verbose',choices=[0,1,2],type=int,default=0,

parser.add_argument('-prune_text_nodes_min_freq',type=int,default=2,
                   help='how often a text description node has to occur to be included in the graph')

parser.add_argument('--subcategories',dest='subcat',action='store_true',
        help='do we want subcategories (e.g. category punishment: corporal, subcategory: whipping), there will be many more nodes with subcat enabled')
args = parser.parse_args()


@@ -42,7 +45,7 @@ def write(path,G):
		f.write(json.dumps(nx.readwrite.json_graph.node_link_data(G)))


G,index_dict = gb.build_graph(years=args.year)
G,index_dict = gb.build_graph(years=args.year,subcat=args.subcat)
print("Graph info before text description node simplification:")
print(nx.info(G))
gh.simplify_text_description_nodes(G,index_dict,mode=args.text_node_simplification_mode,min_freq=args.prune_text_nodes_min_freq)