<commit_before>import Foundation

class MCreateFont
{
    let fonts:[MCreateFontName]
    private let kResourceName:String = "ResourceFonts"
    private let kResourceExtension:String = "plist"
    private let kKeyName:String = "name"
    private let kKeyFont:String = "font"
    
    init()
    {
        var fonts:[MCreateFontName] = []
        
        guard
            
            let resourceFont:URL = Bundle.main.url(
                forResource:kResourceName,
                withExtension:kResourceExtension),
            let fontArray:NSArray = NSArray(
                contentsOf:resourceFont),
            let fontList:[Any] = fontArray as? [Any]
            
        else
        {
            self.fonts = fonts
            
            return
        }
        
        for font:Any in fontList
        {
            guard
            
                let fontMap:[String:String] = font as? [String:String],
                let itemFont:String = fontMap[kKeyFont],
                let itemName:String = fontMap[kKeyName]
            
            else
            {
                continue
            }
            
            let item:MCreateFontName = mcare
        }
        
        self.fonts = fonts
    }
}
<commit_msg>parsing and sorting fonts<commit_after>import Foundation

class MCreateFont
{
    let fonts:[MCreateFontItem]
    private let kResourceName:String = "ResourceFonts"
    private let kResourceExtension:String = "plist"
    private let kKeyName:String = "name"
    private let kKeyFont:String = "font"
    
    init()
    {
        var fonts:[MCreateFontItem] = []
        
        guard
            
            let resourceFont:URL = Bundle.main.url(
                forResource:kResourceName,
                withExtension:kResourceExtension),
            let fontArray:NSArray = NSArray(
                contentsOf:resourceFont),
            let fontList:[Any] = fontArray as? [Any]
            
        else
        {
            self.fonts = fonts
            
            return
        }
        
        for font:Any in fontList
        {
            guard
            
                let fontMap:[String:String] = font as? [String:String],
                let itemName:String = fontMap[kKeyName],
                let itemFont:String = fontMap[kKeyFont]
            
            else
            {
                continue
            }
            
            let item:MCreateFontItem = MCreateFontItem(
                displayName:itemName,
                fontName:itemFont)
            
            fonts.append(item)
        }
        
        fonts.sort
        { (itemA:MCreateFontItem, itemB:MCreateFontItem) -> Bool in
            
            let comparisonResult:ComparisonResult = itemA.displayName.compare(itemB.displayName)
            
            switch comparisonResult
            {
            case ComparisonResult.orderedAscending,
                 ComparisonResult.orderedSame:
                
                return true
                
            case ComparisonResult.orderedDescending:
                
                return false
            }
        }
        
        self.fonts = fonts
    }
}

{'fraction_non_alphanumeric': 0.06633134234517447, 'fraction_numerical': 0.0, 'mean_word_length': 1.2487632508833921, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '5094011', 'n_tokens_mistral': 828, 'n_tokens_neox': 776, 'n_words': 159}