when_exe 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/when_exe.rb +1 -1
- data/lib/when_exe/basictypes.rb +6 -6
- data/lib/when_exe/linkeddata.rb +4 -2
- data/lib/when_exe/locales/locale.rb +28 -7
- data/lib/when_exe/parts/resource.rb +1 -1
- data/lib/when_exe/region/chinese.rb +6 -3
- data/lib/when_exe/region/chinese/epochs.rb +1 -1
- data/lib/when_exe/region/discordian.rb +1 -1
- data/lib/when_exe/region/geologicalage.rb +1 -1
- data/lib/when_exe/region/indian.rb +2 -2
- data/lib/when_exe/region/japanese/notes.rb +1 -1
- data/lib/when_exe/region/japanese/twins.rb +9 -8
- data/lib/when_exe/region/mayan.rb +2 -2
- data/lib/when_exe/region/roman.rb +2 -2
- data/lib/when_exe/region/shire.rb +1 -1
- data/lib/when_exe/region/zoroastrian.rb +1 -1
- data/lib/when_exe/tmposition.rb +1 -1
- data/lib/when_exe/version.rb +1 -1
- data/test/examples/JapanHolidays.ics +2 -2
- data/test/examples/JapanHolidaysRFC6350.ics +3 -3
- data/test/examples/Residue.m17n +2 -2
- data/test/examples/Spatial.m17n +3 -3
- data/test/examples/Terms.m17n +2 -2
- data/test/scripts/8.ext.rb +6 -6
- data/test/scripts/8.rb +6 -6
- data/test/scripts/korea.rb +1 -1
- data/test/test/basictypes.rb +2 -2
- data/test/test/coordinates.rb +47 -47
- data/test/test/inspect.rb +2 -2
- data/test/test/parts.rb +10 -10
- data/test/test/region/m17n.rb +19 -19
- data/test/test/region/mayan.rb +15 -15
- data/test/test/region/residue.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b9bc44ba4bb20ae30d7045497d49f25fd503dfd
|
4
|
+
data.tar.gz: ffe446a7242476d41521a3d6d0476976fa23f3fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbaf55a5f8bc08cfde7cead93da6d72a9436405ced2efe0630c824f0bcb0749a5767385d8e2ff79bad0a83ecb8f1ec127ed864d79456ab8060a924d9371ea64e
|
7
|
+
data.tar.gz: ed61811070132482a71402702c2ea9aeff47cff2f4c6f97c4d213f77add98472a4f622b8a3d52a70fcaaf541af412f440566d799d615a038eeafdeccd9543934
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@ when_exe - A multicultural and multilingualized calendar library
|
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/when_exe.svg)](http://badge.fury.io/rb/when_exe)
|
5
5
|
|
6
|
-
[when_exe](http://rubygems.org/gems/when_exe) is a multicultural and multilingualized calendar library based on [ISO 8601](
|
6
|
+
[when_exe](http://rubygems.org/gems/when_exe) is a multicultural and multilingualized calendar library based on [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601), [ISO 19108](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=26013), [RFC 5545(iCalendar)](http://tools.ietf.org/html/rfc5545) and [RFC6350](http://tools.ietf.org/html/rfc6350). [JSON-LD](http://www.w3.org/TR/json-ld/) formats for TemporalPosition and TemporalReferenceSystem are available.
|
7
7
|
|
8
8
|
[<img alt='Architecture' title='display this figure at actual size' src='https://raw.githubusercontent.com/suchowan/when_exe/f7bb8b51259f0c1653c6c37b3ce20bd2a6ab7914/architecture.png' width='637' height='408'/>](https://raw.githubusercontent.com/suchowan/when_exe/f7bb8b51259f0c1653c6c37b3ce20bd2a6ab7914/architecture.png)
|
9
9
|
|
data/lib/when_exe.rb
CHANGED
@@ -879,7 +879,7 @@ module When
|
|
879
879
|
locale = options.delete(:locale) || 'en'
|
880
880
|
title = EncodingConversion.to_internal_encoding(title)
|
881
881
|
entry, query = title.split('?', 2)
|
882
|
-
url = "
|
882
|
+
url = "https://#{locale}.wikipedia.org/wiki/#{URI.encode(entry).gsub(' ', '_')}"
|
883
883
|
Locale.send(:wikipedia_object, url, options) unless options.empty?
|
884
884
|
url += '?' + query if query
|
885
885
|
object = Parts::Resource._instance(url)
|
data/lib/when_exe/basictypes.rb
CHANGED
@@ -588,14 +588,14 @@ module When
|
|
588
588
|
# prefix: - namespace 引数の指定により URI に展開する
|
589
589
|
#
|
590
590
|
# @example
|
591
|
-
# M17n.new(['3月', 'fr:Mars=
|
592
|
-
# {'en_wikipedia'=>'
|
593
|
-
# 'ja_wikipedia'=>'
|
591
|
+
# M17n.new(['3月', 'fr:Mars=https://fr.wikipedia.org/wiki/Mars_(mois)', 'March'],
|
592
|
+
# {'en_wikipedia'=>'https://en.wikipedia.org/wiki/',
|
593
|
+
# 'ja_wikipedia'=>'https://ja.wikipedia.org/wiki/'},
|
594
594
|
# ['=ja_wikipedia:', '*en=en_wikipedia:']) を行うと、生成された M17n では、
|
595
595
|
# @names = {'' =>'3月', 'fr'=>'Mars', 'en'=>'March'}
|
596
|
-
# @namespace = {'' =>'
|
597
|
-
# 'fr'=>'
|
598
|
-
# 'en'=>'
|
596
|
+
# @namespace = {'' =>'https://ja.wikipedia.org/wiki/3%E6%9C%88',
|
597
|
+
# 'fr'=>'https://fr.wikipedia.org/wiki/Mars_(mois)',
|
598
|
+
# 'en'=>'https://en.wikipedia.org/wiki/March'}
|
599
599
|
# となり、通常の String として振舞う場合は 'March' として振舞う
|
600
600
|
#
|
601
601
|
def initialize(*args)
|
data/lib/when_exe/linkeddata.rb
CHANGED
@@ -15,6 +15,7 @@ module When
|
|
15
15
|
|
16
16
|
Schema = {
|
17
17
|
'reference' => "Locale#reference-instance_method",
|
18
|
+
'dbpedia' => "Locale#dbpedia-instance_method",
|
18
19
|
'label' => "BasicTypes/M17n#label-instance_method",
|
19
20
|
'prev' => "TM/TemporalPosition#prev-instance_method",
|
20
21
|
'succ' => "TM/TemporalPosition#succ-instance_method",
|
@@ -379,7 +380,7 @@ module When
|
|
379
380
|
return source unless context
|
380
381
|
source =~ /\A((.+)([:#\/]))([^:#\/]+)\z/
|
381
382
|
namespace, item = $1.to_s, $4
|
382
|
-
if namespace =~ /^
|
383
|
+
if namespace =~ /^Ahttps?:\/\/([^.]+)\.wikipedia\.org/
|
383
384
|
prefix = "wiki_#{$1}"
|
384
385
|
elsif namespace && namespace.index(When::Parts::Resource.base_uri) == 0
|
385
386
|
label = begin When.Resource(namespace.sub(/::\z/, '')) rescue return source end
|
@@ -420,7 +421,8 @@ module When
|
|
420
421
|
hash = {}
|
421
422
|
hash[RDFS + 'label'] = names.keys.map {|key| key=='' ? names[key] : {'@language'=>key, '@value'=>names[key]}}
|
422
423
|
hash[ts + 'label'] = label
|
423
|
-
hash[ts + 'reference'] = link.values.map {|ref| {'@id'=>ref}}
|
424
|
+
hash[ts + 'reference'] = link.values.uniq.map {|ref| {'@id'=>ref}}
|
425
|
+
hash[ts + 'dbpedia'] = link.values.uniq.map {|ref| Locale._dbpedia(ref)}.compact.map {|uri| {'@id'=>uri}}
|
424
426
|
hash
|
425
427
|
end
|
426
428
|
end
|
@@ -28,7 +28,7 @@ module When
|
|
28
28
|
|
29
29
|
# 省略時 Namespace
|
30
30
|
DefaultNamespaces = Hash.new {|hash, key|
|
31
|
-
hash[key] = "
|
31
|
+
hash[key] = "https://#{key}.wikipedia.org/wiki/"
|
32
32
|
}.update({
|
33
33
|
'mailto' => false,
|
34
34
|
'https' => false,
|
@@ -57,7 +57,7 @@ module When
|
|
57
57
|
|
58
58
|
# Wikipedia の URL の正規表現
|
59
59
|
# @private
|
60
|
-
Ref = /\
|
60
|
+
Ref = /\Ahttps?:\/\/(.+?)\.wikipedia\.org\/wiki\/([^#]+?)\z/
|
61
61
|
|
62
62
|
# Wikipedia の多言語リンクの正規表現
|
63
63
|
# @private
|
@@ -75,7 +75,7 @@ module When
|
|
75
75
|
#
|
76
76
|
# @param [Hash] options 下記の通り
|
77
77
|
# @option options [Hash] :alias Locale の読み替えパターンを Hash で指定する。
|
78
|
-
# @option options [Hash] :
|
78
|
+
# @option options [Hash] :namespace_format 名前空間定義の省略時に名前空間生成に用いる書式
|
79
79
|
# @option options [Hash] :unification 漢字の包摂パターンを Hash で指定する。
|
80
80
|
# @option options [Numeric] :wikipedia_interval Wikipedia の連続的な参照を抑制するための遅延時間/秒
|
81
81
|
#
|
@@ -85,7 +85,7 @@ module When
|
|
85
85
|
#
|
86
86
|
def _setup_(options={})
|
87
87
|
@aliases = options[:alias] || DefaultAlias
|
88
|
-
@namespaces = options[:
|
88
|
+
@namespaces = options[:namespace_format] || DefaultNamespaces
|
89
89
|
@unifications = options[:unification] || DefaultUnification
|
90
90
|
@wikipedia_interval = options[:wikipedia_interval]
|
91
91
|
end
|
@@ -96,7 +96,7 @@ module When
|
|
96
96
|
#
|
97
97
|
def _setup_info
|
98
98
|
{:alias => _alias,
|
99
|
-
:
|
99
|
+
:namespace_format => _namespaces,
|
100
100
|
:unification => _unification,
|
101
101
|
:wikipedia_interval => @wikipedia_interval}
|
102
102
|
end
|
@@ -275,6 +275,17 @@ module When
|
|
275
275
|
return nil
|
276
276
|
end
|
277
277
|
|
278
|
+
# DBpedia IRI の取得
|
279
|
+
#
|
280
|
+
# @param [String] source もとの URI
|
281
|
+
#
|
282
|
+
# @return [String] DBpedia IRI
|
283
|
+
# @private
|
284
|
+
def _dbpedia(source)
|
285
|
+
return nil unless Ref =~ source
|
286
|
+
return "http://#{$1=='en' ? '' : $1+'.'}dbpedia.org/resource/#{URI.decode($2)}"
|
287
|
+
end
|
288
|
+
|
278
289
|
private
|
279
290
|
|
280
291
|
# Locale の読み替えパターン
|
@@ -325,7 +336,7 @@ module When
|
|
325
336
|
contents = nil
|
326
337
|
begin
|
327
338
|
OpenURI
|
328
|
-
source = open(path, 'r'+mode)
|
339
|
+
source = open(path, 'r'+mode, {:ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE})
|
329
340
|
contents = source.read
|
330
341
|
ensure
|
331
342
|
@wikipedia_last_access = Time.now.to_f
|
@@ -343,7 +354,7 @@ module When
|
|
343
354
|
}
|
344
355
|
contents.scan(Link) do |link|
|
345
356
|
word[:names][$2] = $4
|
346
|
-
word[:link ][$2] = "
|
357
|
+
word[:link ][$2] = "https://#{$2}.wikipedia.org/wiki/#{$3}"
|
347
358
|
end
|
348
359
|
object = When::BasicTypes::M17n.new(word)
|
349
360
|
|
@@ -438,6 +449,16 @@ module When
|
|
438
449
|
return Locale._hash_value(@link, loc.sub('_', '-'))
|
439
450
|
end
|
440
451
|
|
452
|
+
# 特定 locale に対応した DBpedia URI の取得
|
453
|
+
#
|
454
|
+
# @param [String] loc locale の指定
|
455
|
+
#
|
456
|
+
# @return [String] loc に対応した DBpedia URI
|
457
|
+
#
|
458
|
+
def dbpedia(loc='')
|
459
|
+
Locale._dbpedia(reference(loc))
|
460
|
+
end
|
461
|
+
|
441
462
|
# 部分文字列
|
442
463
|
#
|
443
464
|
# @param [Range] range String#[] と同様の指定方法で範囲を指定する
|
@@ -260,7 +260,7 @@ module When::Parts
|
|
260
260
|
def _setup_(options={})
|
261
261
|
super()
|
262
262
|
@_prefix = {
|
263
|
-
'_wp' => '
|
263
|
+
'_wp' => 'https://en.wikipedia.org/wiki/',
|
264
264
|
'_w' => base_uri + '/',
|
265
265
|
'_p' => base_uri + 'Parts/',
|
266
266
|
'_b' => base_uri + 'BasicTypes/',
|
@@ -482,7 +482,9 @@ module When
|
|
482
482
|
|
483
483
|
# 暦元天正冬至から当該年の近日点通過までの日数
|
484
484
|
def _perihelion_(year)
|
485
|
-
|
485
|
+
date = _winter_solstice_(year)
|
486
|
+
return date unless @anomalistic_year_shift
|
487
|
+
date + year * @precession + @anomalistic_year_shift
|
486
488
|
end
|
487
489
|
|
488
490
|
# 歳周(当該年の日数)
|
@@ -550,7 +552,7 @@ module When
|
|
550
552
|
end
|
551
553
|
|
552
554
|
# 定朔
|
553
|
-
solar_unit = _year_length(year) / @year_length
|
555
|
+
solar_unit = (_year_length(year) + (@anomalistic_year_shift ? @precession : 0))/ @year_length
|
554
556
|
mean_motion = (@lunar_mean_motion - @solar_weight / solar_unit) * 10000_0000
|
555
557
|
@day_epoch + mean_lunation - send('_anomaly_' + @anomaly_method.downcase, mean_lunation, year, solar_unit, mean_motion)
|
556
558
|
end
|
@@ -649,7 +651,8 @@ module When
|
|
649
651
|
def _initialize_rissei
|
650
652
|
@year_length = @year_length.to_f # 暦元の冬至年 / 日
|
651
653
|
@year_span = (@year_span || 1).to_i # 冬至年の改訂周期 / 年
|
652
|
-
@anomalistic_year_shift =
|
654
|
+
@anomalistic_year_shift = @anomalistic_year_shift.to_f if @anomalistic_year_shift # 暦應(暦元での冬至から近日点通過までの日数)
|
655
|
+
@precession = (@precession || 0.015).to_f # 歳差
|
653
656
|
@lunation_length = @lunation_length.to_f # 朔実(朔望月)
|
654
657
|
@lunation_shift = @lunation_shift.to_f # 閏應(暦元前経朔から暦元天正冬至までの日数)
|
655
658
|
@lunar_mean_motion = @lunar_mean_motion.to_f # 月平行(恒星天に対する月の平均運動 / 日)
|
@@ -744,7 +744,7 @@ module When
|
|
744
744
|
["[至徳=ja:%%<至徳_(唐)>]1" , "@A" , "name=[粛宗=ja:%%<粛宗_(唐)>];756-07-12"], # 甲子
|
745
745
|
["[乾元=ja:%%<乾元_(唐)>]1" , "" , " 758-02-05"], # 丁未
|
746
746
|
["[粛宗#上元=ja:%%<上元_(唐粛宗)>]1", "" , " 760-04=19"], # 己卯
|
747
|
-
["[<粛宗>=
|
747
|
+
["[<粛宗>=https://zh.wikisource.org/wiki/%%<去上元年號大赦文>]1" ,"","name=[粛宗=ja:%%<粛宗_(唐)>];761-09-21", '762*11^Chinese#{C:0761}', ""], # 壬寅
|
748
748
|
["[宝応]1" , "@A" , 'name=[代宗=ja:%%<代宗_(唐)>];762-04-15^Chinese#{A:0523}'], # 甲子 本年から五紀暦を使用
|
749
749
|
["[広徳=ja:%%<広徳_(唐)>]1" , "" , " 763-07-11"], # 壬子
|
750
750
|
["[永泰=ja:%%<永泰_(唐)>]1" , "" , " 765-01-01"], # 癸巳
|
@@ -25,7 +25,7 @@ module When
|
|
25
25
|
class CalendarNote::DiscordianWeek < CalendarNote::Week
|
26
26
|
|
27
27
|
Notes = [When::BasicTypes::M17n, [
|
28
|
-
"namespace:[en=
|
28
|
+
"namespace:[en=https://en.wiktionary.org/wiki/]",
|
29
29
|
"locale:[=en:, ja=ja:]",
|
30
30
|
"names:[Discordian]",
|
31
31
|
|
@@ -19,7 +19,7 @@ class When::TM::OrdinalReferenceSystem
|
|
19
19
|
"begin:-4_600_000_000-"
|
20
20
|
],
|
21
21
|
[When::TM::OrdinalEra,
|
22
|
-
"namespace:[root=
|
22
|
+
"namespace:[root=https://ja.wikipedia.org/wiki/%%<始生代>#]",
|
23
23
|
"*eon:[始生代,Archean]",
|
24
24
|
[When::TM::OrdinalEra,
|
25
25
|
"*era:[原始生代=root:%.<原始生代_(Eoarchean)>,Eoarchean]",
|
@@ -911,7 +911,7 @@ module When
|
|
911
911
|
|
912
912
|
# 月の暦注 ----------------------------
|
913
913
|
[When::BasicTypes::M17n,
|
914
|
-
"names:note for month=, 月の暦注=, *alias:month]",
|
914
|
+
"names:[note for month=, 月の暦注=, *alias:month]",
|
915
915
|
[When::BasicTypes::M17n,
|
916
916
|
"names:[month name=en:Month, 月の名前=ja:%%<月_(暦)>, zh:該月的名稱=, *alias:Month=]"
|
917
917
|
]
|
@@ -1101,7 +1101,7 @@ module When
|
|
1101
1101
|
#
|
1102
1102
|
# @return [When::BasicTypes::M17n] 木星年の名称
|
1103
1103
|
#
|
1104
|
-
# see {
|
1104
|
+
# see {https://en.wikipedia.org/wiki/Samvatsara Samvatsara}
|
1105
1105
|
#
|
1106
1106
|
def samvatsara(dates)
|
1107
1107
|
year_kali = dates.l_date.most_significant_coordinate + dates.l_date.frame.epoch_in_CE + 3101
|
@@ -274,7 +274,7 @@ class When::CalendarNote
|
|
274
274
|
[Note, 0x3FFF, "label:[雑事吉=]", 'position:雑事吉'], #104: 干支 節月
|
275
275
|
[Note, 0x3FFF, "label:[小字注=]", 'position:下段小字 下段小字 下段小字 下段小字'],#105: 干支 節月
|
276
276
|
[Note, 0xC000, "label:[土用の丑]", 'position:雑節'], #106: 土用の丑
|
277
|
-
[Note, 0xC000, "label:[
|
277
|
+
[Note, 0xC000, "label:[陰陽遁始=]", 'position:民間'], #107: 九星の陰遁・陽遁の折り返し日
|
278
278
|
]
|
279
279
|
]]
|
280
280
|
|
@@ -64,7 +64,7 @@ module When
|
|
64
64
|
'lunation_length' => 29.530590, # 朔実(朔望月)
|
65
65
|
'lunar_mean_motion' => 13.36875, # 月平行(恒星天に対する月の平均運動 / 日)
|
66
66
|
'anomalistic_month_length' => 27.5546, # 転終(近点月)
|
67
|
-
'anomaly_method' => '
|
67
|
+
'anomaly_method' => 'a', # (経朔-定朔)の計算方法(a:差分, b:微分, c:幾何学的補正)
|
68
68
|
'anomaly_precision' => 1e-5, # c 方式 での収束判定誤差 / 日
|
69
69
|
'lunar_unit' => 0.1, # 太陰遅速計算用招差法定数の時間の単位(限)
|
70
70
|
'solar_weight' => 1, # (経朔-定朔)の計算で用いる実行差での太陽盈縮の重み(0:非考慮,1:考慮)
|
@@ -72,7 +72,8 @@ module When
|
|
72
72
|
[ 0 ... 72.65342, 0, [-0, -1173_1000, +3_7000, +400]],
|
73
73
|
[ 72.65342...137.773, 137.773, [-0, -1324_0000, +5_2000, +500]],
|
74
74
|
[137.773 ...202.89258, 137.773, [+0, +1324_0000, -5_2000, -500]],
|
75
|
-
[202.89258
|
75
|
+
[202.89258...275.546, 275.546, [+0, +1173_1000, -3_7000, -400]],
|
76
|
+
[275.546 .. 277, 275.546, [-0, -1173_1000, +3_7000, +400]]
|
76
77
|
],
|
77
78
|
's' => [ # 太陽盈縮計算用招差法定数
|
78
79
|
[ 0 ... 89.25392, 0, [0, +436_0000, -2_0000, -34]],
|
@@ -99,7 +100,7 @@ module When
|
|
99
100
|
'day_epoch' => 2336111 + 7.675, # 暦元天正冬至のユリウス日
|
100
101
|
'year_epoch' => 1684, # 暦元の西暦年
|
101
102
|
'year_length' => 365.241696, # 暦元の冬至年 / 日
|
102
|
-
'anomalistic_year_shift' => 6.445, # 暦應(
|
103
|
+
'anomalistic_year_shift' => 6.445, # 暦應(暦元での冬至から近日点通過までの日数)
|
103
104
|
'lunation_shift' => 2.779 - 0.015, # 閏應(暦元前経朔から暦元天正冬至までの日数)
|
104
105
|
'anomalistic_month_shift' => 22.72 - 0.015 # 転應(暦元前近/遠地点通過から暦元天正冬至までの日数)
|
105
106
|
})]
|
@@ -115,7 +116,7 @@ module When
|
|
115
116
|
'day_epoch' => 2336111 + 7.69 , # 暦元天正冬至のユリウス日
|
116
117
|
'year_epoch' => 1684, # 暦元の西暦年
|
117
118
|
'year_length' => 365.241696, # 暦元の冬至年 / 日
|
118
|
-
'anomalistic_year_shift' => 6.445, # 暦應(
|
119
|
+
'anomalistic_year_shift' => 6.445, # 暦應(暦元での冬至から近日点通過までの日数)
|
119
120
|
'lunation_shift' => 2.779, # 閏應(暦元前経朔から暦元天正冬至までの日数)
|
120
121
|
'anomalistic_month_shift' => 22.72 # 転應(暦元前近/遠地点通過から暦元天正冬至までの日数)
|
121
122
|
})]
|
@@ -131,7 +132,7 @@ module When
|
|
131
132
|
'day_epoch' => 2336111 + 7.9038,# 暦元天正冬至のユリウス日
|
132
133
|
'year_epoch' => 1684, # 暦元の西暦年
|
133
134
|
'year_length' => 365.241696, # 暦元の冬至年 / 日
|
134
|
-
'anomalistic_year_shift' => 6.445, # 暦應(
|
135
|
+
'anomalistic_year_shift' => 6.445, # 暦應(暦元での冬至から近日点通過までの日数)
|
135
136
|
'lunation_shift' => 2.779 + 0.2138, # 閏應(暦元前経朔から暦元天正冬至までの日数)
|
136
137
|
'anomalistic_month_shift' => 22.72 + 0.2138 # 転應(暦元前近/遠地点通過から暦元天正冬至までの日数)
|
137
138
|
})]
|
@@ -147,7 +148,7 @@ module When
|
|
147
148
|
'day_epoch' => 2336111 + 7.6223,# 暦元天正冬至のユリウス日
|
148
149
|
'year_epoch' => 1684, # 暦元の西暦年
|
149
150
|
'year_length' => 365.241696, # 暦元の冬至年 / 日
|
150
|
-
'anomalistic_year_shift' => 6.445, # 暦應(
|
151
|
+
'anomalistic_year_shift' => 6.445, # 暦應(暦元での冬至から近日点通過までの日数)
|
151
152
|
'lunation_shift' => 2.779 - 0.0677, # 閏應(暦元前経朔から暦元天正冬至までの日数)
|
152
153
|
'anomalistic_month_shift' => 22.72 - 0.0677 # 転應(暦元前近/遠地点通過から暦元天正冬至までの日数)
|
153
154
|
})]
|
@@ -163,7 +164,7 @@ module When
|
|
163
164
|
'day_epoch' => 2361671 + 14.536, # 暦元天正冬至のユリウス日
|
164
165
|
'year_epoch' => 1754, # 暦元の西暦年
|
165
166
|
'year_length' => 365.241556, # 暦元の冬至年 / 日
|
166
|
-
'anomalistic_year_shift' => 6.455, # 暦應(
|
167
|
+
'anomalistic_year_shift' => 6.455, # 暦應(暦元での冬至から近日点通過までの日数)
|
167
168
|
'lunation_shift' => 25.654, # 閏應(暦元前経朔から暦元天正冬至までの日数)
|
168
169
|
'anomalistic_month_shift' => 18.88, # 転應(暦元前近/遠地点通過から暦元天正冬至までの日数)
|
169
170
|
's' => ChineseSolar.change_unit(365.241556 / 365.241696, _japanese_common['s'])
|
@@ -180,7 +181,7 @@ module When
|
|
180
181
|
'day_epoch' => 2361671 + 14.681, # 暦元天正冬至のユリウス日
|
181
182
|
'year_epoch' => 1754, # 暦元の西暦年
|
182
183
|
'year_length' => 365.241626, # 暦元の冬至年 / 日
|
183
|
-
'anomalistic_year_shift' => 7.42, # 暦應(
|
184
|
+
'anomalistic_year_shift' => 7.42, # 暦應(暦元での冬至から近日点通過までの日数)
|
184
185
|
'lunation_shift' => 25.82, # 閏應(暦元前経朔から暦元天正冬至までの日数)
|
185
186
|
'anomalistic_month_shift' => 19.307, # 転應(暦元前近/遠地点通過から暦元天正冬至までの日数)
|
186
187
|
's' => ChineseSolar.change_unit(365.241626 / 365.241696, _japanese_common['s'])
|
@@ -24,7 +24,7 @@ module When
|
|
24
24
|
|
25
25
|
[Residue,
|
26
26
|
"label:[Haab', ハアブ, Haab]", "divisor:365", 'day:#{Haab:300}', "format:[%2$d%1$s/365=]",
|
27
|
-
"namespace:[glyph=
|
27
|
+
"namespace:[glyph=https://en.wikipedia.org/wiki/File:]",
|
28
28
|
[Residue, "label:[Pop =glyph:Maya-Pop.jpg, ポプ, Pop ]", "remainder: 0"],
|
29
29
|
[Residue, "label:[Wo' =glyph:Maya-Dresden-wo.jpg, ウオ, Wo ]", "remainder: 20"],
|
30
30
|
[Residue, "label:[Sip =glyph:Maya-Dresden-sip.jpg, シプ, Sip ]", "remainder: 40"],
|
@@ -54,7 +54,7 @@ module When
|
|
54
54
|
],
|
55
55
|
|
56
56
|
[Residue,
|
57
|
-
"namespace:[glyph=
|
57
|
+
"namespace:[glyph=https://en.wikipedia.org/wiki/File:MAYA-g-log-cal-]",
|
58
58
|
"label:[Tzolk'in, ツォルキン, Tzolkin]", "divisor:20", 'day:#{Tzolkin:4}', "format:[%s(%d/20)=]",
|
59
59
|
[Residue, "label:[Imix' =glyph:D01-Imix.png, イミシュ, Imix =glyph:D01-Imix-cdxW.png ]", "remainder: 0"],
|
60
60
|
[Residue, "label:[Ik' =glyph:D02-Ik.png, イック, Ik =glyph:D02-Ik-cdxW.png ]", "remainder: 1"],
|
@@ -96,7 +96,7 @@ module When
|
|
96
96
|
|
97
97
|
class TM::CalendarEra
|
98
98
|
|
99
|
-
# From
|
99
|
+
# From https://en.wikipedia.org/wiki/Julian_calendar#Sacrobosco.27s_theory_on_month_lengths
|
100
100
|
Julians = [self, [
|
101
101
|
"locale:[=en:, ja=ja:, zh=zh:, alias]",
|
102
102
|
"period:[Roman=en:Roman_calendar, ローマ暦, 羅馬曆]",
|
@@ -124,7 +124,7 @@ module When
|
|
124
124
|
|
125
125
|
module CalendarTypes
|
126
126
|
|
127
|
-
# From
|
127
|
+
# From https://en.wikipedia.org/wiki/Julian_calendar#Sacrobosco.27s_theory_on_month_lengths
|
128
128
|
_Index0 = When::Coordinates::DefaultDayIndex
|
129
129
|
_IndicesB12 = [When.Index('Roman::MonthB', {:unit=>12}), _Index0]
|
130
130
|
_Indices12 = [When.Index('Roman::Month', {:unit=>12}), _Index0]
|
@@ -9,7 +9,7 @@ module When
|
|
9
9
|
class BasicTypes::M17n
|
10
10
|
|
11
11
|
Shire = [self, [
|
12
|
-
"namespace:[cal=
|
12
|
+
"namespace:[cal=https://en.wikipedia.org/wiki/Middle-earth_calendar#]",
|
13
13
|
"locale:[=en:, ja=ja:, zh=zh:, alias]",
|
14
14
|
"names:[Middle-earth=en:Middle-earth_calendar#Shire_calendar, ホビット庄暦=ja:%%<指輪物語>, 中土曆=zh:%%<魔戒>, *alias:Shire]",
|
15
15
|
|
data/lib/when_exe/tmposition.rb
CHANGED
@@ -1296,7 +1296,7 @@ module When::TM
|
|
1296
1296
|
|
1297
1297
|
# Modified Julian Date
|
1298
1298
|
#
|
1299
|
-
# see {
|
1299
|
+
# see {https://en.wikipedia.org/wiki/Julian_day#Variants MJD}
|
1300
1300
|
JDN_of_MJD = 2400000.5
|
1301
1301
|
|
1302
1302
|
# Countdown to Equinoctial Planetconjunction
|
data/lib/when_exe/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
BEGIN:VCALENDAR
|
2
|
-
# Copyright (C) 2011 Takashi SUGA
|
2
|
+
# Copyright (C) 2011-2015 Takashi SUGA
|
3
3
|
#
|
4
4
|
# You may use and/or modify this file according to the license
|
5
5
|
# described in the LICENSE.txt file included in this archive.
|
@@ -8,7 +8,7 @@ BEGIN:VCALENDAR
|
|
8
8
|
VERSION:2.0
|
9
9
|
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
|
10
10
|
LOCALE:[ja=ja:,*en=en:]
|
11
|
-
NAMESPACE:[ja=
|
11
|
+
NAMESPACE:[ja=https://ja.wikipedia.org/wiki/,en=https://en.wikipedia.org/wiki/]
|
12
12
|
BEGIN:VTIMEZONE
|
13
13
|
TZID:Asia/Tokyo
|
14
14
|
X-LIC-LOCATION:Asia/Tokyo
|
@@ -1,5 +1,5 @@
|
|
1
1
|
BEGIN:VCALENDAR
|
2
|
-
# Copyright (C) 2011-
|
2
|
+
# Copyright (C) 2011-2015 Takashi SUGA
|
3
3
|
#
|
4
4
|
# You may use and/or modify this file according to the license
|
5
5
|
# described in the LICENSE.txt file included in this archive.
|
@@ -7,8 +7,8 @@ BEGIN:VCALENDAR
|
|
7
7
|
|
8
8
|
VERSION:2.0
|
9
9
|
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
|
10
|
-
NAMESPACE;ALTID=1;PREFIX=ja:
|
11
|
-
NAMESPACE;ALTID=1;PREFIX=en:
|
10
|
+
NAMESPACE;ALTID=1;PREFIX=ja:https://ja.wikipedia.org/wiki/
|
11
|
+
NAMESPACE;ALTID=1;PREFIX=en:https://en.wikipedia.org/wiki/
|
12
12
|
BEGIN:VTIMEZONE
|
13
13
|
TZID:Asia/Tokyo
|
14
14
|
X-LIC-LOCATION:Asia/Tokyo
|
data/test/examples/Residue.m17n
CHANGED
@@ -3,8 +3,8 @@ BEGIN:B:M17N
|
|
3
3
|
#
|
4
4
|
# You may use and/or modify this file according to the license
|
5
5
|
# described in the LICENSE.txt file included in this archive.
|
6
|
-
NAMESPACE:[en=
|
7
|
-
ja=
|
6
|
+
NAMESPACE:[en=https://en.wikipedia.org/wiki/,
|
7
|
+
ja=https://ja.wikipedia.org/wiki/]
|
8
8
|
LOCALE:[=en:, ja=ja:, alias]
|
9
9
|
NAMES:[Residue]
|
10
10
|
|
data/test/examples/Spatial.m17n
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
BEGIN:B:M17N
|
2
|
-
# Copyright (C) 2011-
|
2
|
+
# Copyright (C) 2011-2015 Takashi SUGA
|
3
3
|
#
|
4
4
|
# You may use and/or modify this file according to the license
|
5
5
|
# described in the LICENSE.txt file included in this archive.
|
6
|
-
NAMESPACE:[ja=
|
7
|
-
NAMESPACE;ALTID=1;PREFIX=en:
|
6
|
+
NAMESPACE:[ja=https://ja.wikipedia.org/wiki/]
|
7
|
+
NAMESPACE;ALTID=1;PREFIX=en:https://en.wikipedia.org/wiki/
|
8
8
|
LOCALE:[=en:, ja=ja:, alias]
|
9
9
|
NAMES:[Locations]
|
10
10
|
|
data/test/examples/Terms.m17n
CHANGED
@@ -3,8 +3,8 @@ BEGIN:B:M17n
|
|
3
3
|
#
|
4
4
|
# You may use and/or modify this file according to the license
|
5
5
|
# described in the LICENSE.txt file included in this archive.
|
6
|
-
NAMESPACE:[en=
|
7
|
-
ja=
|
6
|
+
NAMESPACE:[en=https://en.wikipedia.org/wiki/,
|
7
|
+
ja=https://ja.wikipedia.org/wiki/]
|
8
8
|
LOCALE:[=en:, ja=ja:, alias]
|
9
9
|
NAMES:[Calendar=]
|
10
10
|
|
data/test/scripts/8.ext.rb
CHANGED
@@ -23,9 +23,9 @@ p gregorian.translate('fr') #=> "Gregorian" (未定義でデフ
|
|
23
23
|
p gregorian/'ja' #=> "グレゴリオ暦"
|
24
24
|
p gregorian/'en' #=> "Gregorian"
|
25
25
|
p gregorian/'fr' #=> "Gregorian" (未定義でデフォルト使用)
|
26
|
-
p gregorian.reference('ja') #=> "
|
27
|
-
p gregorian.reference('en') #=> "
|
28
|
-
p gregorian.reference('fr') #=> "
|
26
|
+
p gregorian.reference('ja') #=> "https://ja.wikipedia.org/wiki/%E3%82%B0%E3%83%AC%E3%82%B4%E3%83%AA%E3%82%AA%E6%9A%A6"
|
27
|
+
p gregorian.reference('en') #=> "https://en.wikipedia.org/wiki/Gregorian_calendar"
|
28
|
+
p gregorian.reference('fr') #=> "https://en.wikipedia.org/wiki/Gregorian_calendar" (未定義でデフォルト使用)
|
29
29
|
p 'Gregorian'.calendar.label.iri #=> "http://hosi.org/When/BasicTypes/M17n/Christian::Gregorian" (同じIRIのオブジェクト)
|
30
30
|
|
31
31
|
# * 一月
|
@@ -37,9 +37,9 @@ p january.translate('fr') #=> "janvier"
|
|
37
37
|
p january/'ja' #=> "1月"
|
38
38
|
p january/'en' #=> "January"
|
39
39
|
p january/'fr' #=> "janvier"
|
40
|
-
p january.reference('ja') #=> "
|
41
|
-
p january.reference('en') #=> "
|
42
|
-
p january.reference('fr') #=> "
|
40
|
+
p january.reference('ja') #=> "https://ja.wikipedia.org/wiki/1%E6%9C%88"
|
41
|
+
p january.reference('en') #=> "https://en.wikipedia.org/wiki/January"
|
42
|
+
p january.reference('fr') #=> "https://en.wikipedia.org/wiki/January" (未定義でデフォルト使用)
|
43
43
|
p '1月'.month_name.iri #=> "http://hosi.org/When/BasicTypes/M17n/Calendar::Month::January" (同じIRIのオブジェクト)
|
44
44
|
p 'Calendar::Month::January'.m17n.iri #=> "http://hosi.org/When/BasicTypes/M17n/Calendar::Month::January" (同じIRIのオブジェクト)
|
45
45
|
|
data/test/scripts/8.rb
CHANGED
@@ -24,9 +24,9 @@ p gregorian.translate('fr') #=> "Gregorian" (未定義でデフ
|
|
24
24
|
p gregorian/'ja' #=> "グレゴリオ暦"
|
25
25
|
p gregorian/'en' #=> "Gregorian"
|
26
26
|
p gregorian/'fr' #=> "Gregorian" (未定義でデフォルト使用)
|
27
|
-
p gregorian.reference('ja') #=> "
|
28
|
-
p gregorian.reference('en') #=> "
|
29
|
-
p gregorian.reference('fr') #=> "
|
27
|
+
p gregorian.reference('ja') #=> "https://ja.wikipedia.org/wiki/%E3%82%B0%E3%83%AC%E3%82%B4%E3%83%AA%E3%82%AA%E6%9A%A6"
|
28
|
+
p gregorian.reference('en') #=> "https://en.wikipedia.org/wiki/Gregorian_calendar"
|
29
|
+
p gregorian.reference('fr') #=> "https://en.wikipedia.org/wiki/Gregorian_calendar" (未定義でデフォルト使用)
|
30
30
|
p Calendar('Gregorian').label.iri #=> "http://hosi.org/When/BasicTypes/M17n/Christian::Gregorian" (同じIRIのオブジェクト)
|
31
31
|
|
32
32
|
# * 一月
|
@@ -38,9 +38,9 @@ p january.translate('fr') #=> "janvier"
|
|
38
38
|
p january/'ja' #=> "1月"
|
39
39
|
p january/'en' #=> "January"
|
40
40
|
p january/'fr' #=> "janvier"
|
41
|
-
p january.reference('ja') #=> "
|
42
|
-
p january.reference('en') #=> "
|
43
|
-
p january.reference('fr') #=> "
|
41
|
+
p january.reference('ja') #=> "https://ja.wikipedia.org/wiki/1%E6%9C%88"
|
42
|
+
p january.reference('en') #=> "https://en.wikipedia.org/wiki/January"
|
43
|
+
p january.reference('fr') #=> "https://en.wikipedia.org/wiki/January" (未定義でデフォルト使用)
|
44
44
|
p MonthName('1月').iri #=> "http://hosi.org/When/BasicTypes/M17n/Calendar::Month::January" (同じIRIのオブジェクト)
|
45
45
|
p M17n('Calendar::Month::January').iri #=> "http://hosi.org/When/BasicTypes/M17n/Calendar::Month::January" (同じIRIのオブジェクト)
|
46
46
|
|
data/test/scripts/korea.rb
CHANGED
@@ -11,7 +11,7 @@ include When
|
|
11
11
|
|
12
12
|
class When::TM::CalendarEra
|
13
13
|
Korea = [self, [
|
14
|
-
'namespace:[en=
|
14
|
+
'namespace:[en=https://en.wikipedia.org/wiki/, ja=https://ja.wikipedia.org/wiki/]',
|
15
15
|
'locale:[=en:, ja=ja:, alias]',
|
16
16
|
'area:[Korea, 朝鮮]',
|
17
17
|
['[秦漢]1.01.01', '@CR', "1-01-01^Chinese_103"],
|
data/test/test/basictypes.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
=begin
|
3
|
-
Copyright (C) 2011-
|
3
|
+
Copyright (C) 2011-2015 Takashi SUGA
|
4
4
|
|
5
5
|
You may use and/or modify this file according to the license
|
6
6
|
described in the LICENSE.txt file included in this archive.
|
@@ -386,7 +386,7 @@ Getsuyou
|
|
386
386
|
Monday
|
387
387
|
]
|
388
388
|
LABEL
|
389
|
-
ISO, jwiki=
|
389
|
+
ISO, jwiki=https://ja.wikipedia.org/wiki/, ewiki=https://en.wikipedia.org/wiki/
|
390
390
|
NS
|
391
391
|
=jwiki:, en=ewiki:
|
392
392
|
LOCALE
|
data/test/test/coordinates.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
=begin
|
3
|
-
Copyright (C) 2011-
|
3
|
+
Copyright (C) 2011-2015 Takashi SUGA
|
4
4
|
|
5
5
|
You may use and/or modify this file according to the license
|
6
6
|
described in the LICENSE.txt file included in this archive.
|
@@ -148,18 +148,18 @@ module MiniTest::Coordinates
|
|
148
148
|
end
|
149
149
|
|
150
150
|
sample =[
|
151
|
-
["明治", "
|
152
|
-
["Meiji", "
|
153
|
-
["M", "
|
154
|
-
["大正", "
|
155
|
-
["Taishō", "
|
156
|
-
["T", "
|
157
|
-
["昭和", "
|
158
|
-
["Shōwa", "
|
159
|
-
["S", "
|
160
|
-
["平成", "
|
161
|
-
["Heisei", "
|
162
|
-
["H", "
|
151
|
+
["明治", "https://ja.wikipedia.org/wiki/%E6%98%8E%E6%B2%BB"],
|
152
|
+
["Meiji", "https://en.wikipedia.org/wiki/Meiji_period"],
|
153
|
+
["M", "https://ja.wikipedia.org/wiki/%E6%98%8E%E6%B2%BB"],
|
154
|
+
["大正", "https://ja.wikipedia.org/wiki/%E5%A4%A7%E6%AD%A3"],
|
155
|
+
["Taishō", "https://en.wikipedia.org/wiki/Taish%C5%8D_period"],
|
156
|
+
["T", "https://ja.wikipedia.org/wiki/%E5%A4%A7%E6%AD%A3"],
|
157
|
+
["昭和", "https://ja.wikipedia.org/wiki/%E6%98%AD%E5%92%8C"],
|
158
|
+
["Shōwa", "https://en.wikipedia.org/wiki/Sh%C5%8Dwa_period"],
|
159
|
+
["S", "https://ja.wikipedia.org/wiki/%E6%98%AD%E5%92%8C"],
|
160
|
+
["平成", "https://ja.wikipedia.org/wiki/%E5%B9%B3%E6%88%90"],
|
161
|
+
["Heisei", "https://en.wikipedia.org/wiki/Heisei_period"],
|
162
|
+
["H", "https://ja.wikipedia.org/wiki/%E5%B9%B3%E6%88%90"]
|
163
163
|
]
|
164
164
|
['明治', '大正', '昭和', '平成'].each do |nengo|
|
165
165
|
era = When::era(nengo)
|
@@ -169,14 +169,14 @@ module MiniTest::Coordinates
|
|
169
169
|
end
|
170
170
|
|
171
171
|
sample =[
|
172
|
-
["明治天皇", "
|
173
|
-
["Emperor_Meiji", "
|
174
|
-
["大正天皇", "
|
175
|
-
["Emperor_Taishō", "
|
176
|
-
["昭和天皇", "
|
177
|
-
["Emperor_Shōwa", "
|
178
|
-
["今上天皇", "
|
179
|
-
["Emperor_Kinjō", "
|
172
|
+
["明治天皇", "https://ja.wikipedia.org/wiki/%E6%98%8E%E6%B2%BB%E5%A4%A9%E7%9A%87"],
|
173
|
+
["Emperor_Meiji", "https://en.wikipedia.org/wiki/Emperor_Meiji"],
|
174
|
+
["大正天皇", "https://ja.wikipedia.org/wiki/%E5%A4%A7%E6%AD%A3%E5%A4%A9%E7%9A%87"],
|
175
|
+
["Emperor_Taishō", "https://en.wikipedia.org/wiki/Emperor_Taish%C5%8D"],
|
176
|
+
["昭和天皇", "https://ja.wikipedia.org/wiki/%E6%98%AD%E5%92%8C%E5%A4%A9%E7%9A%87"],
|
177
|
+
["Emperor_Shōwa", "https://en.wikipedia.org/wiki/Emperor_Sh%C5%8Dwa"],
|
178
|
+
["今上天皇", "https://ja.wikipedia.org/wiki/%E6%98%8E%E4%BB%81"],
|
179
|
+
["Emperor_Kinjō", "https://en.wikipedia.org/wiki/Akihito"]
|
180
180
|
]
|
181
181
|
['明治', '大正', '昭和', '平成'].each do |nengo|
|
182
182
|
name = When.when?(nengo + '06.01.01').query['name']
|
@@ -207,132 +207,132 @@ module MiniTest::Coordinates
|
|
207
207
|
82.5],
|
208
208
|
["Agra",
|
209
209
|
"アーグラ",
|
210
|
-
"
|
210
|
+
"https://en.wikipedia.org/wiki/Agra",
|
211
211
|
27.2,
|
212
212
|
78.0],
|
213
213
|
["Ahmedabad",
|
214
214
|
"アフマダーバード",
|
215
|
-
"
|
215
|
+
"https://en.wikipedia.org/wiki/Ahmedabad",
|
216
216
|
23.0,
|
217
217
|
72.6],
|
218
218
|
["Ajmer",
|
219
219
|
"アジメール",
|
220
|
-
"
|
220
|
+
"https://en.wikipedia.org/wiki/Ajmer",
|
221
221
|
26.5,
|
222
222
|
74.6],
|
223
223
|
["Aligarh",
|
224
224
|
"アリーガル",
|
225
|
-
"
|
225
|
+
"https://en.wikipedia.org/wiki/Aligarh",
|
226
226
|
27.9,
|
227
227
|
78.1],
|
228
228
|
["Amritsar",
|
229
229
|
"アムリトサル",
|
230
|
-
"
|
230
|
+
"https://en.wikipedia.org/wiki/Amritsar",
|
231
231
|
31.6,
|
232
232
|
74.9],
|
233
233
|
["Bangalore",
|
234
234
|
"バンガロール",
|
235
|
-
"
|
235
|
+
"https://en.wikipedia.org/wiki/Bangalore",
|
236
236
|
13.0,
|
237
237
|
77.6],
|
238
238
|
["Bhuvaneswar",
|
239
239
|
"ブヴァネーシュヴァル",
|
240
|
-
"
|
240
|
+
"https://en.wikipedia.org/wiki/Bhuvaneswar",
|
241
241
|
20.2,
|
242
242
|
85.8],
|
243
243
|
["Chennai",
|
244
244
|
"チェンナイ",
|
245
|
-
"
|
245
|
+
"https://en.wikipedia.org/wiki/Chennai",
|
246
246
|
13.1,
|
247
247
|
80.3],
|
248
248
|
["Colombo",
|
249
249
|
"コロンボ",
|
250
|
-
"
|
250
|
+
"https://en.wikipedia.org/wiki/Colombo",
|
251
251
|
6.9,
|
252
252
|
79.9],
|
253
253
|
["Dacca",
|
254
254
|
"ダッカ",
|
255
|
-
"
|
255
|
+
"https://en.wikipedia.org/wiki/Dacca",
|
256
256
|
23.7,
|
257
257
|
90.4],
|
258
258
|
["Delhi",
|
259
259
|
"デリー",
|
260
|
-
"
|
260
|
+
"https://en.wikipedia.org/wiki/Delhi",
|
261
261
|
28.6,
|
262
262
|
77.2],
|
263
263
|
["Hyderabad",
|
264
264
|
"ハイデラバード",
|
265
|
-
"
|
265
|
+
"https://en.wikipedia.org/wiki/Hyderabad",
|
266
266
|
17.4,
|
267
267
|
78.5],
|
268
268
|
["Jaipur",
|
269
269
|
"ジャイプル",
|
270
|
-
"
|
270
|
+
"https://en.wikipedia.org/wiki/Jaipur",
|
271
271
|
26.9,
|
272
272
|
75.8],
|
273
273
|
["Kathmandu",
|
274
274
|
"カトマンズ",
|
275
|
-
"
|
275
|
+
"https://en.wikipedia.org/wiki/Kathmandu",
|
276
276
|
27.7,
|
277
277
|
85.2],
|
278
278
|
["Kochi",
|
279
279
|
"コーチ",
|
280
|
-
"
|
280
|
+
"https://en.wikipedia.org/wiki/Kochi",
|
281
281
|
10.0,
|
282
282
|
76.2],
|
283
283
|
["Kolkata",
|
284
284
|
"コルカタ",
|
285
|
-
"
|
285
|
+
"https://en.wikipedia.org/wiki/Kolkata",
|
286
286
|
22.6,
|
287
287
|
88.4],
|
288
288
|
["Lahor",
|
289
289
|
"ラホール",
|
290
|
-
"
|
290
|
+
"https://en.wikipedia.org/wiki/Lahor",
|
291
291
|
31.6,
|
292
292
|
74.3],
|
293
293
|
["Mathura",
|
294
294
|
"マトゥラー",
|
295
|
-
"
|
295
|
+
"https://en.wikipedia.org/wiki/Mathura",
|
296
296
|
27.5,
|
297
297
|
77.7],
|
298
298
|
["Mumbai",
|
299
299
|
"ムンバイ",
|
300
|
-
"
|
300
|
+
"https://en.wikipedia.org/wiki/Mumbai",
|
301
301
|
19.0,
|
302
302
|
72.8],
|
303
303
|
["Mysore",
|
304
304
|
"マイソール",
|
305
|
-
"
|
305
|
+
"https://en.wikipedia.org/wiki/Mysore",
|
306
306
|
12.3,
|
307
307
|
76.6],
|
308
308
|
["Patna",
|
309
309
|
"パトナ",
|
310
|
-
"
|
310
|
+
"https://en.wikipedia.org/wiki/Patna",
|
311
311
|
25.6,
|
312
312
|
85.1],
|
313
313
|
["Pune",
|
314
314
|
"プネー",
|
315
|
-
"
|
315
|
+
"https://en.wikipedia.org/wiki/Pune",
|
316
316
|
18.5,
|
317
317
|
73.9],
|
318
318
|
["Srinagar",
|
319
319
|
"シュリーナガル",
|
320
|
-
"
|
320
|
+
"https://en.wikipedia.org/wiki/Srinagar",
|
321
321
|
34.1,
|
322
322
|
74.8],
|
323
323
|
["Thiruvananthapuram",
|
324
324
|
"ティルヴァナンタプラム",
|
325
|
-
"
|
325
|
+
"https://en.wikipedia.org/wiki/Thiruvananthapuram",
|
326
326
|
8.5,
|
327
327
|
77.0],
|
328
328
|
["Varanasi",
|
329
329
|
"ワーラーナシー",
|
330
|
-
"
|
330
|
+
"https://en.wikipedia.org/wiki/Varanasi",
|
331
331
|
25.3,
|
332
332
|
83.0],
|
333
333
|
["Ujjain",
|
334
334
|
"ウッジャイン",
|
335
|
-
"
|
335
|
+
"https://en.wikipedia.org/wiki/Ujjain",
|
336
336
|
23.2,
|
337
337
|
75.8]
|
338
338
|
]
|
data/test/test/inspect.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
=begin
|
3
|
-
Copyright (C) 2011-
|
3
|
+
Copyright (C) 2011-2015 Takashi SUGA
|
4
4
|
|
5
5
|
You may use and/or modify this file according to the license
|
6
6
|
described in the LICENSE.txt file included in this archive.
|
@@ -11,7 +11,7 @@ module MiniTest
|
|
11
11
|
class Inspect < MiniTest::TestCase
|
12
12
|
|
13
13
|
def test__strftime_1
|
14
|
-
ns = 'ISO, jwiki=
|
14
|
+
ns = 'ISO, jwiki=https://ja.wikipedia.org/wiki/, ewiki=https://en.wikipedia.org/wiki/'
|
15
15
|
locale = '=jwiki:, en=ewiki:'
|
16
16
|
term1 = When::BasicTypes::M17n.new('[月曜, Monday]', ns, locale)
|
17
17
|
term2 = When::BasicTypes::M17n.new('[です, It is]', ns, locale)
|
data/test/test/parts.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
=begin
|
3
|
-
Copyright (C) 2011-
|
3
|
+
Copyright (C) 2011-2015 Takashi SUGA
|
4
4
|
|
5
5
|
You may use and/or modify this file according to the license
|
6
6
|
described in the LICENSE.txt file included in this archive.
|
@@ -83,7 +83,7 @@ Getsuyou
|
|
83
83
|
Monday
|
84
84
|
]
|
85
85
|
LABEL
|
86
|
-
ISO, jwiki=
|
86
|
+
ISO, jwiki=https://ja.wikipedia.org/wiki/, ewiki=https://en.wikipedia.org/wiki/
|
87
87
|
NS
|
88
88
|
=jwiki:, en=ewiki:
|
89
89
|
LOCALE
|
@@ -98,9 +98,9 @@ LOCALE
|
|
98
98
|
def test__reference
|
99
99
|
assert_equal(nil, Term1.reference('ja_JP'))
|
100
100
|
assert_equal(nil, Term1.reference('en_US'))
|
101
|
-
assert_equal("
|
102
|
-
assert_equal("
|
103
|
-
assert_equal("
|
101
|
+
assert_equal("https://ja.wikipedia.org/wiki/Getsuyou", Term2.reference('ja_JP'))
|
102
|
+
assert_equal("https://en.wikipedia.org/wiki/Monday", Term2.reference('en_US'))
|
103
|
+
assert_equal("https://ja.wikipedia.org/wiki/%E6%9C%88%E6%9B%9C%E6%97%A5", Term3.reference('ja_JP'))
|
104
104
|
end
|
105
105
|
|
106
106
|
def test__labels
|
@@ -111,17 +111,17 @@ LOCALE
|
|
111
111
|
|
112
112
|
def test__link
|
113
113
|
assert_equal({},Term1.link)
|
114
|
-
assert_equal({""=>"
|
115
|
-
"en"=>"
|
116
|
-
assert_equal({"ja"=>"
|
117
|
-
""=>"
|
114
|
+
assert_equal({""=>"https://ja.wikipedia.org/wiki/Getsuyou",
|
115
|
+
"en"=>"https://en.wikipedia.org/wiki/Monday"}, Term2.link)
|
116
|
+
assert_equal({"ja"=>"https://ja.wikipedia.org/wiki/%E6%9C%88%E6%9B%9C%E6%97%A5",
|
117
|
+
""=>"https://en.wikipedia.org/wiki/Monday"}, Term3.link)
|
118
118
|
end
|
119
119
|
|
120
120
|
def test__prefix
|
121
121
|
date = When.when?('0594-09=12^Japanese')
|
122
122
|
assert_equal(["閏九月", String], [date.name('Month').label.to_s, date.name('Month').label.class])
|
123
123
|
assert_equal(["閏九月", String], [date.name('Month').to_s, date.name('Month').to_s.class])
|
124
|
-
assert_equal("
|
124
|
+
assert_equal("https://ja.wikipedia.org/wiki/%E9%96%8F", date.name('Month').reference('ja'))
|
125
125
|
assert_equal("閏九月", date.name('Month').translate('日本語'))
|
126
126
|
assert_equal("閏長月", date.name('Month').translate('alias'))
|
127
127
|
assert_equal("Intercalary Month 9", date.name('Month').translate('en_US'))
|
data/test/test/region/m17n.rb
CHANGED
@@ -12,24 +12,24 @@ module MiniTest
|
|
12
12
|
|
13
13
|
First = [
|
14
14
|
["Calendar", "Calendar", nil],
|
15
|
-
["Month", "月の名前", "
|
16
|
-
["Month", "月の名前", "
|
17
|
-
["January", "1月", "
|
15
|
+
["Month", "月の名前", "https://ja.wikipedia.org/wiki/%E6%9C%88_(%E6%9A%A6)"],
|
16
|
+
["Month", "月の名前", "https://ja.wikipedia.org/wiki/%E6%9C%88_(%E6%9A%A6)"],
|
17
|
+
["January", "1月", "https://ja.wikipedia.org/wiki/1%E6%9C%88"]
|
18
18
|
]
|
19
19
|
|
20
20
|
Second = [
|
21
|
-
["January", "1月", "
|
22
|
-
["February", "2月", "
|
23
|
-
["March", "3月", "
|
24
|
-
["April", "4月", "
|
25
|
-
["May", "5月", "
|
26
|
-
["June", "6月", "
|
27
|
-
["July", "7月", "
|
28
|
-
["August", "8月", "
|
29
|
-
["September", "9月", "
|
30
|
-
["October", "10月", "
|
31
|
-
["November", "11月", "
|
32
|
-
["December", "12月", "
|
21
|
+
["January", "1月", "https://ja.wikipedia.org/wiki/1%E6%9C%88" ],
|
22
|
+
["February", "2月", "https://ja.wikipedia.org/wiki/2%E6%9C%88" ],
|
23
|
+
["March", "3月", "https://ja.wikipedia.org/wiki/3%E6%9C%88" ],
|
24
|
+
["April", "4月", "https://ja.wikipedia.org/wiki/4%E6%9C%88" ],
|
25
|
+
["May", "5月", "https://ja.wikipedia.org/wiki/5%E6%9C%88" ],
|
26
|
+
["June", "6月", "https://ja.wikipedia.org/wiki/6%E6%9C%88" ],
|
27
|
+
["July", "7月", "https://ja.wikipedia.org/wiki/7%E6%9C%88" ],
|
28
|
+
["August", "8月", "https://ja.wikipedia.org/wiki/8%E6%9C%88" ],
|
29
|
+
["September", "9月", "https://ja.wikipedia.org/wiki/9%E6%9C%88" ],
|
30
|
+
["October", "10月", "https://ja.wikipedia.org/wiki/10%E6%9C%88"],
|
31
|
+
["November", "11月", "https://ja.wikipedia.org/wiki/11%E6%9C%88"],
|
32
|
+
["December", "12月", "https://ja.wikipedia.org/wiki/12%E6%9C%88"]
|
33
33
|
]
|
34
34
|
|
35
35
|
def test__m17n_1
|
@@ -59,12 +59,12 @@ module MiniTest
|
|
59
59
|
|
60
60
|
def test__m17n_2
|
61
61
|
march = When.m17n(['en:March=en_ns:', 'ja:3月=ja_ns:'],
|
62
|
-
{'en_ns'=>'
|
63
|
-
'ja_ns'=>'
|
62
|
+
{'en_ns'=>'https://en.wikipedia.org/wiki/',
|
63
|
+
'ja_ns'=>'https://ja.wikipedia.org/wiki/'})
|
64
64
|
|
65
65
|
[
|
66
|
-
['ja', ["3月", "3月", "
|
67
|
-
['en', ["March", "March", "
|
66
|
+
['ja', ["3月", "3月", "https://ja.wikipedia.org/wiki/3%E6%9C%88"]],
|
67
|
+
['en', ["March", "March", "https://en.wikipedia.org/wiki/March" ]]
|
68
68
|
].each do |sample|
|
69
69
|
assert_equal(sample[1], [march.translate(sample[0]), march.translate(sample[0]), march.reference(sample[0])])
|
70
70
|
end
|
data/test/test/region/mayan.rb
CHANGED
@@ -48,10 +48,10 @@ module MiniTest
|
|
48
48
|
# No offset
|
49
49
|
haab = When.Resource("_co:Mayan::Haab'")
|
50
50
|
assert_equal("ハアブ", haab.label.translate('ja'))
|
51
|
-
assert_equal("
|
51
|
+
assert_equal("https://en.wikipedia.org/wiki/Haab'", haab.label.reference)
|
52
52
|
pop = When.Resource("_co:Mayan::Haab'::Pop")
|
53
53
|
assert_equal("Pop", pop.label.translate('en'))
|
54
|
-
assert_equal("
|
54
|
+
assert_equal("https://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
|
55
55
|
date0 = When.when?('2011-05-16T12:34:56Z')
|
56
56
|
sample = [
|
57
57
|
"2012-04-12T12:34:56Z",
|
@@ -68,10 +68,10 @@ module MiniTest
|
|
68
68
|
# offset 0B
|
69
69
|
haab = When.Resource("_co:Mayan?Epoch=0D::Haab'")
|
70
70
|
assert_equal("ハアブ", haab.label.translate('ja'))
|
71
|
-
assert_equal("
|
71
|
+
assert_equal("https://en.wikipedia.org/wiki/Haab'", haab.label.reference)
|
72
72
|
pop = When.Resource("_co:Mayan?Epoch=0D::Haab'::Pop")
|
73
73
|
assert_equal("Pop", pop.label.translate('en'))
|
74
|
-
assert_equal("
|
74
|
+
assert_equal("https://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
|
75
75
|
date0 = When.when?('2011-05-16T12:34:56Z')
|
76
76
|
sample = [
|
77
77
|
"2012-04-12T12:34:56Z",
|
@@ -88,10 +88,10 @@ module MiniTest
|
|
88
88
|
# offset 2B
|
89
89
|
haab = When.Resource("_co:Mayan?Epoch=2D::Haab'")
|
90
90
|
assert_equal("ハアブ", haab.label.translate('ja'))
|
91
|
-
assert_equal("
|
91
|
+
assert_equal("https://en.wikipedia.org/wiki/Haab'", haab.label.reference)
|
92
92
|
pop = When.Resource("_co:Mayan?Epoch=2D::Haab'::Pop")
|
93
93
|
assert_equal("Pop", pop.label.translate('en'))
|
94
|
-
assert_equal("
|
94
|
+
assert_equal("https://en.wikipedia.org/wiki/File:Maya-Pop.jpg", pop.label.reference)
|
95
95
|
date0 = When.when?('2011-05-16T12:34:56Z')
|
96
96
|
sample = [
|
97
97
|
"2012-04-14T12:34:56Z",
|
@@ -110,16 +110,16 @@ module MiniTest
|
|
110
110
|
# No offset
|
111
111
|
trecena = When.Resource("_co:Mayan::Trecena::Trecena")
|
112
112
|
assert_equal("トレセナ", trecena.label.translate('ja'))
|
113
|
-
assert_equal("
|
113
|
+
assert_equal("https://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
|
114
114
|
assert_equal(2, When.when?('2011-05-15') % trecena)
|
115
115
|
|
116
116
|
|
117
117
|
tzolkin = When.Resource("_co:Mayan::Tzolk'in")
|
118
118
|
assert_equal("ツォルキン", tzolkin.label.translate('ja'))
|
119
|
-
assert_equal("
|
119
|
+
assert_equal("https://en.wikipedia.org/wiki/Tzolk'in", tzolkin.label.reference)
|
120
120
|
ajaw = When.Resource("_co:Mayan::Tzolk'in::Ajaw")
|
121
121
|
assert_equal("Ajaw", ajaw.label.translate('en'))
|
122
|
-
assert_equal("
|
122
|
+
assert_equal("https://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
|
123
123
|
date0 = When.when?('2011-05-16T12:34:56Z')
|
124
124
|
sample = [
|
125
125
|
"2011-05-21T12:34:56Z",
|
@@ -138,16 +138,16 @@ module MiniTest
|
|
138
138
|
# offset 0B
|
139
139
|
trecena = When.Resource("_co:Mayan?Epoch=0D::Trecena::Trecena")
|
140
140
|
assert_equal("トレセナ", trecena.label.translate('ja'))
|
141
|
-
assert_equal("
|
141
|
+
assert_equal("https://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
|
142
142
|
assert_equal(2, When.when?('2011-05-15') % trecena)
|
143
143
|
|
144
144
|
|
145
145
|
tzolkin = When.Resource("_co:Mayan?Epoch=0D::Tzolk'in")
|
146
146
|
assert_equal("ツォルキン", tzolkin.label.translate('ja'))
|
147
|
-
assert_equal("
|
147
|
+
assert_equal("https://en.wikipedia.org/wiki/Tzolk'in", tzolkin.label.reference)
|
148
148
|
ajaw = When.Resource("_co:Mayan?Epoch=0D::Tzolk'in::Ajaw")
|
149
149
|
assert_equal("Ajaw", ajaw.label.translate('en'))
|
150
|
-
assert_equal("
|
150
|
+
assert_equal("https://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
|
151
151
|
date0 = When.when?('2011-05-16T12:34:56Z')
|
152
152
|
sample = [
|
153
153
|
"2011-05-21T12:34:56Z",
|
@@ -166,16 +166,16 @@ module MiniTest
|
|
166
166
|
# offset 2B
|
167
167
|
trecena = When.Resource("_co:Mayan?Epoch=2D::Trecena::Trecena")
|
168
168
|
assert_equal("トレセナ", trecena.label.translate('ja'))
|
169
|
-
assert_equal("
|
169
|
+
assert_equal("https://en.wikipedia.org/wiki/Trecena", trecena.label.reference)
|
170
170
|
assert_equal(2, When.when?('2011-05-17') % trecena)
|
171
171
|
|
172
172
|
|
173
173
|
tzolkin = When.Resource("_co:Mayan?Epoch=2D::Tzolk'in")
|
174
174
|
assert_equal("ツォルキン", tzolkin.label.translate('ja'))
|
175
|
-
assert_equal("
|
175
|
+
assert_equal("https://en.wikipedia.org/wiki/Tzolk'in", tzolkin.label.reference)
|
176
176
|
ajaw = When.Resource("_co:Mayan?Epoch=2D::Tzolk'in::Ajaw")
|
177
177
|
assert_equal("Ajaw", ajaw.label.translate('en'))
|
178
|
-
assert_equal("
|
178
|
+
assert_equal("https://en.wikipedia.org/wiki/File:MAYA-g-log-cal-D20-Ajaw-cdxW.png", ajaw.label.reference('alias'))
|
179
179
|
date0 = When.when?('2011-05-16T12:34:56Z')
|
180
180
|
sample = [
|
181
181
|
"2011-05-23T12:34:56Z",
|
data/test/test/region/residue.rb
CHANGED
@@ -41,13 +41,13 @@ module MiniTest
|
|
41
41
|
assert_equal("日曜日", When.Resource(iri + '::Week::Sunday::Sunday').translate('ja'))
|
42
42
|
|
43
43
|
sample = [
|
44
|
-
["Monday", "月曜日", "
|
45
|
-
["Tuesday", "火曜日", "
|
46
|
-
["Wednesday", "水曜日", "
|
47
|
-
["Thursday", "木曜日", "
|
48
|
-
["Friday", "金曜日", "
|
49
|
-
["Saturday", "土曜日", "
|
50
|
-
["Sunday", "日曜日", "
|
44
|
+
["Monday", "月曜日", "https://en.wikipedia.org/wiki/Monday"],
|
45
|
+
["Tuesday", "火曜日", "https://en.wikipedia.org/wiki/Tuesday"],
|
46
|
+
["Wednesday", "水曜日", "https://en.wikipedia.org/wiki/Wednesday"],
|
47
|
+
["Thursday", "木曜日", "https://en.wikipedia.org/wiki/Thursday"],
|
48
|
+
["Friday", "金曜日", "https://en.wikipedia.org/wiki/Friday"],
|
49
|
+
["Saturday", "土曜日", "https://en.wikipedia.org/wiki/Saturday"],
|
50
|
+
["Sunday", "日曜日", "https://en.wikipedia.org/wiki/Sunday"]
|
51
51
|
]
|
52
52
|
assert_equal(7, When::Parts::Resource[iri + '::Week'].child.size)
|
53
53
|
When::Parts::Resource[iri + '::Week'].child.each do |obj|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: when_exe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi SUGA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A multicultural and multilingualized calendar library based on ISO 8601,
|
14
14
|
ISO 19108, RFC 5545(iCalendar) and RFC6350. JSON-LD formats for TemporalPosition
|