-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVikaSyntax.py
More file actions
55 lines (48 loc) · 1.44 KB
/
VikaSyntax.py
File metadata and controls
55 lines (48 loc) · 1.44 KB
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
class VikaSyntax:
def __init__(self):
self.verbs = list()
self.localisation = list()
self.objects = list()
self.objectPlural = bool
def HasVerb(self, verb: str) -> bool:
for v in self.verbs:
if(v["r"] in verb):
print("Verb found")
return True
return False;
def HasLocalisation(self, loc: str) -> bool:
for l in self.localisation:
print(l)
print(l["n"])
if(l["n"] in loc):
print("Localisation found")
return True
return False;
def HasObject(self, obj: str) -> bool:
for o in self.objects:
print(o)
print(o["n"])
if(o["n"] in obj):
print("object found")
return True
return False;
def PrintSyntax(self):
print("Verbs")
if len(self.verbs) != 0:
for verb in self.verbs:
print(verb)
else:
print(" No verbs")
print("Localisation")
if len(self.localisation) != 0:
for loc in self.localisation:
print(loc)
else:
print(" No localisations")
print("Objects")
if len(self.objects) != 0:
for obj in self.objects:
print(obj)
print("plural: ", self.objectPlural)
else:
print(" No objects")