when_exe 0.3.7 → 0.3.8
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 +210 -171
- data/bin/irb.rc +1 -0
- data/lib/when_exe.rb +78 -53
- data/lib/when_exe/basictypes.rb +27 -8
- data/lib/when_exe/calendarnote.rb +848 -805
- data/lib/when_exe/calendartypes.rb +110 -240
- data/lib/when_exe/coordinates.rb +2440 -2175
- data/lib/when_exe/core/compatibility.rb +1 -1
- data/lib/when_exe/core/duration.rb +13 -11
- data/lib/when_exe/core/extension.rb +38 -45
- data/lib/when_exe/ephemeris.rb +43 -14
- data/lib/when_exe/ephemeris/eclipse.rb +149 -0
- data/lib/when_exe/ephemeris/notes.rb +39 -7
- data/lib/when_exe/icalendar.rb +2 -6
- data/lib/when_exe/inspect.rb +1408 -1399
- data/lib/when_exe/parts/enumerator.rb +486 -477
- data/lib/when_exe/parts/resource.rb +1101 -1069
- data/lib/when_exe/parts/timezone.rb +6 -5
- data/lib/when_exe/region/babylonian.rb +405 -405
- data/lib/when_exe/region/bahai.rb +21 -61
- data/lib/when_exe/region/chinese/epochs.rb +81 -81
- data/lib/when_exe/region/chinese/twins.rb +51 -51
- data/lib/when_exe/region/christian.rb +7 -2
- data/lib/when_exe/region/coptic.rb +1 -1
- data/lib/when_exe/region/discordian.rb +9 -16
- data/lib/when_exe/region/french.rb +1 -1
- data/lib/when_exe/region/hanke_henry.rb +57 -0
- data/lib/when_exe/region/indian.rb +41 -73
- data/lib/when_exe/region/international_fixed.rb +97 -0
- data/lib/when_exe/region/iranian.rb +203 -203
- data/lib/when_exe/region/japanese.rb +13 -13
- data/lib/when_exe/region/japanese/eclipses.rb +1194 -0
- data/lib/when_exe/region/japanese/notes.rb +1482 -1383
- data/lib/when_exe/region/japanese/residues.rb +726 -721
- data/lib/when_exe/region/japanese/twins.rb +37 -37
- data/lib/when_exe/region/jewish.rb +2 -2
- data/lib/when_exe/region/pax.rb +60 -0
- data/lib/when_exe/region/positivist.rb +100 -0
- data/lib/when_exe/region/roman.rb +333 -334
- data/lib/when_exe/region/shire.rb +3 -20
- data/lib/when_exe/region/thai.rb +2 -2
- data/lib/when_exe/region/tibetan.rb +3 -3
- data/lib/when_exe/region/tranquility.rb +208 -0
- data/lib/when_exe/region/vanishing_leprechaun.rb +53 -0
- data/lib/when_exe/region/vietnamese.rb +4 -4
- data/lib/when_exe/region/world.rb +9 -13
- data/lib/when_exe/region/world_season.rb +89 -0
- data/lib/when_exe/region/zoroastrian.rb +4 -2
- data/lib/when_exe/tmobjects.rb +14 -4
- data/lib/when_exe/tmposition.rb +239 -81
- data/lib/when_exe/tmreference.rb +57 -28
- data/lib/when_exe/version.rb +1 -1
- data/link_to_online_documents +6 -3
- data/test/examples/today.rb +1 -1
- data/test/scripts.rb +23 -0
- data/test/scripts/2.ext.rb +169 -0
- data/test/scripts/2.rb +169 -0
- data/test/scripts/3.ext.rb +133 -0
- data/test/scripts/3.rb +134 -0
- data/test/scripts/4.ext.rb +112 -0
- data/test/scripts/4.min.rb +65 -0
- data/test/scripts/4.rb +136 -0
- data/test/scripts/5.ext.rb +78 -0
- data/test/scripts/5.rb +81 -0
- data/test/scripts/6.gcal.rb +131 -0
- data/test/scripts/6.rb +205 -0
- data/test/scripts/6.tz.rb +105 -0
- data/test/scripts/7.phase.rb +109 -0
- data/test/scripts/7.rb +95 -0
- data/test/scripts/7.term.rb +128 -0
- data/test/scripts/7.week.rb +84 -0
- data/test/scripts/8.ext.rb +61 -0
- data/test/scripts/8.rb +62 -0
- data/test/scripts/9.ext.rb +131 -0
- data/test/scripts/9.rb +130 -0
- data/test/scripts/chinese-luni-solar.rb +52 -0
- data/test/{examples → scripts}/geometric_complex.rb +41 -41
- data/test/scripts/geometric_complex.txt +18 -0
- data/test/scripts/korea.rb +59 -0
- data/test/scripts/thai-reviewed.txt +211 -0
- data/test/scripts/thai.rb +36 -0
- data/test/scripts/thai.txt +210 -0
- data/test/test.rb +7 -0
- data/test/test/basictypes.rb +22 -0
- data/test/test/coordinates.rb +2 -1
- data/test/test/ephemeris.rb +34 -2
- data/test/test/icalendar.rb +12 -0
- data/test/test/inspect.rb +37 -1
- data/test/test/parts.rb +4 -3
- data/test/test/region/armenian.rb +20 -0
- data/test/test/region/bahai.rb +58 -0
- data/test/test/region/chinese.rb +14 -3
- data/test/test/region/christian.rb +16 -35
- data/test/test/region/discordian.rb +20 -0
- data/test/test/region/indian.rb +30 -2
- data/test/test/region/japanese.rb +24 -0
- data/test/test/region/jewish.rb +2 -0
- data/test/test/region/m17n.rb +9 -0
- data/test/test/region/reforms.rb +121 -0
- data/test/test/region/residue.rb +17 -11
- data/test/test/region/shire.rb +58 -0
- data/test/test/region/swedish.rb +45 -0
- data/test/test/region/zoroastrian.rb +58 -0
- data/test/test/tmobjects.rb +74 -0
- data/test/test/tmposition.rb +468 -397
- data/when_exe.gemspec +2 -2
- metadata +49 -6
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
=begin
|
|
3
|
+
Copyright (C) 2014 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
|
+
InternationalFixed = [self, [
|
|
13
|
+
"locale:[=en:, ja=ja:, alias]",
|
|
14
|
+
"names:[InternationalFixed=]",
|
|
15
|
+
"[InternationalFixed=en:International_Fixed_Calendar, 国際固定暦]"
|
|
16
|
+
]]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
#
|
|
20
|
+
# InternationalFixed Week
|
|
21
|
+
#
|
|
22
|
+
class CalendarNote::InternationalFixedWeek < CalendarNote::Week
|
|
23
|
+
|
|
24
|
+
#
|
|
25
|
+
# InternationalFixed Note
|
|
26
|
+
#
|
|
27
|
+
Notes = [When::BasicTypes::M17n, [
|
|
28
|
+
"locale:[=en:, ja=ja:, alias]",
|
|
29
|
+
"names:[InternationalFixed]",
|
|
30
|
+
|
|
31
|
+
# Notes for year ----------------------------
|
|
32
|
+
[When::BasicTypes::M17n,
|
|
33
|
+
"names:[year]"
|
|
34
|
+
],
|
|
35
|
+
|
|
36
|
+
# Notes for month ----------------------------
|
|
37
|
+
[When::BasicTypes::M17n,
|
|
38
|
+
"names:[month]",
|
|
39
|
+
[When::BasicTypes::M17n,
|
|
40
|
+
"names:[Month]",
|
|
41
|
+
"[January, 1月, /date/month_names/1] ",
|
|
42
|
+
"[February, 2月, /date/month_names/2] ",
|
|
43
|
+
"[March, 3月, /date/month_names/3] ",
|
|
44
|
+
"[April, 4月, /date/month_names/4] ",
|
|
45
|
+
"[May, 5月, /date/month_names/5] ",
|
|
46
|
+
"[June, 6月, /date/month_names/6] ",
|
|
47
|
+
"[Sol, 7月 ] ",
|
|
48
|
+
"[July, 8月, /date/month_names/7] ",
|
|
49
|
+
"[August, 9月, /date/month_names/8] ",
|
|
50
|
+
"[September,10月, /date/month_names/9] ",
|
|
51
|
+
"[October, 11月, /date/month_names/10]",
|
|
52
|
+
"[November, 12月, /date/month_names/11]",
|
|
53
|
+
"[December, 13月, /date/month_names/12]"
|
|
54
|
+
]
|
|
55
|
+
],
|
|
56
|
+
|
|
57
|
+
# Notes for day ----------------------------
|
|
58
|
+
[When::BasicTypes::M17n,
|
|
59
|
+
"names:[day]",
|
|
60
|
+
[When::BasicTypes::M17n,
|
|
61
|
+
"names:[Week]",
|
|
62
|
+
[DayOfWeek, "label:[Sunday, 日曜日, /date/day_names/0]", {'delta'=> 7}],
|
|
63
|
+
[DayOfWeek, "label:[Monday, 月曜日, /date/day_names/1]", {'delta'=> 7}],
|
|
64
|
+
[DayOfWeek, "label:[Tuesday, 火曜日, /date/day_names/2]", {'delta'=> 7}],
|
|
65
|
+
[DayOfWeek, "label:[Wednesday, 水曜日, /date/day_names/3]", {'delta'=> 7}],
|
|
66
|
+
[DayOfWeek, "label:[Thursday, 木曜日, /date/day_names/4]", {'delta'=> 7}],
|
|
67
|
+
[DayOfWeek, "label:[Friday, 金曜日, /date/day_names/5]", {'delta'=> 7}],
|
|
68
|
+
[DayOfWeek, "label:[Saturday, 土曜日, /date/day_names/6]", {'delta'=> 7}],
|
|
69
|
+
[DayOfWeek, "label:[OutOfWeek=, 週外日=]", {'delta'=>366}]
|
|
70
|
+
],
|
|
71
|
+
|
|
72
|
+
"[Common_Week]"
|
|
73
|
+
]
|
|
74
|
+
]]
|
|
75
|
+
|
|
76
|
+
fixed_week_definitions
|
|
77
|
+
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
module CalendarTypes
|
|
81
|
+
#
|
|
82
|
+
# InternationalFixed calendar based on Gregorian calendar
|
|
83
|
+
#
|
|
84
|
+
InternationalFixed = [YearLengthTableBased, {
|
|
85
|
+
'label' => 'InternationalFixed::InternationalFixed',
|
|
86
|
+
'indices' => [
|
|
87
|
+
When.Index('InternationalFixedWeekNotes::month::Month', {:unit =>13}),
|
|
88
|
+
When::Coordinates::DefaultDayIndex
|
|
89
|
+
],
|
|
90
|
+
'rule_table' => {
|
|
91
|
+
365 => {'Length'=>[28]*12 + [29]},
|
|
92
|
+
366 => {'Length'=>[28]* 5 + [29] + [28] *6 + [29]}
|
|
93
|
+
},
|
|
94
|
+
'note' => 'InternationalFixedWeek'
|
|
95
|
+
}]
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -1,203 +1,203 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
=begin
|
|
3
|
-
Copyright (C) 2011-2014 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
|
-
class BasicTypes::M17n
|
|
10
|
-
|
|
11
|
-
Iranian = [self, [
|
|
12
|
-
"locale:[=en:, ja=ja:, ar=ar:, alias=ja:]",
|
|
13
|
-
"names:[Iranian=]",
|
|
14
|
-
"[SolarHijri=en:Solar_Hijri_calendar#Details_of_the_modern_calendar, ヘジラ太陽暦=ja:%%<イラン暦>]",
|
|
15
|
-
"[SolarHijriAlgorithmic=en:Solar_Hijri_calendar#Solar_Hijri_algorithmic_calendar, ヘジラ太陽暦=ja:%%<イラン暦>]",
|
|
16
|
-
"[Jalali=en:Jalali_calendar, ジャラーリー暦]",
|
|
17
|
-
"[Borji=, ボルジ暦=]",
|
|
18
|
-
|
|
19
|
-
[self,
|
|
20
|
-
"names:[Month, 月=ja:%%<月_(暦)>]",
|
|
21
|
-
"[Farvardīn=, ファルヴァルディーン=, فروردین=, フラワシ ]",
|
|
22
|
-
"[Ordībehesht=, オルディーベヘシュト=, اردیبهشت=, アシャ・ワヒシュタ ]",
|
|
23
|
-
"[Khordād=, ホルダード=, خرداد=, ハルワタート ]",
|
|
24
|
-
"[Tīr=, ティール=, تیر=, ティシュトリヤ ]",
|
|
25
|
-
"[Mordād=, モルダード=, مرداد=, アムルタート ]",
|
|
26
|
-
"[Shahrīvar=, シャハリーヴァル=, شهریور=, フシャスラ・ワルヤ ]",
|
|
27
|
-
"[Mehr=, メフル=, مهر=, ミスラ ]",
|
|
28
|
-
"[Ābān=, アーバーン=, آبان=, アープ ]",
|
|
29
|
-
"[Āzar=, アーザル=, آذر=, アータル ]",
|
|
30
|
-
"[Dei=, デイ=, دی=, アフラ・マズダー ]",
|
|
31
|
-
"[Bahman=, バフマン=, بهمن=, ウォフ・マナフ ]",
|
|
32
|
-
"[Esfand=, エスファンド=, اسفند=, スプンタ・アールマティ]",
|
|
33
|
-
"[Andarjah=]"
|
|
34
|
-
],
|
|
35
|
-
|
|
36
|
-
[self,
|
|
37
|
-
"names:[Sign=en:Astrological_sign, 十二宮]",
|
|
38
|
-
"[Hamal=, 白羊宮]",
|
|
39
|
-
"[Thur=, 金牛宮]",
|
|
40
|
-
"[Jawzā=, 双児宮]",
|
|
41
|
-
"[Saratān=, 巨蟹宮]",
|
|
42
|
-
"[Asad=, 獅子宮]",
|
|
43
|
-
"[Sunbula=, 処女宮]",
|
|
44
|
-
"[Mizān=, 天秤宮]",
|
|
45
|
-
"['Aqrab=, 天蝎宮]",
|
|
46
|
-
"[Qaws=, 人馬宮]",
|
|
47
|
-
"[Jadi=, 磨羯宮]",
|
|
48
|
-
"[Dalw=, 宝瓶宮]",
|
|
49
|
-
"[Hūt=, 双魚宮]"
|
|
50
|
-
]
|
|
51
|
-
]]
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
module Coordinates
|
|
55
|
-
|
|
56
|
-
# Location of cities in Iran
|
|
57
|
-
Iranian = [When::BasicTypes::M17n, [
|
|
58
|
-
"locale:[=en:, ja=ja:, alias]",
|
|
59
|
-
"names:[Iranian]",
|
|
60
|
-
[Spatial, "long:51.4045E", "lat:32.3905N", "label:[Isfahan, エスファハーン]"],
|
|
61
|
-
[Spatial, "long:51.2523E", "lat:35.4146N", "label:[Tehran, テヘラン ]"]
|
|
62
|
-
]]
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
class TM::CalendarEra
|
|
66
|
-
|
|
67
|
-
# イラン暦
|
|
68
|
-
Iranian = [self, [
|
|
69
|
-
"area:[Iranian]",
|
|
70
|
-
["[Anno_Persico=en:Iranian_calendars,*alias:AP]1.1.1", '@CE', "0001-01-01^TableBasedJalali",
|
|
71
|
-
"1230-01-01^Borji",
|
|
72
|
-
"1304-01-01^SolarHijri", ""],
|
|
73
|
-
["[Anno_Cyrus=,*alias:AC]2535.1.1",
|
|
74
|
-
["[Anno_Hijra=en:Iranian_calendars,*alias:AH]1357.6.5", "@CR", "1357-06-05^SolarHijri"]
|
|
75
|
-
]]
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
module CalendarTypes
|
|
79
|
-
|
|
80
|
-
_indicesM = [
|
|
81
|
-
When.Index('Iranian::Month', {:unit =>12}),
|
|
82
|
-
When::Coordinates::DefaultDayIndex
|
|
83
|
-
]
|
|
84
|
-
|
|
85
|
-
_indicesJ = [
|
|
86
|
-
When.Index('Iranian::Month', {:unit =>13}),
|
|
87
|
-
When::Coordinates::DefaultDayIndex
|
|
88
|
-
]
|
|
89
|
-
|
|
90
|
-
_indicesS = [
|
|
91
|
-
When.Index('Iranian::Sign', {:unit =>12}),
|
|
92
|
-
When::Coordinates::DefaultDayIndex
|
|
93
|
-
]
|
|
94
|
-
|
|
95
|
-
#
|
|
96
|
-
# Solar Hijri Calendar
|
|
97
|
-
#
|
|
98
|
-
SolarHijri = [YearLengthTableBased, {
|
|
99
|
-
'label' => 'Iranian::SolarHijri',
|
|
100
|
-
'indices' => _indicesM,
|
|
101
|
-
'origin_of_MSC' => -621,
|
|
102
|
-
'epoch_in_CE' =>
|
|
103
|
-
'cycle_offset' => 0,
|
|
104
|
-
'time_basis' => '+15:30',
|
|
105
|
-
'rule_table' => {
|
|
106
|
-
365 => {'Length'=>[31] * 6 + [30] * 5 + [29]},
|
|
107
|
-
366 => {'Length'=>[31] * 6 + [30] * 6}
|
|
108
|
-
}
|
|
109
|
-
}]
|
|
110
|
-
|
|
111
|
-
#
|
|
112
|
-
# Solar Hijri Algorithmic Calendar
|
|
113
|
-
#
|
|
114
|
-
SolarHijriAlgorithmic = [CyclicTableBased, {
|
|
115
|
-
'label' => 'Iranian::SolarHijriAlgorithmic',
|
|
116
|
-
'indices' => _indicesM,
|
|
117
|
-
'origin_of_LSC' => 1948321 + 173125,
|
|
118
|
-
'origin_of_MSC' => 475,
|
|
119
|
-
'epoch_in_CE' =>
|
|
120
|
-
'rule_table' => {
|
|
121
|
-
'T' => {'Rule' =>['C128'] * 21 + ['C132']},
|
|
122
|
-
'C128' => {'Rule' =>['C29'] + ['C33'] * 3},
|
|
123
|
-
'C132' => {'Rule' =>['C29'] + ['C33'] * 2 + ['C37']},
|
|
124
|
-
'C29' => {'Rule' =>[365] + ([365] * 3 + [366]) * 7},
|
|
125
|
-
'C33' => {'Rule' =>[365] + ([365] * 3 + [366]) * 8},
|
|
126
|
-
'C37' => {'Rule' =>[365] + ([365] * 3 + [366]) * 9},
|
|
127
|
-
365 => {'Length'=>[31] * 6 + [30] * 5 + [29]},
|
|
128
|
-
366 => {'Length'=>[31] * 6 + [30] * 6}
|
|
129
|
-
}
|
|
130
|
-
}]
|
|
131
|
-
|
|
132
|
-
#
|
|
133
|
-
# Jalali Calendar
|
|
134
|
-
#
|
|
135
|
-
Jalali = [HinduSolar, {
|
|
136
|
-
'label' => 'Iranian::Jalali',
|
|
137
|
-
'indices' => _indicesM,
|
|
138
|
-
'type' => 'SBH'
|
|
139
|
-
}]
|
|
140
|
-
|
|
141
|
-
#
|
|
142
|
-
# Table Based Jalali Calendar
|
|
143
|
-
#
|
|
144
|
-
TableBasedJalali = [CyclicTableBased, {
|
|
145
|
-
'label' => 'Iranian::Jalali',
|
|
146
|
-
'indices' => _indicesJ,
|
|
147
|
-
'origin_of_LSC' => 1948321 + 173125,
|
|
148
|
-
'origin_of_MSC' => 475,
|
|
149
|
-
'epoch_in_CE' =>
|
|
150
|
-
'rule_table' => {
|
|
151
|
-
'T' => {'Rule' =>['C128'] * 21 + ['C132']},
|
|
152
|
-
'C128' => {'Rule' =>['C29'] + ['C33'] * 3},
|
|
153
|
-
'C132' => {'Rule' =>['C29'] + ['C33'] * 2 + ['C37']},
|
|
154
|
-
'C29' => {'Rule' =>[365] + ([365] * 3 + [366]) * 7},
|
|
155
|
-
'C33' => {'Rule' =>[365] + ([365] * 3 + [366]) * 8},
|
|
156
|
-
'C37' => {'Rule' =>[365] + ([365] * 3 + [366]) * 9},
|
|
157
|
-
365 => {'Length'=>[30] * 12 + [5]},
|
|
158
|
-
366 => {'Length'=>[30] * 12 + [6]}
|
|
159
|
-
}
|
|
160
|
-
}]
|
|
161
|
-
|
|
162
|
-
#
|
|
163
|
-
# Borji Calendar
|
|
164
|
-
#
|
|
165
|
-
Borji = [EphemerisBasedSolar, {
|
|
166
|
-
'label' => 'Iranian::Borji',
|
|
167
|
-
'indices' => _indicesS,
|
|
168
|
-
'origin_of_MSC' => -621,
|
|
169
|
-
'epoch_in_CE' =>
|
|
170
|
-
'cycle_offset' => 0,
|
|
171
|
-
'time_basis' => '+15:30'
|
|
172
|
-
}]
|
|
173
|
-
|
|
174
|
-
#
|
|
175
|
-
# Table Based Borji Calendar
|
|
176
|
-
#
|
|
177
|
-
TableBasedBorji = [PatternTableBasedSolar, {
|
|
178
|
-
'label' => 'Iranian::SolarHijri',
|
|
179
|
-
'indices' => _indicesM,
|
|
180
|
-
'origin_of_MSC' => 1230,
|
|
181
|
-
'origin_of_LSC' => 2397203,
|
|
182
|
-
'epoch_in_CE' =>
|
|
183
|
-
'before' => 'Borji',
|
|
184
|
-
'after' => 'SolarHijriAlgorithmic',
|
|
185
|
-
'rule_table'=> %w(
|
|
186
|
-
112111000900 011211000900 012111190900 111121009090 111211000900
|
|
187
|
-
011211000900 012111190900 111120109090 111211009000 011211000900
|
|
188
|
-
012111190900 021120109090 111211009090 111211000900 012111190900
|
|
189
|
-
012120109090 111211009090 111211000900 012111190900 012120109090
|
|
190
|
-
111121009090 111211000900 012111000900 012111109090 111121009090
|
|
191
|
-
111211000900 011211000900 012111109090 111121009090 111211000900
|
|
192
|
-
011211000900 012111109900 111121009090 111211000900 011211000900
|
|
193
|
-
012111109900 111121009090 111211000900 011211000900 012111190900
|
|
194
|
-
111120109090 111211009000 011211000900 012111190900 012120109090
|
|
195
|
-
111211009090 111211000900 012111190900 012120109090 111121009090
|
|
196
|
-
111211000900 012111190900 012111109090 111121009090 111211000900
|
|
197
|
-
011211000900 012111109090 111121009090 111211000900 011211000900
|
|
198
|
-
012111109090 111121009090 111211000900 011211000900 012111109090
|
|
199
|
-
111121009090 111211000900 011211000900 012111109900 111120109090
|
|
200
|
-
111211000900 011211000900 012111190900 012120109090)
|
|
201
|
-
}]
|
|
202
|
-
end
|
|
203
|
-
end
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
=begin
|
|
3
|
+
Copyright (C) 2011-2014 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
|
+
class BasicTypes::M17n
|
|
10
|
+
|
|
11
|
+
Iranian = [self, [
|
|
12
|
+
"locale:[=en:, ja=ja:, ar=ar:, alias=ja:]",
|
|
13
|
+
"names:[Iranian=]",
|
|
14
|
+
"[SolarHijri=en:Solar_Hijri_calendar#Details_of_the_modern_calendar, ヘジラ太陽暦=ja:%%<イラン暦>]",
|
|
15
|
+
"[SolarHijriAlgorithmic=en:Solar_Hijri_calendar#Solar_Hijri_algorithmic_calendar, ヘジラ太陽暦=ja:%%<イラン暦>]",
|
|
16
|
+
"[Jalali=en:Jalali_calendar, ジャラーリー暦]",
|
|
17
|
+
"[Borji=, ボルジ暦=]",
|
|
18
|
+
|
|
19
|
+
[self,
|
|
20
|
+
"names:[Month, 月=ja:%%<月_(暦)>]",
|
|
21
|
+
"[Farvardīn=, ファルヴァルディーン=, فروردین=, フラワシ ]",
|
|
22
|
+
"[Ordībehesht=, オルディーベヘシュト=, اردیبهشت=, アシャ・ワヒシュタ ]",
|
|
23
|
+
"[Khordād=, ホルダード=, خرداد=, ハルワタート ]",
|
|
24
|
+
"[Tīr=, ティール=, تیر=, ティシュトリヤ ]",
|
|
25
|
+
"[Mordād=, モルダード=, مرداد=, アムルタート ]",
|
|
26
|
+
"[Shahrīvar=, シャハリーヴァル=, شهریور=, フシャスラ・ワルヤ ]",
|
|
27
|
+
"[Mehr=, メフル=, مهر=, ミスラ ]",
|
|
28
|
+
"[Ābān=, アーバーン=, آبان=, アープ ]",
|
|
29
|
+
"[Āzar=, アーザル=, آذر=, アータル ]",
|
|
30
|
+
"[Dei=, デイ=, دی=, アフラ・マズダー ]",
|
|
31
|
+
"[Bahman=, バフマン=, بهمن=, ウォフ・マナフ ]",
|
|
32
|
+
"[Esfand=, エスファンド=, اسفند=, スプンタ・アールマティ]",
|
|
33
|
+
"[Andarjah=]"
|
|
34
|
+
],
|
|
35
|
+
|
|
36
|
+
[self,
|
|
37
|
+
"names:[Sign=en:Astrological_sign, 十二宮]",
|
|
38
|
+
"[Hamal=, 白羊宮]",
|
|
39
|
+
"[Thur=, 金牛宮]",
|
|
40
|
+
"[Jawzā=, 双児宮]",
|
|
41
|
+
"[Saratān=, 巨蟹宮]",
|
|
42
|
+
"[Asad=, 獅子宮]",
|
|
43
|
+
"[Sunbula=, 処女宮]",
|
|
44
|
+
"[Mizān=, 天秤宮]",
|
|
45
|
+
"['Aqrab=, 天蝎宮]",
|
|
46
|
+
"[Qaws=, 人馬宮]",
|
|
47
|
+
"[Jadi=, 磨羯宮]",
|
|
48
|
+
"[Dalw=, 宝瓶宮]",
|
|
49
|
+
"[Hūt=, 双魚宮]"
|
|
50
|
+
]
|
|
51
|
+
]]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
module Coordinates
|
|
55
|
+
|
|
56
|
+
# Location of cities in Iran
|
|
57
|
+
Iranian = [When::BasicTypes::M17n, [
|
|
58
|
+
"locale:[=en:, ja=ja:, alias]",
|
|
59
|
+
"names:[Iranian]",
|
|
60
|
+
[Spatial, "long:51.4045E", "lat:32.3905N", "label:[Isfahan, エスファハーン]"],
|
|
61
|
+
[Spatial, "long:51.2523E", "lat:35.4146N", "label:[Tehran, テヘラン ]"]
|
|
62
|
+
]]
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
class TM::CalendarEra
|
|
66
|
+
|
|
67
|
+
# イラン暦
|
|
68
|
+
Iranian = [self, [
|
|
69
|
+
"area:[Iranian]",
|
|
70
|
+
["[Anno_Persico=en:Iranian_calendars,*alias:AP]1.1.1", '@CE', "0001-01-01^TableBasedJalali",
|
|
71
|
+
"1230-01-01^Borji",
|
|
72
|
+
"1304-01-01^SolarHijri", ""],
|
|
73
|
+
["[Anno_Cyrus=,*alias:AC]2535.1.1", "", "1355-01-01^SolarHijri"],
|
|
74
|
+
["[Anno_Hijra=en:Iranian_calendars,*alias:AH]1357.6.5", "@CR", "1357-06-05^SolarHijri"]
|
|
75
|
+
]]
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
module CalendarTypes
|
|
79
|
+
|
|
80
|
+
_indicesM = [
|
|
81
|
+
When.Index('Iranian::Month', {:unit =>12}),
|
|
82
|
+
When::Coordinates::DefaultDayIndex
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
_indicesJ = [
|
|
86
|
+
When.Index('Iranian::Month', {:unit =>13}),
|
|
87
|
+
When::Coordinates::DefaultDayIndex
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
_indicesS = [
|
|
91
|
+
When.Index('Iranian::Sign', {:unit =>12}),
|
|
92
|
+
When::Coordinates::DefaultDayIndex
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
#
|
|
96
|
+
# Solar Hijri Calendar
|
|
97
|
+
#
|
|
98
|
+
SolarHijri = [YearLengthTableBased, {
|
|
99
|
+
'label' => 'Iranian::SolarHijri',
|
|
100
|
+
'indices' => _indicesM,
|
|
101
|
+
'origin_of_MSC' => -621,
|
|
102
|
+
'epoch_in_CE' => 621,
|
|
103
|
+
'cycle_offset' => 0,
|
|
104
|
+
'time_basis' => '+15:30',
|
|
105
|
+
'rule_table' => {
|
|
106
|
+
365 => {'Length'=>[31] * 6 + [30] * 5 + [29]},
|
|
107
|
+
366 => {'Length'=>[31] * 6 + [30] * 6}
|
|
108
|
+
}
|
|
109
|
+
}]
|
|
110
|
+
|
|
111
|
+
#
|
|
112
|
+
# Solar Hijri Algorithmic Calendar
|
|
113
|
+
#
|
|
114
|
+
SolarHijriAlgorithmic = [CyclicTableBased, {
|
|
115
|
+
'label' => 'Iranian::SolarHijriAlgorithmic',
|
|
116
|
+
'indices' => _indicesM,
|
|
117
|
+
'origin_of_LSC' => 1948321 + 173125,
|
|
118
|
+
'origin_of_MSC' => 475,
|
|
119
|
+
'epoch_in_CE' => 621,
|
|
120
|
+
'rule_table' => {
|
|
121
|
+
'T' => {'Rule' =>['C128'] * 21 + ['C132']},
|
|
122
|
+
'C128' => {'Rule' =>['C29'] + ['C33'] * 3},
|
|
123
|
+
'C132' => {'Rule' =>['C29'] + ['C33'] * 2 + ['C37']},
|
|
124
|
+
'C29' => {'Rule' =>[365] + ([365] * 3 + [366]) * 7},
|
|
125
|
+
'C33' => {'Rule' =>[365] + ([365] * 3 + [366]) * 8},
|
|
126
|
+
'C37' => {'Rule' =>[365] + ([365] * 3 + [366]) * 9},
|
|
127
|
+
365 => {'Length'=>[31] * 6 + [30] * 5 + [29]},
|
|
128
|
+
366 => {'Length'=>[31] * 6 + [30] * 6}
|
|
129
|
+
}
|
|
130
|
+
}]
|
|
131
|
+
|
|
132
|
+
#
|
|
133
|
+
# Jalali Calendar
|
|
134
|
+
#
|
|
135
|
+
Jalali = [HinduSolar, {
|
|
136
|
+
'label' => 'Iranian::Jalali',
|
|
137
|
+
'indices' => _indicesM,
|
|
138
|
+
'type' => 'SBH'
|
|
139
|
+
}]
|
|
140
|
+
|
|
141
|
+
#
|
|
142
|
+
# Table Based Jalali Calendar
|
|
143
|
+
#
|
|
144
|
+
TableBasedJalali = [CyclicTableBased, {
|
|
145
|
+
'label' => 'Iranian::Jalali',
|
|
146
|
+
'indices' => _indicesJ,
|
|
147
|
+
'origin_of_LSC' => 1948321 + 173125,
|
|
148
|
+
'origin_of_MSC' => 475,
|
|
149
|
+
'epoch_in_CE' => 621,
|
|
150
|
+
'rule_table' => {
|
|
151
|
+
'T' => {'Rule' =>['C128'] * 21 + ['C132']},
|
|
152
|
+
'C128' => {'Rule' =>['C29'] + ['C33'] * 3},
|
|
153
|
+
'C132' => {'Rule' =>['C29'] + ['C33'] * 2 + ['C37']},
|
|
154
|
+
'C29' => {'Rule' =>[365] + ([365] * 3 + [366]) * 7},
|
|
155
|
+
'C33' => {'Rule' =>[365] + ([365] * 3 + [366]) * 8},
|
|
156
|
+
'C37' => {'Rule' =>[365] + ([365] * 3 + [366]) * 9},
|
|
157
|
+
365 => {'Length'=>[30] * 12 + [5]},
|
|
158
|
+
366 => {'Length'=>[30] * 12 + [6]}
|
|
159
|
+
}
|
|
160
|
+
}]
|
|
161
|
+
|
|
162
|
+
#
|
|
163
|
+
# Borji Calendar
|
|
164
|
+
#
|
|
165
|
+
Borji = [EphemerisBasedSolar, {
|
|
166
|
+
'label' => 'Iranian::Borji',
|
|
167
|
+
'indices' => _indicesS,
|
|
168
|
+
'origin_of_MSC' => -621,
|
|
169
|
+
'epoch_in_CE' => 621,
|
|
170
|
+
'cycle_offset' => 0,
|
|
171
|
+
'time_basis' => '+15:30'
|
|
172
|
+
}]
|
|
173
|
+
|
|
174
|
+
#
|
|
175
|
+
# Table Based Borji Calendar
|
|
176
|
+
#
|
|
177
|
+
TableBasedBorji = [PatternTableBasedSolar, {
|
|
178
|
+
'label' => 'Iranian::SolarHijri',
|
|
179
|
+
'indices' => _indicesM,
|
|
180
|
+
'origin_of_MSC' => 1230,
|
|
181
|
+
'origin_of_LSC' => 2397203,
|
|
182
|
+
'epoch_in_CE' => 621,
|
|
183
|
+
'before' => 'Borji',
|
|
184
|
+
'after' => 'SolarHijriAlgorithmic',
|
|
185
|
+
'rule_table'=> %w(
|
|
186
|
+
112111000900 011211000900 012111190900 111121009090 111211000900
|
|
187
|
+
011211000900 012111190900 111120109090 111211009000 011211000900
|
|
188
|
+
012111190900 021120109090 111211009090 111211000900 012111190900
|
|
189
|
+
012120109090 111211009090 111211000900 012111190900 012120109090
|
|
190
|
+
111121009090 111211000900 012111000900 012111109090 111121009090
|
|
191
|
+
111211000900 011211000900 012111109090 111121009090 111211000900
|
|
192
|
+
011211000900 012111109900 111121009090 111211000900 011211000900
|
|
193
|
+
012111109900 111121009090 111211000900 011211000900 012111190900
|
|
194
|
+
111120109090 111211009000 011211000900 012111190900 012120109090
|
|
195
|
+
111211009090 111211000900 012111190900 012120109090 111121009090
|
|
196
|
+
111211000900 012111190900 012111109090 111121009090 111211000900
|
|
197
|
+
011211000900 012111109090 111121009090 111211000900 011211000900
|
|
198
|
+
012111109090 111121009090 111211000900 011211000900 012111109090
|
|
199
|
+
111121009090 111211000900 011211000900 012111109900 111120109090
|
|
200
|
+
111211000900 011211000900 012111190900 012120109090)
|
|
201
|
+
}]
|
|
202
|
+
end
|
|
203
|
+
end
|