-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain-plan.py
47 lines (43 loc) · 1.28 KB
/
main-plan.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import re
import json
text = """
Here are the installation instructions extracted from the provided README:
[
{
"type": "PackageManager",
"steps": [
{
"text": "1. To download and install SICStus Prolog (it is needed), follow the instructions at <https://sicstus.sics.se/download4.html>."
},
{
"text": "2. Then, you can download DALI and test it by running an example DALI MAS: ",
"seq_order": 2
}
]
},
{
"type": "Binary",
"steps": [
{
"text": "1. To download and install SICStus Prolog (it is needed), follow the instructions at <https://sicstus.sics.se/download4.html>."
},
{
"text": "2. Then, you can download DALI from <https://github.com/AAAI-DISIM-UnivAQ/DALI.git>."
},
{
"text": "3. Unzip the repository, go to the folder 'DALI/Examples/basic', and test if DALI works by double-clicking 'startmas.bat' file (this will launch an example DALI MAS).",
"seq_order": 3
}
]
}
]
Confidence: 95%
"""
# Use regular expression to extract the JSON part
json_match = re.search(r'\[.*?\]', text, re.DOTALL)
if json_match:
json_text = json_match.group(0)
json_data = json.loads(json_text)
print(json_data)
else:
print("No JSON format dictionary found.")