Module: When::Coordinates

Included in:
TM::Calendar, TM::Clock, TM::PeriodDuration, TM::TemporalPosition, TM::TemporalPosition, V::Event::Enumerator
Defined in:
lib/when_exe/spatial.rb,
lib/when_exe/coordinates.rb,
lib/when_exe/region/bahai.rb,
lib/when_exe/region/mayan.rb,
lib/when_exe/region/indian.rb,
lib/when_exe/region/chinese.rb,
lib/when_exe/region/chinese.rb,
lib/when_exe/region/iranian.rb,
lib/when_exe/region/residue.rb,
lib/when_exe/region/russian.rb,
lib/when_exe/region/tibetan.rb,
lib/when_exe/region/balinese.rb,
lib/when_exe/region/javanese.rb,
lib/when_exe/region/location.rb,
lib/when_exe/region/christian.rb,
lib/when_exe/region/japanese/location.rb,
lib/when_exe/region/japanese/residues.rb,
lib/when_exe/inspect.rb,
lib/when_exe.rb

Overview

Copyright © 2012-2016 Takashi SUGA

You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.

Defined Under Namespace

Modules: Temporal Classes: Border, Branch, CalendarBorder, DayBorder, Easter, Index, Kyusei, LeapSeconds, MultiBorder, Pair, Residue, Spatial, Stem, StemBranch, Sunrise, Sunset, Wuku

Constant Summary collapse

PRECISION =

変換テーブル

{'YEAR'=>When::YEAR, 'MONTH' =>When::MONTH,  'WEEK'  =>When::WEEK,   'DAY'   =>When::DAY,
'HOUR'=>When::HOUR, 'MINUTE'=>When::MINUTE, 'SECOND'=>When::SECOND, 'SYSTEM'=>When::SYSTEM}
PERIOD =
{'P1Y' =>When::YEAR, 'P1M'   =>When::MONTH,  'P1W'   =>When::WEEK,   'P1D'   =>When::DAY,
'PT1H'=>When::HOUR, 'PT1M'  =>When::MINUTE, 'PT1S'  =>When::SECOND,
'1Y'  =>When::YEAR, '1M'    =>When::MONTH,  '1W'    =>When::WEEK,   '1D'    =>When::DAY,
'1h'  =>When::HOUR, '1m'    =>When::MINUTE, '1s'    =>When::SECOND}
VALUE =

RFC 5545

{'DATE'=>When::DAY,  'TIME'  =>When::SYSTEM, 'DATE-TIME'=>When::SYSTEM}
PRECISION_NAME =
PRECISION.invert
PERIOD_NAME =
{When::YEAR=>'P1Y' , When::MONTH=>'P1M',   When::WEEK  =>'P1W', When::DAY=>'P1D',
When::HOUR=>'PT1H', When::MINUTE=>'PT1M', When::SECOND=>'PT1S'}
MATCH =
{'NS'=>/(N|S|北緯|南緯)/, 'EW'=>/(E|W|東経|西経)/}
Bahai =

Bahai years

[When::BasicTypes::M17n, [
  "locale:[=en:, ar=ar:, alias=en:]",
  "names:[Bahá'í Faith, بهائية, ja:バハーイー教, *alias:Bahai=]",

  [Residue,
    "label:[year name=, ja:年の名前=, zh:該年的名稱=, *alias:YearName=]",
    "divisor:19", "year:1", "format:[%1$s(%3$d)=, (%3$d)%1$s=]",
    [Residue, "label:[Alif=,   ألف=,   A=            ]", "remainder:  0"],
    [Residue, "label:[Bá=,     باء=,   B=            ]", "remainder:  1"],
    [Residue, "label:[Ab=,     أب=,    Father=       ]", "remainder:  2"],
    [Residue, "label:[Dál=,    دﺍﻝ=,   D=            ]", "remainder:  3"],
    [Residue, "label:[Báb=,    باب=,   Gate=         ]", "remainder:  4"],
    [Residue, "label:[Váv=,    وﺍو=,   V=            ]", "remainder:  5"],
    [Residue, "label:[Abad=,   أبد=,   Eternity=     ]", "remainder:  6"],
    [Residue, "label:[Jád=,    جاد=,   Generosity=   ]", "remainder:  7"],
    [Residue, "label:[Bahá'=,  بهاء=,  Splendour=    ]", "remainder:  8"],
    [Residue, "label:[Ḥubb=,   حب=,    Love=         ]", "remainder:  9"],
    [Residue, "label:[Bahháj=, بهاج=,  Delightful=   ]", "remainder: 10"],
    [Residue, "label:[Javáb=,  جواب=,  Answer=       ]", "remainder: 11"],
    [Residue, "label:[Aḥad=,   احد=,   Single=       ]", "remainder: 12"],
    [Residue, "label:[Vahháb=, بهاء=,  Bountiful=    ]", "remainder: 13"],
    [Residue, "label:[Vidád=,  وداد=,  Affection=    ]", "remainder: 14"],
    [Residue, "label:[Badí‘=, بدیع=,  Beginning=    ]", "remainder: 15"],
    [Residue, "label:[Bahí=,   بهي=,   Luminous=     ]", "remainder: 16"],
    [Residue, "label:[Abhá=,   ابهى=,  Most Luminous=]", "remainder: 17"],
    [Residue, "label:[Váḥid=,  واحد=,  Unity=        ]", "remainder: 18"]
  ]
]]
Mayan =

Mayan Residue

[{'Epoch' => Hash.new {|hash, key|
                       epoch = key.to_i
                       hash[key] = key ? {
                         'Haab'    => ((300 + epoch) % 365).to_s,
                         'Trecena' => ((  8 + epoch) %  13).to_s,
                         'Tzolkin' => ((  4 + epoch) %  20).to_s,
                         'LoN'     => ((  3 + epoch) %   9).to_s
                       } : nil
                     }}, BasicTypes::M17n, [
  "locale:[=en:, ja=ja:, alias]",
  "names:[Mayan]",

  [Residue,
    "label:[Haab', ハアブ, Haab]", "divisor:365", 'day:#{Haab:300}', "format:[%2$d%1$s/365=]",
    "namespace:[glyph=https://en.wikipedia.org/wiki/File:]",
    [Residue, "label:[Pop     =glyph:Maya-Pop.jpg,            ポプ,        Pop   ]", "remainder:  0"],
    [Residue, "label:[Wo'     =glyph:Maya-Dresden-wo.jpg,     ウオ,        Wo    ]", "remainder: 20"],
    [Residue, "label:[Sip     =glyph:Maya-Dresden-sip.jpg,    シプ,        Sip   ]", "remainder: 40"],
    [Residue, "label:[Sotz'   =glyph:Sotz.jpg,                ソッツ,      Sotz  ]", "remainder: 60"],
    [Residue, "label:[Sek     =glyph:Maya-Dresden-Sek.jpg,    セック,      Sek   ]", "remainder: 80"],
    [Residue, "label:[Xul     =glyph:Maya-Xul.png,            シュル,      Xul   ]", "remainder:100"],
    [Residue, "label:[Yaxk'in'=glyph:Maya-Dresden-Yaxkin.jpg, ヤシュキン=, Yaxkin]", "remainder:120"],
    [Residue, "label:[Mol     =glyph:Maya-Mol.png,            モル=,       Mol   ]", "remainder:140"],
    [Residue, "label:[Ch'en   =glyph:Maya-Dresden-Chen.jpg,   チェン,      Chen  ]", "remainder:160"],
    [Residue, "label:[Yax     =glyph:Maya-Dresden-Yax.jpg,    ヤシュ=,     Yax   ]", "remainder:180"],
    [Residue, "label:[Sak'    =glyph:Maya-Dresden-Sak.jpg,    サック,      Sak   ]", "remainder:200"],
    [Residue, "label:[Keh     =glyph:Maya-Dresden-Keh.jpg,    ケフ,        Keh   ]", "remainder:220"],
    [Residue, "label:[Mak     =glyph:Maya-Dresden-Mak.png,    マック=,     Mak   ]", "remainder:240"],
    [Residue, "label:[K'ank'in=glyph:Maya-Dresden-Kankin.png, カンキン,    Kankin]", "remainder:260"],
    [Residue, "label:[Muwan'  =glyph:Muan.jpg,                ムアン=,     Muwan ]", "remainder:280"],
    [Residue, "label:[Pax     =glyph:Maya-Dresden-pax.jpg,    パシュ=,     Pax   ]", "remainder:300"],
    [Residue, "label:[K'ayab  =glyph:Maya-Dresden-Kayab.png,  カヤブ,      Kayab ]", "remainder:320"],
    [Residue, "label:[Kumk'u  =glyph:Maya-Dresden-kumku.jpg,  クムク,      Kumku ]", "remainder:340"],
    [Residue, "label:[Wayeb'  =glyph:Maya-Dresden-wayeb.jpg,  ウェヤブ=,   Wayeb ]", "remainder:360"]
  ],

  [Residue,
    "label:[Tzolk'in, ツォルキン, *Trecena]", "divisor:13",
    [Residue,
      "label:[Trecena, トレセナ=, Trecena]", "divisor:13", 'day:#{Trecena:8}', "format:[%1$s(%3$d/13)=]"
    ],
  ],

  [Residue,
    "namespace:[glyph=https://en.wikipedia.org/wiki/File:MAYA-g-log-cal-]",
    "label:[Tzolk'in, ツォルキン, Tzolkin]", "divisor:20", 'day:#{Tzolkin:4}', "format:[%s(%d/20)=]",
    [Residue, "label:[Imix'   =glyph:D01-Imix.png,     イミシュ,   Imix    =glyph:D01-Imix-cdxW.png    ]", "remainder: 0"],
    [Residue, "label:[Ik'     =glyph:D02-Ik.png,       イック,     Ik      =glyph:D02-Ik-cdxW.png      ]", "remainder: 1"],
    [Residue, "label:[Ak'b'al =glyph:D03-Akbal.png,    アクバル,   Akbal   =glyph:D03-Akbal-cdxW.png   ]", "remainder: 2"],
    [Residue, "label:[K'an    =glyph:D04-Kan.png,      カン,       Kan     =glyph:D04-Kan-cdxW.png     ]", "remainder: 3"],
    [Residue, "label:[Chikchan=glyph:D05-Chikchan.png, チクチャン, Chicchan=glyph:D05-Chikchan-cdxW.png]", "remainder: 4"],
    [Residue, "label:[Kimi    =glyph:D06-Kimi.png,     キミ,       Cimi    =glyph:D06-Kimi-cdxW.png    ]", "remainder: 5"],
    [Residue, "label:[Manik'  =glyph:D07-Manik.png,    マニク,     Manik   =glyph:D07-Manik-cdxW.png   ]", "remainder: 6"],
    [Residue, "label:[Lamat   =glyph:D08-Lamat.png,    ラマト,     Lamat   =glyph:D08-Lamat-cdxW.png   ]", "remainder: 7"],
    [Residue, "label:[Muluk   =glyph:D09-Muluk.png,    ムルク,     Muluc   =glyph:D09-Muluk-cdxW.png   ]", "remainder: 8"],
    [Residue, "label:[Ok      =glyph:D10-Ok.png,       オック=,     Oc      =glyph:D10-Ok-cdxW.png     ]", "remainder: 9"],
    [Residue, "label:[Chuwen  =glyph:D11-Chuwen.png,   チュエン=,   Chuen   =glyph:D11-Chuwen-cdxW.png ]", "remainder:10"],
    [Residue, "label:[Eb'     =glyph:D12-Eb.png,       エブ=,       Eb      =glyph:D12-Eb-cdxW.png     ]", "remainder:11"],
    [Residue, "label:[B'en    =glyph:D13-Ben.png, ベン=ja:%%<ベン_(マヤ暦)>, Ben=glyph:D13-Ben-cdxW.png]", "remainder:12"],
    [Residue, "label:[Ix      =glyph:D14-Ix.png,       イシュ=,     Ix      =glyph:D14-Ix-cdxW.png     ]", "remainder:13"],
    [Residue, "label:[Men     =glyph:D15-Men.png,      メン=,       Men     =glyph:D15-Men-cdxW.png    ]", "remainder:14"],
    [Residue, "label:[Kib'    =glyph:D16-Kib.png,      キッブ=,     Cib     =glyph:D16-Kib-cdxW.png    ]", "remainder:15"],
    [Residue, "label:[Kab'an  =glyph:D17-Kaban.png,    カーバン=,   Caban   =glyph:D17-Kaban-cdxW.png  ]", "remainder:16"],
    [Residue, "label:[Etz'nab'=glyph:D18-Etznab.png,   エツナブ=,   Etznab  =glyph:D18-Etznab-cdxW.png ]", "remainder:17"],
    [Residue, "label:[Kawak   =glyph:D19-Kawak.png,    カワク=,     Cauac   =glyph:D19-Kawak-cdxW.png  ]", "remainder:18"],
    [Residue, "label:[Ajaw    =glyph:D20-Ajaw.png,     アハウ=,     Ahau    =glyph:D20-Ajaw-cdxW.png   ]", "remainder:19"],
  ],

  [Residue,
    "namespace:[glyph=http://www.pauahtun.org/G/G]",
    "label:[Lords_of_the_Night, 夜の九王=]", "divisor:9", 'day:#{LoN:3}', "format:[%s(%d/9)=]",
    [Residue, "label:[G9=glyph:9_m.png]", "remainder: 0"],
    [Residue, "label:[G1=glyph:1_m.png]", "remainder: 1"],
    [Residue, "label:[G2=glyph:2_m.png]", "remainder: 2"],
    [Residue, "label:[G3=glyph:3_m.png]", "remainder: 3"],
    [Residue, "label:[G4=glyph:4_m.png]", "remainder: 4"],
    [Residue, "label:[G5=glyph:5_m.png]", "remainder: 5"],
    [Residue, "label:[G6=glyph:6_m.png]", "remainder: 6"],
    [Residue, "label:[G7=glyph:7_m.png]", "remainder: 7"],
    [Residue, "label:[G8=glyph:8_m.png]", "remainder: 8"],
  ],
]]
Indian =

Location of cities in India

[When::BasicTypes::M17n, [
  "locale:[=en:, ja=ja:, alias]",
  "names:[Indian=en:India, インド, zh:印度]",
  [Spatial, "long:+82.5", "lat:N23.11", "label:[CentralIndia=,      インド中部=]"         ],
  [Spatial, "long:+82.5", "lat:+29.0",  "label:[NorthIndia=,        インド北部]"          ],
  [Spatial, "long:+78.0", "lat:+27.2",  "label:[Agra,               アーグラ]"            ],
  [Spatial, "long:+72.6", "lat:+23.0",  "label:[Ahmedabad,          アフマダーバード]"    ],
  [Spatial, "long:+74.6", "lat:+26.5",  "label:[Ajmer,              アジメール]"          ],
  [Spatial, "long:+78.1", "lat:+27.9",  "label:[Aligarh,            アリーガル]"          ],
  [Spatial, "long:+74.9", "lat:+31.6",  "label:[Amritsar,           アムリトサル]"        ],
  [Spatial, "long:+77.6", "lat:+13.0",  "label:[Bangalore,          バンガロール]"        ],
  [Spatial, "long:+85.8", "lat:+20.2",  "label:[Bhuvaneswar,        ブヴァネーシュヴァル]"],
  [Spatial, "long:+80.3", "lat:+13.1",  "label:[Chennai,            チェンナイ, Madras]"  ],
  [Spatial, "long:+79.9", "lat: +6.9",  "label:[Colombo,            コロンボ]"            ],
  [Spatial, "long:+90.4", "lat:+23.7",  "label:[Dacca,              ダッカ]"              ],
  [Spatial, "long:+77.2", "lat:+28.6",  "label:[Delhi,              デリー]"              ],
  [Spatial, "long:+78.5", "lat:+17.4",  "label:[Hyderabad,          ハイデラバード]"      ],
  [Spatial, "long:+75.8", "lat:+26.9",  "label:[Jaipur,             ジャイプル]"          ],
  [Spatial, "long:+85.2", "lat:+27.7",  "label:[Kathmandu,          カトマンズ]"          ],
  [Spatial, "long:+76.2", "lat:+10.0",  "label:[Kochi,              コーチ, Cochin]"      ],
  [Spatial, "long:+88.4", "lat:+22.6",  "label:[Kolkata,            コルカタ, Calcutta]"  ],
  [Spatial, "long:+74.3", "lat:+31.6",  "label:[Lahor,              ラホール]"            ],
  [Spatial, "long:+77.7", "lat:+27.5",  "label:[Mathura,            マトゥラー]"          ],
  [Spatial, "long:+72.8", "lat:+19.0",  "label:[Mumbai,             ムンバイ, Bombay]"    ],
  [Spatial, "long:+76.6", "lat:+12.3",  "label:[Mysore,             マイソール]"          ],
  [Spatial, "long:+85.1", "lat:+25.6",  "label:[Patna,              パトナ]"              ],
  [Spatial, "long:+73.9", "lat:+18.5",  "label:[Pune,               プネー]"              ],
  [Spatial, "long:+74.8", "lat:+34.1",  "label:[Srinagar,           シュリーナガル]"      ],
  [Spatial, "long:+77.0", "lat: +8.5",  "label:[Thiruvananthapuram, ティルヴァナンタプラム, Trivandrum]"],
  [Spatial, "long:+83.0", "lat:+25.3",  "label:[Varanasi,           ワーラーナシー]"      ],
  [Spatial, "long:+75.8", "lat:+23.2",  "label:[Ujjain,             ウッジャイン=]"       ]
]]
Chinese =

Location of cities in China

[When::BasicTypes::M17n, [
  "locale:[=ja:, en=en:, zh=zh:, alias]",
  "names:[中国, *China, 中國]",
  [Spatial,"long:116.2329E", "lat:39.5420N", "label:[北京, *Beijing]"]
]]
Yi =

Yi years

[When::BasicTypes::M17n, [
  "locale:[=ja:, en=en:, alias]",
  "names:[Yi]",

  [Residue,
    "label:[年の名前=, year name=, zh:該年的名稱=, *alias:YearName=]", "divisor:8", "year:0",
    [Residue, "label:[東北之年=, NorthEastYear=]", "remainder:  0"],
    [Residue, "label:[東方之年=, EastYear=     ]", "remainder:  1"],
    [Residue, "label:[東南之年=, SouthEastYear=]", "remainder:  2"],
    [Residue, "label:[南方之年=, SouthYear=    ]", "remainder:  3"],
    [Residue, "label:[西南之年=, SouthWestYear=]", "remainder:  4"],
    [Residue, "label:[西方之年=, WestYear=     ]", "remainder:  5"],
    [Residue, "label:[西北之年=, NorthWestYear=]", "remainder:  6"],
    [Residue, "label:[北方之年=, NorthYear=    ]", "remainder:  7"]
  ]
]]
Iranian =

Location of cities in Iran

[When::BasicTypes::M17n, [
  "locale:[=en:, ja=ja:, alias]",
  "names:[Iranian]",
  [Spatial, "long:51.4045E", "lat:32.3905N", "label:[Isfahan, エスファハーン]"],
  [Spatial, "long:51.2523E", "lat:35.4146N", "label:[Tehran,  テヘラン      ]"]
]]
Common =

Common Residue

[{'V'=>{'0618'=>{'A'=>'Awakening Of Insects=en:Jingzhe,  *啓蟄,驚蟄',
                          'B'=>'Rain Water=en:Yushui_(solar_term),*雨水,雨水'}}}, When::BasicTypes::M17n, [
  "locale:[=en:, ja=ja:, zh=zh:, tenreki, tibetan, yi, alias]",
  "names:[Common]",

  [Residue,
    "label:[Week, 週]", "divisor:7", "day:0", "format:[%1$s(%2$d)=, ar:(%2$d)%1$s=]",
    [Residue, "label:[Monday,    月曜日, /date/day_names/1]", "remainder:0"],
    [Residue, "label:[Tuesday,   火曜日, /date/day_names/2]", "remainder:1"],
    [Residue, "label:[Wednesday, 水曜日, /date/day_names/3]", "remainder:2"],
    [Residue, "label:[Thursday,  木曜日, /date/day_names/4]", "remainder:3"],
    [Residue, "label:[Friday,    金曜日, /date/day_names/5]", "remainder:4"],
    [Residue, "label:[Saturday,  土曜日, /date/day_names/6]", "remainder:5"],
    [Residue, "label:[Sunday,    日曜日, /date/day_names/0]", "remainder:6"]
  ],

  [When::BasicTypes::M17n,
    "names:[Abbr_Day=, 週日略称=]",
    "[Mon, 月, /date/abbr_day_names/1] ",
    "[Tue, 火, /date/abbr_day_names/2] ",
    "[Wed, 水, /date/abbr_day_names/3] ",
    "[Thu, 木, /date/abbr_day_names/4] ",
    "[Fri, 金, /date/abbr_day_names/5] ",
    "[Sat, 土, /date/abbr_day_names/6] ",
    "[Sun, 日, /date/abbr_day_names/0] "
  ],

  [Residue,
    "locale:[=en:, ja=ja:, zh=zh:, alias]",
    "label:[LunarMansion=en:Lunar_mansion, *宿=ja:%%<月宿>]", "divisor:28", "day:17",   "format:[%s(%02d)=]",
    [Residue, "label:[Horn=,            *角宿, 角宿,  Jiăo= ]", "remainder:0"],  #  1 α Vir 
    [Residue, "label:[Neck=,            *亢宿, 亢宿,  Kàng= ]", "remainder:1"],  #  2 κ Vir 
    [Residue, "label:[Root=,            *氐宿, 氐宿,  Dĭ=   ]", "remainder:2"],  #  3 α Lib 
    [Residue, "label:[Room=,            *房宿, 房宿,  Fáng= ]", "remainder:3"],  #  4 π Sco 
    [Residue, "label:[Heart=,           *心宿, 心宿,  Xīn=  ]", "remainder:4"],  #  5 σ Sco 
    [Residue, "label:[Tail=,            *尾宿, 尾宿,  Wěi=  ]", "remainder:5"],  #  6 μ Sco 
    [Residue, "label:[WinnowingBasket=, *箕宿, 箕宿,  Jī=   ]", "remainder:6"],  #  7 γ Sgr 
    [Residue, "label:[SouthernDipper=,  *斗宿, 斗宿,  Dǒu= ]", "remainder:7"],  #  8 φ Sgr 
    [Residue, "label:[Ox=,              *牛宿, 牛宿,  Niú=  ]", "remainder:8"],  #  9 β Cap 
    [Residue, "label:[Girl=,            *女宿, 女宿,  Nǚ=  ]", "remainder:9"],  # 10 ε Aqr 
    [Residue, "label:[Emptiness=, *虛宿=ja:%%<虚宿>,虚宿,Xū=]", "remainder:10"], # 11 β Aqr 
    [Residue, "label:[Rooftop=,         *危宿, 危宿,  Wēi=  ]", "remainder:11"], # 12 α Aqr 
    [Residue, "label:[Encampment=,      *室宿, 室宿,  Shì=  ]", "remainder:12"], # 13 α Peg 
    [Residue, "label:[Wall=,            *壁宿, 壁宿,  Bì=   ]", "remainder:13"], # 14 γ Peg 
    [Residue, "label:[Legs=,            *奎宿, 奎宿,  Kuí=  ]", "remainder:14"], # 15 η And 
    [Residue, "label:[Bond=,            *婁宿, 婁宿,  Lóu=  ]", "remainder:15"], # 16 β Ari 
    [Residue, "label:[Stomach=,         *胃宿, 胃宿,  Wèi=  ]", "remainder:16"], # 17 35 Ari 
    [Residue, "label:[HairyHead=,       *昴宿, 昴宿,  Mǎo= ]", "remainder:17"], # 18 17 Tau 
    [Residue, "label:[Net=,             *畢宿, 畢宿,  Bì=   ]", "remainder:18"], # 19 ε Tau 
    [Residue, "label:[TurtleBeak=,      *觜宿, 觜宿,  Zī=   ]", "remainder:19"], # 20 λ Ori 
    [Residue, "label:[ThreeStars=,*參宿=ja:%%<参宿>,参宿,Shēn=]","remainder:20"],# 21 ζ Ori 
    [Residue, "label:[Well=,            *井宿, 井宿,  Jǐng=]", "remainder:21"], # 22 μ Gem 
    [Residue, "label:[Ghost=,           *鬼宿, 鬼宿,  Guǐ= ]", "remainder:22"], # 23 θ Cnc 
    [Residue, "label:[Willow=,          *柳宿, 柳宿,  Liǔ= ]", "remainder:23"], # 24 δ Hya 
    [Residue, "label:[Star=,            *星宿, 星宿,  Xīng= ]", "remainder:24"], # 25 α Hya 
    [Residue, "label:[ExtendedNet=,     *張宿, 張宿,  Zhāng=]", "remainder:25"], # 26 υ¹ Hya
    [Residue, "label:[Wings=,           *翼宿, 翼宿,  Yì=   ]", "remainder:26"], # 27 α Crt 
    [Residue, "label:[Chariot=,         *軫宿, 軫宿,  Zhěn= ]", "remainder:27"]  # 28 γ Crv 
  ],

  [Stem,
    "label:[Stem=en:Celestial_stem, *干=ja:%%<十干>, 天干]", "divisor:10", "day:11", "year:4",
    [Stem, "label:[Wood-yang=,  *甲, 甲, 甲=, 木男=, 木公=]", "remainder:0"],
    [Stem, "label:[Wood-yin=,   *乙, 乙, 乙=, 木女=, 木母=]", "remainder:1"],
    [Stem, "label:[Fire-yang=,  *丙, 丙, 丙=, 火男=, 火公=]", "remainder:2"],
    [Stem, "label:[Fire-yin=,   *丁, 丁, 丁=, 火女=, 火母=]", "remainder:3"],
    [Stem, "label:[Erath-yang=, *戊, 戊, 戊=, 土男=, 土公=]", "remainder:4"],
    [Stem, "label:[Erath-yin=,  *己, 己, 己=, 土女=, 土母=]", "remainder:5"],
    [Stem, "label:[Metal-yang=, *庚, 庚, 庚=, 金男=, 銅公=]", "remainder:6"],
    [Stem, "label:[Metal-yin=,  *辛, 辛, 辛=, 金女=, 銅母=]", "remainder:7"],
    [Stem, "label:[Water-yang=, *壬, 壬, 壬=, 水男=, 水公=]", "remainder:8"],
    [Stem, "label:[Water-yin=,  *癸, 癸, 癸=, 水女=, 水母=]", "remainder:9"]
  ],

  [Branch,
    "label:[Branch=en:Earthly_Branches, *支=ja:%%<十二支>, 地支]", "divisor:12", "day:11", "year:4",
    [Branch, "label:[Rat=,     *子, 子, 子=, 鼠=, 鼠=]", "remainder: 0"],
    [Branch, "label:[Ox=,      *丑, 丑, 好=, 牛=, 牛=]", "remainder: 1"],
    [Branch, "label:[Tiger=,   *寅, 寅, 寅=, 虎=, 虎=]", "remainder: 2"],
    [Branch, "label:[Rabbit=,  *卯, 卯, 栄=, 兎=, 兎=]", "remainder: 3"],
    [Branch, "label:[Dragon=,  *辰, 辰, 辰=, 龍=, 龍=]", "remainder: 4"],
    [Branch, "label:[Snake=,   *巳, 巳, 巳=, 蛇=, 蛇=]", "remainder: 5"],
    [Branch, "label:[Horse=,   *午, 午, 午=, 馬=, 馬=]", "remainder: 6"],
    [Branch, "label:[Goat=,    *未, 未, 未=, 羊=, 羊=]", "remainder: 7"],
    [Branch, "label:[Monkey=,  *申, 申, 申=, 猴=, 猴=]", "remainder: 8"],
    [Branch, "label:[Rooster=, *酉, 酉, 酉=, 鷄=, 鷄=]", "remainder: 9"],
    [Branch, "label:[Dog=,     *戌, 戌, 戌=, 狗=, 狗=]", "remainder:10"],
    [Branch, "label:[Pig=,     *亥, 亥, 開=, 猪=, 猪=]", "remainder:11"]
  ],

  [StemBranch,
    "label:[Stem-Branch=en:Sexagenary_cycle, *干支, 干支]", "divisor:60", "day:11", "year:4", "format:[%s(%02d)=]",
    [StemBranch, "label:[Wood-yang-Rat=,     *甲子, 甲子, 甲子=, 木男鼠=, 木公鼠=]", "remainder: 0"],
    [StemBranch, "label:[Wood-yin-Ox=,       *乙丑, 乙丑, 乙好=, 木女牛=, 木母牛=]", "remainder: 1"],
    [StemBranch, "label:[Fire-yang-Tiger=,   *丙寅, 丙寅, 丙寅=, 火男虎=, 火公虎=]", "remainder: 2"],
    [StemBranch, "label:[Fire-yin-Rabbit=,   *丁卯, 丁卯, 丁栄=, 火女兎=, 火母兎=]", "remainder: 3"],
    [StemBranch, "label:[Erath-yang-Dragon=, *戊辰, 戊辰, 戊辰=, 土男龍=, 土公龍=]", "remainder: 4"],
    [StemBranch, "label:[Erath-yin-Snake=,   *己巳, 己巳, 己巳=, 土女蛇=, 土母蛇=]", "remainder: 5"],
    [StemBranch, "label:[Metal-yang-Horse=,  *庚午, 庚午, 庚午=, 金男馬=, 銅公馬=]", "remainder: 6"],
    [StemBranch, "label:[Metal-yin-Goat=,    *辛未, 辛未, 辛未=, 金女羊=, 銅母羊=]", "remainder: 7"],
    [StemBranch, "label:[Water-yang-Monkey=, *壬申, 壬申, 壬申=, 水男猴=, 水公猴=]", "remainder: 8"],
    [StemBranch, "label:[Water-yin-Rooster=, *癸酉, 癸酉, 癸酉=, 水女鷄=, 水母鷄=]", "remainder: 9"],
    [StemBranch, "label:[Wood-yang-Dog=,     *甲戌, 甲戌, 甲戌=, 木男狗=, 木公狗=]", "remainder:10"],
    [StemBranch, "label:[Wood-yin-Pig=,      *乙亥, 乙亥, 乙開=, 木女猪=, 木母猪=]", "remainder:11"],
    [StemBranch, "label:[Fire-yang-Rat=,     *丙子, 丙子, 丙子=, 火男鼠=, 火公鼠=]", "remainder:12"],
    [StemBranch, "label:[Fire-yin-Ox=,       *丁丑, 丁丑, 丁好=, 火女牛=, 火母牛=]", "remainder:13"],
    [StemBranch, "label:[Erath-yang-Tiger=,  *戊寅, 戊寅, 戊寅=, 土男虎=, 土公虎=]", "remainder:14"],
    [StemBranch, "label:[Erath-yin-Rabbit=,  *己卯, 己卯, 己栄=, 土女兎=, 土母兎=]", "remainder:15"],
    [StemBranch, "label:[Metal-yang-Dragon=, *庚辰, 庚辰, 庚辰=, 金男龍=, 銅公龍=]", "remainder:16"],
    [StemBranch, "label:[Metal-yin-Snake=,   *辛巳, 辛巳, 辛巳=, 金女蛇=, 銅母蛇=]", "remainder:17"],
    [StemBranch, "label:[Water-yang-Horse=,  *壬午, 壬午, 壬午=, 水男馬=, 水公馬=]", "remainder:18"],
    [StemBranch, "label:[Water-yin-Goat=,    *癸未, 癸未, 癸未=, 水女羊=, 水母羊=]", "remainder:19"],
    [StemBranch, "label:[Wood-yang-Monkey=,  *甲申, 甲申, 甲申=, 木男猴=, 木公猴=]", "remainder:20"],
    [StemBranch, "label:[Wood-yin-Rooster=,  *乙酉, 乙酉, 乙酉=, 木女鷄=, 木母鷄=]", "remainder:21"],
    [StemBranch, "label:[Fire-yang-Dog=,     *丙戌, 丙戌, 丙戌=, 火男狗=, 火公狗=]", "remainder:22"],
    [StemBranch, "label:[Fire-yin-Pig=,      *丁亥, 丁亥, 丁開=, 火女猪=, 火母猪=]", "remainder:23"],
    [StemBranch, "label:[Erath-yang-Rat=,    *戊子, 戊子, 戊子=, 土男鼠=, 土公鼠=]", "remainder:24"],
    [StemBranch, "label:[Erath-yin-Ox=,      *己丑, 己丑, 己好=, 土女牛=, 土母牛=]", "remainder:25"],
    [StemBranch, "label:[Metal-yang-Tiger=,  *庚寅, 庚寅, 庚寅=, 金男虎=, 銅公虎=]", "remainder:26"],
    [StemBranch, "label:[Metal-yin-Rabbit=,  *辛卯, 辛卯, 辛栄=, 金女兎=, 銅母兎=]", "remainder:27"],
    [StemBranch, "label:[Water-yang-Dragon=, *壬辰, 壬辰, 壬辰=, 水男龍=, 水公龍=]", "remainder:28"],
    [StemBranch, "label:[Water-yin-Snake=,   *癸巳, 癸巳, 癸巳=, 水女蛇=, 水母蛇=]", "remainder:29"],
    [StemBranch, "label:[Wood-yang-Horse=,   *甲午, 甲午, 甲午=, 木男馬=, 木公馬=]", "remainder:30"],
    [StemBranch, "label:[Wood-yin-Goat=,     *乙未, 乙未, 乙未=, 木女羊=, 木母羊=]", "remainder:31"],
    [StemBranch, "label:[Fire-yang-Monkey=,  *丙申, 丙申, 丙申=, 火男猴=, 火公猴=]", "remainder:32"],
    [StemBranch, "label:[Fire-yin-Rooster=,  *丁酉, 丁酉, 丁酉=, 火女鷄=, 火母鷄=]", "remainder:33"],
    [StemBranch, "label:[Erath-yang-Dog=,    *戊戌, 戊戌, 戊戌=, 土男狗=, 土公狗=]", "remainder:34"],
    [StemBranch, "label:[Erath-yin-Pig=,     *己亥, 己亥, 己開=, 土女猪=, 土母猪=]", "remainder:35"],
    [StemBranch, "label:[Metal-yang-Rat=,    *庚子, 庚子, 庚子=, 金男鼠=, 銅公鼠=]", "remainder:36"],
    [StemBranch, "label:[Metal-yin-Ox=,      *辛丑, 辛丑, 辛好=, 金女牛=, 銅母牛=]", "remainder:37"],
    [StemBranch, "label:[Water-yang-Tiger=,  *壬寅, 壬寅, 壬寅=, 水男虎=, 水公虎=]", "remainder:38"],
    [StemBranch, "label:[Water-yin-Rabbit=,  *癸卯, 癸卯, 癸栄=, 水女兎=, 水母兎=]", "remainder:39"],
    [StemBranch, "label:[Wood-yang-Dragon=,  *甲辰, 甲辰, 甲辰=, 木男龍=, 木公龍=]", "remainder:40"],
    [StemBranch, "label:[Wood-yin-Snake=,    *乙巳, 乙巳, 乙巳=, 木女蛇=, 木母蛇=]", "remainder:41"],
    [StemBranch, "label:[Fire-yang-Horse=,   *丙午, 丙午, 丙午=, 火男馬=, 火公馬=]", "remainder:42"],
    [StemBranch, "label:[Fire-yin-Goat=,     *丁未, 丁未, 丁未=, 火女羊=, 火母羊=]", "remainder:43"],
    [StemBranch, "label:[Erath-yang-Monkey=, *戊申, 戊申, 戊申=, 土男猴=, 土公猴=]", "remainder:44"],
    [StemBranch, "label:[Erath-yin-Rooster=, *己酉, 己酉, 己酉=, 土女鷄=, 土母鷄=]", "remainder:45"],
    [StemBranch, "label:[Metal-yang-Dog=,    *庚戌, 庚戌, 庚戌=, 金男狗=, 銅公狗=]", "remainder:46"],
    [StemBranch, "label:[Metal-yin-Pig=,     *辛亥, 辛亥, 辛開=, 金女猪=, 銅母猪=]", "remainder:47"],
    [StemBranch, "label:[Water-yang-Rat=,    *壬子, 壬子, 壬子=, 水男鼠=, 水公鼠=]", "remainder:48"],
    [StemBranch, "label:[Water-yin-Ox=,      *癸丑, 癸丑, 癸好=, 水女牛=, 水母牛=]", "remainder:49"],
    [StemBranch, "label:[Wood-yang-Tiger=,   *甲寅, 甲寅, 甲寅=, 木男虎=, 木公虎=]", "remainder:50"],
    [StemBranch, "label:[Wood-yin-Rabbit=,   *乙卯, 乙卯, 乙栄=, 木女兎=, 木母兎=]", "remainder:51"],
    [StemBranch, "label:[Fire-yang-Dragon=,  *丙辰, 丙辰, 丙辰=, 火男龍=, 火公龍=]", "remainder:52"],
    [StemBranch, "label:[Fire-yin-Snake=,    *丁巳, 丁巳, 丁巳=, 火女蛇=, 火母蛇=]", "remainder:53"],
    [StemBranch, "label:[Erath-yang-Horse=,  *戊午, 戊午, 戊午=, 土男馬=, 土公馬=]", "remainder:54"],
    [StemBranch, "label:[Erath-yin-Goat=,    *己未, 己未, 己未=, 土女羊=, 土母羊=]", "remainder:55"],
    [StemBranch, "label:[Metal-yang-Monkey=, *庚申, 庚申, 庚申=, 金男猴=, 銅公猴=]", "remainder:56"],
    [StemBranch, "label:[Metal-yin-Rooster=, *辛酉, 辛酉, 辛酉=, 金女鷄=, 銅母鷄=]", "remainder:57"],
    [StemBranch, "label:[Water-yang-Dog=,    *壬戌, 壬戌, 壬戌=, 水男狗=, 水公狗=]", "remainder:58"],
    [StemBranch, "label:[Water-yin-Pig=,     *癸亥, 癸亥, 癸開=, 水女猪=, 水母猪=]", "remainder:59"]
  ],

  [Kyusei,
    "locale:[=en:, ja=ja:, zh=ja:]",
    "label:[Kyusei=, *九星, 九星]", "divisor:9", "year:7",
    [Kyusei, "label:[9-Purple-Fire=,  *九紫火星, 九紫火星]", "remainder:0"],
    [Kyusei, "label:[8-White-Earth=,  *八白土星, 八白土星]", "remainder:1"],
    [Kyusei, "label:[7-Red-Metal=,    *七赤金星, 七赤金星]", "remainder:2"],
    [Kyusei, "label:[6-White-Metal=,  *六白金星, 六白金星]", "remainder:3"],
    [Kyusei, "label:[5-Yellow-Earth=, *五黄土星, 五黄土星]", "remainder:4"],
    [Kyusei, "label:[4-Green-Wood=,   *四緑木星, 四緑木星]", "remainder:5"],
    [Kyusei, "label:[3-Blue-Wood=,    *三碧木星, 三碧木星]", "remainder:6"],
    [Kyusei, "label:[2-Black-Earth=,  *二黒土星, 二黒土星]", "remainder:7"],
    [Kyusei, "label:[1-White-Water=,  *一白水星, 一白水星]", "remainder:8"]
  ],

  [Residue,
    "locale:[=en:, ja=ja:, zh=zh:, alias]",
    "label:[SolarTerm=en:Solar_term, *二十四節気, 節気=zh:%%<节气>]", "divisor:360",
    [Residue, "label:[Vernal Equinox=en:Chunfen,                 *春分, 春分, 二月中=]  ", "remainder:0"  ],
    [Residue, "label:[Clear And Bright=en:Qingming,              *清明, 清明, 三月節=]  ", "remainder:15" ],
    [Residue, "label:[Grain Rain=en:Guyu,                        *穀雨, 穀雨, 三月中=]  ", "remainder:30" ],
    [Residue, "label:[Start Of Summer=en:Lixia,                  *立夏, 立夏, 四月節=]  ", "remainder:45" ],
    [Residue, "label:[Grain Full=en:Xiaoman,                     *小満, 小満, 四月中=]  ", "remainder:60" ],
    [Residue, "label:[Grain In Ear=en:Mangzhong,                 *芒種, 芒種, 五月節=]  ", "remainder:75" ],
    [Residue, "label:[Summer Solstice=en:Xiazhi,                 *夏至, 夏至, 五月中=]  ", "remainder:90" ],
    [Residue, "label:[Minor Heat=en:Xiaoshu,                     *小暑, 小暑, 六月節=]  ", "remainder:105"],
    [Residue, "label:[Major Heat=en:Dashu,                       *大暑, 大暑, 六月中=]  ", "remainder:120"],
    [Residue, "label:[Start Of Autumn=en:Liqiu,                  *立秋, 立秋, 七月節=]  ", "remainder:135"],
    [Residue, "label:[Limit Of Heat=en:Chushu,        *処暑, 処暑=zh:%%<处暑>,七月中=]  ", "remainder:150"],
    [Residue, "label:[White Dew=en:Bailu,                        *白露, 白露, 八月節=]  ", "remainder:165"],
    [Residue, "label:[Autumnal Equinox=en:Qiufen,                *秋分, 秋分, 八月中=]  ", "remainder:180"],
    [Residue, "label:[Cold Dew=en:Hanlu,                         *寒露, 寒露, 九月節=]  ", "remainder:195"],
    [Residue, "label:[Frost Descent=en:Shuangjiang_(solar_term), *霜降, 霜降, 九月中=]  ", "remainder:210"],
    [Residue, "label:[Start Of Winter=en:Lidong,                 *立冬, 立冬, 十月節=]  ", "remainder:225"],
    [Residue, "label:[Minor Snow=en:Xiaoxue,                     *小雪, 小雪, 十月中=]  ", "remainder:240"],
    [Residue, "label:[Major Snow=en:Daxue_(solar_term),          *大雪, 大雪, 十一月節=]", "remainder:255"],
    [Residue, "label:[Winter Solstice=en:Dongzhi_(solar_term),   *冬至, 冬至, 十一月中=]", "remainder:270"],
    [Residue, "label:[Minor Cold=en:Xiaohan,                     *小寒, 小寒, 十二月節=]", "remainder:285"],
    [Residue, "label:[Major Cold=en:Dahan_(solar_term),          *大寒, 大寒, 十二月中=]", "remainder:300"],
    [Residue, "label:[Start Of Spring=en:Lichun,                 *立春, 立春, 正月節=]  ", "remainder:315"],
    [Residue, 'label:[#{A:Rain Water=en:Yushui_(solar_term),     *雨水, 雨水},正月中=]  ', "remainder:330"], # 戊寅・儀鳳暦では啓蟄
    [Residue, 'label:[#{B:Awakening Of Insects=en:Jingzhe,       *啓蟄, 驚蟄},二月節=]  ', "remainder:345"]  # 戊寅・儀鳳暦では雨水
  ],

  [Residue,
    "locale:[=en:, ja=ja:, zh=zh:]",
    "label:[LunarPhase=en:Lunar_phase,     *月相, 月相]",   "divisor:360",
    [Residue, "label:[New_moon=,           *朔,   朔    ]", "remainder:0"  ],
    [Residue, "label:[First_quarter_moon=, *上弦, 上弦月]", "remainder:90" ],
    [Residue, "label:[Full_moon=,          *望,   望    ]", "remainder:180"],
    [Residue, "label:[Third_quarter_moon=, *下弦, 下弦月]", "remainder:270"]
  ]
]]
Russian =

Location of cities in Russia

[When::BasicTypes::M17n, [
  "locale:[=en:, ja=ja:, alias]",
  "names:[Russia, ロシア]",
  [Spatial, "long:37.3756E", "lat:55.4508N", "label:[Moscow,           モスクワ            ]"],
  [Spatial, "long:30.18E",   "lat:59.57N",   "label:[Saint_Petersburg, サンクトペテルブルク]"],
  [Spatial,"long:131.55E",   "lat:43.07N",   "label:[Vladivostok,      ウラジオストク      ]"]
]]
Tibetan =

六十干支

[When::BasicTypes::M17n, [
  "locale:[=en:, ja=ja:, alias]",
  "names:[Tibetan]",
  
  [StemBranch,
    "label:[Stem-Branch, *干支]", "divisor:60", "day:11", "year:4",
    [StemBranch, "label:[Wood-Rat=,      *木男鼠=]", "remainder: 0"],
    [StemBranch, "label:[Wood-Ox=,       *木女牛=]", "remainder: 1"],
    [StemBranch, "label:[Fire-Tiger=,    *火男虎=]", "remainder: 2"],
    [StemBranch, "label:[Fire-Rabbit=,   *火女兎=]", "remainder: 3"],
    [StemBranch, "label:[Earth-Dragon=,  *土男龍=]", "remainder: 4"],
    [StemBranch, "label:[Earth-Snake=,   *土女蛇=]", "remainder: 5"],
    [StemBranch, "label:[Iron-Horse=,    *金男馬=]", "remainder: 6"],
    [StemBranch, "label:[Iron-Goat=,     *金女羊=]", "remainder: 7"],
    [StemBranch, "label:[Water-Monkey=,  *水男猴=]", "remainder: 8"],
    [StemBranch, "label:[Water-Rooster=, *水女鷄=]", "remainder: 9"],
    [StemBranch, "label:[Wood-Dog=,      *木男狗=]", "remainder:10"],
    [StemBranch, "label:[Wood-Pig=,      *木女猪=]", "remainder:11"],
    [StemBranch, "label:[Fire-Rat=,      *火男鼠=]", "remainder:12"],
    [StemBranch, "label:[Fire-Ox=,       *火女牛=]", "remainder:13"],
    [StemBranch, "label:[Earth-Tiger=,   *土男虎=]", "remainder:14"],
    [StemBranch, "label:[Earth-Rabbit=,  *土女兎=]", "remainder:15"],
    [StemBranch, "label:[Iron-Dragon=,   *金男龍=]", "remainder:16"],
    [StemBranch, "label:[Iron-Snake=,    *金女蛇=]", "remainder:17"],
    [StemBranch, "label:[Water-Horse=,   *水男馬=]", "remainder:18"],
    [StemBranch, "label:[Water-Goat=,    *水女羊=]", "remainder:19"],
    [StemBranch, "label:[Wood-Monkey=,   *木男猴=]", "remainder:20"],
    [StemBranch, "label:[Wood-Rooster=,  *木女鷄=]", "remainder:21"],
    [StemBranch, "label:[Fire-Dog=,      *火男狗=]", "remainder:22"],
    [StemBranch, "label:[Fire-Pig=,      *火女猪=]", "remainder:23"],
    [StemBranch, "label:[Earth-Rat=,     *土男鼠=]", "remainder:24"],
    [StemBranch, "label:[Earth-Ox=,      *土女牛=]", "remainder:25"],
    [StemBranch, "label:[Iron-Tiger=,    *金男虎=]", "remainder:26"],
    [StemBranch, "label:[Iron-Rabbit=,   *金女兎=]", "remainder:27"],
    [StemBranch, "label:[Water-Dragon=,  *水男龍=]", "remainder:28"],
    [StemBranch, "label:[Water-Snake=,   *水女蛇=]", "remainder:29"],
    [StemBranch, "label:[Wood-Horse=,    *木男馬=]", "remainder:30"],
    [StemBranch, "label:[Wood-Goat=,     *木女羊=]", "remainder:31"],
    [StemBranch, "label:[Fire-Monkey=,   *火男猴=]", "remainder:32"],
    [StemBranch, "label:[Fire-Rooster=,  *火女鷄=]", "remainder:33"],
    [StemBranch, "label:[Earth-Dog=,     *土男狗=]", "remainder:34"],
    [StemBranch, "label:[Earth-Pig=,     *土女猪=]", "remainder:35"],
    [StemBranch, "label:[Iron-Rat=,      *金男鼠=]", "remainder:36"],
    [StemBranch, "label:[Iron-Ox=,       *金女牛=]", "remainder:37"],
    [StemBranch, "label:[Water-Tiger=,   *水男虎=]", "remainder:38"],
    [StemBranch, "label:[Water-Rabbit=,  *水女兎=]", "remainder:39"],
    [StemBranch, "label:[Wood-Dragon=,   *木男龍=]", "remainder:40"],
    [StemBranch, "label:[Wood-Snake=,    *木女蛇=]", "remainder:41"],
    [StemBranch, "label:[Fire-Horse=,    *火男馬=]", "remainder:42"],
    [StemBranch, "label:[Fire-Goat=,     *火女羊=]", "remainder:43"],
    [StemBranch, "label:[Earth-Monkey=,  *土男猴=]", "remainder:44"],
    [StemBranch, "label:[Earth-Rooster=, *土女鷄=]", "remainder:45"],
    [StemBranch, "label:[Iron-Dog=,      *金男狗=]", "remainder:46"],
    [StemBranch, "label:[Iron-Pig=,      *金女猪=]", "remainder:47"],
    [StemBranch, "label:[Water-Rat=,     *水男鼠=]", "remainder:48"],
    [StemBranch, "label:[Water-Ox=,      *水女牛=]", "remainder:49"],
    [StemBranch, "label:[Wood-Tiger=,    *木男虎=]", "remainder:50"],
    [StemBranch, "label:[Wood-Rabbit=,   *木女兎=]", "remainder:51"],
    [StemBranch, "label:[Fire-Dragon=,   *火男龍=]", "remainder:52"],
    [StemBranch, "label:[Fire-Snake=,    *火女蛇=]", "remainder:53"],
    [StemBranch, "label:[Earth-Horse=,   *土男馬=]", "remainder:54"],
    [StemBranch, "label:[Earth-Goat=,    *土女羊=]", "remainder:55"],
    [StemBranch, "label:[Iron-Monkey=,   *金男猴=]", "remainder:56"],
    [StemBranch, "label:[Iron-Rooster=,  *金女鷄=]", "remainder:57"],
    [StemBranch, "label:[Water-Dog=,     *水男狗=]", "remainder:58"],
    [StemBranch, "label:[Water-Pig=,     *水女猪=]", "remainder:59"]
  ]
]]
Javanese =

Javanese Residues

[When::BasicTypes::M17n, [
   "locale:[=en:, ja=ja:, alias]",
   "names:[Javanese=en:Java, ジャワ=ja:ジャワ島, zh:爪哇=zh:爪哇岛]",

   [Residue,
     "label:[Windu=, ウィンドゥ=]", "divisor:8", "year:3",
     [Residue, "label:[Alip=   ]", "remainder:  0"],
     [Residue, "label:[Ehe=    ]", "remainder:  1"],
     [Residue, "label:[Jimawal=]", "remainder:  2"],
     [Residue, "label:[Je=     ]", "remainder:  3"],
     [Residue, "label:[Dal=    ]", "remainder:  4"],
     [Residue, "label:[Be=     ]", "remainder:  5"],
     [Residue, "label:[Wawu=   ]", "remainder:  6"],
     [Residue, "label:[Jimakir=]", "remainder:  7"]
   ],

   [Residue,
     "label:[Pasaran=, 五曜=]", "divisor:5", "day:1",
     [Residue, "label:[Paing=  ]", "remainder:  0"],
     [Residue, "label:[Pon=    ]", "remainder:  1"],
     [Residue, "label:[Wage=   ]", "remainder:  2"],
     [Residue, "label:[Kliwon= ]", "remainder:  3"],
     [Residue, "label:[Legi=   ]", "remainder:  4"]
   ],

   [Residue,
     "label:[Paringkelan=, 六曜=]", "divisor:6", "day:2",
     [Residue, "label:[Tungle=   ]", "remainder:  0"],
     [Residue, "label:[Aryang=   ]", "remainder:  1"],
     [Residue, "label:[Warukung= ]", "remainder:  2"],
     [Residue, "label:[Paningron=]", "remainder:  3"],
     [Residue, "label:[Uwas=     ]", "remainder:  4"],
     [Residue, "label:[Mawulu=   ]", "remainder:  5"]
   ],

   [Residue,
     "label:[Week=, 七曜=]", "divisor:7", "day:6",
     [Residue, "label:[Minggu=]", "remainder:  0"],
     [Residue, "label:[Senin= ]", "remainder:  1"],
     [Residue, "label:[Selasa=]", "remainder:  2"],
     [Residue, "label:[Rabu=  ]", "remainder:  3"],
     [Residue, "label:[Kamis= ]", "remainder:  4"],
     [Residue, "label:[Jumat= ]", "remainder:  5"],
     [Residue, "label:[Sabtu= ]", "remainder:  6"]
   ],

   [Residue,
     "label:[Wuku=, ウク週=]", "divisor:210", "day:146",
     [Residue, "label:[Sinto=       ]", "remainder:  0"],
     [Residue, "label:[Landep=      ]", "remainder:  7"],
     [Residue, "label:[Wukir=       ]", "remainder: 14"],
     [Residue, "label:[Kurantil=    ]", "remainder: 21"],
     [Residue, "label:[Tolu=        ]", "remainder: 28"],
     [Residue, "label:[Gumbrek=     ]", "remainder: 35"],
     [Residue, "label:[Warigalit=   ]", "remainder: 42"],
     [Residue, "label:[Warigagung=  ]", "remainder: 49"],
     [Residue, "label:[Julungwangi= ]", "remainder: 56"],
     [Residue, "label:[Sungsang=    ]", "remainder: 63"],
     [Residue, "label:[Galungan=    ]", "remainder: 70"],
     [Residue, "label:[Kuningan=    ]", "remainder: 77"],
     [Residue, "label:[Langkir=     ]", "remainder: 84"],
     [Residue, "label:[Mondosijo=   ]", "remainder: 91"],
     [Residue, "label:[Julungpujut= ]", "remainder: 98"],
     [Residue, "label:[Pahang=      ]", "remainder:105"],
     [Residue, "label:[Kuruwekut=   ]", "remainder:112"],
     [Residue, "label:[Marakeh=     ]", "remainder:119"],
     [Residue, "label:[Tambir=      ]", "remainder:126"],
     [Residue, "label:[Medangkungan=]", "remainder:133"],
     [Residue, "label:[Maktal=      ]", "remainder:140"],
     [Residue, "label:[Waye=        ]", "remainder:147"],
     [Residue, "label:[Menahil=     ]", "remainder:154"],
     [Residue, "label:[Prangbakat=  ]", "remainder:161"],
     [Residue, "label:[Bolo=        ]", "remainder:168"],
     [Residue, "label:[Wugu=        ]", "remainder:175"],
     [Residue, "label:[Wayang=      ]", "remainder:182"],
     [Residue, "label:[Kulawu=      ]", "remainder:189"],
     [Residue, "label:[Dukut=       ]", "remainder:196"],
     [Residue, "label:[Watugunung=  ]", "remainder:203"]
   ]
]]
LocationTable =
[

  # 0 : Resource Pool
  {},

  # 1 : Fine Area Coordinates
  {},

  # 2 : Middle Area  Coordinates
  Hash.new {|h,k|
    h[k] = {}
  },

  # 3 : Wide Area Coordinates
  Hash.new {|h1,k1|
    h1[k1] = Hash.new {|h2,k2|
      h2[k2] = {}
    }
  },

  # 4 : Alias Pool
  Hash.new {|h,k|
    h[k] = []
  }
]
DefaultDayIndex =

default index for day coordinate

Index.new
DefaultDateIndices =

default indices for date coordinates

[
  Index.new(When::Parts::Resource._instance('_m:Calendar::Month'), {:unit =>12}),
  DefaultDayIndex
]
DefaultTimeIndices =

default indices for time coordinates

[
  Index.new({:base=>0, :unit=>24}),
  Index.new({:base=>0, :unit=>60}),
  Index.new({:base=>0, :unit=>60})
]

Class Method Summary collapse

Class Method Details

.to_deg(src, dir) ⇒ Numeric

60進->10進変換(度単位)

Parameters:

  • src (String)

    60進法で表した方向付きの数値

  • dir (String)

    方向 (‘NS’ または ‘EW’)

Returns:

  • (Numeric)

    10進変換した数値 (src が nil なら0.0を、Numeric ならそのままsrcを返す)



65
66
67
# File 'lib/when_exe/coordinates.rb', line 65

def self.to_deg(src, dir)
  to_deg_225(src, dir) / Spatial::DEGREE
end

.to_deg_225(src, dir, degree = Spatial::DEGREE) ⇒ Numeric

60進->10進変換(1/225度単位)

Parameters:

  • src (String)

    60進法で表した方向付きの数値

  • dir (String)

    方向 (‘NS’ または ‘EW’)

  • degree (Numeric) (defaults to: Spatial::DEGREE)

    角度の単位 (1 => 1度, 225=> 1/225 度)

Returns:

  • (Numeric)

    10進変換した数値 (src が nil なら0.0を、Numeric なら 225*src を返す)



33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/when_exe/coordinates.rb', line 33

def self.to_deg_225(src, dir, degree=Spatial::DEGREE)
  case src
  when String
    src = src.gsub(/_+/,'').gsub(/@/, '.')
    return src.to_r * degree if (src =~ /E[-+]/ || src !~ MATCH[dir])
    sign  = ($1 == dir[1..1]) ? -1 : +1
    value = src.gsub(MATCH[dir], '').strip
    if ((value + "00000") =~ /\A(\d+)\.(\d{2})(\d{2})(\d+)\z/)
      deg, min, sec, frac = $~[1..4]
      sec += "." + frac
    else
      deg, min, sec = value.split(/[^\d.]+/)
    end
    return sign * (deg.to_i *  degree +
              (min||0).to_f * (degree/60.0) +
              (sec||0).to_f * (degree/3600.0))
  when NilClass
    0.0
  when Numeric
    src * degree
  else
    raise TypeError, "Invalid Location Type"
  end
end

.to_dms(src, dir, round = 6) ⇒ String

10進->60進変換

Parameters:

  • src (Numeric)

    数値

  • dir (String)

    方向 (‘NS’ または ‘EW’)

  • round (Integer) (defaults to: 6)

    秒の小数点以下最大桁数

Returns:

  • (String)

    60進変換した数値



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/when_exe/coordinates.rb', line 77

def self.to_dms(src, dir, round=6)
  dir      = (src >= 0) ? dir[0..0] : dir[1..1]
  deg, min  =     src.abs.divmod(1)
  min, sec  =    (60*min).divmod(1)
  sec       = (60*10**round*sec).round
  fig = round + 2
  round.times do
    div, mod = sec.divmod(10)
    if mod == 0
      fig -= 1
      sec  = div
    else
      break
    end
  end
  (['N','S'].include?(dir) ? "%02d.%02d%0#{fig}d%s" : "%03d.%02d%0#{fig}d%s") % [deg, min, sec, dir]
end

.utf_gets(io) ⇒ Object

はしご高など UTF-8 への変換に失敗するコードを含む地名は登録しない



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/when_exe/region/japanese/location.rb', line 24

def self.utf_gets(io)
  error_occurred = false
  line = nil
  loop do
    error = nil
    begin
      line = io.gets
    rescue Encoding::UndefinedConversionError => error
      error_occurred = true
    end
    unless error
      return error_occurred ? utf_gets(io) : line
    end
  end
end