<commit_before>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2005-2007 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package mx.resources
{

import mx.managers.ISystemManager;

/**
 *  The Locale class can be used to parse a locale String such as <code>"en_US_MAC"</code>
 *  into its three parts: a language code, a country code, and a variant.
 *
 *  <p>The localization APIs in the IResourceManager and IResourceBundle
 *  interfaces use locale Strings rather than Locale instances,
 *  so this class is seldom used in an application.</p>
 *
 *  @see mx.resources.IResourceBundle
 *  @see mx.resources.IResourceManager
 *  
 *  @langversion 3.0
 *  @playerversion Flash 9
 *  @playerversion AIR 1.1
 *  @productversion Flex 3
 */
public class Locale
{
    include "../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class variables
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     */
    private static var currentLocale:Locale;

    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     *  Constructor.
     *
     *  @param localeString A 1-, 2-, or 3-part locale String,
     *  such as <code>"en"</code>, <code>"en_US"</code>, or <code>"en_US_MAC"</code>.
     *  The parts are separated by underscore characters.
     *  The first part is a two-letter lowercase language code
     *  as defined by ISO-639, such as <code>"en"</code> for English.
     *  The second part is a two-letter uppercase country code
     *  as defined by ISO-3166, such as <code>"US"</code> for the United States.
     *  The third part is a variant String, which can be used 
     *  to optionally distinguish multiple locales for the same language and country.
     *  It is sometimes used to indicate the operating system
     *  that the locale should be used with, such as <code>"MAC"</code>, <code>"WIN"</code>, or <code>"UNIX"</code>.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */
    public function Locale(localeString:String)
    {
        super();

        this.localeString = localeString;
        
        var parts:Array = localeString.split("_");
        
        if (parts.length > 0)
            _language = parts[0];
        
        if (parts.length > 1)
            _country = parts[1];
        
        if (parts.length > 2)
            _variant = parts.slice(2).join("_");
    }
    
    //--------------------------------------------------------------------------
    //
    //  Variables
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     */
    private var localeString:String;

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  language
    //----------------------------------
            
    /**
     *  @private
     *  Storage for the language property.
     */
    private var _language:String;

    [Inspectable(category="General", defaultValue="null")]
    
    /**
     *  The language code of this Locale instance. [Read-Only]
     *
     *  <pre>
     *  var locale:Locale = new Locale("en_US_MAC");
     *  trace(locale.language); // outputs "en"
     *  </pre>
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */      
    public function get language():String
    {
        return _language;
    }
       
    //----------------------------------
    //  country
    //----------------------------------
            
    /**
     *  @private
     *  Storage for the country property.
     */
    private var _country:String;

    [Inspectable(category="General", defaultValue="null")]

    /**
     *  The country code of this Locale instance. [Read-Only]
     *
     *  <pre>
     *  var locale:Locale = new Locale("en_US_MAC");
     *  trace(locale.country); // outputs "US"
     *  </pre>
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */      
    public function get country():String
    {
        return _country
    }

    //----------------------------------
    //  variant
    //----------------------------------
                
    /**
     *  @private
     *  Storage for the variant property.
     */
    private var _variant:String;

    [Inspectable(category="General", defaultValue="null")]
    
    /**
     *  The variant part of this Locale instance. [Read-Only]
     *
     *  <pre>
     *  var locale:Locale = new Locale("en_US_MAC");
     *  trace(locale.variant); // outputs "MAC"
     *  </pre>
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */      
    public function get variant():String
    {
        return _variant;
    }
    
    //--------------------------------------------------------------------------
    //
    //  Methods
    //
    //--------------------------------------------------------------------------

    /**
     *  Returns the locale String that was used to construct
     *  this Locale instance. For example:
     *
     *  <pre>
     *  var locale:Locale = new Locale("en_US_MAC");
     *  trace(locale.toString()); // outputs "en_US_MAC"
     *  </pre>
     *
     *  @return Returns the locale String that was used to
     *  construct this Locale instance.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */   
    public function toString():String
    {
        return localeString;
    }
}

}
<commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>
package mx.resources
{

import mx.managers.ISystemManager;

/**
 *  The Locale class can be used to parse a locale String such as <code>"en_US_MAC"</code>
 *  into its three parts: a language code, a country code, and a variant.
 *
 *  <p>The localization APIs in the IResourceManager and IResourceBundle
 *  interfaces use locale Strings rather than Locale instances,
 *  so this class is seldom used in an application.</p>
 *
 *  @see mx.resources.IResourceBundle
 *  @see mx.resources.IResourceManager
 *  
 *  @langversion 3.0
 *  @playerversion Flash 9
 *  @playerversion AIR 1.1
 *  @productversion Flex 3
 */
public class Locale
{
    include "../core/Version.as";

    //--------------------------------------------------------------------------
    //
    //  Class variables
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     */
    private static var currentLocale:Locale;

    //--------------------------------------------------------------------------
    //
    //  Constructor
    //
    //--------------------------------------------------------------------------

    /**
     *  Constructor.
     *
     *  @param localeString A 1-, 2-, or 3-part locale String,
     *  such as <code>"en"</code>, <code>"en_US"</code>, or <code>"en_US_MAC"</code>.
     *  The parts are separated by underscore characters.
     *  The first part is a two-letter lowercase language code
     *  as defined by ISO-639, such as <code>"en"</code> for English.
     *  The second part is a two-letter uppercase country code
     *  as defined by ISO-3166, such as <code>"US"</code> for the United States.
     *  The third part is a variant String, which can be used 
     *  to optionally distinguish multiple locales for the same language and country.
     *  It is sometimes used to indicate the operating system
     *  that the locale should be used with, such as <code>"MAC"</code>, <code>"WIN"</code>, or <code>"UNIX"</code>.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */
    public function Locale(localeString:String)
    {
        super();

        this.localeString = localeString;
        
        var parts:Array = localeString.split("_");
        
        if (parts.length > 0)
            _language = parts[0];
        
        if (parts.length > 1)
            _country = parts[1];
        
        if (parts.length > 2)
            _variant = parts.slice(2).join("_");
    }
    
    //--------------------------------------------------------------------------
    //
    //  Variables
    //
    //--------------------------------------------------------------------------

    /**
     *  @private
     */
    private var localeString:String;

    //--------------------------------------------------------------------------
    //
    //  Properties
    //
    //--------------------------------------------------------------------------

    //----------------------------------
    //  language
    //----------------------------------
            
    /**
     *  @private
     *  Storage for the language property.
     */
    private var _language:String;

    [Inspectable(category="General", defaultValue="null")]
    
    /**
     *  The language code of this Locale instance. [Read-Only]
     *
     *  <pre>
     *  var locale:Locale = new Locale("en_US_MAC");
     *  trace(locale.language); // outputs "en"
     *  </pre>
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */      
    public function get language():String
    {
        return _language;
    }
       
    //----------------------------------
    //  country
    //----------------------------------
            
    /**
     *  @private
     *  Storage for the country property.
     */
    private var _country:String;

    [Inspectable(category="General", defaultValue="null")]

    /**
     *  The country code of this Locale instance. [Read-Only]
     *
     *  <pre>
     *  var locale:Locale = new Locale("en_US_MAC");
     *  trace(locale.country); // outputs "US"
     *  </pre>
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */      
    public function get country():String
    {
        return _country
    }

    //----------------------------------
    //  variant
    //----------------------------------
                
    /**
     *  @private
     *  Storage for the variant property.
     */
    private var _variant:String;

    [Inspectable(category="General", defaultValue="null")]
    
    /**
     *  The variant part of this Locale instance. [Read-Only]
     *
     *  <pre>
     *  var locale:Locale = new Locale("en_US_MAC");
     *  trace(locale.variant); // outputs "MAC"
     *  </pre>
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */      
    public function get variant():String
    {
        return _variant;
    }
    
    //--------------------------------------------------------------------------
    //
    //  Methods
    //
    //--------------------------------------------------------------------------

    /**
     *  Returns the locale String that was used to construct
     *  this Locale instance. For example:
     *
     *  <pre>
     *  var locale:Locale = new Locale("en_US_MAC");
     *  trace(locale.toString()); // outputs "en_US_MAC"
     *  </pre>
     *
     *  @return Returns the locale String that was used to
     *  construct this Locale instance.
     *  
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
     */   
    public function toString():String
    {
        return localeString;
    }
}

}

{'fraction_non_alphanumeric': 0.2624324977835093, 'fraction_numerical': 0.009027162085919239, 'mean_word_length': 1.143375367075488, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 65, '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': '5028599', 'n_tokens_mistral': 3354, 'n_tokens_neox': 3192, 'n_words': 884}