Commit 6c348770 authored by  Joel  Oksanen's avatar Joel Oksanen
Browse files

Lots of changes, started working on ConceptNet, CoreNLP, in order to prepare...

Lots of changes, started working on ConceptNet, CoreNLP, in order to prepare SemEval data for training classifier.
parent 9e151325
......@@ -12,19 +12,20 @@ class ConnectionManager: ObservableObject {
@Published var product = Product()
@Published var messages: [Message] = [Message]()
private let ip = "192.168.0.13"
private let port = "8000"
private var messageQueue: [Message]? = nil
// [UserMessage(text: "Why was the camera highly rated?"),
// ADAMessage(text: "The camera was highly rated because the lens was good, although the battery was poor.", arguments: [Argument(name: "camera"), Argument(name: "lens"), Argument(name: "battery")])
init() {
requestProduct(id: "B0012YA85A")
requestProduct(id: "B0075SUK14")
// B00RTGK0N0 - red Canon camera
// B004J3V90Y - Canon T3i
// B0012YA85A - Canon Rebel XSI
// B003ZYF3LO - Nikon D3100
}
private func requestProduct(id: String) {
let url = URL(string: "http://192.168.0.13:8000/ios_server/product/?id=" + id)!
let url = URL(string: "http://" + ip + ":" + port + "/ios_server/product/?id=" + id)!
let task = URLSession.shared.dataTask(with: url) {(data, response, error) in
guard let data = data else { return }
......@@ -61,7 +62,7 @@ class ConnectionManager: ObservableObject {
}
func sendQuery(_ query: ArgumentQuery) {
let url = URL(string: "http://192.168.0.13:8000/ios_server/message/")!
let url = URL(string: "http://" + ip + ":" + port + "/ios_server/message/")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment