<commit_before>//
//  Tag.swift
//  FeedlyKit
//
//  Created by <NAME> on 1/18/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import SwiftyJSON

public final class Tag: Stream,
                        ResponseObjectSerializable, ResponseCollectionSerializable,
                        ParameterEncodable {
    public let id:    String
    public let label: String

    public override var streamId: String {
        return id
    }
    public override var streamTitle: String {
        return label
    }

    public class func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Tag]? {
        let json = JSON(representation)
        return json.arrayValue.map({ Tag(json: $0) })
    }

    public class func Read(userId: String) -> Category {
        return Category(id: "user/\(userId)/tag/global.read", label: "Read")
    }

    public class func Saved(userId: String) -> Category {
        return Category(id: "user/\(userId)/tag/global.saved", label: "Saved")
    }

    @objc required public convenience init?(response: NSHTTPURLResponse, representation: AnyObject) {
        let json = JSON(representation)
        self.init(json: json)
    }

    public init(id: String, label: String) {
        self.id    = id
        self.label = label<commit_msg>Add global tag helper<commit_after>//
//  Tag.swift
//  FeedlyKit
//
//  Created by <NAME> on 1/18/15.
//  Copyright (c) 2015 <NAME>. All rights reserved.
//

import SwiftyJSON

public final class Tag: Stream,
                        ResponseObjectSerializable, ResponseCollectionSerializable,
                        ParameterEncodable {
    public let id:    String
    public let label: String

    public override var streamId: String {
        return id
    }
    public override var streamTitle: String {
        return label
    }

    public class func collection(response response: NSHTTPURLResponse, representation: AnyObject) -> [Tag]? {
        let json = JSON(representation)
        return json.arrayValue.map({ Tag(json: $0) })
    }

    public class func Read(userId: String) -> Tag {
        return Tag(id: "user/\(userId)/tag/global.read", label: "Read")
    }

    public class func Saved(userId: String) -> Tag {
        return Tag(id: "user/\(userId)/tag/global.saved", label: "Saved")
    }

    @objc required public convenience init?(response: NSHTTPURLResponse, representation: AnyObject) {
        let json = JSON(representation)
        self.init(json: json)
    }

    public init(id: String, label: String) {
        self.id    = id
        self.label = label
{'fraction_non_alphanumeric': 0.10733590733590734, 'fraction_numerical': 0.007722007722007722, 'mean_word_length': 2.4092105263157895, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '4391808', 'n_tokens_mistral': 746, 'n_tokens_neox': 723, 'n_words': 216}