when_exe 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +36 -33
- data/bin/locales.rb +1 -1
- data/bin/make_ttl.rb.config +1 -1
- data/lib/when_exe.rb +27 -16
- data/lib/when_exe/basictypes.rb +772 -771
- data/lib/when_exe/calendartypes.rb +1485 -1453
- data/lib/when_exe/coordinates.rb +5 -0
- data/lib/when_exe/core/compatibility.rb +1 -1
- data/lib/when_exe/core/duration.rb +147 -116
- data/lib/when_exe/core/extension.rb +499 -497
- data/lib/when_exe/ephemeris.rb +1952 -1951
- data/lib/when_exe/ephemeris/eclipse.rb +5 -4
- data/lib/when_exe/ephemeris/notes.rb +457 -421
- data/lib/when_exe/ephemeris/planets.rb +585 -585
- data/lib/when_exe/ephemeris/sun.rb +214 -214
- data/lib/when_exe/google_api.rb +153 -0
- data/lib/when_exe/icalendar.rb +1640 -1632
- data/lib/when_exe/inspect.rb +42 -20
- data/lib/when_exe/linkeddata.rb +28 -7
- data/lib/when_exe/locales/autoload.rb +2 -1
- data/lib/when_exe/locales/locale.rb +35 -15
- data/lib/when_exe/locales/zh.rb +77 -0
- data/lib/when_exe/mini_application.rb +3 -1
- data/lib/when_exe/{googlecalendar.rb → obsolete/googlecalendar.rb} +144 -144
- data/lib/when_exe/parts/enumerator.rb +498 -486
- data/lib/when_exe/parts/geometric_complex.rb +397 -397
- data/lib/when_exe/parts/timezone.rb +246 -241
- data/lib/when_exe/region/armenian.rb +55 -56
- data/lib/when_exe/region/babylonian.rb +406 -405
- data/lib/when_exe/region/bahai.rb +107 -106
- data/lib/when_exe/region/balinese.rb +624 -622
- data/lib/when_exe/region/chinese.rb +1071 -1026
- data/lib/when_exe/region/chinese/epochs.rb +28 -28
- data/lib/when_exe/region/chinese/notes.rb +219 -0
- data/lib/when_exe/region/chinese/twins.rb +803 -803
- data/lib/when_exe/region/christian.rb +21 -15
- data/lib/when_exe/region/coptic.rb +107 -106
- data/lib/when_exe/region/discordian.rb +218 -218
- data/lib/when_exe/region/east_asian.rb +1 -1
- data/lib/when_exe/region/french.rb +126 -56
- data/lib/when_exe/region/geologicalage.rb +639 -639
- data/lib/when_exe/region/goddess.rb +60 -58
- data/lib/when_exe/region/hanke_henry.rb +2 -2
- data/lib/when_exe/region/indian.rb +1225 -1222
- data/lib/when_exe/region/international_fixed.rb +96 -97
- data/lib/when_exe/region/iranian.rb +206 -203
- data/lib/when_exe/region/islamic.rb +102 -102
- data/lib/when_exe/region/japanese.rb +126 -71
- data/lib/when_exe/region/japanese/epochs.rb +426 -426
- data/lib/when_exe/region/japanese/notes.rb +101 -81
- data/lib/when_exe/region/japanese/residues.rb +1345 -1311
- data/lib/when_exe/region/japanese/twins.rb +225 -225
- data/lib/when_exe/region/japanese/weeks.rb +112 -112
- data/lib/when_exe/region/javanese.rb +230 -230
- data/lib/when_exe/region/jewish.rb +130 -131
- data/lib/when_exe/region/m17n.rb +114 -114
- data/lib/when_exe/region/martian.rb +258 -258
- data/lib/when_exe/region/mayan.rb +11 -8
- data/lib/when_exe/region/pax.rb +4 -5
- data/lib/when_exe/region/pope.rb +1 -1
- data/lib/when_exe/region/positivist.rb +100 -100
- data/lib/when_exe/region/residue.rb +162 -162
- data/lib/when_exe/region/roman.rb +333 -333
- data/lib/when_exe/region/{soviet.rb → russian.rb} +221 -209
- data/lib/when_exe/region/shire.rb +222 -223
- data/lib/when_exe/region/symmetry.rb +50 -50
- data/lib/when_exe/region/thai.rb +336 -336
- data/lib/when_exe/region/tibetan.rb +315 -316
- data/lib/when_exe/region/tranquility.rb +207 -208
- data/lib/when_exe/region/vanishing_leprechaun.rb +3 -1
- data/lib/when_exe/region/vietnamese.rb +449 -440
- data/lib/when_exe/region/weekdate.rb +80 -80
- data/lib/when_exe/region/world.rb +170 -171
- data/lib/when_exe/region/world_season.rb +89 -89
- data/lib/when_exe/region/yerm.rb +3 -3
- data/lib/when_exe/region/zoroastrian.rb +205 -205
- data/lib/when_exe/timestandard.rb +708 -707
- data/lib/when_exe/tmduration.rb +338 -338
- data/lib/when_exe/tmobjects.rb +1356 -1356
- data/lib/when_exe/tmposition.rb +66 -31
- data/lib/when_exe/version.rb +16 -2
- data/test/examples/Residue.m17n +83 -83
- data/test/examples/Terms.m17n +2 -2
- data/test/test.rb +2 -2
- data/test/test/google_api.rb +65 -0
- data/test/test/linkeddata.rb +1 -1
- data/test/test/{googlecalendar.rb → obsolete/googlecalendar.rb} +194 -194
- data/test/test/region/indian.rb +90 -85
- data/test/test/region/m17n.rb +7 -7
- data/test/test/region/mayan.rb +195 -195
- data/test/test/region/residue.rb +153 -153
- data/test/test/tmposition.rb +11 -1
- data/when_exe.gemspec +2 -2
- metadata +95 -8
- data/test/test.rb.config +0 -1
@@ -1,58 +1,60 @@
|
|
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
|
-
=begin
|
9
|
-
|
10
|
-
References
|
11
|
-
|
12
|
-
(1) http://calendars.wikia.com/wiki/Goddess_Lunar_Calendar
|
13
|
-
(2) http://www.fractal-timewave.com/mmgc/mmgc.htm
|
14
|
-
|
15
|
-
=end
|
16
|
-
|
17
|
-
module When
|
18
|
-
|
19
|
-
class BasicTypes::M17n
|
20
|
-
|
21
|
-
Goddess = [self, [
|
22
|
-
"locale:[=en:, ja]",
|
23
|
-
"names:[Goddess=]",
|
24
|
-
"[Goddess(MMG)=http://calendars.wikia.com/wiki/Goddess_Lunar_Calendar,
|
25
|
-
|
26
|
-
[self,
|
27
|
-
"names:[Month]",
|
28
|
-
"[Athena]", "[Brigid]", "[Cerridwen]", "[Diana ]",
|
29
|
-
"[Epona ]", "[Freya ]", "[Gaea ]", "[Hathor]",
|
30
|
-
"[Inanna]", "[Juno ]", "[Kore ]", "[Lilith]",
|
31
|
-
"[Maria ]"
|
32
|
-
]
|
33
|
-
]]
|
34
|
-
end
|
35
|
-
|
36
|
-
module CalendarTypes
|
37
|
-
|
38
|
-
#
|
39
|
-
# Goddess Calendar
|
40
|
-
#
|
41
|
-
Goddess = [CyclicTableBased, {
|
42
|
-
'label' => 'Goddess::Goddess',
|
43
|
-
'origin_of_LSC' => 2415611 - 180432, # 1901-08-14 Base Cycle = No.1
|
44
|
-
'
|
45
|
-
|
46
|
-
|
47
|
-
When
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
=begin
|
3
|
+
Copyright (C) 2014-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
|
+
=begin
|
9
|
+
|
10
|
+
References
|
11
|
+
|
12
|
+
(1) http://calendars.wikia.com/wiki/Goddess_Lunar_Calendar
|
13
|
+
(2) http://www.fractal-timewave.com/mmgc/mmgc.htm
|
14
|
+
|
15
|
+
=end
|
16
|
+
|
17
|
+
module When
|
18
|
+
|
19
|
+
class BasicTypes::M17n
|
20
|
+
|
21
|
+
Goddess = [self, [
|
22
|
+
"locale:[=en:, ja, zh]",
|
23
|
+
"names:[ Peter Meyer's Goddes Lunar Calendar=, Peter Meyer のゴッデス暦=, *alias:Goddess=]",
|
24
|
+
"[Goddess(MMG)=http://calendars.wikia.com/wiki/Goddess_Lunar_Calendar, ゴッデス暦(MMG), 女神曆(MMG), *alias:Goddess]",
|
25
|
+
|
26
|
+
[self,
|
27
|
+
"names:[month name=en:Month, 月の名前=ja:%%<月_(暦)>, 該月的名稱=, *alias:Month=]",
|
28
|
+
"[Athena]", "[Brigid]", "[Cerridwen]", "[Diana ]",
|
29
|
+
"[Epona ]", "[Freya ]", "[Gaea ]", "[Hathor]",
|
30
|
+
"[Inanna]", "[Juno ]", "[Kore ]", "[Lilith]",
|
31
|
+
"[Maria ]"
|
32
|
+
]
|
33
|
+
]]
|
34
|
+
end
|
35
|
+
|
36
|
+
module CalendarTypes
|
37
|
+
|
38
|
+
#
|
39
|
+
# Goddess Calendar
|
40
|
+
#
|
41
|
+
Goddess = [CyclicTableBased, {
|
42
|
+
'label' => 'Goddess::Goddess',
|
43
|
+
'origin_of_LSC' => 2415611 - 180432, # 1901-08-14 Base Cycle = No.1
|
44
|
+
'note' => [['_m:Calendar::Month'],
|
45
|
+
['_co:Common::Week', '_n:Ephemeris/Notes::day::Moon_Age']],
|
46
|
+
'indices' => [
|
47
|
+
When.Index({:unit=>470}),
|
48
|
+
When.Index('Goddess::Month'),
|
49
|
+
When::Coordinates::DefaultDayIndex,
|
50
|
+
],
|
51
|
+
'rule_table' => {
|
52
|
+
'T' => {'Rule' =>(['L'] * 9 + ['S']) * 23 +
|
53
|
+
(['L'] * 4 + ['S']) * 2 +
|
54
|
+
(['L'] * 9 + ['S']) * 23},
|
55
|
+
'L' => {'Length'=>[30, 29] * 6 + [30]},
|
56
|
+
'S' => {'Length'=>[30, 29] * 6 + [29]}
|
57
|
+
}
|
58
|
+
}]
|
59
|
+
end
|
60
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
=begin
|
3
|
-
Copyright (C) 2014 Takashi SUGA
|
3
|
+
Copyright (C) 2014-2015 Takashi SUGA
|
4
4
|
|
5
5
|
You may use and/or modify this file according to the license described in the LICENSE.txt file included in this archive.
|
6
6
|
=end
|
@@ -15,7 +15,7 @@ module When
|
|
15
15
|
"[HankeHenry=en:Hanke-Henry_Permanent_Calendar, ハンキ=ヘンリー暦=ja:%%<ハンキ=ヘンリー・パーマネント・カレンダー>]",
|
16
16
|
|
17
17
|
[self,
|
18
|
-
"names:[Month,
|
18
|
+
"names:[month name=en:Month, 月の名前=ja:%%<月_(暦)>, zh:該月的名稱=, *alias:Month=]",
|
19
19
|
"[January, 1月, /date/month_names/1] ",
|
20
20
|
"[February, 2月, /date/month_names/2] ",
|
21
21
|
"[March, 3月, /date/month_names/3] ",
|
@@ -1,1222 +1,1225 @@
|
|
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
|
-
require 'when_exe/locales/iast'
|
9
|
-
|
10
|
-
module When
|
11
|
-
class BasicTypes::M17n
|
12
|
-
|
13
|
-
Indian = [self, [
|
14
|
-
"locale:[=en:, ja=ja:,
|
15
|
-
"names:[Indian=]",
|
16
|
-
"[IndianNationalSolar=en:Indian_national_calendar, インド国定暦, era:SE=]",
|
17
|
-
"[Nanakshahi=en:Nanakshahi_calendar,
|
18
|
-
"[RevisedBengali=en:Bengali_calendar,
|
19
|
-
"[HinduSolar=en:Hindu_calendar,
|
20
|
-
"[HinduLuniSolar=en:Hindu_calendar,
|
21
|
-
|
22
|
-
[self,
|
23
|
-
"
|
24
|
-
"[
|
25
|
-
"[%s
|
26
|
-
"[
|
27
|
-
"[adhika %s
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
"[
|
33
|
-
"[
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
"[
|
39
|
-
"[
|
40
|
-
"[
|
41
|
-
"[
|
42
|
-
"[
|
43
|
-
"[
|
44
|
-
"[
|
45
|
-
"[
|
46
|
-
"[
|
47
|
-
"[
|
48
|
-
"[
|
49
|
-
"[
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
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
|
-
"[
|
81
|
-
"[
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
"[
|
89
|
-
"[
|
90
|
-
"[
|
91
|
-
"[
|
92
|
-
"[
|
93
|
-
"[
|
94
|
-
"[
|
95
|
-
"[
|
96
|
-
"[
|
97
|
-
"[
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
[
|
110
|
-
[
|
111
|
-
[Spatial, "long:+
|
112
|
-
[Spatial, "long:+
|
113
|
-
[Spatial, "long:+78.
|
114
|
-
[Spatial, "long:+
|
115
|
-
[Spatial, "long:+
|
116
|
-
[Spatial, "long:+
|
117
|
-
[Spatial, "long:+
|
118
|
-
[Spatial, "long:+
|
119
|
-
[Spatial, "long:+
|
120
|
-
[Spatial, "long:+
|
121
|
-
[Spatial, "long:+
|
122
|
-
[Spatial, "long:+
|
123
|
-
[Spatial, "long:+
|
124
|
-
[Spatial, "long:+
|
125
|
-
[Spatial, "long:+
|
126
|
-
[Spatial, "long:+
|
127
|
-
[Spatial, "long:+
|
128
|
-
[Spatial, "long:+
|
129
|
-
[Spatial, "long:+
|
130
|
-
[Spatial, "long:+
|
131
|
-
[Spatial, "long:+
|
132
|
-
[Spatial, "long:+
|
133
|
-
[Spatial, "long:+
|
134
|
-
[Spatial, "long:+
|
135
|
-
[Spatial, "long:+
|
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
|
-
|
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
|
-
# @param [
|
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
|
-
# @param [
|
335
|
-
# @param [Numeric]
|
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
|
-
#
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
#
|
401
|
-
#
|
402
|
-
# @
|
403
|
-
#
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
# first
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
mean
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
#
|
428
|
-
#
|
429
|
-
# @param [
|
430
|
-
# @param [Numeric]
|
431
|
-
# @param [Numeric]
|
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
|
-
|
459
|
-
|
460
|
-
|
461
|
-
#
|
462
|
-
#
|
463
|
-
#
|
464
|
-
|
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
|
-
@graha.update({
|
545
|
-
:
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
:
|
550
|
-
|
551
|
-
|
552
|
-
:
|
553
|
-
:
|
554
|
-
:
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
'
|
570
|
-
'
|
571
|
-
'
|
572
|
-
|
573
|
-
|
574
|
-
|
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
|
-
When.
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
[
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
696
|
-
|
697
|
-
#
|
698
|
-
|
699
|
-
#
|
700
|
-
#
|
701
|
-
#
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
#
|
713
|
-
#
|
714
|
-
#
|
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
|
-
return
|
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
|
-
|
793
|
-
|
794
|
-
|
795
|
-
@
|
796
|
-
@
|
797
|
-
|
798
|
-
@
|
799
|
-
@
|
800
|
-
@
|
801
|
-
@
|
802
|
-
@
|
803
|
-
@
|
804
|
-
@
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
[
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
"[
|
849
|
-
"[
|
850
|
-
"[
|
851
|
-
"[
|
852
|
-
"[
|
853
|
-
"[
|
854
|
-
"[
|
855
|
-
"[
|
856
|
-
"[
|
857
|
-
"[
|
858
|
-
"[
|
859
|
-
"[
|
860
|
-
"[
|
861
|
-
"[
|
862
|
-
"[
|
863
|
-
"[
|
864
|
-
"[
|
865
|
-
"[
|
866
|
-
"[
|
867
|
-
"[
|
868
|
-
"[
|
869
|
-
"[
|
870
|
-
"[
|
871
|
-
"[
|
872
|
-
"[
|
873
|
-
"[
|
874
|
-
"[
|
875
|
-
"[
|
876
|
-
"[
|
877
|
-
"[
|
878
|
-
"[
|
879
|
-
"[
|
880
|
-
"[
|
881
|
-
"[
|
882
|
-
"[
|
883
|
-
"[
|
884
|
-
"[
|
885
|
-
"[
|
886
|
-
"[
|
887
|
-
"[
|
888
|
-
"[
|
889
|
-
"[
|
890
|
-
"[
|
891
|
-
"[
|
892
|
-
"[
|
893
|
-
"[
|
894
|
-
"[
|
895
|
-
"[
|
896
|
-
"[
|
897
|
-
"[
|
898
|
-
"[
|
899
|
-
"[
|
900
|
-
"[
|
901
|
-
"[
|
902
|
-
"[
|
903
|
-
"[
|
904
|
-
"[
|
905
|
-
"[
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
]
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
"[
|
926
|
-
"[
|
927
|
-
"[
|
928
|
-
"[
|
929
|
-
"[
|
930
|
-
"[
|
931
|
-
"[
|
932
|
-
"[
|
933
|
-
"[
|
934
|
-
"[
|
935
|
-
"[
|
936
|
-
"[
|
937
|
-
"[
|
938
|
-
"[
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
"[
|
946
|
-
"[
|
947
|
-
"[
|
948
|
-
"[
|
949
|
-
"[
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
"[
|
957
|
-
"[
|
958
|
-
"[
|
959
|
-
"[
|
960
|
-
"[
|
961
|
-
"[
|
962
|
-
"[
|
963
|
-
"[
|
964
|
-
"[
|
965
|
-
"[
|
966
|
-
"[
|
967
|
-
"[
|
968
|
-
"[
|
969
|
-
"[
|
970
|
-
"[
|
971
|
-
"[
|
972
|
-
"[
|
973
|
-
"[
|
974
|
-
"[
|
975
|
-
"[
|
976
|
-
"[
|
977
|
-
"[
|
978
|
-
"[
|
979
|
-
"[
|
980
|
-
"[
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
"[
|
988
|
-
"[
|
989
|
-
"[
|
990
|
-
"[
|
991
|
-
"[
|
992
|
-
"[
|
993
|
-
"[
|
994
|
-
"[
|
995
|
-
"[
|
996
|
-
"[
|
997
|
-
"[
|
998
|
-
"[
|
999
|
-
"[
|
1000
|
-
"[
|
1001
|
-
"[
|
1002
|
-
"[
|
1003
|
-
"[
|
1004
|
-
"[
|
1005
|
-
"[
|
1006
|
-
"[
|
1007
|
-
"[
|
1008
|
-
"[
|
1009
|
-
"[
|
1010
|
-
"[
|
1011
|
-
"[
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
"[
|
1019
|
-
"[
|
1020
|
-
"[
|
1021
|
-
"[
|
1022
|
-
"[
|
1023
|
-
"[
|
1024
|
-
"[
|
1025
|
-
"[
|
1026
|
-
"[
|
1027
|
-
|
1028
|
-
|
1029
|
-
]
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
:
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
:
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
|
1059
|
-
|
1060
|
-
|
1061
|
-
|
1062
|
-
|
1063
|
-
#
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
@
|
1070
|
-
|
1071
|
-
|
1072
|
-
@
|
1073
|
-
@
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
#
|
1098
|
-
#
|
1099
|
-
#
|
1100
|
-
#
|
1101
|
-
#
|
1102
|
-
#
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
#
|
1114
|
-
#
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
#
|
1124
|
-
#
|
1125
|
-
#
|
1126
|
-
#
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
#
|
1138
|
-
#
|
1139
|
-
|
1140
|
-
#
|
1141
|
-
|
1142
|
-
#
|
1143
|
-
#
|
1144
|
-
|
1145
|
-
#
|
1146
|
-
|
1147
|
-
#
|
1148
|
-
#
|
1149
|
-
|
1150
|
-
#
|
1151
|
-
|
1152
|
-
#
|
1153
|
-
#
|
1154
|
-
|
1155
|
-
#
|
1156
|
-
#
|
1157
|
-
|
1158
|
-
#
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
#
|
1171
|
-
#
|
1172
|
-
#
|
1173
|
-
#
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
factor =
|
1182
|
-
formula =
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
event
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
#
|
1208
|
-
#
|
1209
|
-
#
|
1210
|
-
#
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1218
|
-
}
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
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
|
+
require 'when_exe/locales/iast'
|
9
|
+
|
10
|
+
module When
|
11
|
+
class BasicTypes::M17n
|
12
|
+
|
13
|
+
Indian = [self, [
|
14
|
+
"locale:[=en:, ja=ja:, zh=zh:, alias]",
|
15
|
+
"names:[Indian=en:India, インド, 印度]",
|
16
|
+
"[IndianNationalSolar=en:Indian_national_calendar, インド国定暦, 印度國定曆, era:SE=]",
|
17
|
+
"[Nanakshahi=en:Nanakshahi_calendar, ナーナク暦=, 拿那克曆=]",
|
18
|
+
"[RevisedBengali=en:Bengali_calendar, 改訂ベンガル暦=, 改变孟加拉曆=]",
|
19
|
+
"[HinduSolar=en:Hindu_calendar, インド太陽暦=ja:%%<ヒンドゥー暦>, 印度陽曆=]",
|
20
|
+
"[HinduLuniSolar=en:Hindu_calendar, インド太陰太陽暦=ja:%%<ヒンドゥー暦>, 印度陰陽曆=]",
|
21
|
+
|
22
|
+
[self,
|
23
|
+
"locale:[=en:, ja=ja:, hi=hi:, alias]",
|
24
|
+
"names:[HalfMonth=, 半月=, pakṣa=, zh:半月=, *IntercalaryMonth=en:Intercalation]",
|
25
|
+
"[%s Śuklapakṣa=, %s 白分=, _IAST_=]",
|
26
|
+
"[%s Kṛṣṇapakṣa=, %s 黒分=, _IAST_=]",
|
27
|
+
"[adhika %s Śuklapakṣa=, 閏%s 白分=, _IAST_=]",
|
28
|
+
"[adhika %s Kṛṣṇapakṣa=, 閏%s 黒分=, _IAST_=]"
|
29
|
+
],
|
30
|
+
|
31
|
+
[self,
|
32
|
+
"names:[IntercalaryDay=en:Intercalation, 閏日=ja:%%<閏>]",
|
33
|
+
"[%s and next day=, %sと翌日=]",
|
34
|
+
"[Intercalary %s=, 重%s=]"
|
35
|
+
],
|
36
|
+
|
37
|
+
[self,
|
38
|
+
"locale:[=en:, ja=ja:, hi=hi:, alias]",
|
39
|
+
"names:[month name named after the star mansion=, 二十七宿にちなむ月名=, zh:對應於星宿月份名稱=, *alias:LunarMonth=]",
|
40
|
+
"[Mārgaśīra=en:Margashirsha, マールガシールシャ=, _IAST_=]",
|
41
|
+
"[Pauṣa=en:Pausha, パウシャ=, _IAST_=]",
|
42
|
+
"[Māgha=en:Maagha, マーガ=, _IAST_=]",
|
43
|
+
"[Phālguna=en:Phalguna, パールグナ=, _IAST_=]",
|
44
|
+
"[Caitra=en:Chaitra, チャイトラ=, _IAST_=]",
|
45
|
+
"[Vaiśākha=en:Vaisakha, ヴァイシャーカ=, _IAST_=]",
|
46
|
+
"[Jyaiṣṭha=en:Jyeshta, ジャイシュタ=, _IAST_=]",
|
47
|
+
"[Āṣāḍha=en:Aashaadha, アーシャーダ=, _IAST_=]",
|
48
|
+
"[Śrāvaṇa=en:Shraavana, シュラーヴァナ=, _IAST_=]",
|
49
|
+
"[Bhādrapada=en:Bhadrapada, バードラパダ=, _IAST_=]",
|
50
|
+
"[Āśvina=en:Ashwin, アーシュヴィナ=, _IAST_=]",
|
51
|
+
"[Kārttika=en:Kartika_(month), カールッティカ=, _IAST_=]"
|
52
|
+
],
|
53
|
+
|
54
|
+
[self,
|
55
|
+
"locale:[=en:, ja=ja:, hi=hi:, alias]",
|
56
|
+
"names:[month name named after the zodiac=, 黄道十二宮にちなむ月名=, zh:對應於黃道十二宮月份名稱=, *alias:SolarMonth=]",
|
57
|
+
"[Maysha=, 白羊宮, _IAST_=]",
|
58
|
+
"[Vrushabha=, 金牛宮, _IAST_=]",
|
59
|
+
"[Mithuna=, 双児宮, _IAST_=]",
|
60
|
+
"[Karka=, 巨蟹宮, _IAST_=]",
|
61
|
+
"[Simha=, 獅子宮, _IAST_=]",
|
62
|
+
"[Kanya=, 処女宮, _IAST_=]",
|
63
|
+
"[Tula=, 天秤宮, _IAST_=]",
|
64
|
+
"[Vrushchika=, 天蝎宮, _IAST_=]",
|
65
|
+
"[Dhanu=, 人馬宮, _IAST_=]",
|
66
|
+
"[Makar=, 磨羯宮, _IAST_=]",
|
67
|
+
"[Kumbha=, 宝瓶宮, _IAST_=]",
|
68
|
+
"[Meena=, 双魚宮, _IAST_=]"
|
69
|
+
],
|
70
|
+
|
71
|
+
[self,
|
72
|
+
"names:[month name named after the star mansion=, 二十七宿にちなむ月名=, zh:對應於星宿月份名稱=, *alias:NanakshahiMonth=]",
|
73
|
+
"[Maghar=en:Maghar_(month) ]",
|
74
|
+
"[Poh ]",
|
75
|
+
"[Magh=en:Magh_(Sikh_calendar)]",
|
76
|
+
"[Phagun ]",
|
77
|
+
"[Chet=en:Chet_(month) ]",
|
78
|
+
"[Vaisakh ]",
|
79
|
+
"[Jeth ]",
|
80
|
+
"[Harh ]",
|
81
|
+
"[Sawan ]",
|
82
|
+
"[Bhadon ]",
|
83
|
+
"[Assu ]",
|
84
|
+
"[Katak ]"
|
85
|
+
],
|
86
|
+
|
87
|
+
[self,
|
88
|
+
"names:[month name named after the star mansion=, 二十七宿にちなむ月名=, zh:對應於星宿月份名稱=, *alias:BengaliMonth=]",
|
89
|
+
"[Ogrôhayôn=]",
|
90
|
+
"[Poush= ]",
|
91
|
+
"[Magh= ]",
|
92
|
+
"[Falgun= ]",
|
93
|
+
"[Chôitrô= ]",
|
94
|
+
"[Bôishakh= ]",
|
95
|
+
"[Jyôishţhô=]",
|
96
|
+
"[Ashaŗh= ]",
|
97
|
+
"[Shrabôn= ]",
|
98
|
+
"[Bhadrô= ]",
|
99
|
+
"[Ashbin= ]",
|
100
|
+
"[Kartik= ]"
|
101
|
+
]
|
102
|
+
]]
|
103
|
+
end
|
104
|
+
|
105
|
+
module Coordinates
|
106
|
+
|
107
|
+
# Location of cities in India
|
108
|
+
Indian = [When::BasicTypes::M17n, [
|
109
|
+
"locale:[=en:, ja=ja:, alias]",
|
110
|
+
"names:[Indian=en:India, インド, zh:印度]",
|
111
|
+
[Spatial, "long:+82.5", "lat:N23.11", "label:[CentralIndia=, インド中部=]" ],
|
112
|
+
[Spatial, "long:+82.5", "lat:+29.0", "label:[NorthIndia=, インド北部]" ],
|
113
|
+
[Spatial, "long:+78.0", "lat:+27.2", "label:[Agra, アーグラ]" ],
|
114
|
+
[Spatial, "long:+72.6", "lat:+23.0", "label:[Ahmedabad, アフマダーバード]" ],
|
115
|
+
[Spatial, "long:+74.6", "lat:+26.5", "label:[Ajmer, アジメール]" ],
|
116
|
+
[Spatial, "long:+78.1", "lat:+27.9", "label:[Aligarh, アリーガル]" ],
|
117
|
+
[Spatial, "long:+74.9", "lat:+31.6", "label:[Amritsar, アムリトサル]" ],
|
118
|
+
[Spatial, "long:+77.6", "lat:+13.0", "label:[Bangalore, バンガロール]" ],
|
119
|
+
[Spatial, "long:+85.8", "lat:+20.2", "label:[Bhuvaneswar, ブヴァネーシュヴァル]"],
|
120
|
+
[Spatial, "long:+80.3", "lat:+13.1", "label:[Chennai, チェンナイ, Madras]" ],
|
121
|
+
[Spatial, "long:+79.9", "lat: +6.9", "label:[Colombo, コロンボ]" ],
|
122
|
+
[Spatial, "long:+90.4", "lat:+23.7", "label:[Dacca, ダッカ]" ],
|
123
|
+
[Spatial, "long:+77.2", "lat:+28.6", "label:[Delhi, デリー]" ],
|
124
|
+
[Spatial, "long:+78.5", "lat:+17.4", "label:[Hyderabad, ハイデラバード]" ],
|
125
|
+
[Spatial, "long:+75.8", "lat:+26.9", "label:[Jaipur, ジャイプル]" ],
|
126
|
+
[Spatial, "long:+85.2", "lat:+27.7", "label:[Kathmandu, カトマンズ]" ],
|
127
|
+
[Spatial, "long:+76.2", "lat:+10.0", "label:[Kochi, コーチ, Cochin]" ],
|
128
|
+
[Spatial, "long:+88.4", "lat:+22.6", "label:[Kolkata, コルカタ, Calcutta]" ],
|
129
|
+
[Spatial, "long:+74.3", "lat:+31.6", "label:[Lahor, ラホール]" ],
|
130
|
+
[Spatial, "long:+77.7", "lat:+27.5", "label:[Mathura, マトゥラー]" ],
|
131
|
+
[Spatial, "long:+72.8", "lat:+19.0", "label:[Mumbai, ムンバイ, Bombay]" ],
|
132
|
+
[Spatial, "long:+76.6", "lat:+12.3", "label:[Mysore, マイソール]" ],
|
133
|
+
[Spatial, "long:+85.1", "lat:+25.6", "label:[Patna, パトナ]" ],
|
134
|
+
[Spatial, "long:+73.9", "lat:+18.5", "label:[Pune, プネー]" ],
|
135
|
+
[Spatial, "long:+74.8", "lat:+34.1", "label:[Srinagar, シュリーナガル]" ],
|
136
|
+
[Spatial, "long:+77.0", "lat: +8.5", "label:[Thiruvananthapuram, ティルヴァナンタプラム, Trivandrum]"],
|
137
|
+
[Spatial, "long:+83.0", "lat:+25.3", "label:[Varanasi, ワーラーナシー]" ],
|
138
|
+
[Spatial, "long:+75.8", "lat:+23.2", "label:[Ujjain, ウッジャイン=]" ]
|
139
|
+
]]
|
140
|
+
end
|
141
|
+
|
142
|
+
module Ephemeris
|
143
|
+
|
144
|
+
#
|
145
|
+
# Hindu Luni-Solar Calendar Formula
|
146
|
+
#
|
147
|
+
class Hindu < Formula
|
148
|
+
|
149
|
+
# Basic Astronomical Constants for Surya-Siddhanta
|
150
|
+
Tz = 0.5+75.8/360 # time difference between JulianDayNumber and Ujjain
|
151
|
+
E = 588_466 - Tz # Yuga Epoch -3101-02-18T00:00:00
|
152
|
+
P = 180 # Precession cycles in yuga
|
153
|
+
Ep = 1_903_318 - Tz # Precession Epoch 499-01-01
|
154
|
+
Ob = 24.0 / 360.0 # Obliquity of the ecliptic
|
155
|
+
|
156
|
+
Grahas = {
|
157
|
+
'SS' => { # Previous / Newest
|
158
|
+
:Star => 1_582_237_800.0, # 1_582_237_500 / 1_582_237_800
|
159
|
+
:Sun => 4_320_000.0,
|
160
|
+
:Moon => 57_753_336.0,
|
161
|
+
:Mercury => 17_937_000.0,
|
162
|
+
:Venus => 7_022_388.0,
|
163
|
+
:Mars => 2_296_824.0,
|
164
|
+
:Jupiter => 364_220.0,
|
165
|
+
:Saturn => 146_564.0,
|
166
|
+
:Candrocca => 488_219.0, # 488_203 / 488_219
|
167
|
+
:Rahu => -232_226.0
|
168
|
+
},
|
169
|
+
'SB' => {
|
170
|
+
:Star => 1_582_237_828.0,
|
171
|
+
:Sun => 4_320_000.0,
|
172
|
+
:Moon => 57_753_336.0,
|
173
|
+
:Mercury => 17_937_060.0,
|
174
|
+
:Venus => 7_022_376.0,
|
175
|
+
:Mars => 2_296_832.0,
|
176
|
+
:Jupiter => 364_220.0,
|
177
|
+
:Saturn => 146_568.0,
|
178
|
+
:Candrocca => 488_203.0, # 488_199 / 488_203
|
179
|
+
:Rahu => -232_238.0
|
180
|
+
}
|
181
|
+
}
|
182
|
+
|
183
|
+
#
|
184
|
+
# 日月五惑星とラーフおよびケートゥ
|
185
|
+
#
|
186
|
+
# @abstract
|
187
|
+
class Graha
|
188
|
+
include When::Ephemeris
|
189
|
+
end
|
190
|
+
|
191
|
+
#
|
192
|
+
# 現代的“惑星”
|
193
|
+
#
|
194
|
+
class ModernGraha < Graha
|
195
|
+
|
196
|
+
# 真黄経
|
197
|
+
#
|
198
|
+
# @param [Numeric] t ユリウス日
|
199
|
+
#
|
200
|
+
# @return [Numeric]
|
201
|
+
#
|
202
|
+
def true_longitude(t)
|
203
|
+
@target.coords(t, @base).phi
|
204
|
+
end
|
205
|
+
|
206
|
+
# オブジェクトの生成
|
207
|
+
#
|
208
|
+
# @param [When::Ephemeris::Datum] target 天体
|
209
|
+
# @param [When::Coordinates::Spatial] base 観測地
|
210
|
+
#
|
211
|
+
def initialize(target, base)
|
212
|
+
@target = target
|
213
|
+
@base = base
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
#
|
218
|
+
# 古典的“惑星”
|
219
|
+
#
|
220
|
+
# @abstract
|
221
|
+
class ClassicGraha < Graha
|
222
|
+
|
223
|
+
# 平均黄経
|
224
|
+
#
|
225
|
+
# @param [Numeric] t ユリウス日
|
226
|
+
#
|
227
|
+
# @return [Numeric]
|
228
|
+
#
|
229
|
+
def mean_longitude(t)
|
230
|
+
_mean_rotation(t - E)
|
231
|
+
end
|
232
|
+
|
233
|
+
# 真黄経
|
234
|
+
#
|
235
|
+
# @param [Numeric] t ユリウス日
|
236
|
+
#
|
237
|
+
# @return [Numeric]
|
238
|
+
#
|
239
|
+
def true_longitude(t)
|
240
|
+
_true_rotation(t - E)
|
241
|
+
end
|
242
|
+
|
243
|
+
# 平均黄経
|
244
|
+
#
|
245
|
+
# @param [Numeric] ahar カリユガ暦元からの経過日数
|
246
|
+
#
|
247
|
+
# @return [Numeric]
|
248
|
+
#
|
249
|
+
def _mean_rotation(ahar)
|
250
|
+
@rotation * ahar / @formula.civil_days
|
251
|
+
end
|
252
|
+
|
253
|
+
# オブジェクトの生成
|
254
|
+
#
|
255
|
+
# @param [When::Ephemeris::Formula] formula 親オブジェクト
|
256
|
+
# @param [Numeric] rotation ユガあたりの回転数
|
257
|
+
#
|
258
|
+
def initialize(formula, rotation)
|
259
|
+
@formula = formula
|
260
|
+
@rotation = rotation
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
# 架空の“惑星” - ラーフ / 月軌道の遠地点としてのケートゥ
|
265
|
+
class VirtualGraha < ClassicGraha
|
266
|
+
|
267
|
+
# 平均黄経
|
268
|
+
#
|
269
|
+
# @param [Numeric] ahar カリユガ暦元からの経過日数
|
270
|
+
#
|
271
|
+
# @return [Numeric]
|
272
|
+
#
|
273
|
+
def _mean_rotation(ahar)
|
274
|
+
super + @rotation0
|
275
|
+
end
|
276
|
+
alias :_true_rotation :_mean_rotation
|
277
|
+
|
278
|
+
# オブジェクトの生成
|
279
|
+
#
|
280
|
+
# @param [When::Ephemeris::Formula] formula 親オブジェクト
|
281
|
+
# @param [Numeric] rotation ユガあたりの回転数
|
282
|
+
# @param [Numeric] rotation0 カリユガ暦元での回転量
|
283
|
+
#
|
284
|
+
def initialize(formula, rotation, rotation0)
|
285
|
+
@rotation0 = rotation0 / 360.0
|
286
|
+
super(formula, rotation)
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
# 実在の“惑星”
|
291
|
+
# @abstract
|
292
|
+
class RealGraha < ClassicGraha
|
293
|
+
|
294
|
+
# マンダ補正
|
295
|
+
#
|
296
|
+
# @param [Numeric] rot 平均近点角など / CIRCLE
|
297
|
+
#
|
298
|
+
# @return [Numeric]
|
299
|
+
#
|
300
|
+
def _manda_equation(rot)
|
301
|
+
asin(@circumm * sinc(rot)) / CIRCLE
|
302
|
+
end
|
303
|
+
|
304
|
+
# オブジェクトの生成
|
305
|
+
#
|
306
|
+
# @param [When::Ephemeris::Formula] formula 親オブジェクト
|
307
|
+
# @param [Numeric] rotation ユガあたりの回転数
|
308
|
+
# @param [Numeric] circumm マンダ円の半径
|
309
|
+
# @param [Numeric] apogee 近点黄経 / CIRCLE
|
310
|
+
#
|
311
|
+
def initialize(formula, rotation, circumm, apogee)
|
312
|
+
@circumm = circumm / 360.0
|
313
|
+
@apogee = apogee / 360.0
|
314
|
+
super(formula, rotation)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
# 太陽と月 - 逆行しない“惑星”
|
319
|
+
# @abstract
|
320
|
+
class ConcentricGraha < RealGraha
|
321
|
+
|
322
|
+
# 平均黄経
|
323
|
+
#
|
324
|
+
# @param [Numeric] ahar カリユガ暦元からの経過日数
|
325
|
+
#
|
326
|
+
# @return [Numeric]
|
327
|
+
#
|
328
|
+
def _mean_rotation(ahar)
|
329
|
+
super + @epoch
|
330
|
+
end
|
331
|
+
|
332
|
+
# オブジェクトの生成
|
333
|
+
#
|
334
|
+
# @param [When::Ephemeris::Formula] formula 親オブジェクト
|
335
|
+
# @param [Numeric] rotation ユガあたりの回転数
|
336
|
+
# @param [Numeric] circumm マンダ円の半径
|
337
|
+
# @param [Numeric] apogee 近点黄経 / CIRCLE
|
338
|
+
# @param [Numeric] epoch カリユガ暦元での黄経 / CIRCLE
|
339
|
+
#
|
340
|
+
def initialize(formula, rotation, circumm, apogee, epoch)
|
341
|
+
@epoch = epoch
|
342
|
+
super(formula, rotation, circumm, apogee)
|
343
|
+
end
|
344
|
+
end
|
345
|
+
|
346
|
+
# 太陽
|
347
|
+
class Sun < ConcentricGraha
|
348
|
+
|
349
|
+
# 真黄経
|
350
|
+
#
|
351
|
+
# @param [Numeric] ahar カリユガ暦元からの経過日数
|
352
|
+
#
|
353
|
+
# @return [Numeric]
|
354
|
+
#
|
355
|
+
def _true_rotation(ahar)
|
356
|
+
mean = _mean_rotation(ahar)
|
357
|
+
mean - _manda_equation(mean - @apogee)
|
358
|
+
end
|
359
|
+
end
|
360
|
+
|
361
|
+
# 月
|
362
|
+
class Moon < ConcentricGraha
|
363
|
+
|
364
|
+
# 真黄経
|
365
|
+
#
|
366
|
+
# @param [Numeric] ahar カリユガ暦元からの経過日数
|
367
|
+
#
|
368
|
+
# @return [Numeric]
|
369
|
+
#
|
370
|
+
def _true_rotation(ahar)
|
371
|
+
mean = _mean_rotation(ahar)
|
372
|
+
mean - _manda_equation(mean - @formula.graha[:Candrocca]._mean_rotation(ahar))
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
# 惑星 - 逆行するもの
|
377
|
+
# @abstract
|
378
|
+
class Planet < RealGraha
|
379
|
+
|
380
|
+
# シグラ補正
|
381
|
+
#
|
382
|
+
# @param [Numeric] anomaly 平均近点角 / CIRCLE
|
383
|
+
#
|
384
|
+
# @return [Numeric]
|
385
|
+
#
|
386
|
+
def _sighra_equation(anomaly)
|
387
|
+
atan2(@circums * sinc(anomaly), @circums * cosc(anomaly) + 1) / CIRCLE
|
388
|
+
end
|
389
|
+
|
390
|
+
# 平均シグラ
|
391
|
+
#
|
392
|
+
# @param [Numeric] ahar カリユガ暦元からの経過日数
|
393
|
+
#
|
394
|
+
# @return [Numeric]
|
395
|
+
#
|
396
|
+
def _mean_sighra(ahar)
|
397
|
+
@sighra * ahar / @formula.civil_days
|
398
|
+
end
|
399
|
+
|
400
|
+
# 真黄経
|
401
|
+
#
|
402
|
+
# @param [Numeric] ahar カリユガ暦元からの経過日数
|
403
|
+
# @param [Numeric] rotation 基準回転量 / CIRCLE
|
404
|
+
#
|
405
|
+
# @return [Numeric]
|
406
|
+
#
|
407
|
+
def _true_rotation(ahar, rotation)
|
408
|
+
# first sighra correction
|
409
|
+
delta = _sighra_equation(_mean_sighra(ahar) - rotation) / 2
|
410
|
+
|
411
|
+
# first manda correction
|
412
|
+
mean = _mean_rotation(ahar) + delta
|
413
|
+
delta = _manda_equation(mean - @apogee) / 2
|
414
|
+
|
415
|
+
# second manda correction
|
416
|
+
mean -= delta
|
417
|
+
delta = _manda_equation(mean - @apogee)
|
418
|
+
|
419
|
+
# second sighra correction
|
420
|
+
mean = _mean_rotation(ahar) - delta
|
421
|
+
delta = _sighra_equation(_mean_sighra(ahar) - mean)
|
422
|
+
|
423
|
+
# true rotation
|
424
|
+
mean + delta
|
425
|
+
end
|
426
|
+
|
427
|
+
# オブジェクトの生成
|
428
|
+
#
|
429
|
+
# @param [When::Ephemeris::Formula] formula 親オブジェクト
|
430
|
+
# @param [Numeric] rotation ユガあたりの回転数
|
431
|
+
# @param [Numeric] circumm マンダ円の半径
|
432
|
+
# @param [Numeric] apogee 近点黄経 / CIRCLE
|
433
|
+
# @param [Numeric] sighra シグラ対象のカリユガあたりの回転数
|
434
|
+
# @param [Numeric] circums シグラ円の半径
|
435
|
+
#
|
436
|
+
def initialize(formula, rotation, circumm, apogee, sighra, circums)
|
437
|
+
@sighra = sighra
|
438
|
+
@circums = circums / 360.0
|
439
|
+
super(formula, rotation, circumm, apogee)
|
440
|
+
end
|
441
|
+
end
|
442
|
+
|
443
|
+
# 内惑星 - 水金
|
444
|
+
class InferiorPlanet < Planet
|
445
|
+
|
446
|
+
# 真黄経
|
447
|
+
#
|
448
|
+
# @param [Numeric] t ユリウス日
|
449
|
+
#
|
450
|
+
# @return [Numeric]
|
451
|
+
#
|
452
|
+
def true_longitude(t)
|
453
|
+
ahar = t - E
|
454
|
+
_true_rotation(ahar, @formula.graha[:Sun]._mean_rotation(ahar))
|
455
|
+
end
|
456
|
+
end
|
457
|
+
|
458
|
+
# 外惑星 - 火木土
|
459
|
+
class SuperiorPlanet < Planet
|
460
|
+
|
461
|
+
# 真黄経
|
462
|
+
#
|
463
|
+
# @param [Numeric] t ユリウス日
|
464
|
+
#
|
465
|
+
# @return [Numeric]
|
466
|
+
#
|
467
|
+
def true_longitude(t)
|
468
|
+
ahar = t - E
|
469
|
+
_true_rotation(ahar, _mean_rotation(ahar))
|
470
|
+
end
|
471
|
+
end
|
472
|
+
|
473
|
+
#
|
474
|
+
# ユガの太陽日数
|
475
|
+
#
|
476
|
+
# @return [Numeric]
|
477
|
+
#
|
478
|
+
attr_reader :civil_days
|
479
|
+
|
480
|
+
# 日の出の日時
|
481
|
+
#
|
482
|
+
# @param [Numeric] sdn ユリウス日
|
483
|
+
# @param [When::TM::TemporalPosition] sdn
|
484
|
+
# @param [nil] height 太陽高度(本クラスでは使用しない)
|
485
|
+
#
|
486
|
+
# @return [Integer, When::TM::DateAndTime] 日の出の日時
|
487
|
+
#
|
488
|
+
def sunrise(sdn, height=nil)
|
489
|
+
t = sdn.to_i - @long / 360.0 - 0.25
|
490
|
+
p = _mean_sun(t) + P * (t - Ep) / @civil_days
|
491
|
+
_to_seed_type(t - asin(tand(@lat)*tan(asin(sinc(p)*sinc(Ob)))) / CIRCLE, sdn)
|
492
|
+
end
|
493
|
+
|
494
|
+
# 日の入りの日時
|
495
|
+
#
|
496
|
+
# @param [Numeric] sdn ユリウス日
|
497
|
+
# @param [When::TM::TemporalPosition] sdn
|
498
|
+
# @param [nil] height 太陽高度(本クラスでは使用しない)
|
499
|
+
#
|
500
|
+
# @return [Integer, When::TM::DateAndTime] 日の入りの日時
|
501
|
+
#
|
502
|
+
def sunset(sdn, height=nil)
|
503
|
+
t = sdn.to_i - @long / 360.0 + 0.25
|
504
|
+
p = _mean_sun(t) + P * (t - Ep) / @civil_days
|
505
|
+
_to_seed_type(t + asin(tand(@lat)*tan(asin(sinc(p)*sinc(Ob)))) / CIRCLE, sdn)
|
506
|
+
end
|
507
|
+
|
508
|
+
# 太陽の南中の日時
|
509
|
+
#
|
510
|
+
# @param [Numeric] sdn ユリウス日
|
511
|
+
# @param [When::TM::TemporalPosition] sdn
|
512
|
+
#
|
513
|
+
# @return [Integer, When::TM::DateAndTime] 太陽の南中の日時
|
514
|
+
#
|
515
|
+
def sun_noon(sdn)
|
516
|
+
_to_seed_type(sdn.to_i - @long / 360.0, sdn)
|
517
|
+
end
|
518
|
+
|
519
|
+
private
|
520
|
+
|
521
|
+
# オブジェクトの正規化
|
522
|
+
def _normalize(args=[], options={})
|
523
|
+
@time_standard ||= 'universal'
|
524
|
+
@bija ||= 'SB'
|
525
|
+
super
|
526
|
+
end
|
527
|
+
|
528
|
+
# 9惑星オブジェクトの生成
|
529
|
+
def _normalize_grahas
|
530
|
+
grahas = Grahas[@bija]
|
531
|
+
|
532
|
+
# ユガあたりの暦定数
|
533
|
+
@sidereal_days = grahas[:Star] # 恒星日
|
534
|
+
@solar_years = grahas[:Sun] # 太陽年
|
535
|
+
@civil_days = @sidereal_days - @solar_years # 太陽日
|
536
|
+
@sidereal_months = grahas[:Moon] # 恒星月
|
537
|
+
@synodic_months = @sidereal_months - @solar_years # 朔望月
|
538
|
+
@adhimasas = @synodic_months - 12 * @solar_years # 閏月
|
539
|
+
@tithis = 30 * @sidereal_months # 太陰日
|
540
|
+
@ksayadinas = @tithis - @civil_days # 欠日
|
541
|
+
|
542
|
+
# 9惑星
|
543
|
+
@graha = {}
|
544
|
+
@graha.update({
|
545
|
+
:Sun => Sun.new( self, @solar_years, 13+50/60.0, 77+17/60.0, -3101)
|
546
|
+
}) if @formula =~ /[SL]/i
|
547
|
+
@graha.update({
|
548
|
+
:Moon => Moon.new( self, @sidereal_months, 31+50/60.0, 0, -28086),
|
549
|
+
:Candrocca => VirtualGraha.new( self, grahas[:Candrocca], 90.0)
|
550
|
+
}) if @formula =~ /[ML]/i
|
551
|
+
@graha.update({
|
552
|
+
:Mercury => InferiorPlanet.new(self, @solar_years, 29.0, 220+27/60.0, grahas[:Mercury], 131.5),
|
553
|
+
:Venus => InferiorPlanet.new(self, @solar_years, 11.5, 79+50/60.0, grahas[:Venus], 261.0),
|
554
|
+
:Mars => SuperiorPlanet.new(self, grahas[:Mars], 73.5, 130+02/60.0, @solar_years, 233.5),
|
555
|
+
:Jupiter => SuperiorPlanet.new(self, grahas[:Jupiter], 32.5, 171+18/60.0, @solar_years, 71.0),
|
556
|
+
:Saturn => SuperiorPlanet.new(self, grahas[:Saturn], 48.5, 236+37/60.0, @solar_years, 39.5),
|
557
|
+
:Rahu => VirtualGraha.new( self, grahas[:Rahu], 180.0)
|
558
|
+
}) if @formula == '2L'
|
559
|
+
end
|
560
|
+
end
|
561
|
+
end
|
562
|
+
|
563
|
+
module CalendarTypes
|
564
|
+
|
565
|
+
#
|
566
|
+
# Indian national solar calendar
|
567
|
+
#
|
568
|
+
IndianNationalSolar = [SolarYearTableBasedWithSunrise, {
|
569
|
+
'label' => 'Indian::IndianNationalSolar',
|
570
|
+
'origin_of_MSC' => -78,
|
571
|
+
'diff_to_CE' => 0,
|
572
|
+
'engine_month' => 2, # February
|
573
|
+
'engine_day' => 28+22, # 22nd of next month
|
574
|
+
'indices' => [
|
575
|
+
When.Index('Indian::LunarMonth', {:unit =>12, :shift=>4}),
|
576
|
+
When::Coordinates::DefaultDayIndex
|
577
|
+
],
|
578
|
+
'rule_table' => {
|
579
|
+
365 => {'Length'=>[30] + [31]*5 + [30]*6},
|
580
|
+
366 => {'Length'=> [31]*6 + [30]*6}
|
581
|
+
}
|
582
|
+
}]
|
583
|
+
|
584
|
+
#
|
585
|
+
# Nanakshahi Calendar
|
586
|
+
#
|
587
|
+
Nanakshahi = [SolarYearTableBased, {
|
588
|
+
'label' => 'Indian::Nanakshahi',
|
589
|
+
'origin_of_MSC' => -1468,
|
590
|
+
'diff_to_CE' => 0,
|
591
|
+
'engine_month' => 3,
|
592
|
+
'engine_day' => 14,
|
593
|
+
'indices' => [
|
594
|
+
When.Index('Indian::NanakshahiMonth', {:unit=>12, :shift=>4}),
|
595
|
+
When::Coordinates::DefaultDayIndex
|
596
|
+
],
|
597
|
+
'rule_table' => {
|
598
|
+
365 => {'Length'=> [31]*5 + [30]*7},
|
599
|
+
366 => {'Length'=> [31]*5 + [30]*6 + [31]}
|
600
|
+
}
|
601
|
+
}]
|
602
|
+
|
603
|
+
#
|
604
|
+
# Revised Bengali Calendar
|
605
|
+
#
|
606
|
+
RevisedBengali = [SolarYearTableBased, {
|
607
|
+
'label' => 'Indian::RevisedBengali',
|
608
|
+
'origin_of_MSC' => -593,
|
609
|
+
'diff_to_CE' => 0,
|
610
|
+
'engine_month' => 4,
|
611
|
+
'engine_day' => 14,
|
612
|
+
'indices' => [
|
613
|
+
When.Index('Indian::BengaliMonth', {:unit=>12, :shift=>5}),
|
614
|
+
When::Coordinates::DefaultDayIndex
|
615
|
+
],
|
616
|
+
'rule_table' => {
|
617
|
+
365 => {'Length'=> [31]*5 + [30]*7},
|
618
|
+
366 => {'Length'=> [31]*5 + [30]*5 + [31, 30]}
|
619
|
+
}
|
620
|
+
}]
|
621
|
+
|
622
|
+
#
|
623
|
+
# Hindu Solar Calendar
|
624
|
+
#
|
625
|
+
class HinduSolar < EphemerisBasedSolar
|
626
|
+
|
627
|
+
# protected
|
628
|
+
|
629
|
+
# 月初の通日
|
630
|
+
#
|
631
|
+
# @param [Integer] m 通月
|
632
|
+
#
|
633
|
+
# @return [Integer] 月初の通日
|
634
|
+
#
|
635
|
+
def _new_month_(m)
|
636
|
+
new_month_time = @formula[0].cn_to_time(m + @cycle_offset)
|
637
|
+
new_month_date = (new_month_time + 0.5 + @formula[0].long/360.0).floor
|
638
|
+
sunrise_time = @formula[0].sunrise(new_month_date)
|
639
|
+
(sunrise_time <= new_month_time) ? new_month_date : new_month_date-1
|
640
|
+
end
|
641
|
+
|
642
|
+
private
|
643
|
+
|
644
|
+
# オブジェクトの正規化
|
645
|
+
#
|
646
|
+
# @formula[0] = 位相の計算に用いる太陽の Formula
|
647
|
+
# @cycle_offset = 位相のオフセット
|
648
|
+
# @start_month = 暦年の最初の月
|
649
|
+
#
|
650
|
+
def _normalize(args=[], options={})
|
651
|
+
@label ||= 'Indian::HinduSolar'
|
652
|
+
@type ||= 'SBS'
|
653
|
+
raise ArgumentError, "Irregal formula: #{@formula}" unless @type.upcase =~ /\A(M|SS|SB)(V|S|B|H|VZ|SZ|BZ|HZ)\z/
|
654
|
+
|
655
|
+
@location ||= HinduLuniSolar::Location_E[$2] || HinduLuniSolar::Location_F[$1]
|
656
|
+
@cycle_offset ||= HinduLuniSolar::CycleOffset[$1]
|
657
|
+
@origin_of_MSC ||= -HinduLuniSolar::YearEpoch[$2]
|
658
|
+
@diff_to_CE ||= 0
|
659
|
+
@start_month ||= 1 # Maysha
|
660
|
+
@start_month = @start_month.to_i
|
661
|
+
@cycle_offset = @cycle_offset.to_f + (@start_month - 1)
|
662
|
+
formula = @formula || HinduLuniSolar::Formula[$1]
|
663
|
+
if formula.kind_of?(String)
|
664
|
+
formula += (formula =~ /\?/) ? '&' : '?'
|
665
|
+
@formula = [When.Resource("_ep:#{formula}location=(#{@location})&formula=12S")]
|
666
|
+
end
|
667
|
+
@indices ||= [
|
668
|
+
When.Index('Indian::SolarMonth', {:shift=>@start_month-1}),
|
669
|
+
When::Coordinates::DefaultDayIndex
|
670
|
+
]
|
671
|
+
|
672
|
+
super
|
673
|
+
end
|
674
|
+
end
|
675
|
+
|
676
|
+
#
|
677
|
+
# Hindu Luni-Solar Calendar
|
678
|
+
#
|
679
|
+
class HinduLuniSolar < EphemerisBasedLuniSolar
|
680
|
+
|
681
|
+
# Calendar Type
|
682
|
+
Formula = {'M'=>'Formula', 'SS'=>'Hindu?bija=SS', 'SB'=>'Hindu?bija=SB'}
|
683
|
+
Location_F = {'M'=>'_co:Indian::CentralIndia', 'SS'=>'_co:Indian::Ujjain', 'SB'=>'_co:Indian::Ujjain'}
|
684
|
+
Location_E = {'B'=>'_co:Indian::Dacca', 'BZ'=>'_co:Indian::Dacca', 'H'=>'_co:Iranian::Tehran', 'HZ'=>'_co:Iranian::Tehran'}
|
685
|
+
CycleOffset = {'M'=>+23.25/30, 'SS'=>0.0, 'SB'=>0.0}
|
686
|
+
HinduStyle = {'A'=>0, 'P'=>1, 'PX'=>2}
|
687
|
+
YearEpoch = {'V'=>-58,'VZ'=>-57,'S'=>78, 'SZ'=>79, 'B'=> 593, 'BZ'=>594, 'H'=> 621, 'HZ'=> 622}
|
688
|
+
|
689
|
+
# White / black month and leap month identification table
|
690
|
+
|
691
|
+
#[w]/b [n]/l #0 #1 #2
|
692
|
+
LEAP_MAP = {[nil, false] => [ 0, 0, 0 ],
|
693
|
+
[nil, true ] => [-1.5, -1.5, -1.5],
|
694
|
+
[true, false] => [+0.5, -0.5, -2.5],
|
695
|
+
[true, true ] => [-1, -2, -1 ]}
|
696
|
+
|
697
|
+
# protected
|
698
|
+
|
699
|
+
# 月初の通日
|
700
|
+
#
|
701
|
+
# @param [Integer] m 通月
|
702
|
+
#
|
703
|
+
# @return [Integer] 月初の通日
|
704
|
+
#
|
705
|
+
def _new_month_(m)
|
706
|
+
new_moon_time = @formula[-1].cn_to_time(m)
|
707
|
+
new_moon_date = (new_moon_time + 0.5 + @formula[-1].long/360.0).floor
|
708
|
+
sunrise_time = @formula[-1].sunrise(new_moon_date)
|
709
|
+
(sunrise_time >= new_moon_time) ? new_moon_date : new_moon_date+1
|
710
|
+
end
|
711
|
+
|
712
|
+
# 年初の通月
|
713
|
+
#
|
714
|
+
# @param [Integer] y 年
|
715
|
+
#
|
716
|
+
# @return [Integer] 年初の通月
|
717
|
+
#
|
718
|
+
def _new_year_month_(y)
|
719
|
+
(Residue.mod(y-1) {|t| _tithi_to_coordinates(t*15)[0]})[0] + 1
|
720
|
+
end
|
721
|
+
|
722
|
+
# 朔望日 -> 年・月・日
|
723
|
+
#
|
724
|
+
# tithi : 朔望日(月の位相 / (CIRCLE/30))
|
725
|
+
#
|
726
|
+
# @return [Array<Numeric>] ( y, m, d )
|
727
|
+
# [ y - 年(Integer) ]
|
728
|
+
# [ m - 月(When::Coordinates::Pair) ]
|
729
|
+
# [ d - 日(Integer) ]
|
730
|
+
#
|
731
|
+
def _tithi_to_coordinates(tithi)
|
732
|
+
m, d = tithi.divmod(30)
|
733
|
+
s = [0,1,2].map {|i| (@formula[1].time_to_cn(30*(m+i)) - @cycle_offset).floor + 1 }
|
734
|
+
f = s[0]==s[1]
|
735
|
+
if (d >= 15.0)
|
736
|
+
d -= 15
|
737
|
+
b = true
|
738
|
+
n = true unless @hindu_style==0
|
739
|
+
f = s[1]==s[2] if @hindu_style==1
|
740
|
+
end
|
741
|
+
y, m = (n ? s[1] : s[0]).divmod(12)
|
742
|
+
return [y, Pair._force_pair(m+1, LEAP_MAP[[b,f]][@hindu_style]), d.floor]
|
743
|
+
end
|
744
|
+
|
745
|
+
# 日時要素の翻訳表の取得
|
746
|
+
#
|
747
|
+
# @overload _ids_(date)
|
748
|
+
# @param [Array<Numeric>] date ( 年 )
|
749
|
+
# @return [Array<When::Coordinates::Pair>] 1年の月の配置の翻訳表
|
750
|
+
#
|
751
|
+
# @overload _ids_(date)
|
752
|
+
# @param [Array<Numeric>] date ( 年 月 )
|
753
|
+
# @return [Array<When::Coordinates::Pair>] 1月の日の配置の翻訳表
|
754
|
+
# @note 月は 0 始まりの通番
|
755
|
+
#
|
756
|
+
def _ids_(date)
|
757
|
+
y, m = date
|
758
|
+
y = +y
|
759
|
+
mm = _new_year_month(y)
|
760
|
+
return (_table(_new_month_(mm+m.to_i)) {|i| _new_month(mm+m+i/15.0)}) if m
|
761
|
+
table = (0...26).to_a.map {|i| _tithi_to_coordinates((mm+i)*15)[1]}
|
762
|
+
table.pop while table[-1].trunk < 11
|
763
|
+
return table
|
764
|
+
end
|
765
|
+
|
766
|
+
private
|
767
|
+
|
768
|
+
# 日時要素の翻訳表の作成
|
769
|
+
def _table(b0)
|
770
|
+
table = [Pair._force_pair(0,0)]
|
771
|
+
(1..16).each do |i|
|
772
|
+
b1 = yield(i)
|
773
|
+
case b1-b0
|
774
|
+
when 0 ; table[-1] = Pair._force_pair(i-1, -2)
|
775
|
+
when 1 ; table << Pair._force_pair(i, 0)
|
776
|
+
when 2 ; table << Pair._force_pair(i, 0) << Pair._force_pair(i, 1)
|
777
|
+
else ; raise ArgumentError, "Irregal date span: #{b1-b0}"
|
778
|
+
end
|
779
|
+
b0 = b1
|
780
|
+
end
|
781
|
+
table.pop while table[-1].trunk >= 16
|
782
|
+
table.shift
|
783
|
+
return table
|
784
|
+
end
|
785
|
+
|
786
|
+
# オブジェクトの正規化
|
787
|
+
#
|
788
|
+
# @formula = 位相の計算に用いる太陽・変換・月の Formula
|
789
|
+
# @cycle_offset = 位相のオフセット
|
790
|
+
# @hindu_style = 閏月の表現方法
|
791
|
+
# @start_month = 暦年の最初の月
|
792
|
+
#
|
793
|
+
def _normalize(args=[], options={})
|
794
|
+
@label ||= 'Indian::HinduLuniSolar'
|
795
|
+
@type ||= 'SBSA'
|
796
|
+
raise ArgumentError, "Irregal formula: #{@formula}" unless @type.upcase =~ /\A(M|SS|SB)(V|S|B|H|VZ|SZ|BZ|HZ)(A|P|PX)\z/
|
797
|
+
|
798
|
+
@location ||= Location_E[$2] || Location_F[$1]
|
799
|
+
@cycle_offset ||= CycleOffset[$1]
|
800
|
+
@origin_of_MSC ||= -YearEpoch[$2]
|
801
|
+
@hindu_style ||= HinduStyle[$3]
|
802
|
+
@diff_to_CE ||= 0
|
803
|
+
@start_month ||= 5 # Chaitra
|
804
|
+
@start_month = @start_month.to_i
|
805
|
+
@cycle_offset = @cycle_offset.to_f + (@start_month - 5)
|
806
|
+
@hindu_style = @hindu_style.to_i
|
807
|
+
@origin_of_MSC = @origin_of_MSC.to_i
|
808
|
+
formula = @formula || Formula[$1]
|
809
|
+
if formula.kind_of?(String)
|
810
|
+
formula += (formula =~ /\?/) ? '&' : '?'
|
811
|
+
@formula = When.Resource(["_ep:#{formula}formula=12S",
|
812
|
+
"_ep:#{formula}formula=30L->12S",
|
813
|
+
"_ep:#{formula}location=(#{@location})&formula=2L"])
|
814
|
+
end
|
815
|
+
intercalary_month = When.Resource('_m:Indian::IntercalaryMonth::*')
|
816
|
+
intercalary_day = When.Resource('_m:Indian::IntercalaryDay::*')
|
817
|
+
@indices ||= [
|
818
|
+
When.Index('Indian::LunarMonth', {:branch=>{-2.5 => intercalary_month[1], # 黒分
|
819
|
+
-2 => intercalary_month[3], # 閏黒分
|
820
|
+
-1.5 => intercalary_month[2], # 閏白分
|
821
|
+
-1 => intercalary_month[3], # 閏黒分
|
822
|
+
-0.5 => intercalary_month[1], # 黒分
|
823
|
+
0 => intercalary_month[0], # 白分
|
824
|
+
+0.5 => intercalary_month[1]}, # 黒分
|
825
|
+
:shift=>@start_month-1}),
|
826
|
+
When.Index({:branch=>{-2=>intercalary_day[0], +1=>intercalary_day[1]}})
|
827
|
+
]
|
828
|
+
|
829
|
+
super
|
830
|
+
end
|
831
|
+
end
|
832
|
+
end
|
833
|
+
|
834
|
+
class CalendarNote
|
835
|
+
#
|
836
|
+
# ヒンドゥー系の暦注
|
837
|
+
#
|
838
|
+
class HinduNote < self
|
839
|
+
|
840
|
+
Notes = [When::BasicTypes::M17n, [
|
841
|
+
"locale:[=en:, ja=ja:, hi=hi:, alias]",
|
842
|
+
"names:[Hindu]",
|
843
|
+
|
844
|
+
# 年の暦注 ----------------------------
|
845
|
+
[When::BasicTypes::M17n,
|
846
|
+
"names:[note for year=, 年の暦注=, *alias:year]",
|
847
|
+
[When::BasicTypes::M17n,
|
848
|
+
"names:[samvatsara, 木星年=]",
|
849
|
+
"[Prabhava=, プラバヴァ=, _IAST_=]", # 1
|
850
|
+
"[Vibhava=, ヴィバヴァ=, _IAST_=]", # 2
|
851
|
+
"[Sukha=, スカ=, _IAST_=]", # 3
|
852
|
+
"[Pramoda=, プラモーダ=, _IAST_=]", # 4
|
853
|
+
"[Prajāpati=, プラジャーパティ=, _IAST_=]", # 5
|
854
|
+
"[Aṅgiras=, アンギラス=, _IAST_=]", # 6
|
855
|
+
"[Śrīmukha=, シュリームカ=, _IAST_=]", # 7
|
856
|
+
"[Bhāva=, バーヴァ=, _IAST_=]", # 8
|
857
|
+
"[Yuvan=, ユヴァン=, _IAST_=]", # 9
|
858
|
+
"[Dhātṛ=, ダートリ=, _IAST_=]", # 10
|
859
|
+
"[Īśvara=, イーシュヴァラ=, _IAST_=]", # 11
|
860
|
+
"[Bahudhānya=, バフダーニャ=, _IAST_=]", # 12
|
861
|
+
"[Pramāthin=, プラマーティン=, _IAST_=]", # 13
|
862
|
+
"[Vikrama=, ヴィクラマ=, _IAST_=]", # 14
|
863
|
+
"[Vṛṣa=, ヴリシャ=, _IAST_=]", # 15
|
864
|
+
"[Chitrabhānu=, チトラバーヌ=, _IAST_=]", # 16
|
865
|
+
"[Subhānu=, スバーヌ=, _IAST_=]", # 17
|
866
|
+
"[Tāraṇa=, ターラナ=, _IAST_=]", # 18
|
867
|
+
"[Pārthiva=, パールティヴァ=, _IAST_=]", # 19
|
868
|
+
"[Vyaya=, ヴヤヤ=, _IAST_=]", # 20
|
869
|
+
"[Sarvajit=, サルヴァジト=, _IAST_=]", # 21
|
870
|
+
"[Sarvadhārin=, サルヴァダーリン=, _IAST_=]", # 22
|
871
|
+
"[Virodhin=, ヴィローディン=, _IAST_=]", # 23
|
872
|
+
"[Vikṛta=, ヴィクリタ=, _IAST_=]", # 24
|
873
|
+
"[Khara=, カラ=, _IAST_=]", # 25
|
874
|
+
"[Nandana=, ナンダナ=, _IAST_=]", # 26
|
875
|
+
"[Vijaya=, ヴィジャヤ=, _IAST_=]", # 27
|
876
|
+
"[Jaya=, ジャヤ=, _IAST_=]", # 28
|
877
|
+
"[Manmatha=, マンマタ=, _IAST_=]", # 29
|
878
|
+
"[Durmukha=, ドゥルムカ=, _IAST_=]", # 30
|
879
|
+
"[Hemalamba=, ヘマラムバ=, _IAST_=]", # 31
|
880
|
+
"[Vilambin=, ヴィラムビン=, _IAST_=]", # 32
|
881
|
+
"[Vikārin=, ヴィカーリン=, _IAST_=]", # 33
|
882
|
+
"[Śārvarin=, シャールヴァリン=, _IAST_=]", # 34
|
883
|
+
"[Plava=, プラヴァ=, _IAST_=]", # 35
|
884
|
+
"[Śubhakṛt=, シュバクリト=, _IAST_=]", # 36
|
885
|
+
"[Śobhana=, ショバナ=, _IAST_=]", # 37
|
886
|
+
"[Krodhin=, クロディン=, _IAST_=]", # 38
|
887
|
+
"[Viśvāvasu=, ヴィシュヴァーヴァス=, _IAST_=]", # 39
|
888
|
+
"[Parābhava=, パラーバヴァ=, _IAST_=]", # 40
|
889
|
+
"[Plavaṅga=, プラヴァンガ=, _IAST_=]", # 41
|
890
|
+
"[Kīlaka=, キーラカ=, _IAST_=]", # 42
|
891
|
+
"[Saumya=, サウムヤ=, _IAST_=]", # 43
|
892
|
+
"[Sādhāraṇa=, サーダーラナ=, _IAST_=]", # 44
|
893
|
+
"[Virodhakṛt=, ヴィローダクリト=, _IAST_=]", # 45
|
894
|
+
"[Paridhāvin=, パリダーヴィン=, _IAST_=]", # 46
|
895
|
+
"[Pramādin=, プラマーディン=, _IAST_=]", # 47
|
896
|
+
"[Ānanda=, アーナンダ=, _IAST_=]", # 48
|
897
|
+
"[Rākṣasa=, ラークシャサ=, _IAST_=]", # 49
|
898
|
+
"[Anala=, アナラ=, _IAST_=]", # 50
|
899
|
+
"[Piṅgala=, ピンガラ=, _IAST_=]", # 51
|
900
|
+
"[Kālayukta=, カーラユクタ=, _IAST_=]", # 52
|
901
|
+
"[Siddhārthin=, シッダールティン=, _IAST_=]", # 53
|
902
|
+
"[Raudra=, ラウドラ=, _IAST_=]", # 54
|
903
|
+
"[Durmati=, ドゥルマティ=, _IAST_=]", # 55
|
904
|
+
"[Dundubhi=, ドゥンドゥビ=, _IAST_=]", # 56
|
905
|
+
"[Rudhirodgārin=, ルディロードガーリン=, _IAST_=]", # 57
|
906
|
+
"[Raktākṣin=, ラクタークシン=, _IAST_=]", # 58
|
907
|
+
"[Krodhana=, クローダナ=, _IAST_=]", # 59
|
908
|
+
"[Kṣaya=, クシャヤ=, _IAST_=]" # 60
|
909
|
+
]
|
910
|
+
],
|
911
|
+
|
912
|
+
# 月の暦注 ----------------------------
|
913
|
+
[When::BasicTypes::M17n,
|
914
|
+
"names:note for month=, 月の暦注=, *alias:month]",
|
915
|
+
[When::BasicTypes::M17n,
|
916
|
+
"names:[month name=en:Month, 月の名前=ja:%%<月_(暦)>, zh:該月的名稱=, *alias:Month=]"
|
917
|
+
]
|
918
|
+
],
|
919
|
+
|
920
|
+
# 日の暦注 ----------------------------
|
921
|
+
[When::BasicTypes::M17n,
|
922
|
+
"names:[note for day=, 日の暦注=, *alias:day]",
|
923
|
+
|
924
|
+
[When::BasicTypes::M17n,
|
925
|
+
"names:[tithi=, ティティ=ja:%%<ティティ>, तिथियाँ]",
|
926
|
+
"[Amavasya, 新月, _IAST_=]", # 新月
|
927
|
+
"[Pratipad=en:Prathama_(day), 1日=, _IAST_=]", # 1
|
928
|
+
"[Dwitiya, 2日=, _IAST_=]", # 2
|
929
|
+
"[Tritiya, 3日=, _IAST_=]", # 3
|
930
|
+
"[Chaturthi, 4日=, _IAST_=]", # 4
|
931
|
+
"[Panchami, 5日=, _IAST_=]", # 5
|
932
|
+
"[Ṣaṣṭhī=en:Shashti, 6日=, _IAST_=]", # 6
|
933
|
+
"[Saptami, 7日=, _IAST_=]", # 7
|
934
|
+
"[Ashtami, 8日=, _IAST_=]", # 8
|
935
|
+
"[Navami, 9日=, _IAST_=]", # 9
|
936
|
+
"[Dashami, 10日=, _IAST_=]", # 10
|
937
|
+
"[Ekadashi, 11日=, _IAST_=]", # 11
|
938
|
+
"[Dwadashi, 12日=, _IAST_=]", # 12
|
939
|
+
"[Thrayodashi, 13日=, _IAST_=]", # 13
|
940
|
+
"[Chaturdashi, 14日=, _IAST_=]", # 14
|
941
|
+
"[Purnima, 満月, _IAST_=]" # 満月
|
942
|
+
],
|
943
|
+
|
944
|
+
[When::BasicTypes::M17n,
|
945
|
+
"names:[vāra=, ヴァーラ=, _IAST_=, *vara=]",
|
946
|
+
"[Ravi=en:S%C5%ABrya, 日曜日, _IAST_=]",
|
947
|
+
"[Soma, 月曜日, _IAST_=]",
|
948
|
+
"[Maṅgala=en:Mangala, 火曜日, _IAST_=]",
|
949
|
+
"[Budha, 水曜日, _IAST_=]",
|
950
|
+
"[Guru, 木曜日, _IAST_=]",
|
951
|
+
"[Śukra=en:Shukra, 金曜日, _IAST_=]",
|
952
|
+
"[Śani=en:Shani, 土曜日, _IAST_=]"
|
953
|
+
],
|
954
|
+
|
955
|
+
[When::BasicTypes::M17n,
|
956
|
+
"names:[nakṣatra=, ナクシャトラ=, _IAST_=, *naksatra=]",
|
957
|
+
"[Aśvinī=en:Ashvin%C4%AB, アシュヴィニー=, _IAST_=, 婁宿]", # 1
|
958
|
+
"[Bharaṇī=en:Bharan%C4%AB, バラニー=, _IAST_=, 胃宿]", # 2
|
959
|
+
"[Kṛttikā=en:Krittik%C4%81, クリッティカー=, _IAST_=, 昴宿]", # 3
|
960
|
+
"[Rohiṇī=en:Rohini_(nakshatra), ローヒニ―=, _IAST_=, 畢宿]", # 4
|
961
|
+
"[Mṛgaśiras=en:Mrigash%C4%ABrsha, ムリガシラス=, _IAST_=, 觜宿]", # 5
|
962
|
+
"[Ārdrā=en:Ardra_(nakshatra), アールドラー=, _IAST_=, 參宿]", # 6
|
963
|
+
"[Punarvasu=en:Punarvasu, プナルヴァス=, _IAST_=, 井宿]", # 7
|
964
|
+
"[Puṣya=en:Pushya, プシュヤ=, _IAST_=, 鬼宿]", # 8
|
965
|
+
"[Aśleṣā=en:%C4%80shlesh%C4%81, アーシュレーシャー=, _IAST_=, 柳宿]", # 9
|
966
|
+
"[Maghā=en:Magh%C4%81, マガー=, _IAST_=, 星宿]", # 10
|
967
|
+
"[Pū. Phalguṇī=en:P%C5%ABrva_Phalgun%C4%AB, P. パールグニー=, _IAST_=, 張宿]", # 11
|
968
|
+
"[U. Phalguṇī=en:Uttara_Phalgun%C4%AB, U. パールグニー=, _IAST_=, 翼宿]", # 12
|
969
|
+
"[Hasta=en:Nakshatra#Divisions, ハスタ=, _IAST_=, 軫宿]", # 13
|
970
|
+
"[Citrā=en:Nakshatra#Divisions, チトラー=, _IAST_=, 角宿]", # 14
|
971
|
+
"[Svāti=en:Sv%C4%81t%C4%AB, スヴァーティー=, _IAST_=, 亢宿]", # 15
|
972
|
+
"[Viśākha=en:Vish%C4%81kh%C4%81, ヴィシャーカー=, _IAST_=, 氐宿]", # 16
|
973
|
+
"[Anurādhā=en:Anur%C4%81dh%C4%81, アヌラーダー=, _IAST_=, 房宿]", # 17
|
974
|
+
"[Jyeṣṭha=en:Jyeshtha, ジェーシュター=, _IAST_=, 心宿]", # 18
|
975
|
+
"[Mūla=en:Mula_(astrology), ムーラ=, _IAST_=, 尾宿]", # 19
|
976
|
+
"[Pū. āṣāḍha=en:P%C5%ABrva_Ash%C4%81dh%C4%81, P. アーシャーダー=, _IAST_=, 箕宿]", # 20
|
977
|
+
"[U. āṣāḍha=en:Uttara_Ash%C4%81dh%C4%81, U. アーシャーダー=, _IAST_=, 斗宿]", # 21
|
978
|
+
"[Śravaṇa=en:Shravana, シュラヴァナ=, _IAST_=, 女宿]", # 22
|
979
|
+
"[Śraviṣṭhā=en:Dhanishta, ダニシュター=, _IAST_=, 虛宿]", # 23
|
980
|
+
"[Śatabhiṣak=en:Shatabhish%C4%81, シャタビシャジュ=, _IAST_=, 危宿]", # 24
|
981
|
+
"[Pū. Bhādrapadā=en:P%C5%ABrva_Bh%C4%81drapad%C4%81,P. バードラパダー=, _IAST_=, 室宿]", # 25
|
982
|
+
"[U. Bhādrapadā=en:Uttara_Bh%C4%81drapad%C4%81, U. バードラパダー=, _IAST_=, 壁宿]", # 26
|
983
|
+
"[Revatī=en:Revati_(nakshatra), レーヴァティー=, _IAST_=, 奎宿]" # 27
|
984
|
+
],
|
985
|
+
|
986
|
+
[When::BasicTypes::M17n,
|
987
|
+
"names:[yoga=, ヨーガ=, _IAST_=]",
|
988
|
+
"[Viṣkambha=, ヴィシュカムバ=, _IAST_=]", # 1
|
989
|
+
"[Prīti=, プリーティ=, _IAST_=]", # 2
|
990
|
+
"[Āyuśmān=, アーユシュマー=, _IAST_=]", # 3
|
991
|
+
"[Saubhāgya=, サウバーギャ=, _IAST_=]", # 4
|
992
|
+
"[Śobhana=, ショーバナ=, _IAST_=]", # 5
|
993
|
+
"[Atigaṇḍa=, アティガンダ=, _IAST_=]", # 6
|
994
|
+
"[Sukarma=, スカルマ=, _IAST_=]", # 7
|
995
|
+
"[Dhṛti=, ドゥリティ=, _IAST_=]", # 8
|
996
|
+
"[Śūla=, シューラ=, _IAST_=]", # 9
|
997
|
+
"[Gaṇḍa=, ガンダ=, _IAST_=]", # 10
|
998
|
+
"[Vṛddhi=, ヴリッディ=, _IAST_=]", # 11
|
999
|
+
"[Dhruva=, ドルヴァ=, _IAST_=]", # 12
|
1000
|
+
"[Vyāghāta=, ヴヤーガータ=, _IAST_=]", # 13
|
1001
|
+
"[Harṣaṇa=, ハルシャナ=, _IAST_=]", # 14
|
1002
|
+
"[Vajra=, ヴァジュラ=, _IAST_=]", # 15
|
1003
|
+
"[Siddhi=, シッディ=, _IAST_=]", # 16
|
1004
|
+
"[Vyatīpāta=, ヴヤティーパータ=, _IAST_=]", # 17
|
1005
|
+
"[Varīyas=, ヴァリーヤス=, _IAST_=]", # 18
|
1006
|
+
"[Parigha=, パリガ=, _IAST_=]", # 19
|
1007
|
+
"[Śiva=, シヴァ=, _IAST_=]", # 20
|
1008
|
+
"[Siddha=, シッダ=, _IAST_=]", # 21
|
1009
|
+
"[Sādhya=, サーディヤ=, _IAST_=]", # 22
|
1010
|
+
"[Śubha=, シュバ=, _IAST_=]", # 23
|
1011
|
+
"[Śukla=, シュクラ=, _IAST_=]", # 24
|
1012
|
+
"[Brahman=, ブラフマン=, _IAST_=]", # 25
|
1013
|
+
"[Māhendra=, マーヘンドラ=, _IAST_=]", # 26
|
1014
|
+
"[Vaidhṛti=, ヴァイドリティ=, _IAST_=]" # 27
|
1015
|
+
],
|
1016
|
+
|
1017
|
+
[When::BasicTypes::M17n,
|
1018
|
+
"names:[Karaṇa=, カラナ=, _IAST_=, *karana]",
|
1019
|
+
"[Bava=, バヴァ=, _IAST_=]", # 1
|
1020
|
+
"[Bālava=, バーラヴァ=, _IAST_=]", # 2
|
1021
|
+
"[Kaulava=, カウラヴァ=, _IAST_=]", # 3
|
1022
|
+
"[Taitila=, タイティラ=, _IAST_=]", # 4
|
1023
|
+
"[Gara=, ガラ=, _IAST_=]", # 5
|
1024
|
+
"[Vaṇija=, ヴァニジュ=, _IAST_=]", # 6
|
1025
|
+
"[Viṣṭi=, ヴィシュティ=, _IAST_=]", # 7
|
1026
|
+
"[Kiṃtughna=, キンストゥグナ=, _IAST_=]", # A
|
1027
|
+
"[Śakuni=, シャクニ=, _IAST_=]", # B
|
1028
|
+
"[Catuṣpāda=, チャトシュパダ=, _IAST_=]", # C
|
1029
|
+
"[Nāga=, ナーガ=, _IAST_=]" # D
|
1030
|
+
]
|
1031
|
+
]
|
1032
|
+
]]
|
1033
|
+
|
1034
|
+
NoteConsts = {
|
1035
|
+
'tithi' => {
|
1036
|
+
:formula => 15,
|
1037
|
+
:range => (-1..2),
|
1038
|
+
:index => [ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
1039
|
+
15,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
|
1040
|
+
},
|
1041
|
+
'naksatra' => {
|
1042
|
+
:formula => '27M',
|
1043
|
+
:range => (-1..2),
|
1044
|
+
:index => (0...27).to_a
|
1045
|
+
},
|
1046
|
+
'yoga' => {
|
1047
|
+
:formula => '27M+27S',
|
1048
|
+
:range => (-1..2),
|
1049
|
+
:index => (0...27).to_a
|
1050
|
+
},
|
1051
|
+
'karana' => {
|
1052
|
+
:formula => 30,
|
1053
|
+
:range => (-2..3),
|
1054
|
+
:index => [7] + (0...7).to_a * 8 + [8,9,10]
|
1055
|
+
}
|
1056
|
+
}
|
1057
|
+
|
1058
|
+
#
|
1059
|
+
# pancanga 計算に必要となる情報をまとめた内部クラス
|
1060
|
+
#
|
1061
|
+
class Dates
|
1062
|
+
|
1063
|
+
# @private
|
1064
|
+
attr_reader :o_date, :l_date, :root, :formula, :iri, :rises
|
1065
|
+
|
1066
|
+
# 初期設定
|
1067
|
+
# @private
|
1068
|
+
def initialize(date)
|
1069
|
+
@o_date = date
|
1070
|
+
clock = date.clock
|
1071
|
+
frame = date.frame if date.frame.kind_of?(When::CalendarTypes::HinduLuniSolar)
|
1072
|
+
@l_date = (frame || When.Calendar('HinduLuniSolar?note=HinduNote')).jul_trans(date.to_i, {:clock=>'+05:30'})
|
1073
|
+
@root = When.CalendarNote('HinduNote/Notes')['day']
|
1074
|
+
@formula = @l_date.frame.formula[-1]
|
1075
|
+
@iri = @formula.iri
|
1076
|
+
@rises = [@formula.sunrise(@l_date), @formula.sunrise(@l_date+When.Duration('P1D'))]
|
1077
|
+
end
|
1078
|
+
|
1079
|
+
# その他のメソッドは @l_date に移譲する
|
1080
|
+
def method_missing(name, *args, &block)
|
1081
|
+
self.class.module_eval %Q{
|
1082
|
+
def #{name}(*args, &block)
|
1083
|
+
@l_date.send("#{name}", *args, &block)
|
1084
|
+
end
|
1085
|
+
} unless When::Parts::MethodCash.escape(name)
|
1086
|
+
@l_date.send(name, *args, &block)
|
1087
|
+
end
|
1088
|
+
end
|
1089
|
+
|
1090
|
+
#
|
1091
|
+
# 任意の暦をインド太陰太陽暦日に変換
|
1092
|
+
# @private
|
1093
|
+
def _to_date_for_note(date)
|
1094
|
+
Dates.new(date)
|
1095
|
+
end
|
1096
|
+
|
1097
|
+
#
|
1098
|
+
# 木星年
|
1099
|
+
#
|
1100
|
+
# @param [Dates] dates
|
1101
|
+
#
|
1102
|
+
# @return [When::BasicTypes::M17n] 木星年の名称
|
1103
|
+
#
|
1104
|
+
# see {http://en.wikipedia.org/wiki/Samvatsara Samvatsara}
|
1105
|
+
#
|
1106
|
+
def samvatsara(dates)
|
1107
|
+
year_kali = dates.l_date.most_significant_coordinate + dates.l_date.frame.epoch_in_CE + 3101
|
1108
|
+
year_mod = year_kali >= jovian ? (year_kali + 12) % 60 :
|
1109
|
+
((year_kali * 211 - 108).div(18000) + year_kali + 26) % 60
|
1110
|
+
When.CalendarNote('HinduNote/Notes')['year']['samvatsara'][year_mod]
|
1111
|
+
end
|
1112
|
+
|
1113
|
+
#
|
1114
|
+
# 木星年の計算方式に“South”を適用開始する年
|
1115
|
+
#
|
1116
|
+
# @return [Integer] 年(カリユガ紀元)
|
1117
|
+
#
|
1118
|
+
def jovian
|
1119
|
+
return @jovian if @jovian.kind_of?(Integer)
|
1120
|
+
@jovian = @jovian ? @jovian.to_i : 4009
|
1121
|
+
end
|
1122
|
+
|
1123
|
+
#
|
1124
|
+
# ヴァーラ (七曜)
|
1125
|
+
#
|
1126
|
+
# @param [Dates] dates
|
1127
|
+
#
|
1128
|
+
# @return [Array<When::TM::TemporalPosition>] 日の出の時刻をイベント時刻とする
|
1129
|
+
#
|
1130
|
+
def vara(dates)
|
1131
|
+
rise = dates.rises[0]
|
1132
|
+
rise.events = [dates.root['vara'][(rise.to_i+1) % 7]]
|
1133
|
+
['V:-', rise]
|
1134
|
+
end
|
1135
|
+
|
1136
|
+
#
|
1137
|
+
# ヴァーラ以外
|
1138
|
+
#
|
1139
|
+
|
1140
|
+
# 当該日付中でティティが変わる日時
|
1141
|
+
# @method tithi(dates)
|
1142
|
+
# @param [Dates] dates
|
1143
|
+
# @return [Array<When::TM::TemporalPosition>] イベント日時
|
1144
|
+
|
1145
|
+
# 当該日付中でナクシャトラが変わる日時
|
1146
|
+
# @method naksatra(dates)
|
1147
|
+
# @param [Dates] dates
|
1148
|
+
# @return [Array<When::TM::TemporalPosition>] イベント日時
|
1149
|
+
|
1150
|
+
# 当該日付中でヨーガが変わる日時
|
1151
|
+
# @method yoga(dates)
|
1152
|
+
# @param [Dates] dates
|
1153
|
+
# @return [Array<When::TM::TemporalPosition>] イベント日時
|
1154
|
+
|
1155
|
+
# 当該日付中でカラナが変わる日時
|
1156
|
+
# @method karana(dates)
|
1157
|
+
# @param [Dates] dates
|
1158
|
+
# @return [Array<When::TM::TemporalPosition>] イベント日時
|
1159
|
+
#
|
1160
|
+
|
1161
|
+
# @private
|
1162
|
+
NoteConsts.keys.each do |key|
|
1163
|
+
module_eval %Q{
|
1164
|
+
def #{key}(dates)
|
1165
|
+
pancanga(dates, '#{key}').map {|event| ['#{key[0..0].upcase}:-', event]}
|
1166
|
+
end
|
1167
|
+
}
|
1168
|
+
end
|
1169
|
+
|
1170
|
+
#
|
1171
|
+
# ヴァーラ以外のイベント日時
|
1172
|
+
#
|
1173
|
+
# @param [Dates] dates
|
1174
|
+
# @param [String] key 'tithi', 'naksatra', 'yoga', 'karana' のいずれか
|
1175
|
+
# @return [Array<When::TM::TemporalPosition>] イベント日時
|
1176
|
+
#
|
1177
|
+
def pancanga(dates, key)
|
1178
|
+
pattern = NoteConsts[key]
|
1179
|
+
note = dates.root[key]
|
1180
|
+
if pattern[:formula].kind_of?(Numeric)
|
1181
|
+
factor = pattern[:formula].to_f
|
1182
|
+
formula = dates.formula
|
1183
|
+
else
|
1184
|
+
factor = 1.0
|
1185
|
+
formula = When.Resource(dates.iri.sub(/formula=2L/, "formula=#{pattern[:formula]}"))
|
1186
|
+
end
|
1187
|
+
cn = (formula.time_to_cn(dates.l_date) * factor).floor
|
1188
|
+
events = []
|
1189
|
+
pattern[:range].each do |i|
|
1190
|
+
event = formula._to_seed_type(formula.cn_to_time((cn+i)/factor), dates.l_date)
|
1191
|
+
break if +event >= +dates.rises[1]
|
1192
|
+
next if +event < +dates.rises[0]
|
1193
|
+
event.events = [note[pattern[:index][(cn+i) % pattern[:index].length]]]
|
1194
|
+
events << event
|
1195
|
+
end
|
1196
|
+
events
|
1197
|
+
end
|
1198
|
+
end
|
1199
|
+
|
1200
|
+
#
|
1201
|
+
# 日の出の九惑星の位置まで計算
|
1202
|
+
#
|
1203
|
+
class HinduNoteDetailed < HinduNote
|
1204
|
+
|
1205
|
+
Notes = HinduNote::Notes
|
1206
|
+
|
1207
|
+
#
|
1208
|
+
# ヴァーラ (七曜)と九惑星の位置
|
1209
|
+
#
|
1210
|
+
# @param [Dates] dates
|
1211
|
+
# @return [Array<When::TM::TemporalPosition, Hash{ 惑星シンボル=>惑星の真黄経 }>]
|
1212
|
+
# 日の出の時刻をイベント時刻とし、その時刻での九惑星の位置を計算
|
1213
|
+
#
|
1214
|
+
def vara(dates)
|
1215
|
+
rise = dates.rises[0]
|
1216
|
+
rise.events = [dates.root['vara'][(rise.to_i+1) % 7]]
|
1217
|
+
t = dates.formula.is_dynamical ? +rise : rise.to_f
|
1218
|
+
[['V:-', rise], dates.formula.graha.keys.inject({}) {|h,p|
|
1219
|
+
h.store(p, dates.formula.graha[p].true_longitude(t))
|
1220
|
+
h
|
1221
|
+
}]
|
1222
|
+
end
|
1223
|
+
end
|
1224
|
+
end
|
1225
|
+
end
|