We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bea8937 commit 4c03db1Copy full SHA for 4c03db1
compression/compression.py
@@ -1,9 +1,19 @@
1
+import sys
2
import json
-from collections import defaultdict
3
import os
4
+from collections import defaultdict
5
+
6
+# Ensure a file path is provided
7
+if len(sys.argv) != 2:
8
+ raise ValueError("Please provide the path to 'python_code_knowledge_graph.json' as an argument.")
9
10
+input_file = sys.argv[1]
11
12
# Load the knowledge graph from the JSON file
-with open("python_code_knowledge_graph.json", "r") as f:
13
+if not os.path.exists(input_file):
14
+ raise FileNotFoundError(f"File not found: {input_file}")
15
16
+with open(input_file, "r") as f:
17
knowledge_graph = json.load(f)
18
19
# Function to generate abbreviations for all unique terms
0 commit comments