<commit_before>//
//  People.swift
//  GoSquared
//
//  Created by <NAME> on 28/08/2015.
//  Copyright © 2015 Go Squared Ltd. All rights reserved.
//

import Foundation

public class People {

    private let key: String
    private let token: String
    private let client: GoSquared
    private let baseURL: String

    public init(client: GoSquared) {
        self.key = client.key
        self.token = client.token
        self.client = client
        self.baseURL = "\(GoSquared.baseURL)/people/v1"
    }

    public func search(query: String = "", count: Int = 35, offset: Int = 0, completionHandler: GoSquared.Handler? = nil) -> NSURLSessionDataTask? {
        let url = NSURL(string: "\(baseURL)/search/?api_key=\(key)&site_token=\(token)&query=\(query)&limit=\(offset),\(count)&sort=last.seen:desc")!

        return client.get(url, handler: completionHandler)
    }

    public func feed(user: String, completionHandler: GoSquared.Handler? = nil) -> NSURLSessionDataTask? {
        let url = NSURL(string: "\(baseURL)/person/\(user)/feed/?api_key=\(key)&site_token=\(token)&presenter=nice")!

        return client.get(url, handler: completionHandler)
    }

}<commit_msg>add people details endpoint<commit_after>//
//  People.swift
//  GoSquared
//
//  Created by <NAME> on 28/08/2015.
//  Copyright © 2015 Go Squared Ltd. All rights reserved.
//

import Foundation

public class People {

    private let key: String
    private let token: String
    private let client: GoSquared
    private let baseURL: String

    public init(client: GoSquared) {
        self.key = client.key
        self.token = client.token
        self.client = client
        self.baseURL = "\(GoSquared.baseURL)/people/v1"
    }

    public func search(query: String = "", count: Int = 35, offset: Int = 0, completionHandler: GoSquared.Handler? = nil) -> NSURLSessionDataTask? {
        let url = NSURL(string: "\(baseURL)/search/?api_key=\(key)&site_token=\(token)&query=\(query)&limit=\(offset),\(count)&sort=last.seen:desc")!

        return client.get(url, handler: completionHandler)
    }

    public func details(user: String, completionHandler: GoSquared.Handler? = nil) -> NSURLSessionDataTask? {
        let url = NSURL(string: "\(baseURL)/person/\(user)/details?api_key=\(key)&site_token=\(token)")!

        return client.get(url, handler: completionHandler)
    }

    public func feed(user: String, completionHandler: GoSquared.Handler? = nil) -> NSURLSessionDataTask? {
        let url = NSURL(string: "\(baseURL)/person/\(user)/feed/?api_key=\(key)&site_token=\(token)&presenter=nice")!

        return client.get(url, handler: completionHandler)
    }

}
{'fraction_non_alphanumeric': 0.14360902255639096, 'fraction_numerical': 0.012030075187969926, 'mean_word_length': 3.2305246422893483, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '3289449', 'n_tokens_mistral': 874, 'n_tokens_neox': 816, 'n_words': 193}