home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Numbers / Words / lang.ru.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  20.5 KB  |  625 lines

  1. <?php
  2. /* vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4: */
  3. //
  4. // +----------------------------------------------------------------------+
  5. // | PHP version 4                                                        |
  6. // +----------------------------------------------------------------------+
  7. // | Copyright (c) 1997-2003 The PHP Group                                |
  8. // +----------------------------------------------------------------------+
  9. // | This source file is subject to version 3.0 of the PHP license,       |
  10. // | that is bundled with this package in the file LICENSE, and is        |
  11. // | available at through the world-wide-web at                           |
  12. // | http://www.php.net/license/3_0.txt.                                  |
  13. // | If you did not receive a copy of the PHP license and are unable to   |
  14. // | obtain it through the world-wide-web, please send a note to          |
  15. // | license@php.net so we can mail you a copy immediately.               |
  16. // +----------------------------------------------------------------------+
  17. // | Authors: Piotr Klaban <makler@man.torun.pl>                          |
  18. // |          Andrey Demenev <demenev@gmail.com>                          |
  19. // +----------------------------------------------------------------------+
  20. //
  21. // $Id: lang.ru.php,v 1.3 2006/06/12 13:50:07 makler Exp $
  22. //
  23. // Numbers_Words class extension to spell numbers in Russian language.
  24. //
  25.  
  26. /**
  27.  * Class for translating numbers into Russian.
  28.  *
  29.  * @author Andrey Demenev
  30.  * @package Numbers_Words
  31.  */
  32.  
  33. /**
  34.  * Include needed files
  35.  */
  36. require_once("Numbers/Words.php");
  37.  
  38. /**
  39.  * Class for translating numbers into Russian.
  40.  *
  41.  * @author Andrey Demenev
  42.  * @package Numbers_Words
  43.  */
  44. class Numbers_Words_ru extends Numbers_Words
  45. {
  46.  
  47.     // {{{ properties
  48.  
  49.     /**
  50.      * Locale name
  51.      * @var string
  52.      * @access public
  53.      */
  54.     var $locale      = 'ru';
  55.  
  56.     /**
  57.      * Language name in English
  58.      * @var string
  59.      * @access public
  60.      */
  61.     var $lang        = 'Russian';
  62.  
  63.     /**
  64.      * Native language name
  65.      * @var string
  66.      * @access public
  67.      */
  68.     var $lang_native = '╨≤±±ΩΦΘ';
  69.     
  70.     /**
  71.      * The word for the minus sign
  72.      * @var string
  73.      * @access private
  74.      */
  75.     var $_minus = '∞Φφ≤±'; // minus sign
  76.     
  77.     /**
  78.      * The sufixes for exponents (singular)
  79.      * Names partly based on:
  80.      * http://home.earthlink.net/~mrob/pub/math/largenum.html
  81.      * http://mathforum.org/dr.math/faq/faq.large.numbers.html
  82.      * http://www.mazes.com/AmericanNumberingSystem.html
  83.      * @var array
  84.      * @access private
  85.      */
  86.     var $_exponent = array(
  87.         0 => '',
  88.         6 => '∞ΦδδΦεφ',
  89.         9 => '∞ΦδδΦα≡Σ',
  90.        12 => '≥≡ΦδδΦεφ',
  91.        15 => 'ΩΓαΣ≡ΦδδΦεφ',
  92.        18 => 'ΩΓΦφ≥ΦδδΦεφ',
  93.        21 => '±σΩ±≥ΦδδΦεφ',
  94.        24 => '±σ∩≥ΦδδΦεφ',
  95.        27 => 'εΩ≥ΦδδΦεφ',
  96.        30 => 'φεφΦδδΦεφ',
  97.        33 => 'Σσ÷ΦδδΦεφ',
  98.        36 => '≤φΣσ÷ΦδδΦεφ',
  99.        39 => 'Σ≤εΣσ÷ΦδδΦεφ',
  100.        42 => '≥≡σΣσ÷ΦδδΦεφ',
  101.        45 => 'ΩΓα≥≤ε≡Σσ÷ΦδδΦεφ',
  102.        48 => 'ΩΓΦφΣσ÷ΦδδΦεφ',
  103.        51 => '±σΩ±Σσ÷ΦδδΦεφ',
  104.        54 => '±σ∩≥σφΣσ÷ΦδδΦεφ',
  105.        57 => 'εΩ≥εΣσ÷ΦδδΦεφ',
  106.        60 => 'φεΓσ∞Σσ÷ΦδδΦεφ',
  107.        63 => 'ΓΦπΦφ≥ΦδδΦεφ',
  108.        66 => '≤φΓΦπΦφ≥ΦδδΦεφ',
  109.        69 => 'Σ≤εΓΦπΦφ≥ΦδδΦεφ',
  110.        72 => '≥≡σΓΦπΦφ≥ΦδδΦεφ',
  111.        75 => 'ΩΓα≥≤ε≡ΓΦπΦφ≥ΦδδΦεφ',
  112.        78 => 'ΩΓΦφΓΦπΦφ≥ΦδδΦεφ',
  113.        81 => '±σΩ±ΓΦπΦφ≥ΦδδΦεφ',
  114.        84 => '±σ∩≥σφΓΦπΦφ≥ΦδδΦεφ',
  115.        87 => 'εΩ≥εΓΦπΦφ≥ΦδδΦεφ',
  116.        90 => 'φεΓσ∞ΓΦπΦφ≥ΦδδΦεφ',
  117.        93 => '≥≡ΦπΦφ≥ΦδδΦεφ',
  118.        96 => '≤φ≥≡ΦπΦφ≥ΦδδΦεφ',
  119.        99 => 'Σ≤ε≥≡ΦπΦφ≥ΦδδΦεφ',
  120.        102 => '≥≡σ≥≡ΦπΦφ≥ΦδδΦεφ',
  121.        105 => 'ΩΓα≥ε≡≥≡ΦπΦφ≥ΦδδΦεφ',
  122.        108 => 'ΩΓΦφ≥≡ΦπΦφ≥ΦδδΦεφ',
  123.        111 => '±σΩ±≥≡ΦπΦφ≥ΦδδΦεφ',
  124.        114 => '±σ∩≥σφ≥≡ΦπΦφ≥ΦδδΦεφ',
  125.        117 => 'εΩ≥ε≥≡ΦπΦφ≥ΦδδΦεφ',
  126.        120 => 'φεΓσ∞≥≡ΦπΦφ≥ΦδδΦεφ',
  127.        123 => 'ΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  128.        126 => '≤φΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  129.        129 => 'Σ≤εΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  130.        132 => '≥≡σΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  131.        135 => 'ΩΓα≥ε≡ΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  132.        138 => 'ΩΓΦφΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  133.        141 => '±σΩ±ΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  134.        144 => '±σ∩≥σφΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  135.        147 => 'εΩ≥εΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  136.        150 => 'φεΓσ∞ΩΓαΣ≡απΦφ≥ΦδδΦεφ',
  137.        153 => 'ΩΓΦφΩΓαπΦφ≥ΦδδΦεφ',
  138.        156 => '≤φΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  139.        159 => 'Σ≤εΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  140.        162 => '≥≡σΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  141.        165 => 'ΩΓα≥ε≡ΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  142.        168 => 'ΩΓΦφΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  143.        171 => '±σΩ±ΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  144.        174 => '±σ∩≥σφΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  145.        177 => 'εΩ≥εΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  146.        180 => 'φεΓσ∞ΩΓΦφΩαπΦφ≥ΦδδΦεφ',
  147.        183 => '±σΩ±απΦφ≥ΦδδΦεφ',
  148.        186 => '≤φ±σΩ±απΦφ≥ΦδδΦεφ',
  149.        189 => 'Σ≤ε±σΩ±απΦφ≥ΦδδΦεφ',
  150.        192 => '≥≡σ±σΩ±απΦφ≥ΦδδΦεφ',
  151.        195 => 'ΩΓα≥ε≡±σΩ±απΦφ≥ΦδδΦεφ',
  152.        198 => 'ΩΓΦφ±σΩ±απΦφ≥ΦδδΦεφ',
  153.        201 => '±σΩ±±σΩ±απΦφ≥ΦδδΦεφ',
  154.        204 => '±σ∩≥σφ±σΩ±απΦφ≥ΦδδΦεφ',
  155.        207 => 'εΩ≥ε±σΩ±απΦφ≥ΦδδΦεφ',
  156.        210 => 'φεΓσ∞±σΩ±απΦφ≥ΦδδΦεφ',
  157.        213 => '±σ∩≥απΦφ≥ΦδδΦεφ',
  158.        216 => '≤φ±σ∩≥απΦφ≥ΦδδΦεφ',
  159.        219 => 'Σ≤ε±σ∩≥απΦφ≥ΦδδΦεφ',
  160.        222 => '≥≡σ±σ∩≥απΦφ≥ΦδδΦεφ',
  161.        225 => 'ΩΓα≥ε≡±σ∩≥απΦφ≥ΦδδΦεφ',
  162.        228 => 'ΩΓΦφ±σ∩≥απΦφ≥ΦδδΦεφ',
  163.        231 => '±σΩ±±σ∩≥απΦφ≥ΦδδΦεφ',
  164.        234 => '±σ∩≥σφ±σ∩≥απΦφ≥ΦδδΦεφ',
  165.        237 => 'εΩ≥ε±σ∩≥απΦφ≥ΦδδΦεφ',
  166.        240 => 'φεΓσ∞±σ∩≥απΦφ≥ΦδδΦεφ',
  167.        243 => 'εΩ≥επΦφ≥ΦδδΦεφ',
  168.        246 => '≤φεΩ≥επΦφ≥ΦδδΦεφ',
  169.        249 => 'Σ≤εεΩ≥επΦφ≥ΦδδΦεφ',
  170.        252 => '≥≡σεΩ≥επΦφ≥ΦδδΦεφ',
  171.        255 => 'ΩΓα≥ε≡εΩ≥επΦφ≥ΦδδΦεφ',
  172.        258 => 'ΩΓΦφεΩ≥επΦφ≥ΦδδΦεφ',
  173.        261 => '±σΩ±εΩ≥επΦφ≥ΦδδΦεφ',
  174.        264 => '±σ∩≥εΩ≥επΦφ≥ΦδδΦεφ',
  175.        267 => 'εΩ≥εεΩ≥επΦφ≥ΦδδΦεφ',
  176.        270 => 'φεΓσ∞εΩ≥επΦφ≥ΦδδΦεφ',
  177.        273 => 'φεφαπΦφ≥ΦδδΦεφ',
  178.        276 => '≤φφεφαπΦφ≥ΦδδΦεφ',
  179.        279 => 'Σ≤εφεφαπΦφ≥ΦδδΦεφ',
  180.        282 => '≥≡σφεφαπΦφ≥ΦδδΦεφ',
  181.        285 => 'ΩΓα≥ε≡φεφαπΦφ≥ΦδδΦεφ',
  182.        288 => 'ΩΓΦφφεφαπΦφ≥ΦδδΦεφ',
  183.        291 => '±σΩ±φεφαπΦφ≥ΦδδΦεφ',
  184.        294 => '±σ∩≥σφφεφαπΦφ≥ΦδδΦεφ',
  185.        297 => 'εΩ≥εφεφαπΦφ≥ΦδδΦεφ',
  186.        300 => 'φεΓσ∞φεφαπΦφ≥ΦδδΦεφ',
  187.        303 => '÷σφ≥ΦδδΦεφ'
  188.         );
  189.  
  190.     /**
  191.      * The array containing the teens' :) names
  192.      * @var array
  193.      * @access private
  194.      */
  195.     var $_teens = array(
  196.         11=>'εΣΦφφαΣ÷α≥ⁿ',
  197.         12=>'ΣΓσφαΣ÷α≥ⁿ',
  198.         13=>'≥≡ΦφαΣ÷α≥ⁿ',
  199.         14=>'≈σ≥√≡φαΣ÷α≥ⁿ',
  200.         15=>'∩ ≥φαΣ÷α≥ⁿ',
  201.         16=>'°σ±≥φαΣ÷α≥ⁿ',
  202.         17=>'±σ∞φαΣ÷α≥ⁿ',
  203.         18=>'Γε±σ∞φαΣ÷α≥ⁿ',
  204.         19=>'ΣσΓ ≥φαΣ÷α≥ⁿ'
  205.         );
  206.  
  207.     /**
  208.      * The array containing the tens' names
  209.      * @var array
  210.      * @access private
  211.      */
  212.     var $_tens = array(
  213.         2=>'ΣΓαΣ÷α≥ⁿ',
  214.         3=>'≥≡ΦΣ÷α≥ⁿ',
  215.         4=>'±ε≡εΩ',
  216.         5=>'∩ ≥ⁿΣσ± ≥',
  217.         6=>'°σ±≥ⁿΣσ± ≥',
  218.         7=>'±σ∞ⁿΣσ± ≥',
  219.         8=>'Γε±σ∞ⁿΣσ± ≥',
  220.         9=>'ΣσΓ φε±≥ε'
  221.         );
  222.  
  223.     /**
  224.      * The array containing the hundreds' names
  225.      * @var array
  226.      * @access private
  227.      */
  228.     var $_hundreds = array(
  229.         1=>'±≥ε',
  230.         2=>'ΣΓσ±≥Φ',
  231.         3=>'≥≡Φ±≥α',
  232.         4=>'≈σ≥√≡σ±≥α',
  233.         5=>'∩ ≥ⁿ±ε≥',
  234.         6=>'°σ±≥ⁿ±ε≥',
  235.         7=>'±σ∞ⁿ±ε≥',
  236.         8=>'Γε±σ∞ⁿ±ε≥',
  237.         9=>'ΣσΓ ≥ⁿ±ε≥'
  238.         );
  239.  
  240.     /**
  241.      * The array containing the digits 
  242.      * for neutral, male and female
  243.      * @var array
  244.      * @access private
  245.      */
  246.     var $_digits = array(
  247.         array('φεδⁿ', 'εΣφε', 'ΣΓα', '≥≡Φ', '≈σ≥√≡σ','∩ ≥ⁿ', '°σ±≥ⁿ', '±σ∞ⁿ', 'Γε±σ∞ⁿ', 'ΣσΓ ≥ⁿ'),
  248.         array('φεδⁿ', 'εΣΦφ', 'ΣΓα', '≥≡Φ', '≈σ≥√≡σ','∩ ≥ⁿ', '°σ±≥ⁿ', '±σ∞ⁿ', 'Γε±σ∞ⁿ', 'ΣσΓ ≥ⁿ'),
  249.         array('φεδⁿ', 'εΣφα', 'ΣΓσ', '≥≡Φ', '≈σ≥√≡σ','∩ ≥ⁿ', '°σ±≥ⁿ', '±σ∞ⁿ', 'Γε±σ∞ⁿ', 'ΣσΓ ≥ⁿ')
  250.     );
  251.  
  252.     /**
  253.      * The word separator
  254.      * @var string
  255.      * @access private
  256.      */
  257.     var $_sep = ' ';
  258.  
  259.     /**
  260.      * The currency names (based on the below links,
  261.      * informations from central bank websites and on encyclopedias)
  262.      *
  263.      * @var array
  264.      * @link http://www.jhall.demon.co.uk/currency/by_abbrev.html World currencies
  265.      * @link http://www.rusimpex.ru/Content/Reference/Refinfo/valuta.htm Foreign currencies names
  266.      * @link http://www.cofe.ru/Finance/money.asp Currencies names
  267.      * @access private
  268.      */
  269.     var $_currency_names = array(
  270.       'ALL' => array(
  271.                 array(1,'δσΩ','δσΩα','δσΩεΓ'), 
  272.                 array(2,'ΩΦφΣα≡Ωα','ΩΦφΣα≡ΩΦ','ΩΦφΣα≡εΩ')
  273.                ),
  274.       'AUD' => array(
  275.                 array(1,'αΓ±≥≡αδΦΘ±ΩΦΘ Σεδδα≡','αΓ±≥≡αδΦΘ±ΩΦ⌡ Σεδδα≡α','αΓ±≥≡αδΦΘ±ΩΦ⌡ Σεδδα≡εΓ'),
  276.                 array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
  277.                ),
  278.       'BGN' => array(
  279.                 array(1,'δσΓ','δσΓα','δσΓεΓ'), 
  280.                 array(2,'±≥ε≥ΦφΩα','±≥ε≥ΦφΩΦ','±≥ε≥ΦφεΩ')
  281.                ),
  282.       'BRL' => array(
  283.                 array(1,'ß≡ατΦδⁿ±ΩΦΘ ≡σαδ','ß≡ατΦδⁿ±ΩΦ⌡ ≡σαδα','ß≡ατΦδⁿ±ΩΦ⌡ ≡σαδεΓ'), 
  284.                 array(1,'±σφ≥αΓε','±σφ≥αΓε','±σφ≥αΓε')
  285.                ),
  286.       'BYR' => array(
  287.                 array(1,'ßσδε≡≤±±ΩΦΘ ≡≤ßδⁿ','ßσδε≡≤±±ΩΦ⌡ ≡≤ßδ ','ßσδε≡≤±±ΩΦ⌡ ≡≤ßδσΘ'), 
  288.                 array(2,'Ωε∩σΘΩα','Ωε∩σΘΩΦ','Ωε∩σσΩ')
  289.                ),
  290.       'CAD' => array(
  291.                 array(1,'ΩαφαΣ±ΩΦΘ Σεδδα≡','ΩαφαΣ±ΩΦ⌡ Σεδδα≡α','ΩαφαΣ±ΩΦ⌡ Σεδδα≡εΓ'),
  292.                 array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
  293.                ),
  294.       'CHF' => array(
  295.                 array(1,'°ΓσΘ÷α≡±ΩΦΘ ⌠≡αφΩ','°ΓσΘ÷α≡±ΩΦ⌡ ⌠≡αφΩα','°ΓσΘ÷α≡±ΩΦ⌡ ⌠≡αφΩεΓ'),
  296.                 array(1,'±αφ≥Φ∞','±αφ≥Φ∞α','±αφ≥Φ∞εΓ')
  297.                ),
  298.       'CYP' => array(
  299.                 array(1,'ΩΦ∩≡±ΩΦΘ ⌠≤φ≥','ΩΦ∩≡±ΩΦ⌡ ⌠≤φ≥α','ΩΦ∩≡±ΩΦ⌡ ⌠≤φ≥εΓ'),
  300.                 array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
  301.                ),
  302.       'CZK' => array(
  303.                 array(2,'≈σ°±Ωα  Ω≡εφα','≈σ°±ΩΦ⌡ Ω≡εφ√','≈σ°±ΩΦ⌡ Ω≡εφ'),
  304.                 array(1,'παδΦ≡µ','παδΦ≡µα','παδΦ≡µσΘ')
  305.                ),
  306.       'DKK' => array(
  307.                 array(2,'Σα≥±Ωα  Ω≡εφα','Σα≥±ΩΦ⌡ Ω≡εφ√','Σα≥±ΩΦ⌡ Ω≡εφ'),
  308.                 array(1,'²≡σ','²≡σ','²≡σ')
  309.                ),
  310.       'EEK' => array(
  311.                 array(2,'²±≥εφ±Ωα  Ω≡εφα','²±≥εφ±ΩΦ⌡ Ω≡εφ√','²±≥εφ±ΩΦ⌡ Ω≡εφ'),
  312.                 array(1,'±σφ≥Φ','±σφ≥Φ','±σφ≥Φ')
  313.                ),
  314.       'EUR' => array(
  315.                 array(1,'σΓ≡ε','σΓ≡ε','σΓ≡ε'),
  316.                 array(1,'σΓ≡ε÷σφ≥','σΓ≡ε÷σφ≥α','σΓ≡ε÷σφ≥εΓ')
  317.                ),
  318.       'CYP' => array(
  319.                 array(1,'⌠≤φ≥ ±≥σ≡δΦφπεΓ','⌠≤φ≥α ±≥σ≡δΦφπεΓ','⌠≤φ≥εΓ ±≥σ≡δΦφπεΓ'),
  320.                 array(1,'∩σφ±','∩σφ±α','∩σφ±εΓ')
  321.                ),
  322.       'CAD' => array(
  323.                 array(1,'πεφΩεφπ±ΩΦΘ Σεδδα≡','πεφΩεφπ±ΩΦ⌡ Σεδδα≡α','πεφΩεφπ±ΩΦ⌡ Σεδδα≡εΓ'),
  324.                 array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
  325.                ),
  326.       'HRK' => array(
  327.                 array(2,'⌡ε≡Γα≥±Ωα  Ω≤φα','⌡ε≡Γα≥±ΩΦ⌡ Ω≤φ√','⌡ε≡Γα≥±ΩΦ⌡ Ω≤φ'),
  328.                 array(2,'δΦ∩α','δΦ∩√','δΦ∩')
  329.                ),
  330.       'HUF' => array(
  331.                 array(1,'Γσφπσ≡±ΩΦΘ ⌠ε≡Φφ≥','Γσφπσ≡±ΩΦ⌡ ⌠ε≡Φφ≥α','Γσφπσ≡±ΩΦ⌡ ⌠ε≡Φφ≥εΓ'),
  332.                 array(1,'⌠Φδδσ≡','⌠Φδδσ≡α','⌠Φδδσ≡εΓ')
  333.                ),
  334.       'ISK' => array(
  335.                 array(2,'Φ±δαφΣ±Ωα  Ω≡εφα','Φ±δαφΣ±ΩΦ⌡ Ω≡εφ√','Φ±δαφΣ±ΩΦ⌡ Ω≡εφ'),
  336.                 array(1,'²≡σ','²≡σ','²≡σ')
  337.                ),
  338.       'JPY' => array(
  339.                 array(2,'Φσφα','Φσφ√','Φσφ'),
  340.                 array(2,'±σφα','±σφ√','±σφ')
  341.                ),
  342.       'LTL' => array(
  343.                 array(1,'δΦ≥','δΦ≥α','δΦ≥εΓ'),
  344.                 array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
  345.                ),
  346.       'LVL' => array(
  347.                 array(1,'δα≥','δα≥α','δα≥εΓ'),
  348.                 array(1,'±σφ≥Φ∞','±σφ≥Φ∞α','±σφ≥Φ∞εΓ')
  349.                ),
  350.       'MKD' => array(
  351.                 array(1,'∞αΩσΣεφ±ΩΦΘ ΣΦφα≡','∞αΩσΣεφ±ΩΦ⌡ ΣΦφα≡α','∞αΩσΣεφ±ΩΦ⌡ ΣΦφα≡εΓ'),
  352.                 array(1,'ΣσφΦ','ΣσφΦ','ΣσφΦ')
  353.                ),
  354.       'MTL' => array(
  355.                 array(2,'∞αδⁿ≥ΦΘ±Ωα  δΦ≡α','∞αδⁿ≥ΦΘ±ΩΦ⌡ δΦ≡√','∞αδⁿ≥ΦΘ±ΩΦ⌡ δΦ≡'),
  356.                 array(1,'±σφ≥Φ∞','±σφ≥Φ∞α','±σφ≥Φ∞εΓ')
  357.                ),
  358.       'NOK' => array(
  359.                 array(2,'φε≡Γσµ±Ωα  Ω≡εφα','φε≡Γσµ±ΩΦ⌡ Ω≡εφ√','φε≡Γσµ±ΩΦ⌡ Ω≡εφ'),
  360.                 array(0,'²≡σ','²≡σ','²≡σ')
  361.                ),
  362.       'PLN' => array(
  363.                 array(1,'τδε≥√Θ','τδε≥√⌡','τδε≥√⌡'),
  364.                 array(1,'π≡ε°','π≡ε°α','π≡ε°σΘ')
  365.                ),
  366.       'ROL' => array(
  367.                 array(1,'≡≤∞√φ±ΩΦΘ δσΘ','≡≤∞√φ±ΩΦ⌡ δσΘ','≡≤∞√φ±ΩΦ⌡ δσΘ'),
  368.                 array(1,'ßαφΦ','ßαφΦ','ßαφΦ')
  369.                ),
  370.        // both RUR and RUR are used, I use RUB for shorter form
  371.       'RUB' => array(
  372.                 array(1,'≡≤ßδⁿ','≡≤ßδ ','≡≤ßδσΘ'),
  373.                 array(2,'Ωε∩σΘΩα','Ωε∩σΘΩΦ','Ωε∩σσΩ')
  374.                ),
  375.       'RUR' => array(
  376.                 array(1,'≡ε±±ΦΘ±ΩΦΘ ≡≤ßδⁿ','≡ε±±ΦΘ±ΩΦ⌡ ≡≤ßδ ','≡ε±±ΦΘ±ΩΦ⌡ ≡≤ßδσΘ'),
  377.                 array(2,'Ωε∩σΘΩα','Ωε∩σΘΩΦ','Ωε∩σσΩ')
  378.                ),
  379.       'SEK' => array(
  380.                 array(2,'°ΓσΣ±Ωα  Ω≡εφα','°ΓσΣ±ΩΦ⌡ Ω≡εφ√','°ΓσΣ±ΩΦ⌡ Ω≡εφ'),
  381.                 array(1,'²≡σ','²≡σ','²≡σ')
  382.                ),
  383.       'SIT' => array(
  384.                 array(1,'±δεΓσφ±ΩΦΘ ≥εδα≡','±δεΓσφ±ΩΦ⌡ ≥εδα≡α','±δεΓσφ±ΩΦ⌡ ≥εδα≡εΓ'),
  385.                 array(2,'±≥ε≥Φφα','±≥ε≥Φφ√','±≥ε≥Φφ')
  386.                ),
  387.       'SKK' => array(
  388.                 array(2,'±δεΓα÷Ωα  Ω≡εφα','±δεΓα÷ΩΦ⌡ Ω≡εφ√','±δεΓα÷ΩΦ⌡ Ω≡εφ'),
  389.                 array(0,'','','')
  390.                ),
  391.       'TRL' => array(
  392.                 array(2,'≥≤≡σ÷Ωα  δΦ≡α','≥≤≡σ÷ΩΦ⌡ δΦ≡√','≥≤≡σ÷ΩΦ⌡ δΦ≡'),
  393.                 array(1,'∩Φα±≥≡','∩Φα±≥≡α','∩Φα±≥≡εΓ')
  394.                ),
  395.       'UAH' => array(
  396.                 array(2,'π≡ΦΓφα','π≡ΦΓφ√','π≡ΦΓσφ'),
  397.                 array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
  398.                ),
  399.       'USD' => array(
  400.                 array(1,'Σεδδα≡ ╤╪└','Σεδδα≡α ╤╪└','Σεδδα≡εΓ ╤╪└'),
  401.                 array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
  402.                ),
  403.       'YUM' => array(
  404.                 array(1,'■πε±δαΓ±ΩΦΘ ΣΦφα≡','■πε±δαΓ±ΩΦ⌡ ΣΦφα≡α','■πε±δαΓ±ΩΦ⌡ ΣΦφα≡εΓ'),
  405.                 array(1,'∩α≡α','∩α≡α','∩α≡α')
  406.                ),
  407.       'ZAR' => array(
  408.                 array(1,'≡αφΣ','≡αφΣα','≡αφΣεΓ'),
  409.                 array(1,'÷σφ≥','÷σφ≥α','÷σφ≥εΓ')
  410.                )
  411.     );
  412.  
  413.     /**
  414.      * The default currency name
  415.      * @var string
  416.      * @access public
  417.      */
  418.     var $def_currency = 'RUB'; // Russian rouble
  419.  
  420.     // }}}
  421.     // {{{ toWords()
  422.  
  423.     /**
  424.      * Converts a number to its word representation
  425.      * in Russian language
  426.      *
  427.      * @param  integer $num   An integer between -infinity and infinity inclusive :)
  428.      *                        that need to be converted to words
  429.      * @param  integer $gender Gender of string, 0=neutral, 1=male, 2=female.
  430.      *                         Optional, defaults to 1.
  431.      *
  432.      * @return string  The corresponding word representation
  433.      *
  434.      * @access private
  435.      * @author Andrey Demenev <demenev@on-line.jar.ru>
  436.      */
  437.     function toWords($num, $gender = 1) 
  438.     {
  439.         return $this->_toWordsWithCase($num, $dummy, $gender);
  440.     }
  441.  
  442.     /**
  443.      * Converts a number to its word representation
  444.      * in Russian language and determines the case of string.
  445.      *
  446.      * @param  integer $num   An integer between -infinity and infinity inclusive :)
  447.      *                        that need to be converted to words
  448.      * @param  integer $case A variable passed by reference which is set to case
  449.      *                       of the word associated with the number
  450.      * @param  integer $gender Gender of string, 0=neutral, 1=male, 2=female.
  451.      *                         Optional, defaults to 1.
  452.      *
  453.      * @return string  The corresponding word representation
  454.      *
  455.      * @access private
  456.      * @author Andrey Demenev <demenev@on-line.jar.ru>
  457.      */
  458.     function _toWordsWithCase($num, &$case, $gender = 1)
  459.     {
  460.       $ret = '';
  461.       $case = 3;
  462.       
  463.       $num = trim($num);
  464.       
  465.       $sign = "";
  466.       if (substr($num, 0, 1) == '-') {
  467.         $sign = $this->_minus . $this->_sep;
  468.         $num = substr($num, 1);
  469.       }
  470.  
  471.       while (strlen($num) % 3) $num = '0' . $num;
  472.       if ($num == 0 || $num == '') {
  473.         $ret .= $this->_digits[$gender][0];
  474.       }
  475.       
  476.       else {
  477.         $power = 0;
  478.         while ($power < strlen($num)) {
  479.             if (!$power) {
  480.                 $groupgender = $gender;
  481.             } elseif ($power == 3) {
  482.                 $groupgender = 2;
  483.             } else {
  484.                 $groupgender = 1;
  485.             }
  486.             $group = $this->_groupToWords(substr($num,-$power-3,3),$groupgender,$_case);
  487.             if (!$power) {
  488.                 $case = $_case;
  489.             }
  490.             if ($power == 3) {
  491.                 if ($_case == 1) {
  492.                     $group .= $this->_sep . '≥√± ≈α';
  493.                 } elseif ($_case == 2) {
  494.                     $group .= $this->_sep . '≥√± ≈Φ';
  495.                 } else {
  496.                     $group .= $this->_sep . '≥√± ≈';
  497.                 }
  498.             } elseif ($group && $power>3 && isset($this->_exponent[$power])) {
  499.                 $group .= $this->_sep . $this->_exponent[$power];
  500.                 if ($_case == 2) {
  501.                     $group .= 'α';
  502.                 } elseif ($_case == 3) {
  503.                     $group .= 'εΓ';
  504.                 }
  505.             }
  506.             if ($group) {
  507.                 $ret = $group . $this->_sep . $ret;
  508.             }
  509.             $power+=3;
  510.         }
  511.       }
  512.  
  513.       return $sign . $ret;
  514.     }
  515.  
  516.     // }}}
  517.     // {{{ _groupToWords()
  518.  
  519.     /**
  520.      * Converts a group of 3 digits to its word representation
  521.      * in Russian language.
  522.      *
  523.      * @param  integer $num   An integer between -infinity and infinity inclusive :)
  524.      *                        that need to be converted to words
  525.      * @param  integer $gender Gender of string, 0=neutral, 1=male, 2=female.
  526.      * @param  integer $case A variable passed by reference which is set to case
  527.      *                       of the word associated with the number
  528.      *
  529.      * @return string  The corresponding word representation
  530.      *
  531.      * @access private
  532.      * @author Andrey Demenev <demenev@on-line.jar.ru>
  533.      */
  534.     function _groupToWords($num, $gender, &$case)
  535.     {
  536.       $ret = '';        
  537.       $case = 3;
  538.       if ((int)$num == 0) {
  539.           $ret = '';
  540.       } elseif ($num < 10) {
  541.           $ret = $this->_digits[$gender][(int)$num];
  542.           if ($num == 1) $case = 1;
  543.           elseif ($num < 5) $case = 2;
  544.           else $case = 3;
  545.       } else {
  546.           $num = str_pad($num,3,'0',STR_PAD_LEFT);
  547.           $hundreds = (int)$num{0};
  548.           if ($hundreds) {
  549.               $ret = $this->_hundreds[$hundreds];
  550.               if (substr($num,1) != '00') {
  551.                   $ret .= $this->_sep;
  552.               }
  553.               $case = 3;
  554.           }
  555.           $tens=(int)$num{1};
  556.           $ones=(int)$num{2};
  557.           if ($tens || $ones) {
  558.               if ($tens == 1 && $ones == 0) $ret .= 'Σσ± ≥ⁿ';
  559.               elseif ($tens == 1) $ret .= $this->_teens[$ones+10];
  560.               else {
  561.                   if ($tens > 0) {
  562.                       $ret .= $this->_tens[(int)$tens];
  563.                   }
  564.                   if ($ones > 0) {
  565.                       $ret .= $this->_sep
  566.                           .$this->_digits[$gender][$ones];
  567.                       if ($ones == 1) {
  568.                           $case = 1;
  569.                       } elseif ($ones < 5) {
  570.                           $case = 2;
  571.                       } else {
  572.                           $case = 3;
  573.                       }
  574.                   }
  575.               }
  576.           }
  577.       }
  578.       return $ret;
  579.     }
  580.     // }}}
  581.     // {{{ toCurrencyWords()
  582.  
  583.     /**
  584.      * Converts a currency value to its word representation
  585.      * (with monetary units) in Russian language
  586.      *
  587.      * @param  integer $int_curr An international currency symbol
  588.      *                 as defined by the ISO 4217 standard (three characters)
  589.      * @param  integer $decimal A money total amount without fraction part (e.g. amount of dollars)
  590.      * @param  integer $fraction Fractional part of the money amount (e.g. amount of cents)
  591.      *                 Optional. Defaults to false.
  592.      * @param  integer $convert_fraction Convert fraction to words (left as numeric if set to false).
  593.      *                 Optional. Defaults to true.
  594.      *
  595.      * @return string  The corresponding word representation for the currency
  596.      *
  597.      * @access public
  598.      * @author Andrey Demenev <demenev@on-line.jar.ru>
  599.      */
  600.     function toCurrencyWords($int_curr, $decimal, $fraction = false, $convert_fraction = true)
  601.     {
  602.         $int_curr = strtoupper($int_curr);
  603.         if (!isset($this->_currency_names[$int_curr])) {
  604.             $int_curr = $this->def_currency;
  605.         }
  606.         $curr_names = $this->_currency_names[$int_curr];
  607.         $ret = trim($this->_toWordsWithCase($decimal, $case, $curr_names[0][0]));
  608.         $ret .= $this->_sep . $curr_names[0][$case];
  609.  
  610.         if ($fraction !== false) {
  611.             if ($convert_fraction) {
  612.                 $ret .= $this->_sep . trim($this->_toWordsWithCase($fraction, $case, $curr_names[1][0]));
  613.             } else {
  614.                 $ret .= $this->_sep . $fraction;
  615.             }
  616.             $ret .= $this->_sep . $curr_names[1][$case];
  617.         }
  618.         return $ret;
  619.     }
  620.     // }}}
  621.  
  622. }
  623.  
  624. ?>
  625.