-
Notifications
You must be signed in to change notification settings - Fork 0
/
M-I-S.swift
71 lines (56 loc) · 2.22 KB
/
M-I-S.swift
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
63
64
65
66
67
68
69
70
71
/* Class library for collecting, processing and presenting information
Author: Pavan Gunupudi 2012 (c) Copyright; All rights reserved.
License: BSD
*/
class Information {
let rawData: String
let description: String
init(description:String, rawData: String) {
self.description = description
self.rawData = rawData
}
func simpleDescription() {
print("Brief info about data: ", description)
print("Full data: ", rawData)
}
}
class Knowledge {
let edict: String
let info: [Information]
init(edict:String, info: [Information]) {
self.edict = edict
self.info = info
}
func simpleDescription() {
for information in info {
print(information.simpleDescription())
}
print(edict)
}
}
class Meaning {
let statementInQuestion: String
let information: [Information]
let priorKnowledge: Knowledge
var analyzedMeaning: String? = nil
var zeitgeistMeaning: String? = nil
init(statement: String, information: [Information], priorKnowledge: Knowledge) {
self.statementInQuestion = statement
self.information = information
self.priorKnowledge = priorKnowledge
}
func simpleDescription() {
print("Statement in Question: \(statementInQuestion)")
print("Meaning:", analyzedMeaning)
}
}
let moonInfo = Information(description: "Something about our moon",
rawData: "It's spherical of course, but in addition, made contact with an old civilization there that cut contacts with Earth long time ago")
let spaceInfo = Information(description: "One of the first space travels",
rawData: "Yuri Gagaran, a Russian cosmonaut, was the first human being to circumnavigate the earth using a space-craft")
let knowHow = Knowledge(edict: "There is a lot to know about space!!.", info: [moonInfo, spaceInfo])
print(knowHow.simpleDescription())
let questForMeaning = Meaning(statement: "Did we go to space before?", information: knowHow.info, priorKnowledge: knowHow)
questForMeaning.analyzedMeaning = "Yes we did!!"
questForMeaning.zeitgeistMeaning = "No we didn't!!"
print(questForMeaning.simpleDescription())