<commit_before>// https://meta.wikimedia.org/wiki/Schema:MobileWikiAppiOSReadingLists

@objc final class ReadingListsFunnel: EventLoggingFunnel, EventLoggingStandardEventProviding {
    @objc public static let shared = ReadingListsFunnel()
    
    private enum Action: String {
        case save
        case unsave
        case createList = "createlist"
        case deleteList = "deletelist"
        case readStart = "read_start"
    }
    
    private override init() {
        super.init(schema: "MobileWikiAppiOSReadingLists", version: 18064062)
    }
    
    private func event(category: EventLoggingCategory, label: EventLoggingLabel?, action: Action, measure: Int = 1) -> Dictionary<String, Any> {
        let category = category.value
        let action = action.rawValue
        let isAnon = !WMFAuthenticationManager.sharedInstance.isLoggedIn
        let primaryLanguage = MWKLanguageLinkController.sharedInstance().appLanguage?.languageCode ?? "en"
        
        var event: [String: Any] = ["category": category, "action": action, "measure": measure, "primary_language": primaryLanguage, "is_anon": isAnon]
        if let labelValue = label?.value {
            event["label"] = labelValue<commit_msg>get primary language from parent<commit_after>// https://meta.wikimedia.org/wiki/Schema:MobileWikiAppiOSReadingLists

@objc final class ReadingListsFunnel: EventLoggingFunnel, EventLoggingStandardEventProviding {
    @objc public static let shared = ReadingListsFunnel()
    
    private enum Action: String {
        case save
        case unsave
        case createList = "createlist"
        case deleteList = "deletelist"
        case readStart = "read_start"
    }
    
    private override init() {
        super.init(schema: "MobileWikiAppiOSReadingLists", version: 18064062)
    }
    
    private func event(category: EventLoggingCategory, label: EventLoggingLabel?, action: Action, measure: Int = 1) -> Dictionary<String, Any> {
        let category = category.value
        let action = action.rawValue
        let isAnon = !WMFAuthenticationManager.sharedInstance.isLoggedIn
        
        var event: [String: Any] = ["category": category, "action": action, "measure": measure, "primary_language": primaryLanguage(), "is_anon": isAnon]
        if let labelValue = label?.value {
            event["label"] = labelValue
{'fraction_non_alphanumeric': 0.09489361702127659, 'fraction_numerical': 0.007659574468085106, 'mean_word_length': 3.3058608058608057, 'pattern_counts': {'":': 10, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '3855062', 'n_tokens_mistral': 668, 'n_tokens_neox': 634, 'n_words': 167}