[](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'); # => { addresses => [ 'еЊ—жµ·йЃ“ж–°е† йѓЎж–°е† з”єй‡Ње№і', 'еЊ—жµ·йЃ“жІ™жµЃйѓЎж—Ґй«з”є', ], local_code_digits => '1' } address_by_area_code('01456'); # => same as above area_code_by_address('大йЄеєњжќ±е¤§йЄеё‚еІ©з”°з”є'); # => { area_code => '72', local_code_digits => '3' } area_code_by_address_prefix_match('大йЄеєњжќ±е¤§йЄеё‚еІ©з”°з”єдёЂдёЃз›®'); # => { area_code => '72', local_code_digits => '3' } area_code_by_address_fuzzy('大йЄеєњжќ±е¤§йЄеё‚еІ©з”°'); # => { # '大йЄеєњжќ±е¤§йЄеё‚еІ©з”°з”є' => { # area_code => '72', # local_code_digits => '3', # }, # '大йЄеєњжќ±е¤§йЄеё‚еІ©з”°з”єдё‰дёЃз›®' => { # area_code => '6', # local_code_digits => '4', # }, # '大йЄеєње¤§йЄеё‚' => { # area_code => '6', # local_code_digits => '4', # }, # '大йЄеєњжќ±е¤§йЄеё‚' => { # area_code => '6', # local_code_digits => '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 => [ 'еЊ—жµ·йЃ“в—Їв—Їеё‚Г—Г—з”є', 'еЊ—жµ·йЃ“в—Їв—Їеё‚в–ів–із”є' ], local_code_digits => '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 => '72', local_code_digits => '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\_fuzzy($address) Retrieve area code by address (partial match). `$address` __MUST__ have prefecture name. This function returns hash reference like; { '大йЄеєњв—Їв—Їеё‚' => { area_code => '6', local_code_digits => '4', }, '大йЄеєњв–ів–іеё‚' => { area_code => '72', local_code_digits => '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 <moznion@gmail.com>