when_exe 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +333 -212
 - data/bin/make_ttl.rb +37 -0
 - data/bin/make_ttl.rb.config +9 -0
 - data/lib/when_exe.rb +923 -925
 - data/lib/when_exe/calendarnote.rb +9 -5
 - data/lib/when_exe/coordinates.rb +2437 -2446
 - data/lib/when_exe/inspect.rb +1480 -1408
 - data/lib/when_exe/linkeddata.rb +574 -0
 - data/lib/when_exe/locales/akt.rb +177 -176
 - data/lib/when_exe/locales/locale.rb +751 -751
 - data/lib/when_exe/mini_application.rb +307 -307
 - data/lib/when_exe/parts/resource.rb +1115 -1103
 - data/lib/when_exe/region/chinese/epochs.rb +6 -5
 - data/lib/when_exe/region/christian.rb +831 -829
 - data/lib/when_exe/region/japanese.rb +93 -93
 - data/lib/when_exe/region/japanese/notes.rb +1510 -1495
 - data/lib/when_exe/region/japanese/residues.rb +13 -13
 - data/lib/when_exe/tmposition.rb +2307 -2273
 - data/lib/when_exe/tmreference.rb +1744 -1734
 - data/lib/when_exe/version.rb +2 -2
 - data/link_to_online_documents +1 -1
 - data/test/scripts/3.ext.rb +6 -6
 - data/test/scripts/3.rb +6 -6
 - data/test/test.rb +76 -75
 - data/test/test/icalendar.rb +883 -879
 - data/test/test/linkeddata.rb +224 -0
 - data/test/test/region/m17n.rb +193 -193
 - data/when_exe.gemspec +3 -2
 - metadata +13 -6
 
| 
         @@ -390,8 +390,8 @@ module When 
     | 
|
| 
       390 
390 
     | 
    
         
             
            	],
         
     | 
| 
       391 
391 
     | 
    
         
             
            	[self,
         
     | 
| 
       392 
392 
     | 
    
         
             
            	  "period:[前燕]",
         
     | 
| 
       393 
     | 
    
         
            -
             
     | 
| 
       394 
     | 
    
         
            -
            	  ["[元璽]1"	,			""	,	" 
     | 
| 
      
 393 
     | 
    
         
            +
            	# ["[燕元=]0.11.26",			"@F"	,	"name=[慕容儁];348-11-26^Chinese0239"],			# 景昭帝 甲辰 3085-6 (即位記事のみ)
         
     | 
| 
      
 394 
     | 
    
         
            +
            	  ["[元璽]1"	,			""	,	"name=[慕容儁];352-11-13^Chinese0239"],			# 戊辰 3131-27
         
     | 
| 
       395 
395 
     | 
    
         
             
            	  ["[光寿]1"	,			""	,	"	     357-02-23"],				# 癸丑 3161-3
         
     | 
| 
       396 
396 
     | 
    
         
             
            	  ["[建熙]1"	,			"@A"	,	"name=[慕容暐];360-01-15", "370-11="]			# 幽帝 戊子 3179-1
         
     | 
| 
       397 
397 
     | 
    
         
             
            	],
         
     | 
| 
         @@ -578,8 +578,9 @@ module When 
     | 
|
| 
       578 
578 
     | 
    
         
             
            	  ["[河清]1"	,			""	,	"	     562-04-06"],				# 乙巳
         
     | 
| 
       579 
579 
     | 
    
         
             
            	  ["[天統=ja:%%<天統_(北斉)>]1"	,	"@A"	,"name=[後主=ja:%%<後主_(北斉)>];565-04-24"],			# 丙子
         
     | 
| 
       580 
580 
     | 
    
         
             
            	  ["[武平=ja:%%<武平_(北斉)>]1"	,	""	,	"	     570-01-01"],				# 乙酉
         
     | 
| 
       581 
     | 
    
         
            -
            	  ["[隆化]1"	,			""	,	"	     576-12- 
     | 
| 
       582 
     | 
    
         
            -
            	  ["[ 
     | 
| 
      
 581 
     | 
    
         
            +
            	  ["[隆化]1"	,			""	,	"	     576-12-13", "577-01-01"],			# 丁巳 5361
         
     | 
| 
      
 582 
     | 
    
         
            +
            	  ["[徳昌=ja:%%<徳昌_(北斉)>]1"	,	""	,"name=[安徳王=ja:%%<高延宗>];576-12-14", "576-12-17="],	# 戊午, 辛酉 5362
         
     | 
| 
      
 583 
     | 
    
         
            +
            	  ["[承光=ja:%%<承光_(北斉)>]1"	,"@A",	"name=[幼主=ja:%%<幼主_(北斉)>];577-01-01", "577-03="]			# 乙亥
         
     | 
| 
       583 
584 
     | 
    
         
             
            	],
         
     | 
| 
       584 
585 
     | 
    
         
             
            	[self,
         
     | 
| 
       585 
586 
     | 
    
         
             
            	  "period:[西魏]",
         
     | 
| 
         @@ -591,7 +592,7 @@ module When 
     | 
|
| 
       591 
592 
     | 
    
         
             
            	  "period:[北周]",
         
     | 
| 
       592 
593 
     | 
    
         
             
            	  ["[<孝閔帝>=ja:%%<孝閔帝>]1.12.30",	"@F"	,	"name=[孝閔帝];556-12-30^Chinese0523"],			# 庚子 北周が西魏に代わる
         
     | 
| 
       593 
594 
     | 
    
         
             
            	  ["[<明帝>=ja:%%<明帝_(北周)>]1.09.28","@A"	,"name=[明帝=ja:%%<明帝_(北周)>];557-09-28"],			# 甲子
         
     | 
| 
       594 
     | 
    
         
            -
            	  ["[武成=ja:%%<武成_(北周)>]1"	,	""	,	"	     559- 
     | 
| 
      
 595 
     | 
    
         
            +
            	  ["[武成=ja:%%<武成_(北周)>]1"	,	""	,	"	     559-08-14"],				# 乙亥 or 己亥 5190-30
         
     | 
| 
       595 
596 
     | 
    
         
             
            	  ["[保定=ja:%%<保定_(北周)>]1"	,	"@A"	,"name=[武帝=ja:%%<武帝_(北周)>];561-01-01"],			# 戊申
         
     | 
| 
       596 
597 
     | 
    
         
             
            	  ["[天和=ja:%%<天和_(北周)>]1"	,	""	,	"	     566-01-05"],				# 癸未 本年から天和暦を使用
         
     | 
| 
       597 
598 
     | 
    
         
             
            	  ["[建徳=ja:%%<建徳_(北周)>]1"	,	""	,	"	     572-03-15"],				# 丁巳
         
     | 
| 
         @@ -1,829 +1,831 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            # -*- coding: utf-8 -*-
         
     | 
| 
       2 
     | 
    
         
            -
            =begin
         
     | 
| 
       3 
     | 
    
         
            -
              Copyright (C) 2011- 
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
              You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
         
     | 
| 
       6 
     | 
    
         
            -
            =end
         
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
            module When
         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
       10 
     | 
    
         
            -
              class BasicTypes::M17n
         
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
                Christian = [self, [
         
     | 
| 
       13 
     | 
    
         
            -
                  "locale:[=en:, ja=ja:, alias]",
         
     | 
| 
       14 
     | 
    
         
            -
                  "names:[Christian=]",
         
     | 
| 
       15 
     | 
    
         
            -
                  "[Julian=en:Julian_calendar,                ユリウス暦    ]",
         
     | 
| 
       16 
     | 
    
         
            -
                  "[Gregorian=en:Gregorian_calendar,          グレゴリオ暦  ]",
         
     | 
| 
       17 
     | 
    
         
            -
                  "[RevisedJulian=en:Revised_Julian_calendar, 修正ユリウス暦]",
         
     | 
| 
       18 
     | 
    
         
            -
                  "[Swedish=en:Swedish_calendar,              スウェーデン暦]",
         
     | 
| 
       19 
     | 
    
         
            -
                  "[Civil in the West=en:Civil_calendar, 西暦, *alias:Civil]"
         
     | 
| 
       20 
     | 
    
         
            -
                ]]
         
     | 
| 
       21 
     | 
    
         
            -
              end
         
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
              class TM::CalendarEra
         
     | 
| 
       24 
     | 
    
         
            -
                # Anno Mundi Era
         
     | 
| 
       25 
     | 
    
         
            -
                Byzantine = [self, [
         
     | 
| 
       26 
     | 
    
         
            -
                  "locale:[=en:, ja=ja:, alias]",
         
     | 
| 
       27 
     | 
    
         
            -
                  "period:[Byzantine=en:Byzantine_calendar, ビザンティン暦=ja:%%<世界創造紀元>]",
         
     | 
| 
       28 
     | 
    
         
            -
                  ["[AM=en:Anno_Mundi, 世界創造紀元, alias:Anno_Mundi]6497*9.1",
         
     | 
| 
       29 
     | 
    
         
            -
                   '@CE', "989*09-01^Julian?border=0*9-1¬e=Roman", "1453-5-29"]
         
     | 
| 
       30 
     | 
    
         
            -
                ]]
         
     | 
| 
       31 
     | 
    
         
            -
              end
         
     | 
| 
       32 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
              module CalendarTypes
         
     | 
| 
       34 
     | 
    
         
            -
             
     | 
| 
       35 
     | 
    
         
            -
                #
         
     | 
| 
       36 
     | 
    
         
            -
                # Christian Base Calendar
         
     | 
| 
       37 
     | 
    
         
            -
                #
         
     | 
| 
       38 
     | 
    
         
            -
                class Christian < When::TM::Calendar
         
     | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
                  # デフォルトの改暦日付(ユリウス通日)
         
     | 
| 
       41 
     | 
    
         
            -
                  # 
         
     | 
| 
       42 
     | 
    
         
            -
                  # @private
         
     | 
| 
       43 
     | 
    
         
            -
                  DefaultReformDate = 2299161 # 1582-10-15
         
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
                  # @private
         
     | 
| 
       46 
     | 
    
         
            -
                  # 
         
     | 
| 
       47 
     | 
    
         
            -
                  # ::Date オブジェクトに対応する暦法名
         
     | 
| 
       48 
     | 
    
         
            -
                  # (require 'Date' されていることの保証は呼び出し側)
         
     | 
| 
       49 
     | 
    
         
            -
                  #
         
     | 
| 
       50 
     | 
    
         
            -
                  def self._default_start(date)
         
     | 
| 
       51 
     | 
    
         
            -
                    case date.start
         
     | 
| 
       52 
     | 
    
         
            -
                    when ::Date::JULIAN    ; 'Julian'
         
     | 
| 
       53 
     | 
    
         
            -
                    when ::Date::GREGORIAN ; 'Gregorian'
         
     | 
| 
       54 
     | 
    
         
            -
                     
     | 
| 
       55 
     | 
    
         
            -
                     
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
       58 
     | 
    
         
            -
                   
     | 
| 
       59 
     | 
    
         
            -
             
     | 
| 
       60 
     | 
    
         
            -
                  #  
     | 
| 
       61 
     | 
    
         
            -
                  #
         
     | 
| 
       62 
     | 
    
         
            -
                   
     | 
| 
       63 
     | 
    
         
            -
             
     | 
| 
       64 
     | 
    
         
            -
             
     | 
| 
       65 
     | 
    
         
            -
                     
     | 
| 
       66 
     | 
    
         
            -
                     
     | 
| 
       67 
     | 
    
         
            -
                     
     | 
| 
       68 
     | 
    
         
            -
             
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                   
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
       72 
     | 
    
         
            -
                  #  
     | 
| 
       73 
     | 
    
         
            -
                  #
         
     | 
| 
       74 
     | 
    
         
            -
                   
     | 
| 
       75 
     | 
    
         
            -
             
     | 
| 
       76 
     | 
    
         
            -
             
     | 
| 
       77 
     | 
    
         
            -
                     
     | 
| 
       78 
     | 
    
         
            -
                     
     | 
| 
       79 
     | 
    
         
            -
                     
     | 
| 
       80 
     | 
    
         
            -
                    m 
     | 
| 
       81 
     | 
    
         
            -
                     
     | 
| 
       82 
     | 
    
         
            -
                     
     | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
             
     | 
| 
       85 
     | 
    
         
            -
                   
     | 
| 
       86 
     | 
    
         
            -
             
     | 
| 
       87 
     | 
    
         
            -
                  #  
     | 
| 
       88 
     | 
    
         
            -
                  #
         
     | 
| 
       89 
     | 
    
         
            -
                   
     | 
| 
       90 
     | 
    
         
            -
             
     | 
| 
       91 
     | 
    
         
            -
             
     | 
| 
       92 
     | 
    
         
            -
                     
     | 
| 
       93 
     | 
    
         
            -
                    return ( 
     | 
| 
       94 
     | 
    
         
            -
             
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
                   
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
       98 
     | 
    
         
            -
                  #  
     | 
| 
       99 
     | 
    
         
            -
                   
     | 
| 
       100 
     | 
    
         
            -
             
     | 
| 
       101 
     | 
    
         
            -
                   
     | 
| 
       102 
     | 
    
         
            -
             
     | 
| 
       103 
     | 
    
         
            -
                   
     | 
| 
       104 
     | 
    
         
            -
             
     | 
| 
       105 
     | 
    
         
            -
                   
     | 
| 
       106 
     | 
    
         
            -
             
     | 
| 
       107 
     | 
    
         
            -
             
     | 
| 
       108 
     | 
    
         
            -
                     
     | 
| 
       109 
     | 
    
         
            -
                     
     | 
| 
       110 
     | 
    
         
            -
             
     | 
| 
       111 
     | 
    
         
            -
             
     | 
| 
       112 
     | 
    
         
            -
             
     | 
| 
       113 
     | 
    
         
            -
                 
     | 
| 
       114 
     | 
    
         
            -
             
     | 
| 
       115 
     | 
    
         
            -
                #
         
     | 
| 
       116 
     | 
    
         
            -
                 
     | 
| 
       117 
     | 
    
         
            -
             
     | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
                  #  
     | 
| 
       121 
     | 
    
         
            -
                  # 
     | 
| 
       122 
     | 
    
         
            -
                  #
         
     | 
| 
       123 
     | 
    
         
            -
                   
     | 
| 
       124 
     | 
    
         
            -
             
     | 
| 
       125 
     | 
    
         
            -
                   
     | 
| 
       126 
     | 
    
         
            -
             
     | 
| 
       127 
     | 
    
         
            -
                   
     | 
| 
       128 
     | 
    
         
            -
             
     | 
| 
       129 
     | 
    
         
            -
                  #  
     | 
| 
       130 
     | 
    
         
            -
                   
     | 
| 
       131 
     | 
    
         
            -
             
     | 
| 
       132 
     | 
    
         
            -
                   
     | 
| 
       133 
     | 
    
         
            -
             
     | 
| 
       134 
     | 
    
         
            -
                   
     | 
| 
       135 
     | 
    
         
            -
             
     | 
| 
       136 
     | 
    
         
            -
                   
     | 
| 
       137 
     | 
    
         
            -
             
     | 
| 
       138 
     | 
    
         
            -
             
     | 
| 
       139 
     | 
    
         
            -
             
     | 
| 
       140 
     | 
    
         
            -
             
     | 
| 
       141 
     | 
    
         
            -
             
     | 
| 
       142 
     | 
    
         
            -
                 
     | 
| 
       143 
     | 
    
         
            -
             
     | 
| 
       144 
     | 
    
         
            -
                #
         
     | 
| 
       145 
     | 
    
         
            -
                 
     | 
| 
       146 
     | 
    
         
            -
             
     | 
| 
       147 
     | 
    
         
            -
             
     | 
| 
       148 
     | 
    
         
            -
             
     | 
| 
       149 
     | 
    
         
            -
                  #  
     | 
| 
       150 
     | 
    
         
            -
                   
     | 
| 
       151 
     | 
    
         
            -
             
     | 
| 
       152 
     | 
    
         
            -
                  #  
     | 
| 
       153 
     | 
    
         
            -
             
     | 
| 
       154 
     | 
    
         
            -
                   
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
       156 
     | 
    
         
            -
                   
     | 
| 
       157 
     | 
    
         
            -
             
     | 
| 
       158 
     | 
    
         
            -
             
     | 
| 
       159 
     | 
    
         
            -
                   
     | 
| 
       160 
     | 
    
         
            -
             
     | 
| 
       161 
     | 
    
         
            -
             
     | 
| 
       162 
     | 
    
         
            -
             
     | 
| 
       163 
     | 
    
         
            -
                    [ 
     | 
| 
       164 
     | 
    
         
            -
                    [ 
     | 
| 
       165 
     | 
    
         
            -
             
     | 
| 
       166 
     | 
    
         
            -
             
     | 
| 
       167 
     | 
    
         
            -
                   
     | 
| 
       168 
     | 
    
         
            -
             
     | 
| 
       169 
     | 
    
         
            -
                   
     | 
| 
       170 
     | 
    
         
            -
             
     | 
| 
       171 
     | 
    
         
            -
             
     | 
| 
       172 
     | 
    
         
            -
                     
     | 
| 
       173 
     | 
    
         
            -
                     
     | 
| 
       174 
     | 
    
         
            -
                     
     | 
| 
       175 
     | 
    
         
            -
                     
     | 
| 
       176 
     | 
    
         
            -
                     
     | 
| 
       177 
     | 
    
         
            -
                     
     | 
| 
       178 
     | 
    
         
            -
                     
     | 
| 
       179 
     | 
    
         
            -
                     
     | 
| 
       180 
     | 
    
         
            -
                     
     | 
| 
       181 
     | 
    
         
            -
                     
     | 
| 
       182 
     | 
    
         
            -
             
     | 
| 
       183 
     | 
    
         
            -
             
     | 
| 
       184 
     | 
    
         
            -
                   
     | 
| 
       185 
     | 
    
         
            -
             
     | 
| 
       186 
     | 
    
         
            -
                  #  
     | 
| 
       187 
     | 
    
         
            -
                  #
         
     | 
| 
       188 
     | 
    
         
            -
                   
     | 
| 
       189 
     | 
    
         
            -
             
     | 
| 
       190 
     | 
    
         
            -
             
     | 
| 
       191 
     | 
    
         
            -
                     
     | 
| 
       192 
     | 
    
         
            -
             
     | 
| 
       193 
     | 
    
         
            -
             
     | 
| 
       194 
     | 
    
         
            -
                   
     | 
| 
       195 
     | 
    
         
            -
             
     | 
| 
       196 
     | 
    
         
            -
                  #  
     | 
| 
       197 
     | 
    
         
            -
                  #
         
     | 
| 
       198 
     | 
    
         
            -
                   
     | 
| 
       199 
     | 
    
         
            -
             
     | 
| 
       200 
     | 
    
         
            -
             
     | 
| 
       201 
     | 
    
         
            -
             
     | 
| 
       202 
     | 
    
         
            -
             
     | 
| 
       203 
     | 
    
         
            -
                   
     | 
| 
       204 
     | 
    
         
            -
             
     | 
| 
       205 
     | 
    
         
            -
                  #  
     | 
| 
       206 
     | 
    
         
            -
                  #
         
     | 
| 
       207 
     | 
    
         
            -
                   
     | 
| 
       208 
     | 
    
         
            -
             
     | 
| 
       209 
     | 
    
         
            -
             
     | 
| 
       210 
     | 
    
         
            -
             
     | 
| 
       211 
     | 
    
         
            -
             
     | 
| 
       212 
     | 
    
         
            -
                   
     | 
| 
       213 
     | 
    
         
            -
             
     | 
| 
       214 
     | 
    
         
            -
                  #  
     | 
| 
       215 
     | 
    
         
            -
                   
     | 
| 
       216 
     | 
    
         
            -
             
     | 
| 
       217 
     | 
    
         
            -
                   
     | 
| 
       218 
     | 
    
         
            -
             
     | 
| 
       219 
     | 
    
         
            -
                   
     | 
| 
       220 
     | 
    
         
            -
             
     | 
| 
       221 
     | 
    
         
            -
                   
     | 
| 
       222 
     | 
    
         
            -
             
     | 
| 
       223 
     | 
    
         
            -
             
     | 
| 
       224 
     | 
    
         
            -
             
     | 
| 
       225 
     | 
    
         
            -
             
     | 
| 
       226 
     | 
    
         
            -
             
     | 
| 
       227 
     | 
    
         
            -
                 
     | 
| 
       228 
     | 
    
         
            -
             
     | 
| 
       229 
     | 
    
         
            -
                #
         
     | 
| 
       230 
     | 
    
         
            -
                 
     | 
| 
       231 
     | 
    
         
            -
             
     | 
| 
       232 
     | 
    
         
            -
             
     | 
| 
       233 
     | 
    
         
            -
             
     | 
| 
       234 
     | 
    
         
            -
                  #  
     | 
| 
       235 
     | 
    
         
            -
                  #
         
     | 
| 
       236 
     | 
    
         
            -
                   
     | 
| 
       237 
     | 
    
         
            -
             
     | 
| 
       238 
     | 
    
         
            -
                   
     | 
| 
       239 
     | 
    
         
            -
             
     | 
| 
       240 
     | 
    
         
            -
                   
     | 
| 
       241 
     | 
    
         
            -
             
     | 
| 
       242 
     | 
    
         
            -
                  #  
     | 
| 
       243 
     | 
    
         
            -
                  #
         
     | 
| 
       244 
     | 
    
         
            -
                   
     | 
| 
       245 
     | 
    
         
            -
             
     | 
| 
       246 
     | 
    
         
            -
                   
     | 
| 
       247 
     | 
    
         
            -
             
     | 
| 
       248 
     | 
    
         
            -
                   
     | 
| 
       249 
     | 
    
         
            -
             
     | 
| 
       250 
     | 
    
         
            -
                  #  
     | 
| 
       251 
     | 
    
         
            -
                  #
         
     | 
| 
       252 
     | 
    
         
            -
                   
     | 
| 
       253 
     | 
    
         
            -
             
     | 
| 
       254 
     | 
    
         
            -
             
     | 
| 
       255 
     | 
    
         
            -
                     
     | 
| 
       256 
     | 
    
         
            -
                    return super unless  
     | 
| 
       257 
     | 
    
         
            -
                     
     | 
| 
       258 
     | 
    
         
            -
             
     | 
| 
       259 
     | 
    
         
            -
             
     | 
| 
       260 
     | 
    
         
            -
                   
     | 
| 
       261 
     | 
    
         
            -
             
     | 
| 
       262 
     | 
    
         
            -
                  #  
     | 
| 
       263 
     | 
    
         
            -
                  # 
     | 
| 
       264 
     | 
    
         
            -
                  # @ 
     | 
| 
       265 
     | 
    
         
            -
                  #
         
     | 
| 
       266 
     | 
    
         
            -
                   
     | 
| 
       267 
     | 
    
         
            -
             
     | 
| 
       268 
     | 
    
         
            -
             
     | 
| 
       269 
     | 
    
         
            -
             
     | 
| 
       270 
     | 
    
         
            -
             
     | 
| 
       271 
     | 
    
         
            -
             
     | 
| 
       272 
     | 
    
         
            -
                 
     | 
| 
       273 
     | 
    
         
            -
             
     | 
| 
       274 
     | 
    
         
            -
                #
         
     | 
| 
       275 
     | 
    
         
            -
                 
     | 
| 
       276 
     | 
    
         
            -
             
     | 
| 
       277 
     | 
    
         
            -
             
     | 
| 
       278 
     | 
    
         
            -
             
     | 
| 
       279 
     | 
    
         
            -
                  #  
     | 
| 
       280 
     | 
    
         
            -
                  #
         
     | 
| 
       281 
     | 
    
         
            -
                  # @ 
     | 
| 
       282 
     | 
    
         
            -
                  #
         
     | 
| 
       283 
     | 
    
         
            -
                   
     | 
| 
       284 
     | 
    
         
            -
             
     | 
| 
       285 
     | 
    
         
            -
                   
     | 
| 
       286 
     | 
    
         
            -
             
     | 
| 
       287 
     | 
    
         
            -
                   
     | 
| 
       288 
     | 
    
         
            -
             
     | 
| 
       289 
     | 
    
         
            -
                  #  
     | 
| 
       290 
     | 
    
         
            -
                  #
         
     | 
| 
       291 
     | 
    
         
            -
                  # @ 
     | 
| 
       292 
     | 
    
         
            -
                  #
         
     | 
| 
       293 
     | 
    
         
            -
                   
     | 
| 
       294 
     | 
    
         
            -
             
     | 
| 
       295 
     | 
    
         
            -
                   
     | 
| 
       296 
     | 
    
         
            -
             
     | 
| 
       297 
     | 
    
         
            -
                   
     | 
| 
       298 
     | 
    
         
            -
             
     | 
| 
       299 
     | 
    
         
            -
                   
     | 
| 
       300 
     | 
    
         
            -
             
     | 
| 
       301 
     | 
    
         
            -
             
     | 
| 
       302 
     | 
    
         
            -
             
     | 
| 
       303 
     | 
    
         
            -
             
     | 
| 
       304 
     | 
    
         
            -
             
     | 
| 
       305 
     | 
    
         
            -
                 
     | 
| 
       306 
     | 
    
         
            -
             
     | 
| 
       307 
     | 
    
         
            -
                #
         
     | 
| 
       308 
     | 
    
         
            -
                 
     | 
| 
       309 
     | 
    
         
            -
             
     | 
| 
       310 
     | 
    
         
            -
             
     | 
| 
       311 
     | 
    
         
            -
             
     | 
| 
       312 
     | 
    
         
            -
                  #  
     | 
| 
       313 
     | 
    
         
            -
                   
     | 
| 
       314 
     | 
    
         
            -
             
     | 
| 
       315 
     | 
    
         
            -
                   
     | 
| 
       316 
     | 
    
         
            -
             
     | 
| 
       317 
     | 
    
         
            -
                  #  
     | 
| 
       318 
     | 
    
         
            -
                  #
         
     | 
| 
       319 
     | 
    
         
            -
                  # @ 
     | 
| 
       320 
     | 
    
         
            -
                  #
         
     | 
| 
       321 
     | 
    
         
            -
                   
     | 
| 
       322 
     | 
    
         
            -
             
     | 
| 
       323 
     | 
    
         
            -
                   
     | 
| 
       324 
     | 
    
         
            -
             
     | 
| 
       325 
     | 
    
         
            -
                   
     | 
| 
       326 
     | 
    
         
            -
             
     | 
| 
       327 
     | 
    
         
            -
                  #  
     | 
| 
       328 
     | 
    
         
            -
                  #
         
     | 
| 
       329 
     | 
    
         
            -
                  # @ 
     | 
| 
       330 
     | 
    
         
            -
                  #
         
     | 
| 
       331 
     | 
    
         
            -
                   
     | 
| 
       332 
     | 
    
         
            -
             
     | 
| 
       333 
     | 
    
         
            -
                   
     | 
| 
       334 
     | 
    
         
            -
             
     | 
| 
       335 
     | 
    
         
            -
                   
     | 
| 
       336 
     | 
    
         
            -
             
     | 
| 
       337 
     | 
    
         
            -
                   
     | 
| 
       338 
     | 
    
         
            -
             
     | 
| 
       339 
     | 
    
         
            -
                   
     | 
| 
       340 
     | 
    
         
            -
                     
     | 
| 
       341 
     | 
    
         
            -
                   
     | 
| 
       342 
     | 
    
         
            -
             
     | 
| 
       343 
     | 
    
         
            -
             
     | 
| 
       344 
     | 
    
         
            -
                 
     | 
| 
       345 
     | 
    
         
            -
             
     | 
| 
       346 
     | 
    
         
            -
                #
         
     | 
| 
       347 
     | 
    
         
            -
                 
     | 
| 
       348 
     | 
    
         
            -
             
     | 
| 
       349 
     | 
    
         
            -
             
     | 
| 
       350 
     | 
    
         
            -
             
     | 
| 
       351 
     | 
    
         
            -
                  #
         
     | 
| 
       352 
     | 
    
         
            -
                  #  
     | 
| 
       353 
     | 
    
         
            -
                  #
         
     | 
| 
       354 
     | 
    
         
            -
                   
     | 
| 
       355 
     | 
    
         
            -
             
     | 
| 
       356 
     | 
    
         
            -
                   
     | 
| 
       357 
     | 
    
         
            -
             
     | 
| 
       358 
     | 
    
         
            -
                  #  
     | 
| 
       359 
     | 
    
         
            -
                   
     | 
| 
       360 
     | 
    
         
            -
             
     | 
| 
       361 
     | 
    
         
            -
                   
     | 
| 
       362 
     | 
    
         
            -
             
     | 
| 
       363 
     | 
    
         
            -
                  #
         
     | 
| 
       364 
     | 
    
         
            -
                  #  
     | 
| 
       365 
     | 
    
         
            -
                  # 
     | 
| 
       366 
     | 
    
         
            -
                  #
         
     | 
| 
       367 
     | 
    
         
            -
                   
     | 
| 
       368 
     | 
    
         
            -
             
     | 
| 
       369 
     | 
    
         
            -
             
     | 
| 
       370 
     | 
    
         
            -
                     
     | 
| 
       371 
     | 
    
         
            -
             
     | 
| 
       372 
     | 
    
         
            -
             
     | 
| 
       373 
     | 
    
         
            -
                   
     | 
| 
       374 
     | 
    
         
            -
             
     | 
| 
       375 
     | 
    
         
            -
                  #  
     | 
| 
       376 
     | 
    
         
            -
                  #
         
     | 
| 
       377 
     | 
    
         
            -
                   
     | 
| 
       378 
     | 
    
         
            -
             
     | 
| 
       379 
     | 
    
         
            -
             
     | 
| 
       380 
     | 
    
         
            -
                     
     | 
| 
       381 
     | 
    
         
            -
                     
     | 
| 
       382 
     | 
    
         
            -
             
     | 
| 
       383 
     | 
    
         
            -
             
     | 
| 
       384 
     | 
    
         
            -
                   
     | 
| 
       385 
     | 
    
         
            -
             
     | 
| 
       386 
     | 
    
         
            -
                  #  
     | 
| 
       387 
     | 
    
         
            -
                  #
         
     | 
| 
       388 
     | 
    
         
            -
                   
     | 
| 
       389 
     | 
    
         
            -
             
     | 
| 
       390 
     | 
    
         
            -
             
     | 
| 
       391 
     | 
    
         
            -
                     
     | 
| 
       392 
     | 
    
         
            -
                      date     = @ 
     | 
| 
       393 
     | 
    
         
            -
             
     | 
| 
       394 
     | 
    
         
            -
             
     | 
| 
       395 
     | 
    
         
            -
             
     | 
| 
       396 
     | 
    
         
            -
                     
     | 
| 
       397 
     | 
    
         
            -
                    date
         
     | 
| 
       398 
     | 
    
         
            -
             
     | 
| 
       399 
     | 
    
         
            -
             
     | 
| 
       400 
     | 
    
         
            -
                   
     | 
| 
       401 
     | 
    
         
            -
             
     | 
| 
       402 
     | 
    
         
            -
                  #  
     | 
| 
       403 
     | 
    
         
            -
                  #
         
     | 
| 
       404 
     | 
    
         
            -
                   
     | 
| 
       405 
     | 
    
         
            -
             
     | 
| 
       406 
     | 
    
         
            -
             
     | 
| 
       407 
     | 
    
         
            -
                     
     | 
| 
       408 
     | 
    
         
            -
                     
     | 
| 
       409 
     | 
    
         
            -
             
     | 
| 
       410 
     | 
    
         
            -
             
     | 
| 
       411 
     | 
    
         
            -
             
     | 
| 
       412 
     | 
    
         
            -
             
     | 
| 
       413 
     | 
    
         
            -
                   
     | 
| 
       414 
     | 
    
         
            -
             
     | 
| 
       415 
     | 
    
         
            -
                  #  
     | 
| 
       416 
     | 
    
         
            -
                  # 
     | 
| 
       417 
     | 
    
         
            -
                  # @ 
     | 
| 
       418 
     | 
    
         
            -
                  #
         
     | 
| 
       419 
     | 
    
         
            -
                   
     | 
| 
       420 
     | 
    
         
            -
             
     | 
| 
       421 
     | 
    
         
            -
                   
     | 
| 
       422 
     | 
    
         
            -
             
     | 
| 
       423 
     | 
    
         
            -
                   
     | 
| 
       424 
     | 
    
         
            -
             
     | 
| 
       425 
     | 
    
         
            -
                  #  
     | 
| 
       426 
     | 
    
         
            -
                   
     | 
| 
       427 
     | 
    
         
            -
             
     | 
| 
       428 
     | 
    
         
            -
                   
     | 
| 
       429 
     | 
    
         
            -
             
     | 
| 
       430 
     | 
    
         
            -
                   
     | 
| 
       431 
     | 
    
         
            -
             
     | 
| 
       432 
     | 
    
         
            -
                   
     | 
| 
       433 
     | 
    
         
            -
             
     | 
| 
       434 
     | 
    
         
            -
                  # 
     | 
| 
       435 
     | 
    
         
            -
                  # 
     | 
| 
       436 
     | 
    
         
            -
                  #   @ 
     | 
| 
       437 
     | 
    
         
            -
                  #   @ 
     | 
| 
       438 
     | 
    
         
            -
                  #   @ 
     | 
| 
       439 
     | 
    
         
            -
                  #   @ 
     | 
| 
       440 
     | 
    
         
            -
                  #   @ 
     | 
| 
       441 
     | 
    
         
            -
                  #
         
     | 
| 
       442 
     | 
    
         
            -
                   
     | 
| 
       443 
     | 
    
         
            -
             
     | 
| 
       444 
     | 
    
         
            -
             
     | 
| 
       445 
     | 
    
         
            -
                     
     | 
| 
       446 
     | 
    
         
            -
             
     | 
| 
       447 
     | 
    
         
            -
                     
     | 
| 
       448 
     | 
    
         
            -
                    @ 
     | 
| 
       449 
     | 
    
         
            -
             
     | 
| 
       450 
     | 
    
         
            -
                     
     | 
| 
       451 
     | 
    
         
            -
             
     | 
| 
       452 
     | 
    
         
            -
                     
     | 
| 
       453 
     | 
    
         
            -
                     
     | 
| 
       454 
     | 
    
         
            -
                     
     | 
| 
       455 
     | 
    
         
            -
                     
     | 
| 
       456 
     | 
    
         
            -
                     
     | 
| 
       457 
     | 
    
         
            -
             
     | 
| 
       458 
     | 
    
         
            -
                    if @ 
     | 
| 
       459 
     | 
    
         
            -
             
     | 
| 
       460 
     | 
    
         
            -
             
     | 
| 
       461 
     | 
    
         
            -
                       
     | 
| 
       462 
     | 
    
         
            -
                      @ 
     | 
| 
       463 
     | 
    
         
            -
             
     | 
| 
       464 
     | 
    
         
            -
                      @reform_jdn  
     | 
| 
       465 
     | 
    
         
            -
             
     | 
| 
       466 
     | 
    
         
            -
                      @ 
     | 
| 
       467 
     | 
    
         
            -
             
     | 
| 
       468 
     | 
    
         
            -
             
     | 
| 
       469 
     | 
    
         
            -
             
     | 
| 
       470 
     | 
    
         
            -
                     
     | 
| 
       471 
     | 
    
         
            -
             
     | 
| 
       472 
     | 
    
         
            -
             
     | 
| 
       473 
     | 
    
         
            -
                     
     | 
| 
       474 
     | 
    
         
            -
             
     | 
| 
       475 
     | 
    
         
            -
                     
     | 
| 
       476 
     | 
    
         
            -
                     
     | 
| 
       477 
     | 
    
         
            -
                     
     | 
| 
       478 
     | 
    
         
            -
             
     | 
| 
       479 
     | 
    
         
            -
             
     | 
| 
       480 
     | 
    
         
            -
             
     | 
| 
       481 
     | 
    
         
            -
                       
     | 
| 
       482 
     | 
    
         
            -
             
     | 
| 
       483 
     | 
    
         
            -
                      @ 
     | 
| 
       484 
     | 
    
         
            -
             
     | 
| 
       485 
     | 
    
         
            -
             
     | 
| 
       486 
     | 
    
         
            -
                     
     | 
| 
       487 
     | 
    
         
            -
             
     | 
| 
       488 
     | 
    
         
            -
             
     | 
| 
       489 
     | 
    
         
            -
                   
     | 
| 
       490 
     | 
    
         
            -
             
     | 
| 
       491 
     | 
    
         
            -
                  #
         
     | 
| 
       492 
     | 
    
         
            -
                   
     | 
| 
       493 
     | 
    
         
            -
             
     | 
| 
       494 
     | 
    
         
            -
             
     | 
| 
       495 
     | 
    
         
            -
                     
     | 
| 
       496 
     | 
    
         
            -
             
     | 
| 
       497 
     | 
    
         
            -
             
     | 
| 
       498 
     | 
    
         
            -
                   
     | 
| 
       499 
     | 
    
         
            -
             
     | 
| 
       500 
     | 
    
         
            -
                  #
         
     | 
| 
       501 
     | 
    
         
            -
                   
     | 
| 
       502 
     | 
    
         
            -
             
     | 
| 
       503 
     | 
    
         
            -
             
     | 
| 
       504 
     | 
    
         
            -
                     
     | 
| 
       505 
     | 
    
         
            -
             
     | 
| 
       506 
     | 
    
         
            -
             
     | 
| 
       507 
     | 
    
         
            -
             
     | 
| 
       508 
     | 
    
         
            -
             
     | 
| 
       509 
     | 
    
         
            -
               
     | 
| 
       510 
     | 
    
         
            -
             
     | 
| 
       511 
     | 
    
         
            -
             
     | 
| 
       512 
     | 
    
         
            -
             
     | 
| 
       513 
     | 
    
         
            -
                #
         
     | 
| 
       514 
     | 
    
         
            -
                 
     | 
| 
       515 
     | 
    
         
            -
             
     | 
| 
       516 
     | 
    
         
            -
             
     | 
| 
       517 
     | 
    
         
            -
             
     | 
| 
       518 
     | 
    
         
            -
                  #  
     | 
| 
       519 
     | 
    
         
            -
                  # 
     | 
| 
       520 
     | 
    
         
            -
                  #
         
     | 
| 
       521 
     | 
    
         
            -
                  # @ 
     | 
| 
       522 
     | 
    
         
            -
                  #
         
     | 
| 
       523 
     | 
    
         
            -
                   
     | 
| 
       524 
     | 
    
         
            -
             
     | 
| 
       525 
     | 
    
         
            -
                   
     | 
| 
       526 
     | 
    
         
            -
             
     | 
| 
       527 
     | 
    
         
            -
                   
     | 
| 
       528 
     | 
    
         
            -
             
     | 
| 
       529 
     | 
    
         
            -
                   
     | 
| 
       530 
     | 
    
         
            -
             
     | 
| 
       531 
     | 
    
         
            -
             
     | 
| 
       532 
     | 
    
         
            -
                   
     | 
| 
       533 
     | 
    
         
            -
             
     | 
| 
       534 
     | 
    
         
            -
             
     | 
| 
       535 
     | 
    
         
            -
             
     | 
| 
       536 
     | 
    
         
            -
               
     | 
| 
       537 
     | 
    
         
            -
             
     | 
| 
       538 
     | 
    
         
            -
              #
         
     | 
| 
       539 
     | 
    
         
            -
               
     | 
| 
       540 
     | 
    
         
            -
             
     | 
| 
       541 
     | 
    
         
            -
             
     | 
| 
       542 
     | 
    
         
            -
             
     | 
| 
       543 
     | 
    
         
            -
             
     | 
| 
       544 
     | 
    
         
            -
             
     | 
| 
       545 
     | 
    
         
            -
                   
     | 
| 
       546 
     | 
    
         
            -
             
     | 
| 
       547 
     | 
    
         
            -
             
     | 
| 
       548 
     | 
    
         
            -
                   
     | 
| 
       549 
     | 
    
         
            -
             
     | 
| 
       550 
     | 
    
         
            -
                   
     | 
| 
       551 
     | 
    
         
            -
             
     | 
| 
       552 
     | 
    
         
            -
             
     | 
| 
       553 
     | 
    
         
            -
             
     | 
| 
       554 
     | 
    
         
            -
             
     | 
| 
       555 
     | 
    
         
            -
                     
     | 
| 
       556 
     | 
    
         
            -
             
     | 
| 
       557 
     | 
    
         
            -
             
     | 
| 
       558 
     | 
    
         
            -
                   
     | 
| 
       559 
     | 
    
         
            -
             
     | 
| 
       560 
     | 
    
         
            -
             
     | 
| 
       561 
     | 
    
         
            -
             
     | 
| 
       562 
     | 
    
         
            -
                     
     | 
| 
       563 
     | 
    
         
            -
                    [When::BasicTypes::M17n, "names:[ 
     | 
| 
       564 
     | 
    
         
            -
                    [When::BasicTypes::M17n, "names:[ 
     | 
| 
       565 
     | 
    
         
            -
                    [When::BasicTypes::M17n, "names:[ 
     | 
| 
       566 
     | 
    
         
            -
             
     | 
| 
       567 
     | 
    
         
            -
             
     | 
| 
       568 
     | 
    
         
            -
             
     | 
| 
       569 
     | 
    
         
            -
                 
     | 
| 
       570 
     | 
    
         
            -
             
     | 
| 
       571 
     | 
    
         
            -
             
     | 
| 
       572 
     | 
    
         
            -
             
     | 
| 
       573 
     | 
    
         
            -
                  [  
     | 
| 
       574 
     | 
    
         
            -
                  [ 3, 
     | 
| 
       575 
     | 
    
         
            -
                  [  
     | 
| 
       576 
     | 
    
         
            -
                  [  
     | 
| 
       577 
     | 
    
         
            -
                  [  
     | 
| 
       578 
     | 
    
         
            -
                  [  
     | 
| 
       579 
     | 
    
         
            -
                  [ 
     | 
| 
       580 
     | 
    
         
            -
                  [ 
     | 
| 
       581 
     | 
    
         
            -
                  [ 
     | 
| 
       582 
     | 
    
         
            -
             
     | 
| 
       583 
     | 
    
         
            -
             
     | 
| 
       584 
     | 
    
         
            -
             
     | 
| 
       585 
     | 
    
         
            -
                 
     | 
| 
       586 
     | 
    
         
            -
             
     | 
| 
       587 
     | 
    
         
            -
                 
     | 
| 
       588 
     | 
    
         
            -
             
     | 
| 
       589 
     | 
    
         
            -
             
     | 
| 
       590 
     | 
    
         
            -
             
     | 
| 
       591 
     | 
    
         
            -
             
     | 
| 
       592 
     | 
    
         
            -
             
     | 
| 
       593 
     | 
    
         
            -
             
     | 
| 
       594 
     | 
    
         
            -
                     
     | 
| 
       595 
     | 
    
         
            -
             
     | 
| 
       596 
     | 
    
         
            -
             
     | 
| 
       597 
     | 
    
         
            -
             
     | 
| 
       598 
     | 
    
         
            -
             
     | 
| 
       599 
     | 
    
         
            -
             
     | 
| 
       600 
     | 
    
         
            -
             
     | 
| 
       601 
     | 
    
         
            -
                 
     | 
| 
       602 
     | 
    
         
            -
             
     | 
| 
       603 
     | 
    
         
            -
             
     | 
| 
       604 
     | 
    
         
            -
             
     | 
| 
       605 
     | 
    
         
            -
                   
     | 
| 
       606 
     | 
    
         
            -
                  - 
     | 
| 
       607 
     | 
    
         
            -
                  - 
     | 
| 
       608 
     | 
    
         
            -
                  - 
     | 
| 
       609 
     | 
    
         
            -
                  - 
     | 
| 
       610 
     | 
    
         
            -
                  - 
     | 
| 
       611 
     | 
    
         
            -
                  - 
     | 
| 
       612 
     | 
    
         
            -
                  - 
     | 
| 
       613 
     | 
    
         
            -
                  - 
     | 
| 
       614 
     | 
    
         
            -
             
     | 
| 
       615 
     | 
    
         
            -
             
     | 
| 
       616 
     | 
    
         
            -
             
     | 
| 
       617 
     | 
    
         
            -
             
     | 
| 
       618 
     | 
    
         
            -
             
     | 
| 
       619 
     | 
    
         
            -
             
     | 
| 
       620 
     | 
    
         
            -
                    
     | 
| 
       621 
     | 
    
         
            -
                    
     | 
| 
       622 
     | 
    
         
            -
                    
     | 
| 
       623 
     | 
    
         
            -
                    
     | 
| 
       624 
     | 
    
         
            -
             
     | 
| 
       625 
     | 
    
         
            -
             
     | 
| 
       626 
     | 
    
         
            -
                 
     | 
| 
       627 
     | 
    
         
            -
             
     | 
| 
       628 
     | 
    
         
            -
                #
         
     | 
| 
       629 
     | 
    
         
            -
                 
     | 
| 
       630 
     | 
    
         
            -
             
     | 
| 
       631 
     | 
    
         
            -
                 
     | 
| 
       632 
     | 
    
         
            -
             
     | 
| 
       633 
     | 
    
         
            -
                 
     | 
| 
       634 
     | 
    
         
            -
             
     | 
| 
       635 
     | 
    
         
            -
                 
     | 
| 
       636 
     | 
    
         
            -
             
     | 
| 
       637 
     | 
    
         
            -
                 
     | 
| 
       638 
     | 
    
         
            -
             
     | 
| 
       639 
     | 
    
         
            -
                 
     | 
| 
       640 
     | 
    
         
            -
             
     | 
| 
       641 
     | 
    
         
            -
                 
     | 
| 
       642 
     | 
    
         
            -
             
     | 
| 
       643 
     | 
    
         
            -
                 
     | 
| 
       644 
     | 
    
         
            -
             
     | 
| 
       645 
     | 
    
         
            -
                 
     | 
| 
       646 
     | 
    
         
            -
             
     | 
| 
       647 
     | 
    
         
            -
                 
     | 
| 
       648 
     | 
    
         
            -
             
     | 
| 
       649 
     | 
    
         
            -
                 
     | 
| 
       650 
     | 
    
         
            -
             
     | 
| 
       651 
     | 
    
         
            -
                 
     | 
| 
       652 
     | 
    
         
            -
             
     | 
| 
       653 
     | 
    
         
            -
                 
     | 
| 
       654 
     | 
    
         
            -
             
     | 
| 
       655 
     | 
    
         
            -
                 
     | 
| 
       656 
     | 
    
         
            -
             
     | 
| 
       657 
     | 
    
         
            -
                 
     | 
| 
       658 
     | 
    
         
            -
             
     | 
| 
       659 
     | 
    
         
            -
                 
     | 
| 
       660 
     | 
    
         
            -
             
     | 
| 
       661 
     | 
    
         
            -
                 
     | 
| 
       662 
     | 
    
         
            -
             
     | 
| 
       663 
     | 
    
         
            -
                 
     | 
| 
       664 
     | 
    
         
            -
             
     | 
| 
       665 
     | 
    
         
            -
                 
     | 
| 
       666 
     | 
    
         
            -
             
     | 
| 
       667 
     | 
    
         
            -
                 
     | 
| 
       668 
     | 
    
         
            -
             
     | 
| 
       669 
     | 
    
         
            -
                #  
     | 
| 
       670 
     | 
    
         
            -
                # 
     | 
| 
       671 
     | 
    
         
            -
                #
         
     | 
| 
       672 
     | 
    
         
            -
                # @ 
     | 
| 
       673 
     | 
    
         
            -
                #
         
     | 
| 
       674 
     | 
    
         
            -
                 
     | 
| 
       675 
     | 
    
         
            -
             
     | 
| 
       676 
     | 
    
         
            -
                 
     | 
| 
       677 
     | 
    
         
            -
             
     | 
| 
       678 
     | 
    
         
            -
                 
     | 
| 
       679 
     | 
    
         
            -
             
     | 
| 
       680 
     | 
    
         
            -
                #  
     | 
| 
       681 
     | 
    
         
            -
                # 
     | 
| 
       682 
     | 
    
         
            -
                # @param [ 
     | 
| 
       683 
     | 
    
         
            -
                #
         
     | 
| 
       684 
     | 
    
         
            -
                # @ 
     | 
| 
       685 
     | 
    
         
            -
                # 
     | 
| 
       686 
     | 
    
         
            -
                #
         
     | 
| 
       687 
     | 
    
         
            -
                 
     | 
| 
       688 
     | 
    
         
            -
             
     | 
| 
       689 
     | 
    
         
            -
             
     | 
| 
       690 
     | 
    
         
            -
                   
     | 
| 
       691 
     | 
    
         
            -
             
     | 
| 
       692 
     | 
    
         
            -
             
     | 
| 
       693 
     | 
    
         
            -
                 
     | 
| 
       694 
     | 
    
         
            -
             
     | 
| 
       695 
     | 
    
         
            -
                #  
     | 
| 
       696 
     | 
    
         
            -
                # 
     | 
| 
       697 
     | 
    
         
            -
                # @param [ 
     | 
| 
       698 
     | 
    
         
            -
                #
         
     | 
| 
       699 
     | 
    
         
            -
                # @ 
     | 
| 
       700 
     | 
    
         
            -
                # 
     | 
| 
       701 
     | 
    
         
            -
                #
         
     | 
| 
       702 
     | 
    
         
            -
                 
     | 
| 
       703 
     | 
    
         
            -
             
     | 
| 
       704 
     | 
    
         
            -
             
     | 
| 
       705 
     | 
    
         
            -
             
     | 
| 
       706 
     | 
    
         
            -
                     
     | 
| 
       707 
     | 
    
         
            -
             
     | 
| 
       708 
     | 
    
         
            -
                     
     | 
| 
       709 
     | 
    
         
            -
                      m +=  
     | 
| 
       710 
     | 
    
         
            -
             
     | 
| 
       711 
     | 
    
         
            -
             
     | 
| 
       712 
     | 
    
         
            -
             
     | 
| 
       713 
     | 
    
         
            -
                     
     | 
| 
       714 
     | 
    
         
            -
                    result  
     | 
| 
       715 
     | 
    
         
            -
             
     | 
| 
       716 
     | 
    
         
            -
             
     | 
| 
       717 
     | 
    
         
            -
             
     | 
| 
       718 
     | 
    
         
            -
                 
     | 
| 
       719 
     | 
    
         
            -
             
     | 
| 
       720 
     | 
    
         
            -
                 
     | 
| 
       721 
     | 
    
         
            -
             
     | 
| 
       722 
     | 
    
         
            -
                 
     | 
| 
       723 
     | 
    
         
            -
             
     | 
| 
       724 
     | 
    
         
            -
                 
     | 
| 
       725 
     | 
    
         
            -
             
     | 
| 
       726 
     | 
    
         
            -
             
     | 
| 
       727 
     | 
    
         
            -
                 
     | 
| 
       728 
     | 
    
         
            -
             
     | 
| 
       729 
     | 
    
         
            -
             
     | 
| 
       730 
     | 
    
         
            -
                 
     | 
| 
       731 
     | 
    
         
            -
             
     | 
| 
       732 
     | 
    
         
            -
                #  
     | 
| 
       733 
     | 
    
         
            -
                # 
     | 
| 
       734 
     | 
    
         
            -
                #
         
     | 
| 
       735 
     | 
    
         
            -
                # @ 
     | 
| 
       736 
     | 
    
         
            -
                # 
     | 
| 
       737 
     | 
    
         
            -
                #
         
     | 
| 
       738 
     | 
    
         
            -
                 
     | 
| 
       739 
     | 
    
         
            -
             
     | 
| 
       740 
     | 
    
         
            -
             
     | 
| 
       741 
     | 
    
         
            -
             
     | 
| 
       742 
     | 
    
         
            -
             
     | 
| 
       743 
     | 
    
         
            -
                 
     | 
| 
       744 
     | 
    
         
            -
             
     | 
| 
       745 
     | 
    
         
            -
                #  
     | 
| 
       746 
     | 
    
         
            -
                # 
     | 
| 
       747 
     | 
    
         
            -
                #
         
     | 
| 
       748 
     | 
    
         
            -
                # @ 
     | 
| 
       749 
     | 
    
         
            -
                # 
     | 
| 
       750 
     | 
    
         
            -
                #
         
     | 
| 
       751 
     | 
    
         
            -
                 
     | 
| 
       752 
     | 
    
         
            -
             
     | 
| 
       753 
     | 
    
         
            -
             
     | 
| 
       754 
     | 
    
         
            -
                   
     | 
| 
       755 
     | 
    
         
            -
                   
     | 
| 
       756 
     | 
    
         
            -
             
     | 
| 
       757 
     | 
    
         
            -
             
     | 
| 
       758 
     | 
    
         
            -
                 
     | 
| 
       759 
     | 
    
         
            -
             
     | 
| 
       760 
     | 
    
         
            -
                 
     | 
| 
       761 
     | 
    
         
            -
             
     | 
| 
       762 
     | 
    
         
            -
                # 
     | 
| 
       763 
     | 
    
         
            -
                #    
     | 
| 
       764 
     | 
    
         
            -
                #    
     | 
| 
       765 
     | 
    
         
            -
                #    
     | 
| 
       766 
     | 
    
         
            -
                #    
     | 
| 
       767 
     | 
    
         
            -
                #    
     | 
| 
       768 
     | 
    
         
            -
                #    
     | 
| 
       769 
     | 
    
         
            -
                #    
     | 
| 
       770 
     | 
    
         
            -
                 
     | 
| 
       771 
     | 
    
         
            -
             
     | 
| 
       772 
     | 
    
         
            -
             
     | 
| 
       773 
     | 
    
         
            -
                   
     | 
| 
       774 
     | 
    
         
            -
                  @ 
     | 
| 
       775 
     | 
    
         
            -
                  @ 
     | 
| 
       776 
     | 
    
         
            -
                  @ 
     | 
| 
       777 
     | 
    
         
            -
                  @ 
     | 
| 
       778 
     | 
    
         
            -
                  @ 
     | 
| 
       779 
     | 
    
         
            -
                  @ 
     | 
| 
       780 
     | 
    
         
            -
                  @ 
     | 
| 
       781 
     | 
    
         
            -
                  @ 
     | 
| 
       782 
     | 
    
         
            -
                  @ 
     | 
| 
       783 
     | 
    
         
            -
                   
     | 
| 
       784 
     | 
    
         
            -
             
     | 
| 
       785 
     | 
    
         
            -
             
     | 
| 
       786 
     | 
    
         
            -
                 
     | 
| 
       787 
     | 
    
         
            -
             
     | 
| 
       788 
     | 
    
         
            -
                #
         
     | 
| 
       789 
     | 
    
         
            -
                 
     | 
| 
       790 
     | 
    
         
            -
             
     | 
| 
       791 
     | 
    
         
            -
             
     | 
| 
       792 
     | 
    
         
            -
                  return When:: 
     | 
| 
       793 
     | 
    
         
            -
             
     | 
| 
       794 
     | 
    
         
            -
                  When 
     | 
| 
       795 
     | 
    
         
            -
             
     | 
| 
       796 
     | 
    
         
            -
             
     | 
| 
       797 
     | 
    
         
            -
                 
     | 
| 
       798 
     | 
    
         
            -
             
     | 
| 
       799 
     | 
    
         
            -
                # 
     | 
| 
       800 
     | 
    
         
            -
                #    
     | 
| 
       801 
     | 
    
         
            -
                #
         
     | 
| 
       802 
     | 
    
         
            -
                #  
     | 
| 
       803 
     | 
    
         
            -
                # 
     | 
| 
       804 
     | 
    
         
            -
                #
         
     | 
| 
       805 
     | 
    
         
            -
                 
     | 
| 
       806 
     | 
    
         
            -
             
     | 
| 
       807 
     | 
    
         
            -
             
     | 
| 
       808 
     | 
    
         
            -
             
     | 
| 
       809 
     | 
    
         
            -
                  when  
     | 
| 
       810 
     | 
    
         
            -
                     
     | 
| 
       811 
     | 
    
         
            -
             
     | 
| 
       812 
     | 
    
         
            -
                    options 
     | 
| 
       813 
     | 
    
         
            -
                     
     | 
| 
       814 
     | 
    
         
            -
             
     | 
| 
       815 
     | 
    
         
            -
             
     | 
| 
       816 
     | 
    
         
            -
             
     | 
| 
       817 
     | 
    
         
            -
                       
     | 
| 
       818 
     | 
    
         
            -
                     
     | 
| 
       819 
     | 
    
         
            -
             
     | 
| 
       820 
     | 
    
         
            -
             
     | 
| 
       821 
     | 
    
         
            -
                     
     | 
| 
       822 
     | 
    
         
            -
                   
     | 
| 
       823 
     | 
    
         
            -
             
     | 
| 
       824 
     | 
    
         
            -
                   
     | 
| 
       825 
     | 
    
         
            -
                   
     | 
| 
       826 
     | 
    
         
            -
                   
     | 
| 
       827 
     | 
    
         
            -
             
     | 
| 
       828 
     | 
    
         
            -
             
     | 
| 
       829 
     | 
    
         
            -
            end
         
     | 
| 
      
 1 
     | 
    
         
            +
            # -*- coding: utf-8 -*-
         
     | 
| 
      
 2 
     | 
    
         
            +
            =begin
         
     | 
| 
      
 3 
     | 
    
         
            +
              Copyright (C) 2011-2015 Takashi SUGA
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
         
     | 
| 
      
 6 
     | 
    
         
            +
            =end
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            module When
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
              class BasicTypes::M17n
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                Christian = [self, [
         
     | 
| 
      
 13 
     | 
    
         
            +
                  "locale:[=en:, ja=ja:, alias]",
         
     | 
| 
      
 14 
     | 
    
         
            +
                  "names:[Christian=]",
         
     | 
| 
      
 15 
     | 
    
         
            +
                  "[Julian=en:Julian_calendar,                ユリウス暦    ]",
         
     | 
| 
      
 16 
     | 
    
         
            +
                  "[Gregorian=en:Gregorian_calendar,          グレゴリオ暦  ]",
         
     | 
| 
      
 17 
     | 
    
         
            +
                  "[RevisedJulian=en:Revised_Julian_calendar, 修正ユリウス暦]",
         
     | 
| 
      
 18 
     | 
    
         
            +
                  "[Swedish=en:Swedish_calendar,              スウェーデン暦]",
         
     | 
| 
      
 19 
     | 
    
         
            +
                  "[Civil in the West=en:Civil_calendar, 西暦, *alias:Civil]"
         
     | 
| 
      
 20 
     | 
    
         
            +
                ]]
         
     | 
| 
      
 21 
     | 
    
         
            +
              end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
              class TM::CalendarEra
         
     | 
| 
      
 24 
     | 
    
         
            +
                # Anno Mundi Era
         
     | 
| 
      
 25 
     | 
    
         
            +
                Byzantine = [self, [
         
     | 
| 
      
 26 
     | 
    
         
            +
                  "locale:[=en:, ja=ja:, alias]",
         
     | 
| 
      
 27 
     | 
    
         
            +
                  "period:[Byzantine=en:Byzantine_calendar, ビザンティン暦=ja:%%<世界創造紀元>]",
         
     | 
| 
      
 28 
     | 
    
         
            +
                  ["[AM=en:Anno_Mundi, 世界創造紀元, alias:Anno_Mundi]6497*9.1",
         
     | 
| 
      
 29 
     | 
    
         
            +
                   '@CE', "989*09-01^Julian?border=0*9-1¬e=Roman", "1453-5-29"]
         
     | 
| 
      
 30 
     | 
    
         
            +
                ]]
         
     | 
| 
      
 31 
     | 
    
         
            +
              end
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
              module CalendarTypes
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
                #
         
     | 
| 
      
 36 
     | 
    
         
            +
                # Christian Base Calendar
         
     | 
| 
      
 37 
     | 
    
         
            +
                #
         
     | 
| 
      
 38 
     | 
    
         
            +
                class Christian < When::TM::Calendar
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                  # デフォルトの改暦日付(ユリウス通日)
         
     | 
| 
      
 41 
     | 
    
         
            +
                  # 
         
     | 
| 
      
 42 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 43 
     | 
    
         
            +
                  DefaultReformDate = 2299161 # 1582-10-15
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 46 
     | 
    
         
            +
                  # 
         
     | 
| 
      
 47 
     | 
    
         
            +
                  # ::Date オブジェクトに対応する暦法名
         
     | 
| 
      
 48 
     | 
    
         
            +
                  # (require 'Date' されていることの保証は呼び出し側)
         
     | 
| 
      
 49 
     | 
    
         
            +
                  #
         
     | 
| 
      
 50 
     | 
    
         
            +
                  def self._default_start(date)
         
     | 
| 
      
 51 
     | 
    
         
            +
                    case date.start
         
     | 
| 
      
 52 
     | 
    
         
            +
                    when ::Date::JULIAN    ; return 'Julian'
         
     | 
| 
      
 53 
     | 
    
         
            +
                    when ::Date::GREGORIAN ; return 'Gregorian'
         
     | 
| 
      
 54 
     | 
    
         
            +
                    end
         
     | 
| 
      
 55 
     | 
    
         
            +
                    start = date.start
         
     | 
| 
      
 56 
     | 
    
         
            +
                    start = start.to_i if start == start.to_i
         
     | 
| 
      
 57 
     | 
    
         
            +
                    "Civil?reform_jdn=#{start}"
         
     | 
| 
      
 58 
     | 
    
         
            +
                  end
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
                  # 年月日 -> 通日
         
     | 
| 
      
 61 
     | 
    
         
            +
                  #
         
     | 
| 
      
 62 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_coordinates_to_number
         
     | 
| 
      
 63 
     | 
    
         
            +
                  #
         
     | 
| 
      
 64 
     | 
    
         
            +
                  def _coordinates_to_number(y,m,d)
         
     | 
| 
      
 65 
     | 
    
         
            +
                    m = (+m + 10) % 12
         
     | 
| 
      
 66 
     | 
    
         
            +
                    y =  +y + 4716 - m / 10
         
     | 
| 
      
 67 
     | 
    
         
            +
                    a = (1461*y.to_i    ).div(4)
         
     | 
| 
      
 68 
     | 
    
         
            +
                    b = ( 153*m.to_i + 2).div(5)
         
     | 
| 
      
 69 
     | 
    
         
            +
                    return a + b + (+d) - 1401
         
     | 
| 
      
 70 
     | 
    
         
            +
                  end
         
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
                  # 通日 - > 年月日
         
     | 
| 
      
 73 
     | 
    
         
            +
                  #
         
     | 
| 
      
 74 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_number_to_coordinates
         
     | 
| 
      
 75 
     | 
    
         
            +
                  #
         
     | 
| 
      
 76 
     | 
    
         
            +
                  def _number_to_coordinates(jdn)
         
     | 
| 
      
 77 
     | 
    
         
            +
                    j    =   jdn.to_i + 1401
         
     | 
| 
      
 78 
     | 
    
         
            +
                    y, t =  (4*j + 3).divmod(1461)
         
     | 
| 
      
 79 
     | 
    
         
            +
                    t    =   t.div(4)
         
     | 
| 
      
 80 
     | 
    
         
            +
                    m, d =  (5*t + 2).divmod(153)
         
     | 
| 
      
 81 
     | 
    
         
            +
                    d    =   d.div(5)
         
     | 
| 
      
 82 
     | 
    
         
            +
                    m    =  (m+2) % 12
         
     | 
| 
      
 83 
     | 
    
         
            +
                    y    =  y - 4716 + (13-m) / 12
         
     | 
| 
      
 84 
     | 
    
         
            +
                    return [y,m,d]
         
     | 
| 
      
 85 
     | 
    
         
            +
                  end
         
     | 
| 
      
 86 
     | 
    
         
            +
             
     | 
| 
      
 87 
     | 
    
         
            +
                  # 暦要素数
         
     | 
| 
      
 88 
     | 
    
         
            +
                  #
         
     | 
| 
      
 89 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_length
         
     | 
| 
      
 90 
     | 
    
         
            +
                  #
         
     | 
| 
      
 91 
     | 
    
         
            +
                  def _length(date)
         
     | 
| 
      
 92 
     | 
    
         
            +
                    yy, mm = date
         
     | 
| 
      
 93 
     | 
    
         
            +
                    return super unless(mm)
         
     | 
| 
      
 94 
     | 
    
         
            +
                    return ((yy % 4) == 0) ? 29 : 28 if (mm == 1)
         
     | 
| 
      
 95 
     | 
    
         
            +
                    return (((((mm + 10) % 12) % 5) % 2) == 0) ? 31 : 30
         
     | 
| 
      
 96 
     | 
    
         
            +
                  end
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
                  # 復活祭の遅延日数
         
     | 
| 
      
 99 
     | 
    
         
            +
                  # 
         
     | 
| 
      
 100 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 101 
     | 
    
         
            +
                  def _easter_delay(year)
         
     | 
| 
      
 102 
     | 
    
         
            +
                    0
         
     | 
| 
      
 103 
     | 
    
         
            +
                  end
         
     | 
| 
      
 104 
     | 
    
         
            +
             
     | 
| 
      
 105 
     | 
    
         
            +
                  private
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
                  def _normalize(args=[], options={})
         
     | 
| 
      
 108 
     | 
    
         
            +
                    raise TypeError, "#{self.class} is abstract class" unless @label
         
     | 
| 
      
 109 
     | 
    
         
            +
                    @note = When.CalendarNote(@note || 'Christian')
         
     | 
| 
      
 110 
     | 
    
         
            +
                    @diff_to_CE ||= 0
         
     | 
| 
      
 111 
     | 
    
         
            +
                    super
         
     | 
| 
      
 112 
     | 
    
         
            +
                  end
         
     | 
| 
      
 113 
     | 
    
         
            +
                end
         
     | 
| 
      
 114 
     | 
    
         
            +
             
     | 
| 
      
 115 
     | 
    
         
            +
                #
         
     | 
| 
      
 116 
     | 
    
         
            +
                # Julian Calendar
         
     | 
| 
      
 117 
     | 
    
         
            +
                #
         
     | 
| 
      
 118 
     | 
    
         
            +
                class Julian < Christian
         
     | 
| 
      
 119 
     | 
    
         
            +
             
     | 
| 
      
 120 
     | 
    
         
            +
                  # 太陰方程式
         
     | 
| 
      
 121 
     | 
    
         
            +
                  #
         
     | 
| 
      
 122 
     | 
    
         
            +
                  # @param [Numeric] year 西暦の年数
         
     | 
| 
      
 123 
     | 
    
         
            +
                  # @return [Integer] 0 (ユリウス暦では補正なし)
         
     | 
| 
      
 124 
     | 
    
         
            +
                  #
         
     | 
| 
      
 125 
     | 
    
         
            +
                  def _lunar_equation(year)
         
     | 
| 
      
 126 
     | 
    
         
            +
                    0
         
     | 
| 
      
 127 
     | 
    
         
            +
                  end
         
     | 
| 
      
 128 
     | 
    
         
            +
             
     | 
| 
      
 129 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 130 
     | 
    
         
            +
                  #
         
     | 
| 
      
 131 
     | 
    
         
            +
                  # 対応する ::Date の start 属性
         
     | 
| 
      
 132 
     | 
    
         
            +
                  def _default_start
         
     | 
| 
      
 133 
     | 
    
         
            +
                    ::Date::JULIAN
         
     | 
| 
      
 134 
     | 
    
         
            +
                  end
         
     | 
| 
      
 135 
     | 
    
         
            +
             
     | 
| 
      
 136 
     | 
    
         
            +
                  private
         
     | 
| 
      
 137 
     | 
    
         
            +
             
     | 
| 
      
 138 
     | 
    
         
            +
                  def _normalize(args=[], options={})
         
     | 
| 
      
 139 
     | 
    
         
            +
                    @label ||= 'Christian::Julian'
         
     | 
| 
      
 140 
     | 
    
         
            +
                    super
         
     | 
| 
      
 141 
     | 
    
         
            +
                  end
         
     | 
| 
      
 142 
     | 
    
         
            +
                end
         
     | 
| 
      
 143 
     | 
    
         
            +
             
     | 
| 
      
 144 
     | 
    
         
            +
                #
         
     | 
| 
      
 145 
     | 
    
         
            +
                # Swedish Calendar
         
     | 
| 
      
 146 
     | 
    
         
            +
                #
         
     | 
| 
      
 147 
     | 
    
         
            +
                class Swedish < Julian
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
                  # デフォルトの改暦日付(ユリウス通日)
         
     | 
| 
      
 150 
     | 
    
         
            +
                  # 
         
     | 
| 
      
 151 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 152 
     | 
    
         
            +
                  DefaultReformDate = 2361390 # 1753-03-01
         
     | 
| 
      
 153 
     | 
    
         
            +
             
     | 
| 
      
 154 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 155 
     | 
    
         
            +
                  #           Julian -  17000229  17120229
         
     | 
| 
      
 156 
     | 
    
         
            +
                  SwedishCalendarRange = 2342042...2346425
         
     | 
| 
      
 157 
     | 
    
         
            +
             
     | 
| 
      
 158 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 159 
     | 
    
         
            +
                  ExtraDate = [1712,1,29]
         
     | 
| 
      
 160 
     | 
    
         
            +
             
     | 
| 
      
 161 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 162 
     | 
    
         
            +
                  Length = {
         
     | 
| 
      
 163 
     | 
    
         
            +
                    [1700, nil] => 365,
         
     | 
| 
      
 164 
     | 
    
         
            +
                    [1700,   1] =>  28,
         
     | 
| 
      
 165 
     | 
    
         
            +
                    [1712, nil] => 367,
         
     | 
| 
      
 166 
     | 
    
         
            +
                    [1712,   1] =>  30
         
     | 
| 
      
 167 
     | 
    
         
            +
                  }
         
     | 
| 
      
 168 
     | 
    
         
            +
             
     | 
| 
      
 169 
     | 
    
         
            +
                  # Ref: http://www.ortelius.de/kalender/east_en.php
         
     | 
| 
      
 170 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 171 
     | 
    
         
            +
                  EasterDelay = {
         
     | 
| 
      
 172 
     | 
    
         
            +
                    1741 =>  -7,
         
     | 
| 
      
 173 
     | 
    
         
            +
                    1742 => -35,
         
     | 
| 
      
 174 
     | 
    
         
            +
                    1744 =>  -7,
         
     | 
| 
      
 175 
     | 
    
         
            +
                    1745 =>  -7,
         
     | 
| 
      
 176 
     | 
    
         
            +
                    1747 => -28,
         
     | 
| 
      
 177 
     | 
    
         
            +
                    1748 =>  -7,
         
     | 
| 
      
 178 
     | 
    
         
            +
                    1750 => -28,
         
     | 
| 
      
 179 
     | 
    
         
            +
                    1751 =>  -7,
         
     | 
| 
      
 180 
     | 
    
         
            +
                    1752 =>  -7,
         
     | 
| 
      
 181 
     | 
    
         
            +
                    1802 =>  +7,
         
     | 
| 
      
 182 
     | 
    
         
            +
                    1805 =>  +7,
         
     | 
| 
      
 183 
     | 
    
         
            +
                    1818 =>  +7
         
     | 
| 
      
 184 
     | 
    
         
            +
                  }
         
     | 
| 
      
 185 
     | 
    
         
            +
             
     | 
| 
      
 186 
     | 
    
         
            +
                  # 年月日 -> 通日
         
     | 
| 
      
 187 
     | 
    
         
            +
                  #
         
     | 
| 
      
 188 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_coordinates_to_number
         
     | 
| 
      
 189 
     | 
    
         
            +
                  #
         
     | 
| 
      
 190 
     | 
    
         
            +
                  def _coordinates_to_number(y,m,d)
         
     | 
| 
      
 191 
     | 
    
         
            +
                    jdn = super
         
     | 
| 
      
 192 
     | 
    
         
            +
                    return SwedishCalendarRange.last if [+y, m, d] == ExtraDate
         
     | 
| 
      
 193 
     | 
    
         
            +
                    SwedishCalendarRange.include?(jdn-1) ? jdn-1 : jdn
         
     | 
| 
      
 194 
     | 
    
         
            +
                  end
         
     | 
| 
      
 195 
     | 
    
         
            +
             
     | 
| 
      
 196 
     | 
    
         
            +
                  # 通日 - > 年月日
         
     | 
| 
      
 197 
     | 
    
         
            +
                  #
         
     | 
| 
      
 198 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_number_to_coordinates
         
     | 
| 
      
 199 
     | 
    
         
            +
                  #
         
     | 
| 
      
 200 
     | 
    
         
            +
                  def _number_to_coordinates(jdn)
         
     | 
| 
      
 201 
     | 
    
         
            +
                    return ExtraDate.dup if jdn == SwedishCalendarRange.last
         
     | 
| 
      
 202 
     | 
    
         
            +
                    super(SwedishCalendarRange.include?(jdn) ? jdn+1 : jdn)
         
     | 
| 
      
 203 
     | 
    
         
            +
                  end
         
     | 
| 
      
 204 
     | 
    
         
            +
             
     | 
| 
      
 205 
     | 
    
         
            +
                  # 暦要素数
         
     | 
| 
      
 206 
     | 
    
         
            +
                  #
         
     | 
| 
      
 207 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_length
         
     | 
| 
      
 208 
     | 
    
         
            +
                  #
         
     | 
| 
      
 209 
     | 
    
         
            +
                  def _length(date)
         
     | 
| 
      
 210 
     | 
    
         
            +
                    y, m = date
         
     | 
| 
      
 211 
     | 
    
         
            +
                    Length[[+y,m]] || super
         
     | 
| 
      
 212 
     | 
    
         
            +
                  end
         
     | 
| 
      
 213 
     | 
    
         
            +
             
     | 
| 
      
 214 
     | 
    
         
            +
                  # 復活祭の遅延日数
         
     | 
| 
      
 215 
     | 
    
         
            +
                  # 
         
     | 
| 
      
 216 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 217 
     | 
    
         
            +
                  def _easter_delay(year)
         
     | 
| 
      
 218 
     | 
    
         
            +
                    EasterDelay[year] || 0
         
     | 
| 
      
 219 
     | 
    
         
            +
                  end
         
     | 
| 
      
 220 
     | 
    
         
            +
             
     | 
| 
      
 221 
     | 
    
         
            +
                  private
         
     | 
| 
      
 222 
     | 
    
         
            +
             
     | 
| 
      
 223 
     | 
    
         
            +
                  def _normalize(args=[], options={})
         
     | 
| 
      
 224 
     | 
    
         
            +
                    @label ||= 'Christian::Swedish'
         
     | 
| 
      
 225 
     | 
    
         
            +
                    super
         
     | 
| 
      
 226 
     | 
    
         
            +
                  end
         
     | 
| 
      
 227 
     | 
    
         
            +
                end
         
     | 
| 
      
 228 
     | 
    
         
            +
             
     | 
| 
      
 229 
     | 
    
         
            +
                #
         
     | 
| 
      
 230 
     | 
    
         
            +
                # Variation of Christian Calendar
         
     | 
| 
      
 231 
     | 
    
         
            +
                #
         
     | 
| 
      
 232 
     | 
    
         
            +
                class ReformVariation < Christian
         
     | 
| 
      
 233 
     | 
    
         
            +
             
     | 
| 
      
 234 
     | 
    
         
            +
                  # 年月日 -> 通日
         
     | 
| 
      
 235 
     | 
    
         
            +
                  #
         
     | 
| 
      
 236 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_coordinates_to_number
         
     | 
| 
      
 237 
     | 
    
         
            +
                  #
         
     | 
| 
      
 238 
     | 
    
         
            +
                  def _coordinates_to_number(y,m,d)
         
     | 
| 
      
 239 
     | 
    
         
            +
                    super - _diff_from_century(((m < 2) ? +y-1 : +y).to_i.div(100))
         
     | 
| 
      
 240 
     | 
    
         
            +
                  end
         
     | 
| 
      
 241 
     | 
    
         
            +
             
     | 
| 
      
 242 
     | 
    
         
            +
                  # 通日 - > 年月日
         
     | 
| 
      
 243 
     | 
    
         
            +
                  #
         
     | 
| 
      
 244 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_number_to_coordinates
         
     | 
| 
      
 245 
     | 
    
         
            +
                  #
         
     | 
| 
      
 246 
     | 
    
         
            +
                  def _number_to_coordinates(jdn)
         
     | 
| 
      
 247 
     | 
    
         
            +
                    super(jdn + _diff_from_century(_century_from_jdn(jdn)))
         
     | 
| 
      
 248 
     | 
    
         
            +
                  end
         
     | 
| 
      
 249 
     | 
    
         
            +
             
     | 
| 
      
 250 
     | 
    
         
            +
                  # 暦要素数
         
     | 
| 
      
 251 
     | 
    
         
            +
                  #
         
     | 
| 
      
 252 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_length
         
     | 
| 
      
 253 
     | 
    
         
            +
                  #
         
     | 
| 
      
 254 
     | 
    
         
            +
                  def _length(date)
         
     | 
| 
      
 255 
     | 
    
         
            +
                    yy, mm = date
         
     | 
| 
      
 256 
     | 
    
         
            +
                    return super unless mm == 1 # 2月でなければユリウス暦と同じ
         
     | 
| 
      
 257 
     | 
    
         
            +
                    cc, yy = yy.divmod(100)
         
     | 
| 
      
 258 
     | 
    
         
            +
                    return super unless yy == 0 # 100で割り切れない年はユリウス暦と同じ
         
     | 
| 
      
 259 
     | 
    
         
            +
                    29 - (_diff_from_century(cc) - _diff_from_century(cc-1))
         
     | 
| 
      
 260 
     | 
    
         
            +
                  end
         
     | 
| 
      
 261 
     | 
    
         
            +
             
     | 
| 
      
 262 
     | 
    
         
            +
                  # 太陰方程式
         
     | 
| 
      
 263 
     | 
    
         
            +
                  #
         
     | 
| 
      
 264 
     | 
    
         
            +
                  # @param [Numeric] year 西暦の年数
         
     | 
| 
      
 265 
     | 
    
         
            +
                  # @return [Integer] 19年7閏のペースに対する満月の日付の補正量
         
     | 
| 
      
 266 
     | 
    
         
            +
                  # @note 太陽暦日の補正も、本メソッドで行う
         
     | 
| 
      
 267 
     | 
    
         
            +
                  #
         
     | 
| 
      
 268 
     | 
    
         
            +
                  def _lunar_equation(year)
         
     | 
| 
      
 269 
     | 
    
         
            +
                    h = +year.div(100)
         
     | 
| 
      
 270 
     | 
    
         
            +
                    (8*(h+11)).div(25) - (_diff_from_century(h) + 5)
         
     | 
| 
      
 271 
     | 
    
         
            +
                  end
         
     | 
| 
      
 272 
     | 
    
         
            +
                end
         
     | 
| 
      
 273 
     | 
    
         
            +
             
     | 
| 
      
 274 
     | 
    
         
            +
                #
         
     | 
| 
      
 275 
     | 
    
         
            +
                # Gregorian Calendar
         
     | 
| 
      
 276 
     | 
    
         
            +
                #
         
     | 
| 
      
 277 
     | 
    
         
            +
                class Gregorian < ReformVariation
         
     | 
| 
      
 278 
     | 
    
         
            +
             
     | 
| 
      
 279 
     | 
    
         
            +
                  # 百年代 - > ユリウス暦とグレゴリオ暦の差
         
     | 
| 
      
 280 
     | 
    
         
            +
                  #
         
     | 
| 
      
 281 
     | 
    
         
            +
                  # @param [Integer] century 百年代
         
     | 
| 
      
 282 
     | 
    
         
            +
                  #
         
     | 
| 
      
 283 
     | 
    
         
            +
                  # @return [Integer] ユリウス暦とグレゴリオ暦の差
         
     | 
| 
      
 284 
     | 
    
         
            +
                  #
         
     | 
| 
      
 285 
     | 
    
         
            +
                  def _diff_from_century(century)
         
     | 
| 
      
 286 
     | 
    
         
            +
                    (3*(century-3)).div(4)+1
         
     | 
| 
      
 287 
     | 
    
         
            +
                  end
         
     | 
| 
      
 288 
     | 
    
         
            +
             
     | 
| 
      
 289 
     | 
    
         
            +
                  # 通日 - > 百年代
         
     | 
| 
      
 290 
     | 
    
         
            +
                  #
         
     | 
| 
      
 291 
     | 
    
         
            +
                  # @param [Integer] jdn 通日
         
     | 
| 
      
 292 
     | 
    
         
            +
                  #
         
     | 
| 
      
 293 
     | 
    
         
            +
                  # @return [Integer] 百年代
         
     | 
| 
      
 294 
     | 
    
         
            +
                  #
         
     | 
| 
      
 295 
     | 
    
         
            +
                  def _century_from_jdn(jdn)
         
     | 
| 
      
 296 
     | 
    
         
            +
                    (4 * jdn - 6884477).div(146097)
         
     | 
| 
      
 297 
     | 
    
         
            +
                  end
         
     | 
| 
      
 298 
     | 
    
         
            +
             
     | 
| 
      
 299 
     | 
    
         
            +
                  private
         
     | 
| 
      
 300 
     | 
    
         
            +
             
     | 
| 
      
 301 
     | 
    
         
            +
                  def _normalize(args=[], options={})
         
     | 
| 
      
 302 
     | 
    
         
            +
                    @label ||= 'Christian::Gregorian'
         
     | 
| 
      
 303 
     | 
    
         
            +
                    super
         
     | 
| 
      
 304 
     | 
    
         
            +
                  end
         
     | 
| 
      
 305 
     | 
    
         
            +
                end
         
     | 
| 
      
 306 
     | 
    
         
            +
             
     | 
| 
      
 307 
     | 
    
         
            +
                #
         
     | 
| 
      
 308 
     | 
    
         
            +
                # Revised Julian Calendar
         
     | 
| 
      
 309 
     | 
    
         
            +
                #
         
     | 
| 
      
 310 
     | 
    
         
            +
                class RevisedJulian < ReformVariation
         
     | 
| 
      
 311 
     | 
    
         
            +
             
     | 
| 
      
 312 
     | 
    
         
            +
                  # デフォルトの改暦日付(ユリウス通日)
         
     | 
| 
      
 313 
     | 
    
         
            +
                  # 
         
     | 
| 
      
 314 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 315 
     | 
    
         
            +
                  DefaultReformDate = 2423707 # 1923-10-14
         
     | 
| 
      
 316 
     | 
    
         
            +
             
     | 
| 
      
 317 
     | 
    
         
            +
                  # 百年代 - > ユリウス暦と修正ユリウス暦の差
         
     | 
| 
      
 318 
     | 
    
         
            +
                  #
         
     | 
| 
      
 319 
     | 
    
         
            +
                  # @param [Integer] century 百年代
         
     | 
| 
      
 320 
     | 
    
         
            +
                  #
         
     | 
| 
      
 321 
     | 
    
         
            +
                  # @return [Integer] ユリウス暦と修正ユリウス暦の差
         
     | 
| 
      
 322 
     | 
    
         
            +
                  #
         
     | 
| 
      
 323 
     | 
    
         
            +
                  def _diff_from_century(century)
         
     | 
| 
      
 324 
     | 
    
         
            +
                    (7*(century-1)).div(9)-1
         
     | 
| 
      
 325 
     | 
    
         
            +
                  end
         
     | 
| 
      
 326 
     | 
    
         
            +
             
     | 
| 
      
 327 
     | 
    
         
            +
                  # 通日 - > 百年代
         
     | 
| 
      
 328 
     | 
    
         
            +
                  #
         
     | 
| 
      
 329 
     | 
    
         
            +
                  # @param [Integer] jdn 通日
         
     | 
| 
      
 330 
     | 
    
         
            +
                  #
         
     | 
| 
      
 331 
     | 
    
         
            +
                  # @return [Integer] 百年代
         
     | 
| 
      
 332 
     | 
    
         
            +
                  #
         
     | 
| 
      
 333 
     | 
    
         
            +
                  def _century_from_jdn(jdn)
         
     | 
| 
      
 334 
     | 
    
         
            +
                    (9 * jdn - 15490078).div(328718)
         
     | 
| 
      
 335 
     | 
    
         
            +
                  end
         
     | 
| 
      
 336 
     | 
    
         
            +
             
     | 
| 
      
 337 
     | 
    
         
            +
                  private
         
     | 
| 
      
 338 
     | 
    
         
            +
             
     | 
| 
      
 339 
     | 
    
         
            +
                  def _normalize(args=[], options={})
         
     | 
| 
      
 340 
     | 
    
         
            +
                    @label ||= 'Christian::RevisedJulian'
         
     | 
| 
      
 341 
     | 
    
         
            +
                  # @diff  ||= [-2, -1, -1, 0, 1, 2, 2, 3, 4, 5] # 1~10世紀の各世紀のユリウス暦と差の日数
         
     | 
| 
      
 342 
     | 
    
         
            +
                    super
         
     | 
| 
      
 343 
     | 
    
         
            +
                  end
         
     | 
| 
      
 344 
     | 
    
         
            +
                end
         
     | 
| 
      
 345 
     | 
    
         
            +
             
     | 
| 
      
 346 
     | 
    
         
            +
                #
         
     | 
| 
      
 347 
     | 
    
         
            +
                # Civil Calendar
         
     | 
| 
      
 348 
     | 
    
         
            +
                #
         
     | 
| 
      
 349 
     | 
    
         
            +
                class Civil < Gregorian
         
     | 
| 
      
 350 
     | 
    
         
            +
             
     | 
| 
      
 351 
     | 
    
         
            +
                  #
         
     | 
| 
      
 352 
     | 
    
         
            +
                  # 改暦日付
         
     | 
| 
      
 353 
     | 
    
         
            +
                  #
         
     | 
| 
      
 354 
     | 
    
         
            +
                  # @return [Integer]
         
     | 
| 
      
 355 
     | 
    
         
            +
                  #
         
     | 
| 
      
 356 
     | 
    
         
            +
                  attr_reader :reform_jdn
         
     | 
| 
      
 357 
     | 
    
         
            +
             
     | 
| 
      
 358 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 359 
     | 
    
         
            +
                  #
         
     | 
| 
      
 360 
     | 
    
         
            +
                  # 対応する ::Date の start 属性
         
     | 
| 
      
 361 
     | 
    
         
            +
                  alias :_default_start :reform_jdn
         
     | 
| 
      
 362 
     | 
    
         
            +
             
     | 
| 
      
 363 
     | 
    
         
            +
                  #
         
     | 
| 
      
 364 
     | 
    
         
            +
                  # 年初の最初の定義の年
         
     | 
| 
      
 365 
     | 
    
         
            +
                  #
         
     | 
| 
      
 366 
     | 
    
         
            +
                  # @return [Integer] 年初の最初の定義の年
         
     | 
| 
      
 367 
     | 
    
         
            +
                  # @return nil
         
     | 
| 
      
 368 
     | 
    
         
            +
                  #
         
     | 
| 
      
 369 
     | 
    
         
            +
                  def first_year_of_border
         
     | 
| 
      
 370 
     | 
    
         
            +
                    return nil unless @border.kind_of?(When::Coordinates::MultiBorder)
         
     | 
| 
      
 371 
     | 
    
         
            +
                    year = @border.borders[-1][:key]
         
     | 
| 
      
 372 
     | 
    
         
            +
                    year.kind_of?(Integer) ? year : nil
         
     | 
| 
      
 373 
     | 
    
         
            +
                  end
         
     | 
| 
      
 374 
     | 
    
         
            +
             
     | 
| 
      
 375 
     | 
    
         
            +
                  # 年月日 -> 通日
         
     | 
| 
      
 376 
     | 
    
         
            +
                  #
         
     | 
| 
      
 377 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_coordinates_to_number
         
     | 
| 
      
 378 
     | 
    
         
            +
                  #
         
     | 
| 
      
 379 
     | 
    
         
            +
                  def _coordinates_to_number(y,m,d)
         
     | 
| 
      
 380 
     | 
    
         
            +
                    skip, limit = @the_length[[y,m]]
         
     | 
| 
      
 381 
     | 
    
         
            +
                    d += skip if skip && d >= limit
         
     | 
| 
      
 382 
     | 
    
         
            +
                    jdn  = @new._coordinates_to_number(y,m,d)
         
     | 
| 
      
 383 
     | 
    
         
            +
                    jdn >= @reform_jdn ? jdn :  @old._coordinates_to_number(y + @origin_of_MSC - @old.origin_of_MSC, m, d)
         
     | 
| 
      
 384 
     | 
    
         
            +
                  end
         
     | 
| 
      
 385 
     | 
    
         
            +
             
     | 
| 
      
 386 
     | 
    
         
            +
                  # 通日 - > 年月日
         
     | 
| 
      
 387 
     | 
    
         
            +
                  #
         
     | 
| 
      
 388 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_number_to_coordinates
         
     | 
| 
      
 389 
     | 
    
         
            +
                  #
         
     | 
| 
      
 390 
     | 
    
         
            +
                  def _number_to_coordinates(jdn)
         
     | 
| 
      
 391 
     | 
    
         
            +
                    if jdn >= @reform_jdn
         
     | 
| 
      
 392 
     | 
    
         
            +
                      date     = @new._number_to_coordinates(jdn)
         
     | 
| 
      
 393 
     | 
    
         
            +
                    else
         
     | 
| 
      
 394 
     | 
    
         
            +
                      date     = @old._number_to_coordinates(jdn)
         
     | 
| 
      
 395 
     | 
    
         
            +
                      date[0] -= @origin_of_MSC - @old.origin_of_MSC
         
     | 
| 
      
 396 
     | 
    
         
            +
                    end
         
     | 
| 
      
 397 
     | 
    
         
            +
                    skip, limit = @the_length[date[0..-2]]
         
     | 
| 
      
 398 
     | 
    
         
            +
                    date[2] -= skip if skip && date[2] >= limit
         
     | 
| 
      
 399 
     | 
    
         
            +
                    date
         
     | 
| 
      
 400 
     | 
    
         
            +
                  end
         
     | 
| 
      
 401 
     | 
    
         
            +
             
     | 
| 
      
 402 
     | 
    
         
            +
                  # 暦要素数
         
     | 
| 
      
 403 
     | 
    
         
            +
                  #
         
     | 
| 
      
 404 
     | 
    
         
            +
                  # @see When::CalendarTypes::TableBased#_length
         
     | 
| 
      
 405 
     | 
    
         
            +
                  #
         
     | 
| 
      
 406 
     | 
    
         
            +
                  def _length(date)
         
     | 
| 
      
 407 
     | 
    
         
            +
                    return @the_length[date][2] if @the_length[date]
         
     | 
| 
      
 408 
     | 
    
         
            +
                    yy, mm = date
         
     | 
| 
      
 409 
     | 
    
         
            +
                    (yy >  @reform_date[0]) ||
         
     | 
| 
      
 410 
     | 
    
         
            +
                    (yy == @reform_date[0] && (!mm || mm >= @reform_date[1])) ?
         
     | 
| 
      
 411 
     | 
    
         
            +
                      @new._length(date) :
         
     | 
| 
      
 412 
     | 
    
         
            +
                      @old._length([yy + @origin_of_MSC - @old.origin_of_MSC, mm])
         
     | 
| 
      
 413 
     | 
    
         
            +
                  end
         
     | 
| 
      
 414 
     | 
    
         
            +
             
     | 
| 
      
 415 
     | 
    
         
            +
                  # 太陰方程式
         
     | 
| 
      
 416 
     | 
    
         
            +
                  #
         
     | 
| 
      
 417 
     | 
    
         
            +
                  # @param [Numeric] year 西暦の年数
         
     | 
| 
      
 418 
     | 
    
         
            +
                  # @return [Integer] 19年7閏のペースに対する満月の日付の補正量
         
     | 
| 
      
 419 
     | 
    
         
            +
                  # @note 太陽暦日の補正も、本メソッドで行う
         
     | 
| 
      
 420 
     | 
    
         
            +
                  #
         
     | 
| 
      
 421 
     | 
    
         
            +
                  def _lunar_equation(year)
         
     | 
| 
      
 422 
     | 
    
         
            +
                    year >= @the_easter ? @new._lunar_equation(year) : @old._lunar_equation(year)
         
     | 
| 
      
 423 
     | 
    
         
            +
                  end
         
     | 
| 
      
 424 
     | 
    
         
            +
             
     | 
| 
      
 425 
     | 
    
         
            +
                  # 復活祭の遅延日数
         
     | 
| 
      
 426 
     | 
    
         
            +
                  # 
         
     | 
| 
      
 427 
     | 
    
         
            +
                  # @private
         
     | 
| 
      
 428 
     | 
    
         
            +
                  def _easter_delay(year)
         
     | 
| 
      
 429 
     | 
    
         
            +
                    @old._easter_delay(year)
         
     | 
| 
      
 430 
     | 
    
         
            +
                  end
         
     | 
| 
      
 431 
     | 
    
         
            +
             
     | 
| 
      
 432 
     | 
    
         
            +
                  private
         
     | 
| 
      
 433 
     | 
    
         
            +
             
     | 
| 
      
 434 
     | 
    
         
            +
                  # オブジェクトの正規化
         
     | 
| 
      
 435 
     | 
    
         
            +
                  #
         
     | 
| 
      
 436 
     | 
    
         
            +
                  #   @old         = 改暦前の暦法(デフォルトはユリウス暦)
         
     | 
| 
      
 437 
     | 
    
         
            +
                  #   @new         = 改暦後の暦法(デフォルトはグレゴリオ暦)
         
     | 
| 
      
 438 
     | 
    
         
            +
                  #   @reform_date = 改暦日付(月日は 1 オリジンで指定し、0 オリジンに直して保持)
         
     | 
| 
      
 439 
     | 
    
         
            +
                  #   @reform_jdn  = 改暦日付のユリウス通日
         
     | 
| 
      
 440 
     | 
    
         
            +
                  #   @reform      = reform_date か reform_jdn を内容で判別し、どちらかに反映する
         
     | 
| 
      
 441 
     | 
    
         
            +
                  #   @the_easter  = 新暦法の復活祭計算の適用を始める年
         
     | 
| 
      
 442 
     | 
    
         
            +
                  #   @the_length  = 通常と異なる日付となる年月の情報({[年,月]=>[スキップした日数, スキップし始める日, 月の日数]})
         
     | 
| 
      
 443 
     | 
    
         
            +
                  #
         
     | 
| 
      
 444 
     | 
    
         
            +
                  def _normalize(args=[], options={})
         
     | 
| 
      
 445 
     | 
    
         
            +
                    @label   ||= 'Christian::Civil'
         
     | 
| 
      
 446 
     | 
    
         
            +
             
     | 
| 
      
 447 
     | 
    
         
            +
                    # 前後の暦法
         
     | 
| 
      
 448 
     | 
    
         
            +
                    @old       = When.Calendar(@old || 'Julian')
         
     | 
| 
      
 449 
     | 
    
         
            +
                    @new       = When.Calendar(@new || 'Gregorian')
         
     | 
| 
      
 450 
     | 
    
         
            +
                    @indices ||= @old.indices
         
     | 
| 
      
 451 
     | 
    
         
            +
             
     | 
| 
      
 452 
     | 
    
         
            +
                    # 改暦日付 (0 オリジン)
         
     | 
| 
      
 453 
     | 
    
         
            +
                    @reform = When::Coordinates::Pair._en_pair_date_time(@reform) if @reform.kind_of?(String)
         
     | 
| 
      
 454 
     | 
    
         
            +
                    case @reform.length
         
     | 
| 
      
 455 
     | 
    
         
            +
                    when 0 ;
         
     | 
| 
      
 456 
     | 
    
         
            +
                    when 1 ; @reform_jdn  = @reform[0]
         
     | 
| 
      
 457 
     | 
    
         
            +
                    else   ; @reform_date = @reform
         
     | 
| 
      
 458 
     | 
    
         
            +
                    end if @reform.kind_of?(Array)
         
     | 
| 
      
 459 
     | 
    
         
            +
             
     | 
| 
      
 460 
     | 
    
         
            +
                    if @reform_date
         
     | 
| 
      
 461 
     | 
    
         
            +
                      @reform_date  = When::Coordinates::Pair._en_pair_date_time(@reform_date) if @reform_date.kind_of?(String)
         
     | 
| 
      
 462 
     | 
    
         
            +
                      @reform_date  = @reform_date.map {|c| c.to_i}
         
     | 
| 
      
 463 
     | 
    
         
            +
                      (1..2).each {|i| @reform_date[i] = @reform_date[i] ? @reform_date[i] - 1 : 0 }
         
     | 
| 
      
 464 
     | 
    
         
            +
                      @reform_jdn   = @new._coordinates_to_number(*@reform_date)
         
     | 
| 
      
 465 
     | 
    
         
            +
                    else
         
     | 
| 
      
 466 
     | 
    
         
            +
                      @reform_jdn ||= [@old.class::DefaultReformDate, @new.class::DefaultReformDate].max
         
     | 
| 
      
 467 
     | 
    
         
            +
                      @reform_jdn   = @reform_jdn.to_i
         
     | 
| 
      
 468 
     | 
    
         
            +
                      @reform_date  = @new._number_to_coordinates(@reform_jdn)
         
     | 
| 
      
 469 
     | 
    
         
            +
                    end
         
     | 
| 
      
 470 
     | 
    
         
            +
                    last_date   = @old._number_to_coordinates(@reform_jdn-1)
         
     | 
| 
      
 471 
     | 
    
         
            +
             
     | 
| 
      
 472 
     | 
    
         
            +
                    # 復活祭との前後関係
         
     | 
| 
      
 473 
     | 
    
         
            +
                    @the_easter = @reform_jdn > When.CalendarNote('Christian').easter(@reform_date[0], @new) ? @reform_date[0]+1 : @reform_date[0]
         
     | 
| 
      
 474 
     | 
    
         
            +
             
     | 
| 
      
 475 
     | 
    
         
            +
                    # 月の日数
         
     | 
| 
      
 476 
     | 
    
         
            +
                    this_month  = @reform_date[0..1]
         
     | 
| 
      
 477 
     | 
    
         
            +
                    new_length  = @new._length(this_month)
         
     | 
| 
      
 478 
     | 
    
         
            +
                    @the_length = {}
         
     | 
| 
      
 479 
     | 
    
         
            +
                    if @reform_date[1] == last_date[1] # 同一月内に閉じた改暦
         
     | 
| 
      
 480 
     | 
    
         
            +
                      skipped_length = @reform_date[2] - last_date[2] - 1
         
     | 
| 
      
 481 
     | 
    
         
            +
                      @the_length[this_month] = [skipped_length, last_date[2]+1, new_length-skipped_length]
         
     | 
| 
      
 482 
     | 
    
         
            +
                    else
         
     | 
| 
      
 483 
     | 
    
         
            +
                      last_month = [(@reform_date[1] > last_date[1] ? @reform_date[0] : @reform_date[0]-1), last_date[1]]
         
     | 
| 
      
 484 
     | 
    
         
            +
                      @the_length[this_month] = [@reform_date[2], 0, new_length - @reform_date[2]]
         
     | 
| 
      
 485 
     | 
    
         
            +
                      @the_length[last_month] = [false, false, last_date[2]+1]
         
     | 
| 
      
 486 
     | 
    
         
            +
                    end
         
     | 
| 
      
 487 
     | 
    
         
            +
             
     | 
| 
      
 488 
     | 
    
         
            +
                    super
         
     | 
| 
      
 489 
     | 
    
         
            +
                  end
         
     | 
| 
      
 490 
     | 
    
         
            +
             
     | 
| 
      
 491 
     | 
    
         
            +
                  #
         
     | 
| 
      
 492 
     | 
    
         
            +
                  # 整数のindex化
         
     | 
| 
      
 493 
     | 
    
         
            +
                  #
         
     | 
| 
      
 494 
     | 
    
         
            +
                  def _to_index(date)
         
     | 
| 
      
 495 
     | 
    
         
            +
                    digit = date[-1] - @base[date.length-1]
         
     | 
| 
      
 496 
     | 
    
         
            +
                    skip, limit = @the_length[date[0..-2]]
         
     | 
| 
      
 497 
     | 
    
         
            +
                    skip && digit >= limit ? digit-skip : digit
         
     | 
| 
      
 498 
     | 
    
         
            +
                  end
         
     | 
| 
      
 499 
     | 
    
         
            +
             
     | 
| 
      
 500 
     | 
    
         
            +
                  #
         
     | 
| 
      
 501 
     | 
    
         
            +
                  # indexの整数化
         
     | 
| 
      
 502 
     | 
    
         
            +
                  #
         
     | 
| 
      
 503 
     | 
    
         
            +
                  def _from_index(date)
         
     | 
| 
      
 504 
     | 
    
         
            +
                    digit = date[-1]
         
     | 
| 
      
 505 
     | 
    
         
            +
                    skip, limit = @the_length[date[0..-2]] 
         
     | 
| 
      
 506 
     | 
    
         
            +
                    (skip && digit >= limit ? digit+skip : digit)+@base[date.length-1]
         
     | 
| 
      
 507 
     | 
    
         
            +
                  end
         
     | 
| 
      
 508 
     | 
    
         
            +
                end
         
     | 
| 
      
 509 
     | 
    
         
            +
              end
         
     | 
| 
      
 510 
     | 
    
         
            +
             
     | 
| 
      
 511 
     | 
    
         
            +
              module Coordinates
         
     | 
| 
      
 512 
     | 
    
         
            +
             
     | 
| 
      
 513 
     | 
    
         
            +
                #
         
     | 
| 
      
 514 
     | 
    
         
            +
                # 日時要素の境界 - 復活祭
         
     | 
| 
      
 515 
     | 
    
         
            +
                #
         
     | 
| 
      
 516 
     | 
    
         
            +
                class Easter < Border
         
     | 
| 
      
 517 
     | 
    
         
            +
             
     | 
| 
      
 518 
     | 
    
         
            +
                  # 境界の取得
         
     | 
| 
      
 519 
     | 
    
         
            +
                  #
         
     | 
| 
      
 520 
     | 
    
         
            +
                  # @param [Array<Numeric>] date 境界を計算する年
         
     | 
| 
      
 521 
     | 
    
         
            +
                  # @param [When::TM::ReferenceSystem] frame 使用する暦法
         
     | 
| 
      
 522 
     | 
    
         
            +
                  #
         
     | 
| 
      
 523 
     | 
    
         
            +
                  # @return [Array<Numeric>] その年の境界
         
     | 
| 
      
 524 
     | 
    
         
            +
                  #
         
     | 
| 
      
 525 
     | 
    
         
            +
                  def border(date=[], frame=When::Gregorian)
         
     | 
| 
      
 526 
     | 
    
         
            +
                    frame._encode(frame._number_to_coordinates(frame.note.easter(date[0], frame)), false)
         
     | 
| 
      
 527 
     | 
    
         
            +
                  end
         
     | 
| 
      
 528 
     | 
    
         
            +
             
     | 
| 
      
 529 
     | 
    
         
            +
                  private
         
     | 
| 
      
 530 
     | 
    
         
            +
             
     | 
| 
      
 531 
     | 
    
         
            +
                  # 要素の正規化
         
     | 
| 
      
 532 
     | 
    
         
            +
                  def _normalize(args=[], options={})
         
     | 
| 
      
 533 
     | 
    
         
            +
                    @border = [0,0,0]
         
     | 
| 
      
 534 
     | 
    
         
            +
                  end
         
     | 
| 
      
 535 
     | 
    
         
            +
                end
         
     | 
| 
      
 536 
     | 
    
         
            +
              end
         
     | 
| 
      
 537 
     | 
    
         
            +
             
     | 
| 
      
 538 
     | 
    
         
            +
              #
         
     | 
| 
      
 539 
     | 
    
         
            +
              # キリスト教の暦注(クリスマスと復活祭)
         
     | 
| 
      
 540 
     | 
    
         
            +
              #
         
     | 
| 
      
 541 
     | 
    
         
            +
              class CalendarNote::Christian < CalendarNote
         
     | 
| 
      
 542 
     | 
    
         
            +
             
     | 
| 
      
 543 
     | 
    
         
            +
                Notes = [When::BasicTypes::M17n, [
         
     | 
| 
      
 544 
     | 
    
         
            +
                  "locale:[=en:, ja=ja:, alias]",
         
     | 
| 
      
 545 
     | 
    
         
            +
                  "names:[Christian]",
         
     | 
| 
      
 546 
     | 
    
         
            +
             
     | 
| 
      
 547 
     | 
    
         
            +
                  # 年の暦注 ----------------------------
         
     | 
| 
      
 548 
     | 
    
         
            +
                  [When::BasicTypes::M17n,
         
     | 
| 
      
 549 
     | 
    
         
            +
                    "names:[year]"
         
     | 
| 
      
 550 
     | 
    
         
            +
                  ],
         
     | 
| 
      
 551 
     | 
    
         
            +
             
     | 
| 
      
 552 
     | 
    
         
            +
                  # 月の暦注 ----------------------------
         
     | 
| 
      
 553 
     | 
    
         
            +
                  [When::BasicTypes::M17n,
         
     | 
| 
      
 554 
     | 
    
         
            +
                    "names:[month]",
         
     | 
| 
      
 555 
     | 
    
         
            +
                    [When::BasicTypes::M17n,
         
     | 
| 
      
 556 
     | 
    
         
            +
                      "names:[Month]"
         
     | 
| 
      
 557 
     | 
    
         
            +
                    ]
         
     | 
| 
      
 558 
     | 
    
         
            +
                  ],
         
     | 
| 
      
 559 
     | 
    
         
            +
             
     | 
| 
      
 560 
     | 
    
         
            +
                  # 日の暦注 ----------------------------
         
     | 
| 
      
 561 
     | 
    
         
            +
                  [When::BasicTypes::M17n,
         
     | 
| 
      
 562 
     | 
    
         
            +
                    "names:[day]",
         
     | 
| 
      
 563 
     | 
    
         
            +
                    [When::BasicTypes::M17n, "names:[Week,           七曜]"      ],
         
     | 
| 
      
 564 
     | 
    
         
            +
                    [When::BasicTypes::M17n, "names:[Easter,         復活祭]"    ],
         
     | 
| 
      
 565 
     | 
    
         
            +
                    [When::BasicTypes::M17n, "names:[Christmas,      クリスマス]"],
         
     | 
| 
      
 566 
     | 
    
         
            +
                    [When::BasicTypes::M17n, "names:[Fixed_feast=,   固定祝日=]" ],
         
     | 
| 
      
 567 
     | 
    
         
            +
                    [When::BasicTypes::M17n, "names:[Moveable_feast, 移動祝日]"  ]
         
     | 
| 
      
 568 
     | 
    
         
            +
                  ]
         
     | 
| 
      
 569 
     | 
    
         
            +
                ]]
         
     | 
| 
      
 570 
     | 
    
         
            +
             
     | 
| 
      
 571 
     | 
    
         
            +
                # 固定祝日
         
     | 
| 
      
 572 
     | 
    
         
            +
                Fixed_feasts = {
         
     | 
| 
      
 573 
     | 
    
         
            +
                  [ 1,  6] => "Epiphany",
         
     | 
| 
      
 574 
     | 
    
         
            +
                  [ 3,  1] => "St.David's Day",
         
     | 
| 
      
 575 
     | 
    
         
            +
                  [ 3, 17] => "St.Patrick's Day",
         
     | 
| 
      
 576 
     | 
    
         
            +
                  [ 3, 25] => "Annunciation-Lady Day",
         
     | 
| 
      
 577 
     | 
    
         
            +
                  [ 4, 23] => "St.George's Day",
         
     | 
| 
      
 578 
     | 
    
         
            +
                  [ 6, 24] => "Midsummer Day",
         
     | 
| 
      
 579 
     | 
    
         
            +
                  [ 9, 14] => "Holy Cross Day",
         
     | 
| 
      
 580 
     | 
    
         
            +
                  [ 9, 29] => "Michaelmas Day",
         
     | 
| 
      
 581 
     | 
    
         
            +
                  [11, 30] => "St.Andrew's Day",
         
     | 
| 
      
 582 
     | 
    
         
            +
                  [12, 13] => "St.Lucia's Day",
         
     | 
| 
      
 583 
     | 
    
         
            +
                  [12, 21] => "St.Thomas's Day",
         
     | 
| 
      
 584 
     | 
    
         
            +
                # [12, 25] => "Christmas Day"
         
     | 
| 
      
 585 
     | 
    
         
            +
                }
         
     | 
| 
      
 586 
     | 
    
         
            +
             
     | 
| 
      
 587 
     | 
    
         
            +
                # 移動祝日 (日付と曜日による)
         
     | 
| 
      
 588 
     | 
    
         
            +
                moveable_feasts = {}
         
     | 
| 
      
 589 
     | 
    
         
            +
                [[[ 9, 15, 2], "III Quatember"],
         
     | 
| 
      
 590 
     | 
    
         
            +
                 [[11, 27, 6], "Advent Sunday"],
         
     | 
| 
      
 591 
     | 
    
         
            +
                 [[12, 14, 2], "IV Quatember" ]].each do |pair|
         
     | 
| 
      
 592 
     | 
    
         
            +
                  date, name = pair
         
     | 
| 
      
 593 
     | 
    
         
            +
                  7.times do
         
     | 
| 
      
 594 
     | 
    
         
            +
                    moveable_feasts[date.dup] = name
         
     | 
| 
      
 595 
     | 
    
         
            +
                    date[1] += 1
         
     | 
| 
      
 596 
     | 
    
         
            +
                    if date[1] > 30
         
     | 
| 
      
 597 
     | 
    
         
            +
                      date[0] += 1
         
     | 
| 
      
 598 
     | 
    
         
            +
                      date[1]  = 1
         
     | 
| 
      
 599 
     | 
    
         
            +
                    end
         
     | 
| 
      
 600 
     | 
    
         
            +
                  end
         
     | 
| 
      
 601 
     | 
    
         
            +
                end
         
     | 
| 
      
 602 
     | 
    
         
            +
             
     | 
| 
      
 603 
     | 
    
         
            +
                # 移動祝日
         
     | 
| 
      
 604 
     | 
    
         
            +
                Moveable_feasts = {
         
     | 
| 
      
 605 
     | 
    
         
            +
                  # 復活祭からの日数による
         
     | 
| 
      
 606 
     | 
    
         
            +
                  -63 => "Septuagesima Sunday",
         
     | 
| 
      
 607 
     | 
    
         
            +
                  -56 => "Sexagesima Sunday",
         
     | 
| 
      
 608 
     | 
    
         
            +
                  -49 => "Quinquagesima Sunday",
         
     | 
| 
      
 609 
     | 
    
         
            +
                  -46 => "Ash Wednesday",
         
     | 
| 
      
 610 
     | 
    
         
            +
                  -42 => "Quadragesima Sunday",
         
     | 
| 
      
 611 
     | 
    
         
            +
                  -40 => "I Quatember",
         
     | 
| 
      
 612 
     | 
    
         
            +
                  -35 => "Reminizer Sunday",
         
     | 
| 
      
 613 
     | 
    
         
            +
                  -28 => "Oculi Sunday",
         
     | 
| 
      
 614 
     | 
    
         
            +
                  -21 => "Laetare Sunday",
         
     | 
| 
      
 615 
     | 
    
         
            +
                  -14 => "Judica Sunday",
         
     | 
| 
      
 616 
     | 
    
         
            +
                   -7 => "Palmarum",
         
     | 
| 
      
 617 
     | 
    
         
            +
                   -2 => "Good Friday",
         
     | 
| 
      
 618 
     | 
    
         
            +
                #   0 => "Easter Day",
         
     | 
| 
      
 619 
     | 
    
         
            +
                    7 => "Low Sunday",
         
     | 
| 
      
 620 
     | 
    
         
            +
                   35 => "Rogation Sunday",
         
     | 
| 
      
 621 
     | 
    
         
            +
                   39 => "Ascension Day",
         
     | 
| 
      
 622 
     | 
    
         
            +
                   49 => "Whitsunday",
         
     | 
| 
      
 623 
     | 
    
         
            +
                   53 => "II Quatember",
         
     | 
| 
      
 624 
     | 
    
         
            +
                   56 => "Trinity Sunday",
         
     | 
| 
      
 625 
     | 
    
         
            +
                   60 => "Corpus Christi",
         
     | 
| 
      
 626 
     | 
    
         
            +
                }.update(moveable_feasts) 
         
     | 
| 
      
 627 
     | 
    
         
            +
             
     | 
| 
      
 628 
     | 
    
         
            +
                #
         
     | 
| 
      
 629 
     | 
    
         
            +
                # 暦法によってイベントの動作を変えるか否か
         
     | 
| 
      
 630 
     | 
    
         
            +
                #
         
     | 
| 
      
 631 
     | 
    
         
            +
                CalendarDepend = true
         
     | 
| 
      
 632 
     | 
    
         
            +
             
     | 
| 
      
 633 
     | 
    
         
            +
                # 週日補正フラグ
         
     | 
| 
      
 634 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 635 
     | 
    
         
            +
                attr_reader :w
         
     | 
| 
      
 636 
     | 
    
         
            +
             
     | 
| 
      
 637 
     | 
    
         
            +
                # 最も遅い満月の3月0日からの日数
         
     | 
| 
      
 638 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 639 
     | 
    
         
            +
                attr_reader :d
         
     | 
| 
      
 640 
     | 
    
         
            +
             
     | 
| 
      
 641 
     | 
    
         
            +
                # クリスマスの3月0日からの日数
         
     | 
| 
      
 642 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 643 
     | 
    
         
            +
                attr_reader :x
         
     | 
| 
      
 644 
     | 
    
         
            +
             
     | 
| 
      
 645 
     | 
    
         
            +
                # 平年数
         
     | 
| 
      
 646 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 647 
     | 
    
         
            +
                attr_reader :n
         
     | 
| 
      
 648 
     | 
    
         
            +
             
     | 
| 
      
 649 
     | 
    
         
            +
                # 置閏周期
         
     | 
| 
      
 650 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 651 
     | 
    
         
            +
                attr_reader :s
         
     | 
| 
      
 652 
     | 
    
         
            +
             
     | 
| 
      
 653 
     | 
    
         
            +
                # 月の位相の補正
         
     | 
| 
      
 654 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 655 
     | 
    
         
            +
                attr_reader :c
         
     | 
| 
      
 656 
     | 
    
         
            +
             
     | 
| 
      
 657 
     | 
    
         
            +
                # ガード
         
     | 
| 
      
 658 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 659 
     | 
    
         
            +
                attr_reader :g
         
     | 
| 
      
 660 
     | 
    
         
            +
             
     | 
| 
      
 661 
     | 
    
         
            +
                # ベース
         
     | 
| 
      
 662 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 663 
     | 
    
         
            +
                attr_reader :b
         
     | 
| 
      
 664 
     | 
    
         
            +
             
     | 
| 
      
 665 
     | 
    
         
            +
                # 満月補正フラグ
         
     | 
| 
      
 666 
     | 
    
         
            +
                # @return [Integer]
         
     | 
| 
      
 667 
     | 
    
         
            +
                attr_reader :f
         
     | 
| 
      
 668 
     | 
    
         
            +
             
     | 
| 
      
 669 
     | 
    
         
            +
                # 七曜
         
     | 
| 
      
 670 
     | 
    
         
            +
                #
         
     | 
| 
      
 671 
     | 
    
         
            +
                # @param [When::TM::TemporalPosition] date
         
     | 
| 
      
 672 
     | 
    
         
            +
                # @param [When::TM::CalDate] base (not used)
         
     | 
| 
      
 673 
     | 
    
         
            +
                #
         
     | 
| 
      
 674 
     | 
    
         
            +
                # @return [When::Coordinates::Residue] 七曜
         
     | 
| 
      
 675 
     | 
    
         
            +
                #
         
     | 
| 
      
 676 
     | 
    
         
            +
                def week(date, base=nil)
         
     | 
| 
      
 677 
     | 
    
         
            +
                  When.Residue('Week')[date.to_i % 7]
         
     | 
| 
      
 678 
     | 
    
         
            +
                end
         
     | 
| 
      
 679 
     | 
    
         
            +
             
     | 
| 
      
 680 
     | 
    
         
            +
                # クリスマス
         
     | 
| 
      
 681 
     | 
    
         
            +
                #
         
     | 
| 
      
 682 
     | 
    
         
            +
                # @param [Numeric] date 西暦の年数
         
     | 
| 
      
 683 
     | 
    
         
            +
                # @param [When::TM::TemporalPosition] date
         
     | 
| 
      
 684 
     | 
    
         
            +
                # @param [When::TM::ReferenceSystem] frame 使用する暦法(デフォルトは When::Gregorian)
         
     | 
| 
      
 685 
     | 
    
         
            +
                #
         
     | 
| 
      
 686 
     | 
    
         
            +
                # @return [Integer]           クリスマスのユリウス通日(dateが西暦の年数の場合)
         
     | 
| 
      
 687 
     | 
    
         
            +
                # @return [When::TM::CalDate] クリスマスのWhen::TM::CalDate(yearがWhen::TM::TemporalPositionの場合)
         
     | 
| 
      
 688 
     | 
    
         
            +
                #
         
     | 
| 
      
 689 
     | 
    
         
            +
                def christmas(date, frame=nil)
         
     | 
| 
      
 690 
     | 
    
         
            +
                  _event(date, 'christmas', frame) do |year, frame|
         
     | 
| 
      
 691 
     | 
    
         
            +
                    @x - 1 + frame._coordinates_to_number(year, 2, 0)
         
     | 
| 
      
 692 
     | 
    
         
            +
                  end
         
     | 
| 
      
 693 
     | 
    
         
            +
                end
         
     | 
| 
      
 694 
     | 
    
         
            +
             
     | 
| 
      
 695 
     | 
    
         
            +
                # 復活祭
         
     | 
| 
      
 696 
     | 
    
         
            +
                #
         
     | 
| 
      
 697 
     | 
    
         
            +
                # @param [Numeric] date 西暦の年数
         
     | 
| 
      
 698 
     | 
    
         
            +
                # @param [When::TM::TemporalPosition] date
         
     | 
| 
      
 699 
     | 
    
         
            +
                # @param [When::TM::ReferenceSystem] frame 使用する暦法(デフォルトは When::Gregorian)
         
     | 
| 
      
 700 
     | 
    
         
            +
                #
         
     | 
| 
      
 701 
     | 
    
         
            +
                # @return [Integer]           復活祭のユリウス通日(dateが西暦の年数の場合)
         
     | 
| 
      
 702 
     | 
    
         
            +
                # @return [When::TM::CalDate] 復活祭のWhen::TM::CalDate(yearがWhen::TM::TemporalPositionの場合)
         
     | 
| 
      
 703 
     | 
    
         
            +
                #
         
     | 
| 
      
 704 
     | 
    
         
            +
                def easter(date, frame=nil)
         
     | 
| 
      
 705 
     | 
    
         
            +
                  _event(date, 'easter', frame) do |year, frame|
         
     | 
| 
      
 706 
     | 
    
         
            +
                    golden = (year+@b) % @s + 1
         
     | 
| 
      
 707 
     | 
    
         
            +
                    m      = (frame._lunar_equation(year) + 11*golden + @c) % 30
         
     | 
| 
      
 708 
     | 
    
         
            +
                    if @f == 0
         
     | 
| 
      
 709 
     | 
    
         
            +
                      m += 1 if m==0 || m==1 && golden>=@n
         
     | 
| 
      
 710 
     | 
    
         
            +
                    else
         
     | 
| 
      
 711 
     | 
    
         
            +
                      m += (golden-1) / @f
         
     | 
| 
      
 712 
     | 
    
         
            +
                      m -= 30 if m>=@n
         
     | 
| 
      
 713 
     | 
    
         
            +
                    end
         
     | 
| 
      
 714 
     | 
    
         
            +
                    result  = frame._coordinates_to_number(year, 2, 0) + @d - 1 - m
         
     | 
| 
      
 715 
     | 
    
         
            +
                    result += @g - (result-@w) % 7 if @w<7
         
     | 
| 
      
 716 
     | 
    
         
            +
                    result + frame._easter_delay(year)
         
     | 
| 
      
 717 
     | 
    
         
            +
                  end
         
     | 
| 
      
 718 
     | 
    
         
            +
                end
         
     | 
| 
      
 719 
     | 
    
         
            +
             
     | 
| 
      
 720 
     | 
    
         
            +
                #   イベントの標準的な間隔を返す
         
     | 
| 
      
 721 
     | 
    
         
            +
                # @private
         
     | 
| 
      
 722 
     | 
    
         
            +
                def _delta(parameter=nil)
         
     | 
| 
      
 723 
     | 
    
         
            +
                  return When::P1Y
         
     | 
| 
      
 724 
     | 
    
         
            +
                end
         
     | 
| 
      
 725 
     | 
    
         
            +
             
     | 
| 
      
 726 
     | 
    
         
            +
                # @private
         
     | 
| 
      
 727 
     | 
    
         
            +
                alias :christmas_delta :_delta
         
     | 
| 
      
 728 
     | 
    
         
            +
             
     | 
| 
      
 729 
     | 
    
         
            +
                # @private
         
     | 
| 
      
 730 
     | 
    
         
            +
                alias :easter_delta    :_delta
         
     | 
| 
      
 731 
     | 
    
         
            +
             
     | 
| 
      
 732 
     | 
    
         
            +
                # 固定祝日
         
     | 
| 
      
 733 
     | 
    
         
            +
                #
         
     | 
| 
      
 734 
     | 
    
         
            +
                # @param [When::TM::TemporalPosition] date
         
     | 
| 
      
 735 
     | 
    
         
            +
                # @param [When::TM::ReferenceSystem] frame 使用する暦法(デフォルトは When::Gregorian)
         
     | 
| 
      
 736 
     | 
    
         
            +
                #
         
     | 
| 
      
 737 
     | 
    
         
            +
                # @return [String] 祝日の名称
         
     | 
| 
      
 738 
     | 
    
         
            +
                # @return [nil]    祝日に該当しない
         
     | 
| 
      
 739 
     | 
    
         
            +
                #
         
     | 
| 
      
 740 
     | 
    
         
            +
                def fixed_feast(date, frame=nil)
         
     | 
| 
      
 741 
     | 
    
         
            +
                  date = When.Calendar(frame||'Gregorian') ^ date unless date.frame.kind_of?(When::CalendarTypes::Christian)
         
     | 
| 
      
 742 
     | 
    
         
            +
                  Fixed_feasts[date.cal_date[-2..-1]]
         
     | 
| 
      
 743 
     | 
    
         
            +
                end
         
     | 
| 
      
 744 
     | 
    
         
            +
             
     | 
| 
      
 745 
     | 
    
         
            +
                # 移動祝日
         
     | 
| 
      
 746 
     | 
    
         
            +
                #
         
     | 
| 
      
 747 
     | 
    
         
            +
                # @param [When::TM::TemporalPosition] date
         
     | 
| 
      
 748 
     | 
    
         
            +
                # @param [When::TM::ReferenceSystem] frame 使用する暦法(デフォルトは When::Gregorian)
         
     | 
| 
      
 749 
     | 
    
         
            +
                #
         
     | 
| 
      
 750 
     | 
    
         
            +
                # @return [String] 祝日の名称
         
     | 
| 
      
 751 
     | 
    
         
            +
                # @return [nil]    祝日に該当しない
         
     | 
| 
      
 752 
     | 
    
         
            +
                #
         
     | 
| 
      
 753 
     | 
    
         
            +
                def moveable_feast(date, frame=nil)
         
     | 
| 
      
 754 
     | 
    
         
            +
                  result = Moveable_feasts[date.to_i - easter(date, frame).to_i]
         
     | 
| 
      
 755 
     | 
    
         
            +
                  return result if result
         
     | 
| 
      
 756 
     | 
    
         
            +
                  date = When.Calendar(frame||'Gregorian') ^ date unless date.frame.kind_of?(When::CalendarTypes::Christian)
         
     | 
| 
      
 757 
     | 
    
         
            +
                  Moveable_feasts[date.cal_date[-2..-1] + [date.to_i % 7]]
         
     | 
| 
      
 758 
     | 
    
         
            +
                end
         
     | 
| 
      
 759 
     | 
    
         
            +
             
     | 
| 
      
 760 
     | 
    
         
            +
                private
         
     | 
| 
      
 761 
     | 
    
         
            +
             
     | 
| 
      
 762 
     | 
    
         
            +
                # オブジェクトの正規化
         
     | 
| 
      
 763 
     | 
    
         
            +
                #   w - 週日補正フラグ(デフォルト  6)
         
     | 
| 
      
 764 
     | 
    
         
            +
                #   d - 最も遅い満月  (デフォルト 3月0日から 50日)
         
     | 
| 
      
 765 
     | 
    
         
            +
                #   x - クリスマス    (デフォルト 3月0日から300日)
         
     | 
| 
      
 766 
     | 
    
         
            +
                #   n - 平年数        (デフォルト 12)
         
     | 
| 
      
 767 
     | 
    
         
            +
                #   s - 置閏周期      (デフォルト 19)
         
     | 
| 
      
 768 
     | 
    
         
            +
                #   c - 月の位相の補正(デフォルト  3)
         
     | 
| 
      
 769 
     | 
    
         
            +
                #   g - ガード        (デフォルト  7)
         
     | 
| 
      
 770 
     | 
    
         
            +
                #   b - ベース        (デフォルト  0)
         
     | 
| 
      
 771 
     | 
    
         
            +
                #   f - 満月補正フラグ(デフォルト  0)
         
     | 
| 
      
 772 
     | 
    
         
            +
                def _normalize(args=[], options={})
         
     | 
| 
      
 773 
     | 
    
         
            +
                  w, d, x, n, s, c, g, b, f = args
         
     | 
| 
      
 774 
     | 
    
         
            +
                  @w = (w || @w ||   6).to_i
         
     | 
| 
      
 775 
     | 
    
         
            +
                  @d = (d || @d ||  50).to_i
         
     | 
| 
      
 776 
     | 
    
         
            +
                  @x = (x || @x || 300).to_i
         
     | 
| 
      
 777 
     | 
    
         
            +
                  @n = (n || @n ||  12).to_i
         
     | 
| 
      
 778 
     | 
    
         
            +
                  @s = (s || @s ||  19).to_i
         
     | 
| 
      
 779 
     | 
    
         
            +
                  @c = (c || @c ||   3).to_i
         
     | 
| 
      
 780 
     | 
    
         
            +
                  @g = (g || @g ||   7).to_i
         
     | 
| 
      
 781 
     | 
    
         
            +
                  @b = (b || @b ||   0).to_i
         
     | 
| 
      
 782 
     | 
    
         
            +
                  @f = (f || @f ||   0).to_i
         
     | 
| 
      
 783 
     | 
    
         
            +
                  @event   = 'easter'
         
     | 
| 
      
 784 
     | 
    
         
            +
                  @prime ||= [['Month'], ['Week']]
         
     | 
| 
      
 785 
     | 
    
         
            +
                  super
         
     | 
| 
      
 786 
     | 
    
         
            +
                end
         
     | 
| 
      
 787 
     | 
    
         
            +
             
     | 
| 
      
 788 
     | 
    
         
            +
                #
         
     | 
| 
      
 789 
     | 
    
         
            +
                # 任意の暦をグレゴリオorユリウス暦日に変換
         
     | 
| 
      
 790 
     | 
    
         
            +
                #
         
     | 
| 
      
 791 
     | 
    
         
            +
                def _to_date_for_note(date)
         
     | 
| 
      
 792 
     | 
    
         
            +
                  return When.Calendar(When::CalendarTypes::Christian._default_start(date)) ^ date if ::Object.const_defined?(:Date) &&
         
     | 
| 
      
 793 
     | 
    
         
            +
                                                                                                      ::Date.method_defined?(:+) && date.kind_of?(::Date)
         
     | 
| 
      
 794 
     | 
    
         
            +
                  return When::Gregorian ^ date if date.kind_of?(::Time)
         
     | 
| 
      
 795 
     | 
    
         
            +
                  return date if date.frame.kind_of?(When::CalendarTypes::Christian)
         
     | 
| 
      
 796 
     | 
    
         
            +
                  When.Calendar(date.frame.iri =~ /Coptic/ || date.to_i < 2299161 ? 'Julian' : 'Gregorian') ^ date
         
     | 
| 
      
 797 
     | 
    
         
            +
                end
         
     | 
| 
      
 798 
     | 
    
         
            +
             
     | 
| 
      
 799 
     | 
    
         
            +
                # 当該年のイベントの日付
         
     | 
| 
      
 800 
     | 
    
         
            +
                #   date       : 西暦の年数 or When::TM::(Temporal)Position
         
     | 
| 
      
 801 
     | 
    
         
            +
                #   event      : イベント名 (String)
         
     | 
| 
      
 802 
     | 
    
         
            +
                #   frame      : 暦法(デフォルトは When:Gregorian)
         
     | 
| 
      
 803 
     | 
    
         
            +
                #
         
     | 
| 
      
 804 
     | 
    
         
            +
                # @return [Integer]           イベントのユリウス通日(dateが西暦の年数の場合)
         
     | 
| 
      
 805 
     | 
    
         
            +
                # @return [When::TM::CalDate] イベントのWhen::TM::CalDate(yearがWhen::TM::(Temporal)Positionの場合)
         
     | 
| 
      
 806 
     | 
    
         
            +
                #
         
     | 
| 
      
 807 
     | 
    
         
            +
                def _event(date, event, frame=nil)
         
     | 
| 
      
 808 
     | 
    
         
            +
                  case date
         
     | 
| 
      
 809 
     | 
    
         
            +
                  when Numeric
         
     | 
| 
      
 810 
     | 
    
         
            +
                    year    = date * 1
         
     | 
| 
      
 811 
     | 
    
         
            +
                  when When::TimeValue
         
     | 
| 
      
 812 
     | 
    
         
            +
                    options = date._attr
         
     | 
| 
      
 813 
     | 
    
         
            +
                    options[:precision] = When::DAY
         
     | 
| 
      
 814 
     | 
    
         
            +
                    options[:events]    = [event]
         
     | 
| 
      
 815 
     | 
    
         
            +
                    if frame
         
     | 
| 
      
 816 
     | 
    
         
            +
                      frame = When.Calendar(frame)
         
     | 
| 
      
 817 
     | 
    
         
            +
                      date  = frame.jul_trans(date, options)
         
     | 
| 
      
 818 
     | 
    
         
            +
                    else
         
     | 
| 
      
 819 
     | 
    
         
            +
                      frame = date.frame
         
     | 
| 
      
 820 
     | 
    
         
            +
                    end
         
     | 
| 
      
 821 
     | 
    
         
            +
                    year = date.most_significant_coordinate * 1
         
     | 
| 
      
 822 
     | 
    
         
            +
                  else
         
     | 
| 
      
 823 
     | 
    
         
            +
                    raise TypeError, "Irregal date type: #{date.class}"
         
     | 
| 
      
 824 
     | 
    
         
            +
                  end
         
     | 
| 
      
 825 
     | 
    
         
            +
                  frame ||= When::Gregorian
         
     | 
| 
      
 826 
     | 
    
         
            +
                  result  = yield(year, frame)
         
     | 
| 
      
 827 
     | 
    
         
            +
                  return result if date.kind_of?(Numeric)
         
     | 
| 
      
 828 
     | 
    
         
            +
                  return frame.jul_trans(result, options)
         
     | 
| 
      
 829 
     | 
    
         
            +
                end
         
     | 
| 
      
 830 
     | 
    
         
            +
              end
         
     | 
| 
      
 831 
     | 
    
         
            +
            end
         
     |