<commit_before>/* ***** BEGIN LICENSE BLOCK *****
 *
 * This file is part of Weave.
 *
 * The Initial Developer of Weave is the Institute for Visualization
 * and Perception Research at the University of Massachusetts Lowell.
 * Portions created by the Initial Developer are Copyright (C) 2008-2015
 * the Initial Developer. All Rights Reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 * 
 * ***** END LICENSE BLOCK ***** */

package weavejs.core
{
	import weavejs.WeaveAPI;
	import weavejs.api.core.ILocale;
	import weavejs.net.ResponseType;
	import weavejs.net.URLRequest;
	import weavejs.util.WeavePromise;

	public class Locale implements ILocale
	{
		private var _reverseLayout:Boolean = false;
		public function get reverseLayout():Boolean { return _reverseLayout; }
		public function set reverseLayout(value:Boolean):void { _reverseLayout = value; }
		
		public function loadFromUrl(jsonUrl:String):WeavePromise
		{
			var request:URLRequest = new URLRequest(jsonUrl);
			request.responseType = ResponseType.JSON;
			return WeaveAPI.URLRequestUtils.request(this, request).then(function(data:Object):void { this.data = data; });
		}
		
		private var _data:Object = {};
		
		public function get data():Object
		{
			return _data;
		}
		
		public function set data(value:Object):void
		{
			_data = value;<commit_msg>fixed lost 'this' context<commit_after>/* ***** BEGIN LICENSE BLOCK *****
 *
 * This file is part of Weave.
 *
 * The Initial Developer of Weave is the Institute for Visualization
 * and Perception Research at the University of Massachusetts Lowell.
 * Portions created by the Initial Developer are Copyright (C) 2008-2015
 * the Initial Developer. All Rights Reserved.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/.
 * 
 * ***** END LICENSE BLOCK ***** */

package weavejs.core
{
	import weavejs.WeaveAPI;
	import weavejs.api.core.ILocale;
	import weavejs.net.ResponseType;
	import weavejs.net.URLRequest;
	import weavejs.util.WeavePromise;

	public class Locale implements ILocale
	{
		private var _reverseLayout:Boolean = false;
		public function get reverseLayout():Boolean { return _reverseLayout; }
		public function set reverseLayout(value:Boolean):void { _reverseLayout = value; }
		
		public function loadFromUrl(jsonUrl:String):WeavePromise
		{
			var request:URLRequest = new URLRequest(jsonUrl);
			request.responseType = ResponseType.JSON;
			var self:Locale = this;
			return WeaveAPI.URLRequestUtils.request(this, request).then(function(data:Object):void { self.data = data; });
		}
		
		private var _data:Object = {};
		
		public function get data():Object
		{
			return _data;
		}
		
		public function set data(value:Object):void
		{
			_data = value;
{'fraction_non_alphanumeric': 0.09923664122137404, 'fraction_numerical': 0.007965482907401261, 'mean_word_length': 4.082630691399663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2956742', 'n_tokens_mistral': 983, 'n_tokens_neox': 869, 'n_words': 293}