<commit_before><?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate ZipCodeFormatter. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Script>
        <![CDATA[

            import mx.events.ValidationResultEvent;			
            private var vResult:ValidationResultEvent;

            // Event handler to validate and format input.
            private function Format():void 
            {
                vResult = zcVal.validate();
                
                if (vResult.type==ValidationResultEvent.VALID) {
                    formattedZipcode.text= zipFormatter.format(zip.text);
                }
                
                else {
                    formattedZipcode.text= "";
                }
            }
        ]]>      
    </mx:Script>

    <mx:ZipCodeFormatter id="zipFormatter" formatString="#####-####"/>

    <mx:ZipCodeValidator id="zcVal" source="{zip}" property="text" allowedFormatChars=""/>

    <mx:Panel title="ZipCodeFormatter Example" width="75%" height="75%" 
            paddingTop="10" paddingLeft="10" paddingRight="10" paddingBottom="10">

        <mx:Form width="100%">
            <mx:FormItem label="Enter a 5 or 9 digit U.S. ZIP code:" width="100%">
                <mx:TextInput id="zip" text=""/>
            </mx:FormItem>

            <mx:FormItem label="Formatted ZIP code: " width="100%">
                <mx:TextInput id="formattedZipcode" text="" editable="false"/>
            </mx:FormItem>

            <mx:FormItem>
                <mx:Button label="Validate and Format" click="Format();"/>
            </mx:FormItem>
        </mx:Form>

    </mx:Panel>
</mx:Application><commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after><?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate ZipCodeFormatter. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo">

    <fx:Script>
        <![CDATA[
            import mx.events.ValidationResultEvent;

            private var vResult:ValidationResultEvent;

            // Event handler to validate and format input.
            private function Format():void {
                vResult = zcVal.validate();

                if (vResult.type == ValidationResultEvent.VALID) {
                    formattedZipcode.text = zipFormatter.format(zip.text);
                } else {
                    formattedZipcode.text = "";
                }
            }
        ]]>
    </fx:Script>

    <fx:Declarations>
        <mx:ZipCodeFormatter id="zipFormatter" formatString="#####-####"/>
        <mx:ZipCodeValidator id="zcVal" source="{zip}" property="text" allowedFormatChars=""/>
    </fx:Declarations>

    <s:Panel title="ZipCodeFormatter Example"
            width="75%" height="75%" 
            horizontalCenter="0" verticalCenter="0">
        <mx:Form left="10" right="10" top="10" bottom="10">
            <mx:FormItem label="Enter a 5 or 9 digit U.S. ZIP code:" width="100%">
                <s:TextInput id="zip" text=""/>
            </mx:FormItem>
            <mx:FormItem label="Formatted ZIP code: " width="100%">
                <s:TextInput id="formattedZipcode" text="" editable="false"/>
            </mx:FormItem>
            <mx:FormItem>
                <s:Button label="Validate and Format" click="Format();"/>
            </mx:FormItem>
        </mx:Form>
    </s:Panel>

</s:Application>
{'fraction_non_alphanumeric': 0.15071225071225072, 'fraction_numerical': 0.01680911680911681, 'mean_word_length': 2.0450997398091935, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 2, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 8}, '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': '2566788', 'n_tokens_mistral': 1070, 'n_tokens_neox': 964, 'n_words': 192}