<commit_before>//
//  IssueModel.swift
//  bugit
//
//  Created by <NAME> on 11/17/16.
//  Copyright © 2016 BugIt App. All rights reserved.
//

import UIKit

class IssueModel: NSObject {
    var project: String?
    var issueTypeId: String?
    var summary: String?
    var issueDescription: String?
    var assignee: String?
    var reporter: String?
    var priority: String?
    var labels: [String]?
    var environment: String?
    var components: [String : String]?
    
}<commit_msg>Add a method to the IssueModel to return a JSON representation of its data.<commit_after>//
//  IssueModel.swift
//  bugit
//
//  Created by <NAME> on 11/17/16.
//  Copyright © 2016 BugIt App. All rights reserved.
//

import UIKit

class IssueModel: NSObject {
    var project: String?
    var issueTypeId: String?
    var summary: String?
    var issueDescription: String?
    var assignee: String?
    var reporter: String?
    var priority: String?
    var labels: [String]?
    var environment: String?
    var components: [String : String]?
    
    func toJSON() -> Dictionary<String, Any> {
        var json = Dictionary<String, Any>()
        if let project = project {
            json["project"] = project
        }
        if let summary = summary {
            json["summary"] = summary
        }
        if let assignee = assignee {
            json["assignee"] = assignee
        }
        if let reporter = reporter {
            json["reporter"] = reporter
        }
        if let labels = labels {
            json["labels"] = labels
        }
        if let environment = environment {
            json["environment"] = environment
        }
        if let issueDescription = issueDescription {
            json["description"] = issueDescription
        }
        return json
    }
}
{'fraction_non_alphanumeric': 0.10044642857142858, 'fraction_numerical': 0.011160714285714286, 'mean_word_length': 2.0807560137457046, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2735319', 'n_tokens_mistral': 516, 'n_tokens_neox': 490, 'n_words': 169}