when_exe 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -10,49 +10,49 @@ module When
|
|
10
10
|
class TM::CalendarEra
|
11
11
|
|
12
12
|
# Japanese Luni-Solar Calendar Series for Japanese Note
|
13
|
-
JapaneseLuniSolar = [self, [
|
13
|
+
JapaneseLuniSolar = [{}, self, [
|
14
14
|
'locale:[=ja:, en=en:]',
|
15
15
|
'area:[日本の暦月=, *JapaneseLuniSolar=]',
|
16
|
-
['[平朔儀鳳暦=]-660.01.01', '@F',
|
17
|
-
['[元嘉暦]454.01.01', '@CR',
|
18
|
-
['[儀鳳暦]697.01.01', '@CR',
|
19
|
-
['[大衍暦]764.01.01', '@CR',
|
20
|
-
['[五紀暦]858.01.01', '@CR',
|
21
|
-
['[宣明暦]862.01.01', '@CR',
|
22
|
-
['[貞享乙丑暦=]1685.01.01', '@CR',
|
23
|
-
['[貞享暦]1687.01.01', '@CR',
|
24
|
-
['[宝暦癸酉暦=]1753.01.01', '@CR',
|
25
|
-
['[宝暦甲戌暦=]1754.01.01', '@CR',
|
26
|
-
['[宝暦暦]1755.01.01', '@CR',
|
27
|
-
['[修正宝暦暦=]1771.01.01', '@CR',
|
28
|
-
['[寛政暦]1798.01.01', '@CR',
|
29
|
-
['[寛政丁亥暦]1827.01.01', '@CR',
|
30
|
-
['[天保暦]1844.01.01', '@CR',
|
31
|
-
['[旧々暦=,*JSO=]1872.12.03','@CR',
|
32
|
-
['[旧暦,*JS=]1887.11.18', '@CR',
|
16
|
+
['[平朔儀鳳暦=]-660.01.01', '@F', '-660-01-01^JapaneseTwin::平朔儀鳳暦'],
|
17
|
+
['[元嘉暦]454.01.01', '@CR', '454-01-01^ChineseTwin::元嘉暦'],
|
18
|
+
['[儀鳳暦]697.01.01', '@CR', '697-01-01^ChineseTwin::麟徳暦'],
|
19
|
+
['[大衍暦]764.01.01', '@CR', '764-01-01^ChineseTwin::大衍暦'],
|
20
|
+
['[五紀暦]858.01.01', '@CR', '858-01-01^ChineseTwin::五紀暦'],
|
21
|
+
['[宣明暦]862.01.01', '@CR', '862-01-01^ChineseTwin::宣明暦'],
|
22
|
+
['[貞享乙丑暦=]1685.01.01', '@CR', '1685-01-01^JapaneseTwin::貞享乙丑暦'],
|
23
|
+
['[貞享暦]1687.01.01', '@CR', '1687-01-01^JapaneseTwin::貞享暦' ],
|
24
|
+
['[宝暦癸酉暦=]1753.01.01', '@CR', '1753-01-01^JapaneseTwin::宝暦癸酉暦'],
|
25
|
+
['[宝暦甲戌暦=]1754.01.01', '@CR', '1754-01-01^JapaneseTwin::宝暦甲戌暦'],
|
26
|
+
['[宝暦暦]1755.01.01', '@CR', '1755-01-01^JapaneseTwin::宝暦暦' ],
|
27
|
+
['[修正宝暦暦=]1771.01.01', '@CR', '1771-01-01^JapaneseTwin::修正宝暦暦'],
|
28
|
+
['[寛政暦]1798.01.01', '@CR', '1798-01-01^JapaneseTwin::寛政暦' ], # 京都平均太陽時
|
29
|
+
['[寛政丁亥暦]1827.01.01', '@CR', '1827-01-01^JapaneseTwin::寛政丁亥暦'], # 京都平均太陽時
|
30
|
+
['[天保暦]1844.01.01', '@CR', '1844-01-01^JapaneseTwin#{?Clock=Clock}::天保暦'], # 京都真太陽時
|
31
|
+
['[旧々暦=,*JSO=]1872.12.03','@CR', '1872-12-03^JapaneseTwin::旧々暦' ], # 東京平均太陽時
|
32
|
+
['[旧暦,*JS=]1887.11.18', '@CR', '1887-11-18^JapaneseTwin::旧暦' ] # 日本標準時
|
33
33
|
]]
|
34
34
|
|
35
35
|
# Japanese Solar Calendar Series for Japanese Note
|
36
|
-
JapaneseSolar = [self, [
|
36
|
+
JapaneseSolar = [{}, self, [
|
37
37
|
'locale:[=ja:, en=en:]',
|
38
38
|
'area:[日本の節月=, *JapaneseSolar=]',
|
39
|
-
['[平朔儀鳳暦=]-661.01.01', '@F',
|
40
|
-
['[元嘉暦]454.01.12', '@CR',
|
41
|
-
['[儀鳳暦]696.12.27', '@CR',
|
42
|
-
['[大衍暦]764.01.06', '@CR',
|
43
|
-
['[五紀暦]857.12.19', '@CR',
|
44
|
-
['[宣明暦]862.01.03', '@CR',
|
45
|
-
['[貞享乙丑暦=]1685.01.01', '@CR',
|
46
|
-
['[貞享暦]1687.01.08', '@CR',
|
47
|
-
['[宝暦癸酉暦=]1752.12.30', '@CR',
|
48
|
-
['[宝暦甲戌暦=]1753.12.19', '@CR',
|
49
|
-
['[宝暦暦]1755.01.07', '@CR',
|
50
|
-
['[修正宝暦暦=]1771.01.11', '@CR',
|
51
|
-
['[寛政暦]1798.01.12', '@CR',
|
52
|
-
['[寛政丁亥暦]1826.12.22', '@CR',
|
53
|
-
['[天保暦]1844.01.14', '@CR',
|
54
|
-
['[旧々暦=,*JSO=]1872.11.26','@CR',
|
55
|
-
['[旧暦,*JS=]1887.11.26', '@CR',
|
39
|
+
['[平朔儀鳳暦=]-661.01.01', '@F', '-661-01-01^JapaneseTwin::平朔儀鳳暦(節月)'], # 年の始めに遡って開始(実際は12.22)
|
40
|
+
['[元嘉暦]454.01.12', '@CR', '454-01-12^ChineseTwin::元嘉暦(節月)'],
|
41
|
+
['[儀鳳暦]696.12.27', '@CR', '696-12-27^ChineseTwin::麟徳暦(節月)'],
|
42
|
+
['[大衍暦]764.01.06', '@CR', '764-01-06^ChineseTwin::大衍暦(節月)'],
|
43
|
+
['[五紀暦]857.12.19', '@CR', '857-12-19^ChineseTwin::五紀暦(節月)'],
|
44
|
+
['[宣明暦]862.01.03', '@CR', '862-01-03^ChineseTwin::宣明暦(節月)'],
|
45
|
+
['[貞享乙丑暦=]1685.01.01', '@CR', '1685-01-01^JapaneseTwin::貞享乙丑暦(節月)'],
|
46
|
+
['[貞享暦]1687.01.08', '@CR', '1687-01-08^JapaneseTwin::貞享暦(節月)' ],
|
47
|
+
['[宝暦癸酉暦=]1752.12.30', '@CR', '1752-12-30^JapaneseTwin::宝暦癸酉暦(節月)'],
|
48
|
+
['[宝暦甲戌暦=]1753.12.19', '@CR', '1753-12-19^JapaneseTwin::宝暦甲戌暦(節月)'],
|
49
|
+
['[宝暦暦]1755.01.07', '@CR', '1755-01-07^JapaneseTwin::宝暦暦(節月)' ],
|
50
|
+
['[修正宝暦暦=]1771.01.11', '@CR', '1771-01-11^JapaneseTwin::修正宝暦暦(節月)'],
|
51
|
+
['[寛政暦]1798.01.12', '@CR', '1798-01-12^JapaneseTwin::寛政暦(節月)' ],
|
52
|
+
['[寛政丁亥暦]1826.12.22', '@CR', '1826-12-22^JapaneseTwin::寛政丁亥暦(節月)'],
|
53
|
+
['[天保暦]1844.01.14', '@CR', '1844-01-14^JapaneseTwin#{?Clock=Clock}::天保暦(節月)'], # 京都真太陽時
|
54
|
+
['[旧々暦=,*JSO=]1872.11.26','@CR', '1872-11-26^JapaneseTwin::旧々暦(節月)' ], # 東京平均太陽時
|
55
|
+
['[旧暦,*JS=]1887.11.26', '@CR', '1887-11-26^JapaneseTwin::旧暦(節月)' ] # 日本標準時
|
56
56
|
]]
|
57
57
|
end
|
58
58
|
|
@@ -205,7 +205,7 @@ module When
|
|
205
205
|
|
206
206
|
[ChineseLuniSolar,
|
207
207
|
'name:[天保暦]',
|
208
|
-
'time_basis:LAT?long=135.4520E&lat=35.0117N',
|
208
|
+
'time_basis:#{Clock:LAT}?long=135.4520E&lat=35.0117N',
|
209
209
|
'intercalary_span:3'
|
210
210
|
],
|
211
211
|
|
@@ -66,8 +66,8 @@ module When
|
|
66
66
|
|
67
67
|
# Default Parameters
|
68
68
|
Rational
|
69
|
-
@epoch_in_CE ||=
|
70
|
-
@origin_of_MSC ||=
|
69
|
+
@epoch_in_CE ||= -3760
|
70
|
+
@origin_of_MSC ||= 3761
|
71
71
|
@origin_of_LSC ||= 1721300 + Rational( 9415, 98496)
|
72
72
|
@mean_month ||= 29 + Rational(261307, 492480)
|
73
73
|
@leap_period ||= 19
|
@@ -0,0 +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
|
+
module When
|
9
|
+
|
10
|
+
class BasicTypes::M17n
|
11
|
+
|
12
|
+
Pax = [self, [
|
13
|
+
"locale:[=en:, ja]",
|
14
|
+
"names:[Pax=]",
|
15
|
+
"[Pax=en:Pax_Calendar, パックス暦=ja:%%<13の月の暦>#%.<パックス暦>]",
|
16
|
+
|
17
|
+
# %0s は“閏”の表記を抑制する指定となっている
|
18
|
+
[self,
|
19
|
+
"names:[Month, 月=ja:%%<月_(暦)>]",
|
20
|
+
"[January, 1月, /date/month_names/1] ",
|
21
|
+
"[February, 2月, /date/month_names/2] ",
|
22
|
+
"[March, 3月, /date/month_names/3] ",
|
23
|
+
"[April, 4月, /date/month_names/4] ",
|
24
|
+
"[May, 5月, /date/month_names/5] ",
|
25
|
+
"[June, 6月, /date/month_names/6] ",
|
26
|
+
"[July, 7月, /date/month_names/7] ",
|
27
|
+
"[August, 8月, /date/month_names/8] ",
|
28
|
+
"[September, 9月, /date/month_names/9] ",
|
29
|
+
"[October, 10月, /date/month_names/10]",
|
30
|
+
"[November, 11月, /date/month_names/11]",
|
31
|
+
"[Columbus, 12月 ]",
|
32
|
+
"[December, 13月, /date/month_names/12]",
|
33
|
+
"[%0sPax=en:Pax_Calendar, %0sパックス=ja:%%<13の月の暦>#%.<パックス暦>]" # Leap week
|
34
|
+
]
|
35
|
+
]]
|
36
|
+
end
|
37
|
+
|
38
|
+
module CalendarTypes
|
39
|
+
|
40
|
+
#
|
41
|
+
# Pax Calendar
|
42
|
+
#
|
43
|
+
Pax = [CyclicTableBased, {
|
44
|
+
'label' => 'Pax::Pax',
|
45
|
+
'origin_of_LSC' => 1721061,
|
46
|
+
'indices' => [
|
47
|
+
When.Index('Pax::Month', {:branch=>{+1=>When.Resource('_m:Pax::Month::*')[13]}}),
|
48
|
+
When::Coordinates::DefaultDayIndex
|
49
|
+
],
|
50
|
+
'rule_table' => {
|
51
|
+
'T' => {'Rule' =>[364] + (1...400).to_a.map {|year|
|
52
|
+
yy = year % 100
|
53
|
+
(yy % 6) == 0 || yy==99 ? 371 : 364
|
54
|
+
}},
|
55
|
+
364 => {'Length'=>[28] * 13, 'IDs'=>'1,2,3,4,5,6,7,8,9,10,11,12,13'},
|
56
|
+
371 => {'Length'=>[28] * 12 + [7,28], 'IDs'=>'1,2,3,4,5,6,7,8,9,10,11,12,12=,13'}
|
57
|
+
}
|
58
|
+
}]
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,100 @@
|
|
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
|
+
Positivist = [self, [
|
13
|
+
"locale:[=en:, ja=ja:, alias]",
|
14
|
+
"names:[Positivist=]",
|
15
|
+
"[Positivist=en:Positivist_calendar, オーギュスト・コントの暦=ja:%%<13の月の暦>#%.<実証暦>]"
|
16
|
+
]]
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# Positivist Week
|
21
|
+
#
|
22
|
+
class CalendarNote::PositivistWeek < CalendarNote::Week
|
23
|
+
|
24
|
+
#
|
25
|
+
# Positivist Note
|
26
|
+
#
|
27
|
+
Notes = [When::BasicTypes::M17n, [
|
28
|
+
"locale:[=en:, ja=ja:, alias]",
|
29
|
+
"names:[Positivist]",
|
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
|
+
"[Moses, モーセ ]",
|
42
|
+
"[Homer, ホメーロス ]",
|
43
|
+
"[Aristotle, アリストテレス ]",
|
44
|
+
"[Archimedes, アルキメデス ]",
|
45
|
+
"[Caesar=en:Julius_Caesar, カエサル=ja:%%<ガイウス・ユリウス・カエサル> ]",
|
46
|
+
"[Saint Paul=en:Paul_of_Tarsus, パウロ ]",
|
47
|
+
"[Charlemagne, シャルルマーニュ=ja:%%<カール大帝> ]",
|
48
|
+
"[Dante=en:Dante_Alighieri, ダンテ=ja:%%<ダンテ・アリギエーリ> ]",
|
49
|
+
"[Gutenberg=en:Johann_Gutenberg, グーテンベルク=ja:%%<ヨハネス・グーテンベルク> ]",
|
50
|
+
"[Shakespeare=en:William_Shakespeare, シェイクスピア=ja:%%<ウィリアム・シェイクスピア> ]",
|
51
|
+
"[Descartes=en:%%<René_Descartes>, デカルト=ja:%%<ルネ・デカルト> ]",
|
52
|
+
"[Frederick=en:Frederick_II_of_Prussia, フリードリヒ=ja:%%<フリードリヒ2世 (プロイセン王)> ]",
|
53
|
+
"[Bichat=en:%%<Marie_François_Xavier Bichat>, ビシャ=ja:%%<マリー・フランソワ・クサヴィエ・ビシャ>]"
|
54
|
+
]
|
55
|
+
],
|
56
|
+
|
57
|
+
# Notes for day ----------------------------
|
58
|
+
[When::BasicTypes::M17n,
|
59
|
+
"names:[day]",
|
60
|
+
[When::BasicTypes::M17n,
|
61
|
+
"names:[Week]",
|
62
|
+
[DayOfWeek, "label:[Monday, 月曜日, /date/day_names/1]", {'delta'=> 7}],
|
63
|
+
[DayOfWeek, "label:[Tuesday, 火曜日, /date/day_names/2]", {'delta'=> 7}],
|
64
|
+
[DayOfWeek, "label:[Wednesday, 水曜日, /date/day_names/3]", {'delta'=> 7}],
|
65
|
+
[DayOfWeek, "label:[Thursday, 木曜日, /date/day_names/4]", {'delta'=> 7}],
|
66
|
+
[DayOfWeek, "label:[Friday, 金曜日, /date/day_names/5]", {'delta'=> 7}],
|
67
|
+
[DayOfWeek, "label:[Saturday, 土曜日, /date/day_names/6]", {'delta'=> 7}],
|
68
|
+
[DayOfWeek, "label:[Sunday, 日曜日, /date/day_names/0]", {'delta'=> 7}],
|
69
|
+
[DayOfWeek, "label:[Festival_of_the_Dead, 祖先の祭=]", {'delta'=> 366}],
|
70
|
+
[DayOfWeek, "label:[Festival_of_Holy_Women=, 聖女の祭=]", {'delta'=>1461}]
|
71
|
+
],
|
72
|
+
|
73
|
+
"[Common_Week]"
|
74
|
+
]
|
75
|
+
]]
|
76
|
+
|
77
|
+
fixed_week_definitions
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
module CalendarTypes
|
82
|
+
#
|
83
|
+
# Positivist calendar based on Gregorian calendar
|
84
|
+
#
|
85
|
+
Positivist = [YearLengthTableBased, {
|
86
|
+
'label' => 'Positivist::Positivist',
|
87
|
+
'indices' => [
|
88
|
+
When.Index('PositivistWeekNotes::month::Month', {:unit =>13}),
|
89
|
+
When::Coordinates::DefaultDayIndex
|
90
|
+
],
|
91
|
+
'origin_of_MSC' => -1788,
|
92
|
+
'diff_to_CE' => 0,
|
93
|
+
'rule_table' => {
|
94
|
+
365 => {'Length'=>[28]*12 + [29]},
|
95
|
+
366 => {'Length'=>[28]*12 + [30]}
|
96
|
+
},
|
97
|
+
'note' => 'PositivistWeek'
|
98
|
+
}]
|
99
|
+
end
|
100
|
+
end
|
@@ -1,334 +1,333 @@
|
|
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
|
-
|
10
|
-
class BasicTypes::M17n
|
11
|
-
|
12
|
-
Roman = [self, [
|
13
|
-
"locale:[=en:, ja=ja:, alias]",
|
14
|
-
"names:[Roman=]",
|
15
|
-
|
16
|
-
# Remarks
|
17
|
-
'[based on Chris Bennett "Roman Dates" (Retrieved 2013-05-13)=http://www.tyndalehouse.com/Egypt/ptolemies/chron/roman/chron_rom_intro_fr.htm,' +
|
18
|
-
'典拠 - Chris Bennett "Roman Dates" (2013-05-13 閲覧)=]',
|
19
|
-
|
20
|
-
[self, # ..CE-44 / ..BCE45
|
21
|
-
"names:[MonthA=en:Month, 月=ja:%%<月_(暦)>]",
|
22
|
-
"[Ianuarius, 1月]",
|
23
|
-
"[Februarius, 2月]",
|
24
|
-
"[Martius, 3月]",
|
25
|
-
"[Aprilis, 4月]",
|
26
|
-
"[Maius, 5月]",
|
27
|
-
"[Iunius, 6月]",
|
28
|
-
"[Quintilis, 旧7月=]",
|
29
|
-
"[Sextilis, 旧8月=]",
|
30
|
-
"[September, 9月]",
|
31
|
-
"[October, 10月]",
|
32
|
-
"[November, 11月]",
|
33
|
-
"[December, 12月]"
|
34
|
-
],
|
35
|
-
|
36
|
-
[self, # CE-43..CE-8 / BCE44..BCE9
|
37
|
-
"names:[MonthB=en:Month, 月=ja:%%<月_(暦)>]",
|
38
|
-
"[Ianuarius, 1月]",
|
39
|
-
"[Februarius, 2月]",
|
40
|
-
"[Martius, 3月]",
|
41
|
-
"[Aprilis, 4月]",
|
42
|
-
"[Maius, 5月]",
|
43
|
-
"[Iunius, 6月]",
|
44
|
-
"[Iulius, 7月]",
|
45
|
-
"[Sextilis, 旧8月=]",
|
46
|
-
"[September, 9月]",
|
47
|
-
"[October, 10月]",
|
48
|
-
"[November, 11月]",
|
49
|
-
"[December, 12月]"
|
50
|
-
],
|
51
|
-
|
52
|
-
[self, # CE-7..CE36, CE41.. / BCE8..CE36, CE41..
|
53
|
-
"names:[Month, 月=ja:%%<月_(暦)>]",
|
54
|
-
"[Ianuarius, 1月]",
|
55
|
-
"[Februarius, 2月]",
|
56
|
-
"[Martius, 3月]",
|
57
|
-
"[Aprilis, 4月]",
|
58
|
-
"[Maius, 5月]",
|
59
|
-
"[Iunius, 6月]",
|
60
|
-
"[Iulius, 7月]",
|
61
|
-
"[Augustus, 8月]",
|
62
|
-
"[September, 9月]",
|
63
|
-
"[October, 10月]",
|
64
|
-
"[November, 11月]",
|
65
|
-
"[December, 12月]"
|
66
|
-
],
|
67
|
-
|
68
|
-
[self, # CE37..CE40
|
69
|
-
"names:[MonthD=en:Month, 月=ja:%%<月_(暦)>]",
|
70
|
-
"[Ianuarius, 1月]",
|
71
|
-
"[Februarius, 2月]",
|
72
|
-
"[Martius, 3月]",
|
73
|
-
"[Aprilis, 4月]",
|
74
|
-
"[Maius, 5月]",
|
75
|
-
"[Iunius, 6月]",
|
76
|
-
"[Iulius, 7月]",
|
77
|
-
"[Augustus, 8月]",
|
78
|
-
"[Germanicus, 新9月=]",
|
79
|
-
"[October, 10月]",
|
80
|
-
"[November, 11月]",
|
81
|
-
"[December, 12月]"
|
82
|
-
],
|
83
|
-
|
84
|
-
# %0s は“閏”の表記を抑制する指定となっている
|
85
|
-
[self, # Intercalary Months
|
86
|
-
"names:[IntercalaryMonth=en:Intercalation, 閏月]",
|
87
|
-
"[%0sIntercalaris=en:Roman_calendar#Calendar_of_Numa," +
|
88
|
-
"閏月%0s=ja:%%<ローマ暦>#%.<末期のローマ暦>]",
|
89
|
-
"[%0sIntercalaris Prior=en:Julian_calendar#Realignment_of_the_year," +
|
90
|
-
"第1閏月%0s=ja:%%<ローマ暦>#%.<末期のローマ暦>]",
|
91
|
-
"[%0sIntercalaris Posterior=en:Julian_calendar#Realignment_of_the_year," +
|
92
|
-
"第2閏月%0s=ja:%%<ローマ暦>#%.<末期のローマ暦>]",
|
93
|
-
]
|
94
|
-
]]
|
95
|
-
end
|
96
|
-
|
97
|
-
class TM::CalendarEra
|
98
|
-
|
99
|
-
# From http://en.wikipedia.org/wiki/Julian_calendar#Sacrobosco.27s_theory_on_month_lengths
|
100
|
-
Julian = [self, [
|
101
|
-
"locale:[=en:, ja=ja:, alias]",
|
102
|
-
"period:[Roman=en:Roman_calendar, ローマ暦]",
|
103
|
-
["[AUC=en:Ab_urbe_condita, 建国紀元=ja:%%<ローマ建国紀元>, alias:Ab_urbe_condita]709.1.1",
|
104
|
-
'@CE', "-44-01-01^JulianA",
|
105
|
-
"-7-03-01^JulianB",
|
106
|
-
"8-01-01^JulianC", "476-09-04"]
|
107
|
-
]]
|
108
|
-
|
109
|
-
# From Chris Bennett, http://www.tyndalehouse.com/Egypt/ptolemies/chron/roman/chron_rom_intro_fr.htm
|
110
|
-
Roman = [self, [
|
111
|
-
"locale:[=en:, ja=ja:, alias]",
|
112
|
-
"period:[Roman=en:Roman_calendar, ローマ暦]",
|
113
|
-
["[AUC=en:Ab_urbe_condita, 建国紀元=ja:%%<ローマ建国紀元>, alias:Ab_urbe_condita]492.5.1",
|
114
|
-
'@CE', "-261-05-01^RomanA?border=0-5-1",
|
115
|
-
"-221-03-01^RomanA?border=0-3-1",
|
116
|
-
"-152-01-01^RomanA",
|
117
|
-
"-43-01-01^RomanB",
|
118
|
-
"-7-01-01^RomanC",
|
119
|
-
"37-01-01^RomanD",
|
120
|
-
"41-01-01^Roman", "476-09-04"]
|
121
|
-
]]
|
122
|
-
|
123
|
-
end
|
124
|
-
|
125
|
-
module CalendarTypes
|
126
|
-
|
127
|
-
# From http://en.wikipedia.org/wiki/Julian_calendar#Sacrobosco.27s_theory_on_month_lengths
|
128
|
-
_Index0 = When::Coordinates::DefaultDayIndex
|
129
|
-
_IndicesB12 = [When.Index('Roman::MonthB', {:unit=>12}), _Index0]
|
130
|
-
_Indices12 = [When.Index('Roman::Month', {:unit=>12}), _Index0]
|
131
|
-
|
132
|
-
#
|
133
|
-
# Julian Calendar A : BCE45-BCE8
|
134
|
-
#
|
135
|
-
JulianA = [CyclicTableBased, {
|
136
|
-
'origin_of_LSC' => 1704987,
|
137
|
-
'origin_of_MSC' => -44,
|
138
|
-
'indices' => _IndicesB12,
|
139
|
-
'rule_table' => {
|
140
|
-
'T' => {'Rule' =>[365,366,365]},
|
141
|
-
365 => {'Length'=>[31,29] + [31,30]*5},
|
142
|
-
366 => {'Length'=>[31,30] + [31,30]*5}
|
143
|
-
},
|
144
|
-
'note' => 'Roman'
|
145
|
-
}]
|
146
|
-
|
147
|
-
#
|
148
|
-
# Julian Calendar B : BCE8-CE7
|
149
|
-
#
|
150
|
-
JulianB = [CyclicTableBased, {
|
151
|
-
'origin_of_LSC' => 1704987+13,
|
152
|
-
'origin_of_MSC' => -44,
|
153
|
-
'indices' => _IndicesB12,
|
154
|
-
'rule_table' => {
|
155
|
-
'T' => {'Rule' =>[365]},
|
156
|
-
365 => {'Length'=>[31,28] + [31,30,31,30,31]*2}
|
157
|
-
},
|
158
|
-
'note' => 'Roman'
|
159
|
-
}]
|
160
|
-
|
161
|
-
#
|
162
|
-
# Julian Calendar C : CE8-
|
163
|
-
#
|
164
|
-
JulianC = [Julian, {
|
165
|
-
'indices' => _Indices12,
|
166
|
-
'note' => 'Roman'
|
167
|
-
}]
|
168
|
-
|
169
|
-
# From Chris Bennett, http://www.tyndalehouse.com/Egypt/ptolemies/chron/roman/chron_rom_intro_fr.htm
|
170
|
-
#
|
171
|
-
# Roman Calendar BCE262-(CE60)-CE480
|
172
|
-
#
|
173
|
-
# _ID_N = '1,2,3,4,5,6,7,8,9,10,11,12'
|
174
|
-
_ID_L = '1,2,2=,3,4,5,6,7,8,9,10,11,12'
|
175
|
-
_ID_J = '1,2,2=,3,4,5,6,7,8,9,10,11,11<,11>,12'
|
176
|
-
_Branch = {
|
177
|
-
1=>When.Resource('_m:Roman::IntercalaryMonth::*')[0],
|
178
|
-
0.5=>When.Resource('_m:Roman::IntercalaryMonth::*')[1],
|
179
|
-
1.5=>When.Resource('_m:Roman::IntercalaryMonth::*')[2]
|
180
|
-
}
|
181
|
-
_IndicesA = [When.Index('Roman::MonthA', {:branch=>_Branch}), _Index0]
|
182
|
-
_IndicesB = [When.Index('Roman::MonthB', {:branch=>_Branch}), _Index0]
|
183
|
-
_Indices = [When.Index('Roman::Month', {:branch=>_Branch}), _Index0]
|
184
|
-
_IndicesD = [When.Index('Roman::MonthD', {:branch=>_Branch}), _Index0]
|
185
|
-
_remarks = When.M17n('Roman::based on Chris Bennett "Roman Dates" (Retrieved 2013-05-13)')
|
186
|
-
|
187
|
-
|
188
|
-
'
|
189
|
-
'
|
190
|
-
'
|
191
|
-
|
192
|
-
|
193
|
-
A
|
194
|
-
|
195
|
-
C A C A C A C A C A C A
|
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
|
-
"label:[
|
244
|
-
[When::Coordinates::Residue, "label:[
|
245
|
-
[When::Coordinates::Residue, "label:[
|
246
|
-
[When::Coordinates::Residue, "label:[
|
247
|
-
[When::Coordinates::Residue, "label:[
|
248
|
-
[When::Coordinates::Residue, "label:[
|
249
|
-
[When::Coordinates::Residue, "label:[
|
250
|
-
[When::Coordinates::Residue, "label:[
|
251
|
-
[When::Coordinates::Residue, "label:[
|
252
|
-
[When::Coordinates::Residue, "label:[
|
253
|
-
[When::Coordinates::Residue, "label:[
|
254
|
-
[When::Coordinates::Residue, "label:[
|
255
|
-
[When::Coordinates::Residue, "label:[
|
256
|
-
[When::Coordinates::Residue, "label:[
|
257
|
-
[When::Coordinates::Residue, "label:[
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
'a.d.
|
282
|
-
'
|
283
|
-
'a.d.
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
#
|
292
|
-
#
|
293
|
-
#
|
294
|
-
#
|
295
|
-
#
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
when
|
303
|
-
when
|
304
|
-
when
|
305
|
-
when
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
name
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
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
|
+
|
10
|
+
class BasicTypes::M17n
|
11
|
+
|
12
|
+
Roman = [self, [
|
13
|
+
"locale:[=en:, ja=ja:, alias]",
|
14
|
+
"names:[Roman=]",
|
15
|
+
|
16
|
+
# Remarks
|
17
|
+
'[based on Chris Bennett "Roman Dates" (Retrieved 2013-05-13)=http://www.tyndalehouse.com/Egypt/ptolemies/chron/roman/chron_rom_intro_fr.htm,' +
|
18
|
+
'典拠 - Chris Bennett "Roman Dates" (2013-05-13 閲覧)=]',
|
19
|
+
|
20
|
+
[self, # ..CE-44 / ..BCE45
|
21
|
+
"names:[MonthA=en:Month, 月=ja:%%<月_(暦)>]",
|
22
|
+
"[Ianuarius, 1月]",
|
23
|
+
"[Februarius, 2月]",
|
24
|
+
"[Martius, 3月]",
|
25
|
+
"[Aprilis, 4月]",
|
26
|
+
"[Maius, 5月]",
|
27
|
+
"[Iunius, 6月]",
|
28
|
+
"[Quintilis, 旧7月=]",
|
29
|
+
"[Sextilis, 旧8月=]",
|
30
|
+
"[September, 9月]",
|
31
|
+
"[October, 10月]",
|
32
|
+
"[November, 11月]",
|
33
|
+
"[December, 12月]"
|
34
|
+
],
|
35
|
+
|
36
|
+
[self, # CE-43..CE-8 / BCE44..BCE9
|
37
|
+
"names:[MonthB=en:Month, 月=ja:%%<月_(暦)>]",
|
38
|
+
"[Ianuarius, 1月]",
|
39
|
+
"[Februarius, 2月]",
|
40
|
+
"[Martius, 3月]",
|
41
|
+
"[Aprilis, 4月]",
|
42
|
+
"[Maius, 5月]",
|
43
|
+
"[Iunius, 6月]",
|
44
|
+
"[Iulius, 7月]",
|
45
|
+
"[Sextilis, 旧8月=]",
|
46
|
+
"[September, 9月]",
|
47
|
+
"[October, 10月]",
|
48
|
+
"[November, 11月]",
|
49
|
+
"[December, 12月]"
|
50
|
+
],
|
51
|
+
|
52
|
+
[self, # CE-7..CE36, CE41.. / BCE8..CE36, CE41..
|
53
|
+
"names:[Month, 月=ja:%%<月_(暦)>]",
|
54
|
+
"[Ianuarius, 1月]",
|
55
|
+
"[Februarius, 2月]",
|
56
|
+
"[Martius, 3月]",
|
57
|
+
"[Aprilis, 4月]",
|
58
|
+
"[Maius, 5月]",
|
59
|
+
"[Iunius, 6月]",
|
60
|
+
"[Iulius, 7月]",
|
61
|
+
"[Augustus, 8月]",
|
62
|
+
"[September, 9月]",
|
63
|
+
"[October, 10月]",
|
64
|
+
"[November, 11月]",
|
65
|
+
"[December, 12月]"
|
66
|
+
],
|
67
|
+
|
68
|
+
[self, # CE37..CE40
|
69
|
+
"names:[MonthD=en:Month, 月=ja:%%<月_(暦)>]",
|
70
|
+
"[Ianuarius, 1月]",
|
71
|
+
"[Februarius, 2月]",
|
72
|
+
"[Martius, 3月]",
|
73
|
+
"[Aprilis, 4月]",
|
74
|
+
"[Maius, 5月]",
|
75
|
+
"[Iunius, 6月]",
|
76
|
+
"[Iulius, 7月]",
|
77
|
+
"[Augustus, 8月]",
|
78
|
+
"[Germanicus, 新9月=]",
|
79
|
+
"[October, 10月]",
|
80
|
+
"[November, 11月]",
|
81
|
+
"[December, 12月]"
|
82
|
+
],
|
83
|
+
|
84
|
+
# %0s は“閏”の表記を抑制する指定となっている
|
85
|
+
[self, # Intercalary Months
|
86
|
+
"names:[IntercalaryMonth=en:Intercalation, 閏月]",
|
87
|
+
"[%0sIntercalaris=en:Roman_calendar#Calendar_of_Numa," +
|
88
|
+
"閏月%0s=ja:%%<ローマ暦>#%.<末期のローマ暦>]",
|
89
|
+
"[%0sIntercalaris Prior=en:Julian_calendar#Realignment_of_the_year," +
|
90
|
+
"第1閏月%0s=ja:%%<ローマ暦>#%.<末期のローマ暦>]",
|
91
|
+
"[%0sIntercalaris Posterior=en:Julian_calendar#Realignment_of_the_year," +
|
92
|
+
"第2閏月%0s=ja:%%<ローマ暦>#%.<末期のローマ暦>]",
|
93
|
+
]
|
94
|
+
]]
|
95
|
+
end
|
96
|
+
|
97
|
+
class TM::CalendarEra
|
98
|
+
|
99
|
+
# From http://en.wikipedia.org/wiki/Julian_calendar#Sacrobosco.27s_theory_on_month_lengths
|
100
|
+
Julian = [self, [
|
101
|
+
"locale:[=en:, ja=ja:, alias]",
|
102
|
+
"period:[Roman=en:Roman_calendar, ローマ暦]",
|
103
|
+
["[AUC=en:Ab_urbe_condita, 建国紀元=ja:%%<ローマ建国紀元>, alias:Ab_urbe_condita]709.1.1",
|
104
|
+
'@CE', "-44-01-01^JulianA",
|
105
|
+
"-7-03-01^JulianB",
|
106
|
+
"8-01-01^JulianC", "476-09-04"]
|
107
|
+
]]
|
108
|
+
|
109
|
+
# From Chris Bennett, http://www.tyndalehouse.com/Egypt/ptolemies/chron/roman/chron_rom_intro_fr.htm
|
110
|
+
Roman = [self, [
|
111
|
+
"locale:[=en:, ja=ja:, alias]",
|
112
|
+
"period:[Roman=en:Roman_calendar, ローマ暦]",
|
113
|
+
["[AUC=en:Ab_urbe_condita, 建国紀元=ja:%%<ローマ建国紀元>, alias:Ab_urbe_condita]492.5.1",
|
114
|
+
'@CE', "-261-05-01^RomanA?border=0-5-1",
|
115
|
+
"-221-03-01^RomanA?border=0-3-1",
|
116
|
+
"-152-01-01^RomanA",
|
117
|
+
"-43-01-01^RomanB",
|
118
|
+
"-7-01-01^RomanC",
|
119
|
+
"37-01-01^RomanD",
|
120
|
+
"41-01-01^Roman", "476-09-04"]
|
121
|
+
]]
|
122
|
+
|
123
|
+
end
|
124
|
+
|
125
|
+
module CalendarTypes
|
126
|
+
|
127
|
+
# From http://en.wikipedia.org/wiki/Julian_calendar#Sacrobosco.27s_theory_on_month_lengths
|
128
|
+
_Index0 = When::Coordinates::DefaultDayIndex
|
129
|
+
_IndicesB12 = [When.Index('Roman::MonthB', {:unit=>12}), _Index0]
|
130
|
+
_Indices12 = [When.Index('Roman::Month', {:unit=>12}), _Index0]
|
131
|
+
|
132
|
+
#
|
133
|
+
# Julian Calendar A : BCE45-BCE8
|
134
|
+
#
|
135
|
+
JulianA = [CyclicTableBased, {
|
136
|
+
'origin_of_LSC' => 1704987,
|
137
|
+
'origin_of_MSC' => -44,
|
138
|
+
'indices' => _IndicesB12,
|
139
|
+
'rule_table' => {
|
140
|
+
'T' => {'Rule' =>[365,366,365]},
|
141
|
+
365 => {'Length'=>[31,29] + [31,30]*5},
|
142
|
+
366 => {'Length'=>[31,30] + [31,30]*5}
|
143
|
+
},
|
144
|
+
'note' => 'Roman'
|
145
|
+
}]
|
146
|
+
|
147
|
+
#
|
148
|
+
# Julian Calendar B : BCE8-CE7
|
149
|
+
#
|
150
|
+
JulianB = [CyclicTableBased, {
|
151
|
+
'origin_of_LSC' => 1704987+13,
|
152
|
+
'origin_of_MSC' => -44,
|
153
|
+
'indices' => _IndicesB12,
|
154
|
+
'rule_table' => {
|
155
|
+
'T' => {'Rule' =>[365]},
|
156
|
+
365 => {'Length'=>[31,28] + [31,30,31,30,31]*2}
|
157
|
+
},
|
158
|
+
'note' => 'Roman'
|
159
|
+
}]
|
160
|
+
|
161
|
+
#
|
162
|
+
# Julian Calendar C : CE8-
|
163
|
+
#
|
164
|
+
JulianC = [Julian, {
|
165
|
+
'indices' => _Indices12,
|
166
|
+
'note' => 'Roman'
|
167
|
+
}]
|
168
|
+
|
169
|
+
# From Chris Bennett, http://www.tyndalehouse.com/Egypt/ptolemies/chron/roman/chron_rom_intro_fr.htm
|
170
|
+
#
|
171
|
+
# Roman Calendar BCE262-(CE60)-CE480
|
172
|
+
#
|
173
|
+
# _ID_N = '1,2,3,4,5,6,7,8,9,10,11,12'
|
174
|
+
_ID_L = '1,2,2=,3,4,5,6,7,8,9,10,11,12'
|
175
|
+
_ID_J = '1,2,2=,3,4,5,6,7,8,9,10,11,11<,11>,12'
|
176
|
+
_Branch = {
|
177
|
+
1=>When.Resource('_m:Roman::IntercalaryMonth::*')[0],
|
178
|
+
0.5=>When.Resource('_m:Roman::IntercalaryMonth::*')[1],
|
179
|
+
1.5=>When.Resource('_m:Roman::IntercalaryMonth::*')[2]
|
180
|
+
}
|
181
|
+
_IndicesA = [When.Index('Roman::MonthA', {:branch=>_Branch}), _Index0]
|
182
|
+
_IndicesB = [When.Index('Roman::MonthB', {:branch=>_Branch}), _Index0]
|
183
|
+
_Indices = [When.Index('Roman::Month', {:branch=>_Branch}), _Index0]
|
184
|
+
_IndicesD = [When.Index('Roman::MonthD', {:branch=>_Branch}), _Index0]
|
185
|
+
_remarks = When.M17n('Roman::based on Chris Bennett "Roman Dates" (Retrieved 2013-05-13)')
|
186
|
+
_options = {
|
187
|
+
'origin_of_LSC' => 1625698,
|
188
|
+
'origin_of_MSC' => -261,
|
189
|
+
'indices' => _Indices,
|
190
|
+
'rule_table' => {
|
191
|
+
'T' => {'Rule' => %w( A C A B A C A B A C A B
|
192
|
+
A C A B A C A B A C A B A C A B A C A B A C A B A C A B A C A B A A C B A A A A C A A A B A C A A B
|
193
|
+
A A A A A A A A A A C A C A B C A C A B C A C A C A B C A C A C A A B C A B C A B C A B C A C A C A
|
194
|
+
C A C A C A C A C A C A A C A C A C A C A C A C A C A C A C A C A C A C A A C A A C A A C A A C A A
|
195
|
+
C A C A C A C A C A C A C A A C A C A C A C A C A C A C A C A C A C A A C A A C A A C A A B A A C A
|
196
|
+
A A A A J N L N N L N N L N N L N N L N N L N N L N N L N N L N N L N N L N N L N N L N N N N N N N) +
|
197
|
+
%w(N N N L) * 120
|
198
|
+
},
|
199
|
+
'A' => {'Length'=>[29, 28, 31, 29, 31, 29, 31, 29, 29, 31, 29, 29]},
|
200
|
+
'B' => {'Length'=>[29, 23, 27, 31, 29, 31, 29, 31, 29, 29, 31, 29, 29], 'IDs'=>_ID_L},
|
201
|
+
'C' => {'Length'=>[29, 24, 27, 31, 29, 31, 29, 31, 29, 29, 31, 29, 29], 'IDs'=>_ID_L},
|
202
|
+
'J' => {'Length'=>[29, 24, 27, 31, 29, 31, 29, 31, 29, 29, 31, 34, 31, 31, 29], 'IDs'=>_ID_J},
|
203
|
+
'N' => {'Length'=>[31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]},
|
204
|
+
'L' => {'Length'=>[31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]},
|
205
|
+
},
|
206
|
+
'note' => 'Roman'
|
207
|
+
}
|
208
|
+
# @private
|
209
|
+
RomanA = [CyclicTableBased, _options.merge({'remarks'=>_remarks, 'indices' => _IndicesA})]
|
210
|
+
# @private
|
211
|
+
RomanB = [CyclicTableBased, _options.merge({'remarks'=>_remarks, 'indices' => _IndicesB})]
|
212
|
+
# @private
|
213
|
+
RomanC = [CyclicTableBased, _options.merge({'remarks'=>_remarks })]
|
214
|
+
# @private
|
215
|
+
RomanD = [CyclicTableBased, _options.merge({'remarks'=>_remarks, 'indices' => _IndicesD})]
|
216
|
+
# @private
|
217
|
+
Roman = [CyclicTableBased, _options]
|
218
|
+
end
|
219
|
+
|
220
|
+
#
|
221
|
+
# 古代ローマの暦注
|
222
|
+
#
|
223
|
+
class CalendarNote::Roman < CalendarNote
|
224
|
+
|
225
|
+
Notes = [When::BasicTypes::M17n, [
|
226
|
+
"locale:[=en:, ja=ja:, alias]",
|
227
|
+
"names:[Roman]",
|
228
|
+
|
229
|
+
# 年の暦注 ----------------------------
|
230
|
+
[When::BasicTypes::M17n,
|
231
|
+
"names:[year]",
|
232
|
+
|
233
|
+
[When::Coordinates::Residue,
|
234
|
+
"label:[Solar=en:Solar_cycle_(calendar), 太陽章=]", "divisor:28", "year:-8",
|
235
|
+
],
|
236
|
+
|
237
|
+
[When::Coordinates::Residue,
|
238
|
+
"label:[Metonic=en:Metonic_cycle, 太陰章=]", "divisor:19", "year:0",
|
239
|
+
],
|
240
|
+
|
241
|
+
[When::Coordinates::Residue,
|
242
|
+
"label:[Indiction, インディクション]", "divisor:15", "year:-2", "format:[%s=]",
|
243
|
+
[When::Coordinates::Residue, "label:[I= ]", "remainder: 0"],
|
244
|
+
[When::Coordinates::Residue, "label:[II= ]", "remainder: 1"],
|
245
|
+
[When::Coordinates::Residue, "label:[III= ]", "remainder: 2"],
|
246
|
+
[When::Coordinates::Residue, "label:[IV= ]", "remainder: 3"],
|
247
|
+
[When::Coordinates::Residue, "label:[V= ]", "remainder: 4"],
|
248
|
+
[When::Coordinates::Residue, "label:[VI= ]", "remainder: 5"],
|
249
|
+
[When::Coordinates::Residue, "label:[VII= ]", "remainder: 6"],
|
250
|
+
[When::Coordinates::Residue, "label:[VIII=]", "remainder: 7"],
|
251
|
+
[When::Coordinates::Residue, "label:[IX= ]", "remainder: 8"],
|
252
|
+
[When::Coordinates::Residue, "label:[X= ]", "remainder: 9"],
|
253
|
+
[When::Coordinates::Residue, "label:[XI= ]", "remainder: 10"],
|
254
|
+
[When::Coordinates::Residue, "label:[XII= ]", "remainder: 11"],
|
255
|
+
[When::Coordinates::Residue, "label:[XIII=]", "remainder: 12"],
|
256
|
+
[When::Coordinates::Residue, "label:[XIV= ]", "remainder: 13"],
|
257
|
+
[When::Coordinates::Residue, "label:[XV= ]", "remainder: 14"],
|
258
|
+
]
|
259
|
+
],
|
260
|
+
|
261
|
+
# 月の暦注 ----------------------------
|
262
|
+
[When::BasicTypes::M17n,
|
263
|
+
"names:[month]",
|
264
|
+
[When::BasicTypes::M17n,
|
265
|
+
"names:[Month]"
|
266
|
+
]
|
267
|
+
],
|
268
|
+
|
269
|
+
# 日の暦注 ----------------------------
|
270
|
+
[When::BasicTypes::M17n,
|
271
|
+
"names:[day]",
|
272
|
+
|
273
|
+
[When::BasicTypes::M17n,
|
274
|
+
"names:[Nomen]"
|
275
|
+
]
|
276
|
+
]
|
277
|
+
]]
|
278
|
+
|
279
|
+
Order = [
|
280
|
+
'a.d. bis VI',
|
281
|
+
'prid.', 'a.d. III', 'a.d. IV', 'a.d. V', 'a.d. VI', 'a.d. VII', 'a.d. VIII',
|
282
|
+
'a.d. IX', 'a.d. X', 'a.d. XI', 'a.d. XII', 'a.d. XIII', 'a.d. XIV', 'a.d. XV',
|
283
|
+
'a.d. XVI', 'a.d. XVII', 'a.d. XVIII', 'a.d. XIX', 'a.d. XX', 'a.d. XXI', 'a.d. XXII'
|
284
|
+
]
|
285
|
+
|
286
|
+
LongMonths = [3, 5, 7, 10, When.Pair(11,0.5), When.Pair(11,1.5)]
|
287
|
+
LongType = [1, 2..6, 7, 8..14, 15]
|
288
|
+
ShortType = [1, 2..4, 5, 6..12, 13]
|
289
|
+
|
290
|
+
# 暦注 - 日の名前
|
291
|
+
#
|
292
|
+
# @param [When::TM::CalDate] date
|
293
|
+
#
|
294
|
+
# @return [String]
|
295
|
+
#
|
296
|
+
def nomen(date)
|
297
|
+
y, m, d = date.cal_date
|
298
|
+
month_name = _abbr_of_month(date)
|
299
|
+
kal, to_nonae, nonae, to_idus, idus = LongMonths.include?(m) ? LongType : ShortType
|
300
|
+
case d
|
301
|
+
when kal ; return 'Kal. ' + month_name
|
302
|
+
when to_nonae ; return Order[nonae - d] + ' Non. ' + month_name
|
303
|
+
when nonae ; return 'Non. ' + month_name
|
304
|
+
when to_idus ; return Order[idus - d] + ' Id. ' + month_name
|
305
|
+
when idus ; return 'Id. ' + month_name
|
306
|
+
end
|
307
|
+
this_month = date.floor(When::MONTH)
|
308
|
+
next_month = this_month.succ
|
309
|
+
month_name = _abbr_of_month(next_month)
|
310
|
+
rest = next_month.to_i - date.to_i
|
311
|
+
if m == 2 && next_month.to_i - this_month.to_i == 29
|
312
|
+
return Order[0] + ' Kal. ' + month_name if rest == 5
|
313
|
+
rest -= 1 if rest > 5
|
314
|
+
end
|
315
|
+
return Order[rest] + ' Kal. ' + month_name
|
316
|
+
end
|
317
|
+
|
318
|
+
private
|
319
|
+
|
320
|
+
# オブジェクトの正規化
|
321
|
+
def _normalize(args=[], options={})
|
322
|
+
@event = 'nomen'
|
323
|
+
super
|
324
|
+
end
|
325
|
+
|
326
|
+
# 日の省略名
|
327
|
+
def _abbr_of_month(month)
|
328
|
+
name = month.name('month').to_s
|
329
|
+
return name.sub(/ (..).*/, ' \1.') if name.sub!(/Intercalaris(.*)?/, 'Int.\1')
|
330
|
+
name.size <= 3 ? name : name[/\A...[^caeiou]*/] + '.'
|
331
|
+
end
|
332
|
+
end
|
333
|
+
end
|