gedcom 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +74 -0
  3. data/README.txt +129 -0
  4. data/Rakefile +13 -0
  5. data/lib/gedcom.rb +105 -0
  6. data/lib/gedcom/address_record.rb +77 -0
  7. data/lib/gedcom/adoption_record.rb +57 -0
  8. data/lib/gedcom/association_record.rb +79 -0
  9. data/lib/gedcom/cause_record.rb +45 -0
  10. data/lib/gedcom/change_date_record.rb +39 -0
  11. data/lib/gedcom/character_set_record.rb +41 -0
  12. data/lib/gedcom/citation_data_record.rb +49 -0
  13. data/lib/gedcom/citation_event_type_record.rb +42 -0
  14. data/lib/gedcom/corporate_record.rb +36 -0
  15. data/lib/gedcom/date_record.rb +206 -0
  16. data/lib/gedcom/encoded_line_record.rb +34 -0
  17. data/lib/gedcom/event_age_record.rb +36 -0
  18. data/lib/gedcom/event_record.rb +258 -0
  19. data/lib/gedcom/events_list_record.rb +61 -0
  20. data/lib/gedcom/families_individuals.rb +79 -0
  21. data/lib/gedcom/family_record.rb +89 -0
  22. data/lib/gedcom/gedcom_all.rb +41 -0
  23. data/lib/gedcom/gedcom_base.rb +337 -0
  24. data/lib/gedcom/gedcom_record.rb +44 -0
  25. data/lib/gedcom/header_data_record.rb +49 -0
  26. data/lib/gedcom/header_record.rb +75 -0
  27. data/lib/gedcom/header_source_record.rb +42 -0
  28. data/lib/gedcom/individual_attribute_record.rb +86 -0
  29. data/lib/gedcom/individual_record.rb +128 -0
  30. data/lib/gedcom/multimedia_citation_record.rb +55 -0
  31. data/lib/gedcom/multimedia_record.rb +72 -0
  32. data/lib/gedcom/name_record.rb +58 -0
  33. data/lib/gedcom/note_citation_record.rb +37 -0
  34. data/lib/gedcom/note_record.rb +61 -0
  35. data/lib/gedcom/place_record.rb +46 -0
  36. data/lib/gedcom/refn_record.rb +32 -0
  37. data/lib/gedcom/repository_caln.rb +33 -0
  38. data/lib/gedcom/repository_citation_record.rb +43 -0
  39. data/lib/gedcom/repository_record.rb +41 -0
  40. data/lib/gedcom/source_citation_record.rb +74 -0
  41. data/lib/gedcom/source_record.rb +84 -0
  42. data/lib/gedcom/source_scope_record.rb +35 -0
  43. data/lib/gedcom/submission_record.rb +53 -0
  44. data/lib/gedcom/submitter_record.rb +53 -0
  45. data/lib/gedcom/text_record.rb +31 -0
  46. data/lib/gedcom/trailer_record.rb +22 -0
  47. data/lib/gedcom/transmission.rb +103 -0
  48. data/lib/gedcom/transmission_base.rb +267 -0
  49. data/lib/parser/class_tracker.rb +33 -0
  50. data/lib/parser/ged_line.rb +99 -0
  51. data/lib/parser/gedcom_parser.rb +798 -0
  52. data/lib/parser/instruction.rb +14 -0
  53. data/lib/parser/parse_state.rb +49 -0
  54. data/test/test_gedcom.rb +7 -0
  55. data/test_data/Document.RTF +1 -0
  56. data/test_data/Document.tex +1 -0
  57. data/test_data/ImgFile.BMP +0 -0
  58. data/test_data/ImgFile.GIF +0 -0
  59. data/test_data/ImgFile.JPG +0 -0
  60. data/test_data/ImgFile.MAC +0 -0
  61. data/test_data/ImgFile.PCX +0 -0
  62. data/test_data/ImgFile.PIC +0 -0
  63. data/test_data/ImgFile.PNG +0 -0
  64. data/test_data/ImgFile.PSD +0 -0
  65. data/test_data/ImgFile.TGA +0 -0
  66. data/test_data/ImgFile.TIF +0 -0
  67. data/test_data/README.txt +1 -16
  68. data/test_data/TGC551.ged +1 -0
  69. data/test_data/TGC551LF.ged +2162 -0
  70. data/test_data/TGC55C.ged +1 -0
  71. data/test_data/TGC55CLF.ged +2202 -0
  72. data/test_data/force.wav +0 -0
  73. data/test_data/suntun.mov +0 -0
  74. data/test_data/top.mpg +0 -0
  75. metadata +140 -0
@@ -0,0 +1,79 @@
1
+ require 'gedcom_base.rb'
2
+
3
+ #Internal representation of the GEDCOM ASSO record types.
4
+ #
5
+ #A relationship between an Individual_record and one of the other level 0
6
+ #record types, as defined by the TYPE tag. The default being another
7
+ #a relationship with another Individual_record.
8
+ #
9
+ #=ASSOCIATION_STRUCTURE:=
10
+ # n ASSO @<XREF:TYPE>@ {0:M}
11
+ # +1 TYPE <RECORD_TYPE> {1:1}
12
+ # +1 RELA <RELATION_IS_DESCRIPTOR> {1:1}
13
+ # +1 <<NOTE_STRUCTURE>> {0:M}
14
+ # +1 <<SOURCE_CITATION>> {0:M}
15
+ #
16
+ #==RECORD_TYPE:= {Size=3:4}
17
+ # FAM | INDI | NOTE | OBJE | REPO | SOUR | SUBM | SUBN
18
+ #
19
+ # An indicator of the record type being pointed to or used. For example if in an ASSOciation, an
20
+ # INDIvidual record were to be ASSOciated with a FAM record then:
21
+ # 0 INDI
22
+ # 1 ASSO @F1@
23
+ # 2 TYPE FAM /* ASSOCIATION is with a FAM record.
24
+ # 2 RELA Witness at marriage
25
+ #
26
+ #==RELATION_IS_DESCRIPTOR:= {Size=1:25}
27
+ # A word or phrase that states object 1's relation is object 2. For example you would read the following
28
+ # as "Joe Jacob's great grandson is the submitter pointed to by the @XREF:SUBM@":
29
+ # 0 INDI
30
+ # 1 NAME Joe /Jacob/
31
+ # 1 ASSO @<XREF:SUBM>@
32
+ # 2 TYPE SUBM
33
+ # 2 RELA great grandson
34
+ #
35
+ #The attributes are all arrays for the level +1 tags/records.
36
+ #* Those ending in _ref are GEDCOM XREF index keys
37
+ #* Those ending in _record are array of classes of that type.
38
+ #* The remainder are arrays of attributes that could be present in this record.
39
+ class Association_record < GEDCOMBase
40
+ attr_accessor :association_ref, :associated_record_tag, :relationship_description
41
+ attr_accessor :source_citation_record, :note_citation_record
42
+
43
+ ClassTracker << :Association_record
44
+
45
+ #new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.
46
+ def initialize(*a)
47
+ super(*a)
48
+ @this_level = [ [:xref, "ASSO", :association_ref ] ]
49
+ @sub_level = [ #level 1
50
+ [:print, "TYPE", :associated_record_tag ],
51
+ [:print, "RELA", :relationship_description ],
52
+ [:walk, nil, :source_citation_record ],
53
+ [:walk, nil, :note_citation_record ],
54
+ ]
55
+ end
56
+
57
+ protected
58
+
59
+ #validate that the record referenced by the XREF actually exists in this transmission.
60
+ #Genearte a warning if it does not. It does not stop the processing of this line.
61
+ #Association_records default to :individual, but the TYPE field can override this.
62
+ def xref_check(level, tag, index, xref)
63
+ asso_index = case @associated_record_tag
64
+ when nil then index
65
+ when 'FAM' then :family
66
+ when 'INDI' then :individual
67
+ when 'NOTE' then :note
68
+ when 'OBJE' then :multimedia
69
+ when 'REPO' then :repository
70
+ when 'SOUR' then :source
71
+ when 'SUBM' then :submitter
72
+ when 'SUBM' then :submission
73
+ else :individual #which will be the default individual index.
74
+ end
75
+
76
+ super(level, tag, asso_index, xref)
77
+ end
78
+ end
79
+
@@ -0,0 +1,45 @@
1
+ require 'gedcom_base.rb'
2
+
3
+ #Cause_record is part of Event_record, recording the cause of the event. They aren't
4
+ #often seen in GEDCOM files.
5
+ #
6
+ #=EVENT_DETAIL:=
7
+ # ...
8
+ # n CAUS <CAUSE_OF_EVENT> {0:1}
9
+ # ...
10
+ #
11
+ # I have added a Restriction notice, a Source_citation_record, and a NOTE. As long as
12
+ # you don't use these fields, the GEDCOM output will be standard. Restriction notice
13
+ # tags, like NOTE and SOUR tags, should be part of every record type, but they aren't.
14
+ #
15
+ # +1 RESN <RESTRICTION_NOTICE> {0:1}
16
+ # +1 <<SOURCE_CITATION>> {0:M}
17
+ # +1 <<NOTE_STRUCTURE>> {0:M}
18
+ #
19
+ #==CAUSE_OF_EVENT:= {Size=1:90}
20
+ # Used in special cases to record the reasons which precipitated an event. Normally this will be used
21
+ # subordinate to a death event to show cause of death, such as might be listed on a death certificate.
22
+ #
23
+ #
24
+ #The attributes are all arrays for the level +1 tags/records.
25
+ #* Those ending in _ref are GEDCOM XREF index keys
26
+ #* Those ending in _record are array of classes of that type.
27
+ #* The remainder are arrays of attributes that could be present in this record.
28
+ class Cause_record < GEDCOMBase
29
+ attr_accessor :cause, :restriction, :source_citation_record
30
+ attr_accessor :note_citation_record
31
+
32
+ ClassTracker << :Cause_record
33
+
34
+ #new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.
35
+ def initialize(*a)
36
+ super(*a)
37
+ @this_level = [ [:print, "CAUS", :cause] ]
38
+ @sub_level = [ #level + 1
39
+ [:print, "RESN", :restriction],
40
+ [:walk, nil, :source_citation_record],
41
+ [:walk, nil, :note_citation_record],
42
+ ]
43
+ end
44
+
45
+ end
@@ -0,0 +1,39 @@
1
+ require 'gedcom_base.rb'
2
+
3
+
4
+ #Change_date_record is part of many other records, recording the
5
+ #date and time that the parent record was last altered. It also
6
+ #allows for a comment to be added. Probably not that useful, as
7
+ #the standard only allows for one of these in a parent record. It
8
+ #would be more useful to have a history of changes using multiple
9
+ #Change_records. It would also help to have them in more records.
10
+ #
11
+ #=CHANGE_DATE:=
12
+ # n CHAN {1:1}
13
+ # +1 DATE <CHANGE_DATE> {1:1}
14
+ # +2 TIME <TIME_VALUE> {0:1}
15
+ # +1 <<NOTE_STRUCTURE>> {0:M}
16
+ #
17
+ # The change date is intended to only record the last change to a record. Some systems may want to
18
+ # manage the change process with more detail, but it is sufficient for GEDCOM purposes to indicate
19
+ # the last time that a record was modified.
20
+ #
21
+ #The attributes are all arrays for the level +1 tags/records.
22
+ #* Those ending in _ref are GEDCOM XREF index keys
23
+ #* Those ending in _record are array of classes of that type.
24
+ #* The remainder are arrays of attributes that could be present in this record.
25
+ class Change_date_record < GEDCOMBase
26
+ attr_accessor :date_record, :note_citation_record
27
+
28
+ ClassTracker << :Change_date_record
29
+
30
+ #new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.
31
+ def initialize(*a)
32
+ super(*a)
33
+ @this_level = [ [ :nodata, "CHAN", nil] ]
34
+ @sub_level = [ #level + 1
35
+ [:walk, nil, :date_record],
36
+ [:walk, nil, :note_citation_record]
37
+ ]
38
+ end
39
+ end
@@ -0,0 +1,41 @@
1
+ require 'gedcom_base.rb'
2
+
3
+ #Character_set_record is part of the HEAD record, and names the
4
+ #the character set used in this transmission.
5
+ #
6
+ #=HEADER:=
7
+ # 0 HEAD {1:1}
8
+ # ...
9
+ # 1 CHAR <CHARACTER_SET> {1:1}
10
+ # +1 VERS <VERSION_NUMBER> {0:1}
11
+ # ...
12
+ #
13
+ #==CHARACTER_SET:= {Size=1:8}
14
+ # ANSEL | UNICODE | ASCII
15
+ #
16
+ # A code value that represents the character set to be used to interpret this data. The default character
17
+ # set is ANSEL, which includes ASCII as a subset.
18
+ #
19
+ # Note:: The IBMPC character set is not allowed. This character set cannot be interpreted properly
20
+ # without knowing which code page the sender was using.
21
+ #
22
+ #The attributes are all arrays for the level +1 tags/records.
23
+ #* Those ending in _ref are GEDCOM XREF index keys
24
+ #* Those ending in _record are array of classes of that type.
25
+ #* The remainder are arrays of attributes that could be present in this record.
26
+ class Character_set_record < GEDCOMBase
27
+ attr_accessor :char_set_id, :version
28
+ attr_accessor :note_citation_record
29
+
30
+ ClassTracker << :Character_set_record
31
+
32
+ #new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.
33
+ def initialize(*a)
34
+ super(*a)
35
+ @this_level = [ [:print, "CHAR", :char_set_id] ]
36
+ @sub_level = [ #level + 1
37
+ [:print, "VERS", :version],
38
+ [:walk, nil, :note_citation_record]
39
+ ]
40
+ end
41
+ end
@@ -0,0 +1,49 @@
1
+ require 'gedcom_base.rb'
2
+
3
+ #Citation_data_record is DATA record in a Source_citation_record.
4
+ #
5
+ #=SOURCE_CITATION:= (within another record, referencing a SOURCE_RECORD)
6
+ # -1 SOUR @<XREF:SOUR>@ {1:1} (pointer to source record)
7
+ # ...
8
+ # n DATA {0:1}
9
+ # +1 DATE <ENTRY_RECORDING_DATE> {0:1}
10
+ # +1 TEXT <TEXT_FROM_SOURCE> {0:M}
11
+ # +2 [ CONC | CONT ] <TEXT_FROM_SOURCE> {0:M}
12
+ # ...
13
+ #
14
+ #==ENTRY_RECORDING_DATE:=
15
+ # <DATE_VALUE>
16
+ #
17
+ # The date that this event data was entered into the original source document.
18
+ #
19
+ #==TEXT_FROM_SOURCE:= {Size=1:248}
20
+ # <TEXT>
21
+ #
22
+ # A verbatim copy of any description contained within the source. This indicates notes or text that are
23
+ # actually contained in the source document, not the submitter's opinion about the source. This should
24
+ # be, from the evidence point of view, "what the original record keeper said" as opposed to the
25
+ # researcher's interpretation. The word TEXT, in this case, means from the text which appeared in the
26
+ # source record including labels.
27
+ #
28
+ #The attributes are all arrays for the level +1 tags/records.
29
+ #* Those ending in _ref are GEDCOM XREF index keys
30
+ #* Those ending in _record are array of classes of that type.
31
+ #* The remainder are arrays of attributes that could be present in this record.
32
+ class Citation_data_record < GEDCOMBase
33
+ attr_accessor :date_record, :text_record
34
+ attr_accessor :note_citation_record
35
+
36
+ ClassTracker << :Citation_data_record
37
+
38
+ #new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.
39
+ def initialize(*a)
40
+ super(*a)
41
+ @this_level = [ [:print, "DATA", nil ] ]
42
+ @sub_level = [ #level 1
43
+ [:walk, nil, :date_record],
44
+ [:walk, nil, :text_record ],
45
+ [:walk, nil, :note_citation_record ],
46
+ ]
47
+ end
48
+ end
49
+
@@ -0,0 +1,42 @@
1
+ require 'gedcom_base.rb'
2
+
3
+ #Source_citation_record has an EVEN tag. This is not an Event_record, but the event
4
+ #type that the source record records.
5
+ #
6
+ #=SOURCE_CITATION:= (within another record, referencing a SOURCE_RECORD)
7
+ # -1 SOUR @<XREF:SOUR>@ {1:1} (pointer to source record)
8
+ # ...
9
+ # n EVEN <EVENT_TYPE_CITED_FROM> {0:1}
10
+ # +1 ROLE <ROLE_IN_EVENT> {0:1}
11
+ # ...
12
+ #
13
+ #==EVENT_TYPE_CITED_FROM:= {SIZE=1:15}
14
+ # <EVENT_ATTRIBUTE_TYPE>
15
+ #
16
+ # A code that indicates the type of event which was responsible for the source entry being recorded. For
17
+ # example, if the entry was created to record a birth of a child, then the type would be BIRT regardless
18
+ # of the assertions made from that record, such as the mother's name or mother's birth date. This will
19
+ # allow a prioritized best view choice and a determination of the certainty associated with the source
20
+ # used in asserting the cited fact.
21
+ #
22
+ #The attributes are all arrays for the level +1 tags/records.
23
+ #* Those ending in _ref are GEDCOM XREF index keys
24
+ #* Those ending in _record are array of classes of that type.
25
+ #* The remainder are arrays of attributes that could be present in this record.
26
+ class Citation_event_type_record < GEDCOMBase
27
+ attr_accessor :event_type, :role
28
+ attr_accessor :note_citation_record
29
+
30
+ ClassTracker << :Citation_event_type_record
31
+
32
+ #new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.
33
+ def initialize(*a)
34
+ super(*a)
35
+ @this_level = [ [:print, "EVEN", :event_type ] ]
36
+ @sub_level = [ #level 1
37
+ [:print, "ROLE", :role],
38
+ [:walk, nil, :note_citation_record ],
39
+ ]
40
+ end
41
+ end
42
+
@@ -0,0 +1,36 @@
1
+ require 'gedcom_base.rb'
2
+
3
+ #The Corparte_record is part of the HEAD records SOUR record.
4
+ #
5
+ #=HEADER:=
6
+ # 0 HEAD {1:1}
7
+ # 1 SOUR <APPROVED_SYSTEM_ID> {1:1}
8
+ # ...
9
+ # n CORP <NAME_OF_BUSINESS> {0:1}
10
+ # +1 <<ADDRESS_STRUCTURE>> {0:1}
11
+ # +1 PHON <PHONE_NUMBER> {0:3} (defined in the Address structure)
12
+ #
13
+ #==NAME_OF_BUSINESS:= {Size=1:90}
14
+ # Name of the business, corporation, or person that produced or commissioned the product.
15
+ #
16
+ #The attributes are all arrays for the level +1 tags/records.
17
+ #* Those ending in _ref are GEDCOM XREF index keys
18
+ #* Those ending in _record are array of classes of that type.
19
+ #* The remainder are arrays of attributes that could be present in this record.
20
+ class Corporate_record < GEDCOMBase
21
+ attr_accessor :company_name, :phonenumber, :address_record
22
+ attr_accessor :note_citation_record
23
+
24
+ ClassTracker << :Corporate_record
25
+
26
+ #new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.
27
+ def initialize(*a)
28
+ super(*a)
29
+ @this_level = [ [:print, "CORP", :company_name] ]
30
+ @sub_level = [ #level + 1
31
+ [:print, "PHON", :phonenumber],
32
+ [:walk, nil, :address_record],
33
+ [:walk, nil, :note_citation_record],
34
+ ]
35
+ end
36
+ end
@@ -0,0 +1,206 @@
1
+ require 'gedcom_base.rb'
2
+
3
+ #Dates are stored here. In GEDCOM, they have to have the flexibility to hold
4
+ #multiple data formats, both current and historical. Dates can be strings or
5
+ #can have structure. At the moment, this class just stores them as strings,
6
+ #with an optional TIME information.
7
+ #
8
+ #=DATE:= {Size=4:35}
9
+ # [<DATE_CALENDAR_ESCAPE> | <NULL>] <DATE_CALENDAR>
10
+ #
11
+ #==DATE_CALENDAR_ESCAPE:= {Size=4:15}
12
+ # @#DHEBREW@ | @#DROMAN@ | @#DFRENCH R@ | @#DGREGORIAN@ | @#DJULIAN@ | @#DUNKNOWN@
13
+ #
14
+ # The date escape determines the date interpretation by signifying which <DATE_CALENDAR> to use.
15
+ # The default calendar is the Gregorian calendar.
16
+ #
17
+ #==DATE_CALENDAR:= {Size=4:35}
18
+ # <DATE_GREG> | <DATE_JULN> | <DATE_HEBR> | <DATE_FREN> | <DATE_FUTURE>
19
+ #
20
+ # The selection is based on the <DATE_CALENDAR_ESCAPE> that precedes the
21
+ # <DATE_CALENDAR> value immediately to the left. If <DATE_CALENDAR_ESCAPE> doesn't
22
+ # appear at this point, then @#DGREGORIAN@ is assumed. No future calendar types will use words
23
+ # (e.g., month names) from this list: FROM, TO, BEF, AFT, BET, AND, ABT, EST, CAL, or INT.
24
+ # When only a day and month appears as a DATE value it is considered a date phrase and not a valid
25
+ # date form.
26
+ #
27
+ # Date Escape Syntax Selected
28
+ # ----------- -------------
29
+ # @#DGREGORIAN@ <DATE_GREG>
30
+ # @#DJULIAN@ <DATE_JULN>
31
+ # @#DHEBREW@ <DATE_HEBR>
32
+ # @#DFRENCH R@ <DATE_FREN>
33
+ # @#DROMAN@ for future definition
34
+ # @#DUNKNOWN@ calendar not known
35
+ #
36
+ #==DATE_APPROXIMATED:= {Size=4:35}
37
+ # ABT <DATE> | CAL <DATE> | EST <DATE>
38
+ #
39
+ # Where:
40
+ # ABT:: About, meaning the date is not exact.
41
+ # CAL:: Calculated mathematically, for example, from an event date and age.
42
+ # EST:: Estimated based on an algorithm using some other event date.
43
+ #
44
+ #==DATE_EXACT:= {Size=10:11}
45
+ # <DAY> <MONTH> <YEAR_GREG>
46
+ #
47
+ #==DATE_FREN:= {Size=4:35}
48
+ # <YEAR> | <MONTH_FREN> <YEAR> | <DAY> <MONTH_FREN> <YEAR>
49
+ #===MONTH_FREN:= {Size=4}
50
+ # VEND | BRUM | FRIM | NIVO | PLUV | VENT | GERM | FLOR | PRAI | MESS | THER | FRUC | COMP
51
+ # Where:
52
+ # VEND:: VENDEMIAIRE
53
+ # BRUM:: BRUMAIRE
54
+ # FRIM:: FRIMAIRE
55
+ # NIVO:: NIVOSE
56
+ # PLUV:: PLUVIOSE
57
+ # VENT:: VENTOSE
58
+ # GERM:: GERMINAL
59
+ # FLOR:: FLOREAL
60
+ # PRAI:: PRAIRIAL
61
+ # MESS:: MESSIDOR
62
+ # THER:; THERMIDOR
63
+ # FRUC:: FRUCTIDOR
64
+ # COMP:: JOUR_COMPLEMENTAIRS
65
+ #
66
+ #==DATE_GREG:= {Size=4:35}
67
+ # <YEAR_GREG> | <MONTH> <YEAR_GREG> | <DAY> <MONTH> <YEAR_GREG>
68
+ #===YEAR_GREG:= {Size=3:7}
69
+ # [ <NUMBER> | <NUMBER>/<DIGIT><DIGIT> ]
70
+ #
71
+ # The slash "/" <DIGIT><DIGIT> a year modifier which shows the possible date alternatives for pre-
72
+ # 1752 date brought about by a changing the beginning of the year from MAR to JAN in the English
73
+ # calendar change of 1752, for example, 15 APR 1699/00. A (B.C.) appended to the <YEAR> indicates
74
+ # a date before the birth of Christ.
75
+ #
76
+ #
77
+ #==DATE_HEBR:= {Size=4:35}
78
+ # <YEAR> | <MONTH_HEBR> <YEAR> | <DAY> <MONTH_HEBR> <YEAR>
79
+ #===MONTH_HEBR:= {Size=3}
80
+ # TSH | CSH | KSL | TVT | SHV | ADR | ADS | NSN | IYR | SVN | TMZ | AAV | ELL
81
+ # Where:
82
+ # TSH:: Tishri
83
+ # CSH:: Cheshvan
84
+ # KSL:: Kislev
85
+ # TVT:: Tevet
86
+ # SHV:: Shevat
87
+ # ADR:: Adar
88
+ # ADS:: Adar Sheni
89
+ # NSN:: Nisan
90
+ # IYR:: Iyar
91
+ # SVN:: Sivan
92
+ # TMZ:: Tammuz
93
+ # AAV:: Av
94
+ # ELL:: Elul
95
+ #
96
+ #==DATE_JULN:= {Size=4:35}
97
+ # <YEAR> | <MONTH> <YEAR> | <DAY> <MONTH> <YEAR>
98
+ #===MONTH:= {Size=3}
99
+ # JAN | FEB | MAR | APR | MAY | JUN | JUL | AUG | SEP | OCT | NOV | DEC
100
+ # Where:
101
+ # JAN:: January
102
+ # FEB:: February
103
+ # MAR:: March
104
+ # APR:: April
105
+ # MAY:: May
106
+ # JUN:: June
107
+ # JUL:: July
108
+ # AUG:: August
109
+ # SEP:: September
110
+ # OCT:: October
111
+ # NOV:: November
112
+ # DEC:: December
113
+ #
114
+ #==DATE_PERIOD:= {Size=7:35}
115
+ # FROM <DATE> | TO <DATE> | FROM <DATE> TO <DATE>
116
+ #
117
+ # Where:
118
+ # FROM:: Indicates the beginning of a happening or state.
119
+ # TO:: Indicates the ending of a happening or state.
120
+ #
121
+ # Examples:
122
+ # FROM 1904 to 1915
123
+ # The state of some attribute existed from 1904 to 1915 inclusive.
124
+ # FROM 1904
125
+ # The state of the attribute began in 1904 but the end date is unknown.
126
+ # TO 1915
127
+ # The state ended in 1915 but the begin date is unknown.
128
+ #
129
+ #==DATE_PHRASE:= {Size=1:35}
130
+ # (<TEXT>)
131
+ #
132
+ # Any statement offered as a date when the year is not recognizable to a date parser, but which gives
133
+ # information about when an event occurred. The date phrase is enclosed in matching parentheses.
134
+ #
135
+ #==DATE_RANGE:= {Size=8:35}
136
+ # BEF <DATE> | AFT <DATE> | BET <DATE> AND <DATE>
137
+ #
138
+ # Where:
139
+ # AFT:: Event happened after the given date.
140
+ # BEF:: Event happened before the given date.
141
+ # BET:: Event happened some time between date 1 AND date 2. For example, bet 1904 and 1915
142
+ # indicates that the event state (perhaps a single day) existed somewhere between 1904 and
143
+ # 1915 inclusive.
144
+ #
145
+ # The date range differs from the date period in that the date range is an estimate that an event happened
146
+ # on a single date somewhere in the date range specified.
147
+ #
148
+ # The following are equivalent and interchangeable:
149
+ # Short form Long Form
150
+ # ---------— ---------—-
151
+ # 1852 BET 1 JAN 1852 AND 31 DEC 1852
152
+ # 1852 BET 1 JAN 1852 AND DEC 1852
153
+ # 1852 BET JAN 1852 AND 31 DEC 1852
154
+ # 1852 BET JAN 1852 AND DEC 1852
155
+ # JAN 1920 BET 1 JAN 1920 AND 31 JAN 1920
156
+ #
157
+ #==DATE_VALUE:= {Size=1:35}
158
+ # <DATE> | <DATE_PERIOD> | <DATE_RANGE> | <DATE_APPROXIMATED> | INT <DATE> (<DATE_PHRASE>) | (<DATE_PHRASE>)
159
+ #
160
+ # The DATE_VALUE represents the date of an activity, attribute, or event where:
161
+ # INT:: Interpreted from knowledge about the associated date phrase included in parentheses.
162
+ #
163
+ # An acceptable alternative to the date phrase choice is to use one of the other choices such as
164
+ # <DATE_APPROXIMATED> choice as the DATE line value and then include the
165
+ # <DATE_PHRASE> as a NOTE value subordinate to the DATE line.
166
+ #
167
+ # The date value can take on the date form of just a date, an approximated date, between a date and
168
+ # another date, and from one date to another date. The preferred form of showing date imprecision, is
169
+ # to show, for example, MAY 1890 rather than ABT 12 MAY 1890. This is because limits have not
170
+ # been assigned to the precision of the prefixes such as ABT or EST.
171
+ #
172
+ #==DAY:= {Size=1:2}
173
+ # dd
174
+ #
175
+ # Day of the month, where dd is a numeric digit whose value is within the valid range of the days for the
176
+ # associated calendar month.
177
+ #
178
+ #=TIME_VALUE:= {Size=1:12}
179
+ # [ hh:mm:ss.fs ]
180
+ #
181
+ # The time of a specific event, usually a computer-timed event, where:
182
+ # hh:: hours on a 24-hour clock
183
+ # mm:: minutes
184
+ # ss:: seconds (optional)
185
+ # fs:: decimal fraction of a second (optional)
186
+ #
187
+ #The attributes are all arrays for the level +1 tags/records.
188
+ #* Those ending in _ref are GEDCOM XREF index keys
189
+ #* Those ending in _record are array of classes of that type.
190
+ #* The remainder are arrays of attributes that could be present in this record.
191
+ class Date_record < GEDCOMBase
192
+ attr_accessor :date_value, :time_value, :source_citation_record, :note_citation_record
193
+
194
+ ClassTracker << :Date_record
195
+
196
+ #new sets up the state engine arrays @this_level and @sub_level, which drive the to_gedcom method generating GEDCOM output.
197
+ def initialize(*a)
198
+ super(*a)
199
+ @this_level = [ [ :date, "DATE", :date_value ] ]
200
+ @sub_level = [ #level + 1
201
+ [ :time, "TIME", :time_value],
202
+ [ :walk, nil, :source_citation_record],
203
+ [ :walk, nil, :note_citation_record]
204
+ ]
205
+ end
206
+ end