<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">[![Build Status](https://travis-ci.org/moznion/Number-Phone-JP-AreaCode.png?branch=master)](https://travis-ci.org/moznion/Number-Phone-JP-AreaCode)
# NAME

Number::Phone::JP::AreaCode - Utilities for Japanese area code of phone

# SYNOPSIS

    use Number::Phone::JP::AreaCode qw/
        area_code_by_address
        area_code_by_address_prefix_match
        area_code_by_address_fuzzy
        address_by_area_code
    /;

    address_by_area_code('1456'); # =&gt; { addresses =&gt; [ 'ĺŚ—ćµ·é“ć–°ĺ†&nbsp;éˇć–°ĺ†&nbsp;ç”şé‡Śĺął', 'ĺŚ—ćµ·é“ć˛™ćµéˇć—Ąé«ç”ş', ], local_code_digits =&gt; '1' }
    address_by_area_code('01456'); # =&gt; same as above
    area_code_by_address('ĺ¤§éŞĺşśćť±ĺ¤§éŞĺ¸‚ĺ˛©ç”°ç”ş'); # =&gt; { area_code =&gt; '72', local_code_digits =&gt; '3' }
    area_code_by_address_prefix_match('ĺ¤§éŞĺşśćť±ĺ¤§éŞĺ¸‚ĺ˛©ç”°ç”şä¸€ä¸ç›®'); # =&gt; { area_code =&gt; '72', local_code_digits =&gt; '3' }
    area_code_by_address_fuzzy('ĺ¤§éŞĺşśćť±ĺ¤§éŞĺ¸‚ĺ˛©ç”°'); # =&gt; {
                                                      #        'ĺ¤§éŞĺşśćť±ĺ¤§éŞĺ¸‚ĺ˛©ç”°ç”ş' =&gt; {
                                                      #            area_code         =&gt; '72',
                                                      #            local_code_digits =&gt; '3',
                                                      #        },
                                                      #        'ĺ¤§éŞĺşśćť±ĺ¤§éŞĺ¸‚ĺ˛©ç”°ç”şä¸‰ä¸ç›®' =&gt; {
                                                      #            area_code         =&gt; '6',
                                                      #            local_code_digits =&gt; '4',
                                                      #        },
                                                      #        'ĺ¤§éŞĺşśĺ¤§éŞĺ¸‚' =&gt; {
                                                      #            area_code         =&gt; '6',
                                                      #            local_code_digits =&gt; '4',
                                                      #        },
                                                      #        'ĺ¤§éŞĺşśćť±ĺ¤§éŞĺ¸‚' =&gt; {
                                                      #            area_code         =&gt; '6',
                                                      #            local_code_digits =&gt; '4',
                                                      #        }
                                                      #    }

# DESCRIPTION

Number::Phone::JP::AreaCode provides utilities for Japanese area code of phone.
You can retrieve area code by address and opposite.

If you want to know about Japanese area code of phone, please refer [http://www.soumu.go.jp/main\_sosiki/joho\_tsusin/top/tel\_number/shigai\_list.html](http://www.soumu.go.jp/main_sosiki/joho_tsusin/top/tel_number/shigai_list.html) (Japanese web page).

# FUNCTIONS

All of functions return `undef` if result of retrieving is nothing.

- address\_by\_area\_code($area\_code)

    Retrieve addresses list by area code.
    This function returns hash reference like;

        {
            addresses         =&gt; [ 'ĺŚ—ćµ·é“â—Żâ—Żĺ¸‚Ă—Ă—ç”ş', 'ĺŚ—ćµ·é“â—Żâ—Żĺ¸‚â–łâ–łç”ş' ],
            local_code_digits =&gt; '3'
        }

    `addresses` is the list of addresses that belong with area code.
    `local_code_digits` is the number of digits of local code.

    You can append country code (0) or not. As you like it!

- area\_code\_by\_address($address)

    Retrieve area code by address (perfect matching). `$address` __MUST__ have prefecture name.
    This function returns hash reference like;

        {
            area_code =&gt; '72',
            local_code_digits =&gt; '3'
        }

    `area_code` is the area code which excepted country code (0).
    `local_code_digits` is the number of digits of local code.

- area\_code\_by\_address\_prefix\_match($address)

    Retrieve area code by address (prefix matching and longest matching). `$address` __MUST__ have prefecture name.
    This function returns hash reference that is the same as `area_code_by_address`.

- area\_code\_by\_address\_fuzz($address)

    Retrieve area code by address (partial match). `$address` __MUST__ have prefecture name.
    This function returns hash reference like;

        {
            'ĺ¤§éŞĺşśâ—Żâ—Żĺ¸‚' =&gt; {
                area_code         =&gt; '6',
                local_code_digits =&gt; '4',
            },
            'ĺ¤§éŞĺşśâ–łâ–łĺ¸‚' =&gt; {
                area_code         =&gt; '72',
                local_code_digits =&gt; '3',
            }
        }

# LICENSE

Copyright (C) moznion.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

# CONTRIBUTOR

ytnobody

# AUTHOR

moznion &lt;moznion@gmail.com&gt;
</pre></body></html>