<commit_before>/**
 * Decode a custom config file format into the elements needed to build iOS and Android preference xml
 *
 *
 */
'use strict';
	
var commonMappings = {
	title: {
		ios: "Title",
		android: "@android:title"
	},
	key: {
		ios: "Key",
		android: "@android:key"
	},
	default: {
		ios: "DefaultValue",
		android: "@android:defaultValue"
	},
	description: {
		ios: "FooterText",
		android: "@android:summary"
	},
};

module.exports = {
	group: {
		ios: "PSGroupSpecifier",
		android: "PreferenceCategory",
		attrs: {
			description: commonMappings.description,
			title: commonMappings.title
		}
	},
	selectNotSupported: {
		ios: "PSMultiValueSpecifier",
		android: "MultiSelectListPreference",
		attrs: {
			key:     commonMappings.key,
			title:   commonMappings.title,
			default: commonMappings.default,
		}
	},
	radio: {
		ios: "PSRadioGroupSpecifier",
		android: "ListPreference",
		required: ["title", "key", "default"],
		attrs: {
			key:     commonMappings.key,
			title:   commonMappings.title,
			default: commonMappings.default,
			description: commonMappings.description,
		},
		fixup: {
			ios: function (element, config) {
				element.Titles = [];
				element.Values = [];
				config.items.forEach(function(a) {
					element.Values.push(a.id || a.value);
					element.Titles.push(a.title || a.name);
				});
			},
			android: function (element, config) {
				var name = config.name || config.key,
					titles = [], values = [];

				config.items.forEach(function(item) {<commit_msg>Fixes iOS 8.2+ radio settings reverting to default<commit_after>/**
 * Decode a custom config file format into the elements needed to build iOS and Android preference xml
 *
 *
 */
'use strict';
	
var commonMappings = {
	title: {
		ios: "Title",
		android: "@android:title"
	},
	key: {
		ios: "Key",
		android: "@android:key"
	},
	default: {
		ios: "DefaultValue",
		android: "@android:defaultValue"
	},
	description: {
		ios: "FooterText",
		android: "@android:summary"
	},
};

module.exports = {
	group: {
		ios: "PSGroupSpecifier",
		android: "PreferenceCategory",
		attrs: {
			description: commonMappings.description,
			title: commonMappings.title
		}
	},
	selectNotSupported: {
		ios: "PSMultiValueSpecifier",
		android: "MultiSelectListPreference",
		attrs: {
			key:     commonMappings.key,
			title:   commonMappings.title,
			default: commonMappings.default,
		}
	},
	radio: {
		ios: "PSMultiValueSpecifier",
		android: "ListPreference",
		required: ["title", "key", "default"],
		attrs: {
			key:     commonMappings.key,
			title:   commonMappings.title,
			default: commonMappings.default,
			description: commonMappings.description,
		},
		fixup: {
			ios: function (element, config) {
				element.Titles = [];
				element.Values = [];
				config.items.forEach(function(a) {
					element.Values.push(a.id || a.value);
					element.Titles.push(a.title || a.name);
				});
			},
			android: function (element, config) {
				var name = config.name || config.key,
					titles = [], values = [];

				config.items.forEach(function(item) {
{'fraction_non_alphanumeric': 0.14851161269218188, 'fraction_numerical': 0.0006542361792607131, 'mean_word_length': 3.5438335809806834, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '2441509', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1018, 'n_words': 219}