<commit_before>
import Foundation
import CoreData
import CoreSpotlight
import MobileCoreServices

class Contact: NSManagedObject {
    
    class func create(name:String, phone:String, email:String) -> Contact {
        let contact = Contact.MR_createEntity()
        contact.name = name
        contact.phone = phone
        contact.email = email
        contact.index()
        return contact
    }}

extension Contact : Indexable {
    func index() {
        let item = CSSearchableItem(uniqueIdentifier: email, domainIdentifier: "com.philips.pins.SearchDemo.contact", attributeSet: attributes())
        item.expirationDate = NSDate().dateByAddingTimeInterval(60*10)
        CSSearchableIndex.defaultSearchableIndex().indexSearchableItems([item]) { (error) -> Void in
            if (error != nil) {
                print(error?.localizedDescription)
            }
        }
    }
    
    func  attributes() -> CSSearchableItemAttributeSet {
        let attributes = CSSearchableItemAttributeSet(itemContentType:kUTTypeContact as String)
        attributes.title = name
        if let email = email {
            attributes.emailAddresses = [email]
        }
        
        if let phone = phone {
            attributes.phoneNumbers = [phone]
        }
        attributes.keywords = ["contact"]
        return attributes
    }
}<commit_msg>Description in contact<commit_after>
import Foundation
import CoreData
import CoreSpotlight
import MobileCoreServices

class Contact: NSManagedObject {
    
    class func create(name:String, phone:String, email:String) -> Contact {
        let contact = Contact.MR_createEntity()
        contact.name = name
        contact.phone = phone
        contact.email = email
        contact.index()
        return contact
    }}

extension Contact : Indexable {
    func index() {
        let item = CSSearchableItem(uniqueIdentifier: email, domainIdentifier: "com.philips.pins.SearchDemo.contact", attributeSet: attributes())
        item.expirationDate = NSDate().dateByAddingTimeInterval(60*10)
        CSSearchableIndex.defaultSearchableIndex().indexSearchableItems([item]) { (error) -> Void in
            if (error != nil) {
                print(error?.localizedDescription)
            }
        }
    }
    
    func  attributes() -> CSSearchableItemAttributeSet {
        let attributes = CSSearchableItemAttributeSet(itemContentType:kUTTypeContact as String)
        attributes.title = name
        if let email = email {
            attributes.emailAddresses = [email]
        }
        
        if let phone = phone {
            attributes.phoneNumbers = [phone, "(888) 555-5521"]
            attributes.supportsPhoneCall = 1
        }
        attributes.contentDescription = phone! + "\n" + email!
        attributes.keywords = ["contact"]
        return attributes
    }
}
{'fraction_non_alphanumeric': 0.08872393071756804, 'fraction_numerical': 0.00671615411806292, 'mean_word_length': 2.4723926380368098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7466842', 'n_tokens_mistral': 741, 'n_tokens_neox': 713, 'n_words': 168}