-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstatement_logic.py
62 lines (50 loc) · 1.47 KB
/
statement_logic.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import add_path
from settings import *
from general import *
# import general_functions as gf
from dictionary.split_sentences import split_sentencescl
class calculate_statments:
def __init__(self):
self.temp11()
claims = pi.open_pickle("claims")
self.claims = claims[2]
for self.claim in self.claims:
self.main()
def main(self):
self.enclose()
self.sp_sent = split_sentencescl().main(self.claim)
bb = 8
def enclose(self):
b = len(self.claim) - 1
while b > -1:
let = self.claim[b]
if let.isalpha():
self.claim = replace_at_i(b + 1, self.claim, ")")
self.claim = replace_at_i(b - 1, self.claim, "(")
b -= 2
else:
b -= 1
def unenclose(self):
b = len(self.claim) - 1
while b > -1:
let = self.claim[b]
if let.isalpha():
self.claim = delete_at_i(b + 1, self.claim)
self.claim = delete_at_i(b - 1, self.claim, "(")
else:
b -= 1
def temp11(self):
d = "(b C c)"
e = "(~b C c)"
f = "(b C ~c)"
g = "(~b C ~c)"
h = "~(b C c)"
i = "~(~b C c)"
j = "~(b C ~c)"
k = "~(~b C ~c)"
lst = [d,e,f,g,h,i,j,k]
lst2 = list(combinations(lst,2))
for x, y in lst2:
p(f"{x} {cj} {y}")
return
calculate_statments()