gedcom 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,33 @@
1
+ #ClassTracker keeps track of the existence of our gedcom classes.
2
+ #If they don't exist yet, the parser will need to dynamically create them.
3
+ #
4
+ #This started as an experiment to automate the generation of the Gedcom classes, but they now all exist
5
+ #and none should ever end up being created dynamically. I need to deprecate this class at some point.
6
+
7
+
8
+ class ClassTracker
9
+ #Create a hash of known class definitions, we would not have to do this when I figure out how to tell if a class definition exists.
10
+ @@classes = { }
11
+
12
+ #Returns true if the named class is in @@classes.
13
+ def self.exists?(class_name)
14
+ @@classes[class_name.to_sym] == true
15
+ end
16
+
17
+ #Adds a class to the @@classes hash using the << operator.
18
+ def self.<<(class_name)
19
+ @@classes[class_name.to_sym] = true
20
+ end
21
+
22
+ #return the state of each of the classes recorded in the @@classes hash, as a string.
23
+ def self.to_s
24
+ s = '{'
25
+ @@classes.each { |k,v| s += "\n\t#{k.to_s}=>#{v.to_s},"}
26
+ s[-1] = '' if s[-1,1] == ','[0,1]
27
+ s << "\n}"
28
+ end
29
+
30
+ end
31
+
32
+ #ClassTracker << :kkk
33
+ #print ClassTracker
@@ -0,0 +1,99 @@
1
+ #GedLine takes a GEDCOM line tokenised into a word array returning an object
2
+ #with the:
3
+ # * level number in @level
4
+ # * the GEDCOM tag in @tag
5
+ # * the data portion in @data
6
+ # * the XREF value, if this line has one, in @XREF
7
+ # * the @user set to true if this is a user defined TAG (e.g. starts with '_')
8
+
9
+ class GedLine
10
+ attr_accessor :xref, :tag, :data, :level, :user
11
+
12
+ #GedLine.new(*data) takes a GEDCOM line as word array and does all the work to categorize the tokens.
13
+ def initialize(*data)
14
+ case
15
+ when data.length < 2
16
+ raise "line too short (#{data.length})"
17
+ when data[0] == nil
18
+ raise "level is nil"
19
+ when data[1] == nil
20
+ raise "No Tag or Xref after the level"
21
+ #need to add a test to ensure level is a number!
22
+ end
23
+
24
+ @level = data[0].to_i
25
+
26
+ if @level == 0 #At the top level, where the xrefs and tags are reversed.
27
+ if data[1][0..0] == '@' #Then we have an xref line
28
+ @xref = data[1].gsub(/\A@|@\Z/, '')
29
+ @tag = data[2]
30
+ @data = data.length == 3 ? nil : data[3..-1] #note lines can have data here. Others will not.
31
+ if @xref.length > 22
32
+ raise "Xref too long (Max = 22, length = #{@xref.length}) "
33
+ end
34
+ elsif data.length != 2 #This is a Head or Trailer line, so should be two tokens long.
35
+ raise "Level 0 line has too many tokens"
36
+ else
37
+ @xref = nil
38
+ @data = nil
39
+ @tag = data[1]
40
+ end
41
+ else
42
+ @tag = data[1]
43
+ if data.length == 2
44
+ @xref = nil
45
+ @data = nil
46
+ elsif data[2][0..0] == '@' #Then we have an xref line
47
+ if data.length != 3 #These will always have 3 tokens.
48
+ raise "Level #{@level} #{@tag} Xref Line has too many tokens"
49
+ end
50
+ @xref = data[2].gsub(/\A@|@\Z/, '')
51
+ @data = nil
52
+ if @xref.length > 22
53
+ raise "Xref too long (Max = 22, length = #{@xref.length}) "
54
+ end
55
+ else
56
+ @xref = nil
57
+ @data = data[2..-1]
58
+ end
59
+ end
60
+ @user = nil
61
+ end
62
+
63
+ #Test for this being a user Tag.
64
+ def user_tag?
65
+ @user == true
66
+ end
67
+
68
+ #Returns the hash key for this GEDCOM LINE to lookup the action in the GedcomParser::TAG has.
69
+ def index
70
+ user_tag? ? [ "NOTE", :user ] : ( @xref ? [@tag, :xref] : [@tag, nil] )
71
+ end
72
+
73
+
74
+ #creates as NOTE from a user defined tag.
75
+ #sets the @user field to true.
76
+ def user_tag
77
+ if @xref != nil
78
+ if @data == nil
79
+ @data = [ '@' + @xref + '@' ]
80
+ else
81
+ @data[0,0] = '@' + @xref + '@'
82
+ end
83
+ @xref = nil if @level != 0 #Retain for the NOTES xref if this is a level 0 user tag.
84
+ end
85
+ if @data == nil
86
+ @data = [ @tag ]
87
+ else
88
+ @data[0,0] = @tag
89
+ end
90
+ @data[0,0] = @level.to_s
91
+ @user = true
92
+ @tag = "NOTE"
93
+ end
94
+
95
+ #Returns a String with the @level, @xref, @tag and @data values.
96
+ def to_s
97
+ "Level #{@level}, Xref = @#{@xref}@, Tag = #{@tag}, Data = '#{@data ? @data.inject('') do |x,y| x + ' ' + y end : nil}'"
98
+ end
99
+ end
@@ -0,0 +1,798 @@
1
+ require 'parse_state.rb'
2
+ require 'ged_line.rb'
3
+ require 'transmission.rb'
4
+
5
+ #Class GedcomParser is a GEDCOM 5.5 Parser
6
+ #
7
+ #The GEDCOM 5.5 grammer is defined in the TAGS hash.
8
+ # * Each TAGS hash members key represents a name of a GEDCOM record definition in the standard.
9
+ # The standard doesn't name all sub-levels of a record, but for our definitions we have had to.
10
+ # e.g. In the standard:
11
+ # HEADER:=
12
+ # n HEAD {1:1}
13
+ # +1 SOUR <APPROVED_SYSTEM_ID> {1:1}
14
+ # ...
15
+ # becomes a :header key and a :header_source key in the TAGS hash.
16
+ #
17
+ # * Each value is another hash, whose key is a two member array: [<GEDCOM_TAG>, <context>]
18
+ # Valid Contexts:
19
+ # [:xref] indicates that the GEDCOM TAG with a reference value, so should have an @XREF@ value following it
20
+ # Nb. With level 0 GEDCOM records, the @XREF@ will proceed the GEDCOM TAG.
21
+ # [nil] indicates this is a standard GEDCOM tag, possibly with a data value following it.
22
+ # [:user] indicates that this is a user defined tag, not one from the standard.
23
+ # e.g.
24
+ # ["NOTE", :xref] is a NOTE tag with a reference to a note, or at Level 0 the :xref is the key for other records to refer to.
25
+ # ["NOTE", nil] is an inline NOTE, with the note being the value on the GEDCOM line
26
+ # ["NOTE", :user] is a NOTE record where the standard didn't allow for one (i.e. user defined)
27
+ # Each value of this hash being an array telling the parse what it must do when it meets the GEDCOM_TAG in the context.
28
+ # This array array has the following fields
29
+ # 0. CHILD_RECORD This is the key to the child level tag description lines.
30
+ # 1. MIN_OCCURANCES What is the minimum number of times we should see this field. Usually 0 or 1
31
+ # 2. MAX_OCCURANCES How many times can this tag appear at this level. Nil means any number of times
32
+ # 3. DATA_TYPE What is the type of the data in the data field. Nil means we expect no data.
33
+ # 4. DATA_SIZE How big can this field be
34
+ # 5. ACTION The action(s) the parser should take to instatiate a class and/or store the value portion of the GEDCOM line.
35
+ # The Action tags are processed in order. A class tag changes the target class of field, key and xref tags.
36
+ # - [:class, :class_name] inidicates this line, and any further data, will be stored in the class :class_name
37
+ # - [:pop] indicates that data will now be stored in the previous class.
38
+ # - [:field, :fieldname] indicates that the data part of the line will be stored in the field :field_name
39
+ # - [:field, [:fieldname, value]] fieldname stores the given value.
40
+ # - [:append, :fieldname] indicates that the data part of the line will be appended to this field
41
+ # - [:append_nl, :fieldname] indicates that the data part of the line will be appended to this field, after first appending a nl
42
+ # - [:xref, [:field, :record_type]] indicates that the xref value of the line will get stored in the named field and points to the record_type.
43
+ # - [:key, :index_name] means we need to create an index entry, in the index index_name, for this items xref value.
44
+ # - nil in this field indicates that we should ignore this TAG and its children.
45
+ # 6. DATA_DESCRIPTION Comment to indicate purpose of the gedcom TAG at this level.
46
+
47
+ class GedcomParser
48
+
49
+ attr_reader :transmission
50
+
51
+ CHILD_RECORD = 0 #This is the key to the child level tag description lines.
52
+ MIN_OCCURANCES = 1 #What is the minimum number of times we should see this field. Usually 0 or 1
53
+ MAX_OCCURANCES = 2 #How many times can this tag appear at this level. Nil means any number of times
54
+ DATA_TYPE = 3 #What is the type of the data in the data field. Nil means we expect no data.
55
+ DATA_SIZE = 4 #How big can this field be
56
+ ACTION = 5 #The action(s) the parser should take to instatiate a class and/or store the value portion of the GEDCOM line.
57
+ DATA_DESCRIPTION = 6 #Comment to indicate purpose of the gedcom TAG at this level.
58
+
59
+ TAGS = {
60
+ :transmission =>
61
+ {
62
+ ["HEAD", nil] => [:header, 1, 1, nil, 0, [ [:class, :header_record] ], "File Header"],
63
+ ["SUBM", :xref] => [:submitter_record, 0, 1, nil, 0, [ [:class, :submitter_record], [:xref, [:submitter_ref, :submitter]], [:key, :submitter] ], "File's Submitter Record"],
64
+ ["FAM", :xref] => [:family_record, 0, nil, nil, 0, [ [:class, :family_record], [:xref, [:family_ref, :family]], [:key, :family] ], "Family Record" ],
65
+ ["INDI", :xref] => [:individual_record, 0, nil, nil, 0, [ [:class, :individual_record], [:xref, [:individual_ref, :individual]], [:key, :individual] ], "Individual Record" ],
66
+ ["SOUR", :xref] => [:source_record, 0, nil, nil, 0, [ [:class, :source_record], [:xref, [:source_ref, :source]], [:key, :source] ], "Source Record" ],
67
+ ["OBJE", :xref] => [:multimedia_record, 0, nil, nil, 0, [ [:class, :multimedia_record], [:xref, [:multimedia_ref, :multimedia]], [:key, :multimedia] ], "Multimedia Object" ],
68
+ ["NOTE", :xref] => [:note_record, 0, nil, :string, 248, [ [:class, :note_record], [:xref, [:note_ref, :note]], [:key, :note], [:field, :note] ], "Note Record" ],
69
+ ["REPO", :xref] => [:repository_record, 0, nil, nil, 0, [ [:class, :repository_record], [:xref, [:repository_ref, :repository]], [:key, :repository] ], "Repository Record" ],
70
+ ["SUBN", :xref] => [:submission_record, 0, nil, nil, 0, [ [:class, :submission_record], [:xref, [:submission_ref, :submission]], [:key, :submission] ], "Submission Record" ],
71
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_record], [:xref, [:note_ref, :note]], [:key, :note], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
72
+ ["TRLR", nil] => [nil, 1, 1, nil, 0, [ [:class, :trailer_record], [:pop] ], "End of Data Line" ],
73
+ },
74
+
75
+ :header =>
76
+ {
77
+ ["SOUR", nil] => [:header_source, 1, 1, :identifier, 20, [ [:class, :header_source_record], [:field, :approved_system_id] ], "Source System's Registered Name" ],
78
+ ["DEST", nil] => [nil, 0, 1, :identifier, 20, [ [:field, :destination] ], "Destination System's Registered Name" ],
79
+ ["DATE", nil] => [:date_structure, 0, 1, :date_exact, 11, [ [:class, :date_record], [:field, :date_value] ], "Transmission Date" ],
80
+ ["SUBM", :xref] => [nil, 1, 1, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ], "Reference to a Submitter Record" ],
81
+ ["SUBN", :xref] => [nil, 0, 1, nil, 0, [ [:xref, [:submission_ref, :submission]] ], "Reference to a Submission Record" ],
82
+ ["FILE", nil] => [nil, 0, 1, :string, 90, [ [:field, :file_name] ], "This files name" ],
83
+ ["COPR", nil] => [nil, 0, 1, :string, 90, [ [:field, :copyright] ], "Copyright Notice for this file" ],
84
+ ["GEDC", nil] => [:header_gedc, 1, 1, nil, 0, [ [:class, :gedcom_record] ], "GEDCOM Info" ],
85
+ ["CHAR", nil] => [:header_char, 1, 1, :char_set_id,8, [ [:class, :character_set_record], [:field, :char_set_id] ], "Character Set" ],
86
+ ["LANG", nil] => [nil, 0, 1, :language_id,15, [ [:field, :language_id] ], "Language of Text" ],
87
+ ["PLAC", nil] => [:header_plac, 0, 1, nil, 0, [ [:class, :place_record] ], "Default's for Places" ],
88
+ ["NOTE", nil] => [:note_cont_conc, 0, 1, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "File Content Description" ],
89
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
90
+ },
91
+
92
+ :header_source =>
93
+ {
94
+ ["VERS", nil] => [nil, 0, 1, :string, 15, [ [:field, :version] ], "Program's Version :number"],
95
+ ["NAME", nil] => [nil, 0, 1, :string, 90, [ [:field, :name] ], "Program's Name" ],
96
+ ["CORP", nil] => [:header_source_corp, 0, 1, :string, 90, [ [:class, :corporate_record], [:field, :company_name] ], "Company name the produced the Pragram" ],
97
+ ["DATA", nil] => [:header_source_data, 0, 1, :string, 90, [ [:class, :header_data_record], [:field, :data_source] ], "Identifies Data Source Record"],
98
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
99
+ },
100
+ :header_source_corp =>
101
+ {
102
+ ["ADDR", nil] => [:address_structure, 0, 1, :string, 60, [ [:class, :address_record], [:field, :address] ], "Address" ],
103
+ ["PHON", nil] => [nil, 0, 3, :string, 25, [ [:field, :phonenumber] ], "Phone :number" ],
104
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
105
+ },
106
+ :header_source_data =>
107
+ {
108
+ ["DATE", nil] => [nil, 0, 1, :date_value, 11, [ [:field, :date] ], "Publication Date" ],
109
+ ["COPR", nil] => [nil, 0, 1, :string, 90, [ [:field, :copyright] ], "Copyright Statement from Data Source" ],
110
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
111
+ },
112
+ :date_structure =>
113
+ {
114
+ ["TIME", nil] => [nil, 0, 1, :time_val, 12, [ [:field, :time_value] ], "Time of event" ],
115
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
116
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
117
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ], #Not legal gedcom 5.5
118
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ], #Not legal gedcom 5.5
119
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
120
+ },
121
+ :header_gedc =>
122
+ {
123
+ ["VERS", nil] => [nil, 1, 1, :string, 15, [ [:field, :version] ], "Version of GEDCOM" ],
124
+ ["FORM", nil] => [nil, 1, 1, :string, 20, [ [:field, :encoding_format] ], "GEDCOM Encoding Format" ],
125
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
126
+ },
127
+ :header_char =>
128
+ {
129
+ ["VERS", nil] => [nil, 0, 1, :string, 15, [ [:field, :version] ], "Character Set Version" ],
130
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
131
+ },
132
+ :header_plac =>
133
+ {
134
+ ["FORM", nil] => [nil, 1, 1, :placehierachy, 120, [ [:field, :place_hierachy] ], "Default Place Hierachy (comma separarted jurisdictions)"],
135
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
136
+ },
137
+ :note_cont_conc =>
138
+ {
139
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :note] ], "Continuation on New Line"],
140
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :note] ], "Continuation on Same Line" ],
141
+ },
142
+ :family_record =>
143
+ {
144
+ #RESN is not standard gedcom.
145
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
146
+
147
+ ["ANUL", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "ANUL"]] ], "Annulment" ],
148
+ ["CENS", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "CENS"]] ], "Census" ],
149
+ ["DIV", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "DIV"]] ], "Divorce" ],
150
+ ["DIVF", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "DIVF"]] ], "Divorce Filed" ],
151
+ ["ENGA", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "ENGA"]] ], "Engagement" ],
152
+ ["MARR", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "MARR"]] ], "Marriage" ],
153
+ ["MARB", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "MARB"]] ], "Marriage Bann" ],
154
+ ["MARC", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "MARC"]] ], "Marriage Contract" ],
155
+ ["MARL", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "MARL"]] ], "Marriage License" ],
156
+ ["MARS", nil] => [:family_event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "MARS"]] ], "Marriage Settlement Agreement" ],
157
+ ["EVEN", nil] => [:family_event_detail, 0, nil, nil, 0, [ [:class, :event_record], [:field, [:event_type, "EVEN"]] ], "Any Other Event" ],
158
+ ["RESI", nil] => [:event_detail, 0, nil, :y_or_null, 0, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "RESI"]] ], "Residence" ], #NOT Standard gedcom 5.5
159
+
160
+ ["HUSB", :xref] => [:attached_note, 0, 1, nil, 0, [ [:xref, [:husband_ref, :individual]], [:push] ], "Husband and/or Biological Father of the Children" ],
161
+ ["WIFE", :xref] => [:attached_note, 0, 1, nil, 0, [ [:xref, [:wife_ref, :individual]], [:push] ], "Wife and/or Biological Mother of the Children" ],
162
+ ["CHIL", :xref] => [:attached_note, 0, nil, nil, 0, [ [:xref, [:child_ref, :individual]], [:push] ], "Child" ],
163
+ ["NCHI", nil] => [nil, 0, 1, :number, 3, [ [:field, :number_children] ], "Total :number of Children" ],
164
+ ["SUBM", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ],"Submitter of Record's Information" ],
165
+
166
+ ["SLGS", nil] => [:lds_individual_ordinance_slgs, 0, nil, :y_or_null,0, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "SLGS"]]], "LDS Spouse Sealing Record" ],
167
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
168
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
169
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
170
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
171
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
172
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248,[ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
173
+ ["REFN", nil] => [:family_record_refn, 0, nil, :string, 20, [ [:class, :refn_record], [:field, :user_reference_number] ], "User Defined Reference :number" ],
174
+ ["RIN", nil] => [nil, 0, 1, :number, 12, [ [:field, :automated_record_id] ], "System Generated Record ID" ],
175
+ ["CHAN", nil] => [:change_date, 0, 1, nil, 0, [ [:class, :change_date_record] ], "Date this Record was Last Modified" ],
176
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
177
+ },
178
+ :family_event_detail =>
179
+ {
180
+ #RESN is not standard gedcom.
181
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
182
+
183
+ ["TYPE", nil] => [nil, 0, 1, :string, 90, [ [:field, :event_descriptor] ], "Event Description" ],
184
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ],
185
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy,120, [ [:class, :place_record], [:field, :place_value] ], "Jurisdictional Place Hierachy where the Event Occurred" ],
186
+ ["ADDR", nil] => [:address_structure, 0, 1, :string, 60, [ [:class, :address_record], [:field, :address] ], "Address" ],
187
+ ["PHON", nil] => [nil, 0, 3, :string, 25, [ [:field, :phonenumber] ], "Phone :number" ],
188
+ ["AGE", nil] => [nil, 0, 1, :age, 12, [ [:field, :age] ], "Age at the time of the Event" ],
189
+ ["AGNC", nil] => [nil, 0, 1, :string, 120, [ [:field, :agency] ], "Controlling/Resonsible Entity/Authority" ],
190
+ ["CAUS", nil] => [:cause_note_structure_inline,0, 1, :string, 90, [ [:class, :cause_record], [:field, :cause] ], "Cause of the Event" ],
191
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
192
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
193
+ #Subm records in events is not standard gedcom 5.5
194
+ ["SUBM", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ],"Submitter of Record's Information" ],
195
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
196
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
197
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
198
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
199
+ ["HUSB", nil] => [:family_event_detail_age,0, 1, nil, 0, [ [:class, :event_age_record], [:field, [:relation, "HUSB"]] ], "Husband's Age Record" ],
200
+ ["WIFE", nil] => [:family_event_detail_age,0, 1, nil, 0, [ [:class, :event_age_record], [:field, [:relation, "WIFE"]] ], "Wife's Age Record" ],
201
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
202
+ },
203
+ :family_event_detail_age =>
204
+ {
205
+ ["AGE", nil] => [nil, 1, 1, :age, 12, [ [:field, :age] ], "Age at the time of the Event"],
206
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
207
+ },
208
+ :family_record_refn =>
209
+ {
210
+ ["TYPE", nil] => [nil, 0, 1, :string, 40, [ [:field, :ref_type] ], "User Defined Reference Type"],
211
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
212
+ },
213
+ :individual_record =>
214
+ {
215
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ],
216
+
217
+
218
+ #Internally, we ignore the y_or_null, as both indicate we have to build a record, but we don't need to record, in it, that we did it.
219
+ ["BIRT", nil] => [:individual_event_structure_birt, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "BIRT"]] ], "Birth" ],
220
+ ["CHR", nil] => [:individual_event_structure_birt, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "CHR"]] ], "Christening" ],
221
+ ["ADOP", nil] => [:individual_event_structure_adop, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "ADOP"]] ], "Adoption" ],
222
+ ["DEAT", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "DEAT"]] ], "Death" ],
223
+ ["BURI", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "BURI"]] ], "Burial" ],
224
+ ["CREM", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "CREM"]] ], "Cremation" ],
225
+ ["BAPM", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "BAPM"]] ], "Baptism" ],
226
+ ["BARM", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "BARM"]] ], "Bar Mitzvah (13y old Jewish Boys cermonial event)" ],
227
+ ["BASM", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "BASM"]] ], "Bas Mitzvah (13y old Jewish Girls cermonial event)" ],
228
+ ["BLES", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "BLES"]] ], "Blessing" ],
229
+ ["CHRA", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "CHRA"]] ], "Adult Christening" ],
230
+ ["CONF", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "CONF"]] ], "Confirmation" ],
231
+ ["FCOM", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "FCOM"]] ], "First Communion" ],
232
+ ["ORDN", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "ORDN"]] ], "Ordination" ],
233
+ ["NATU", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "NATU"]] ], "Naturalization" ],
234
+ ["EMIG", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "EMIG"]] ], "Emigration" ],
235
+ ["IMMI", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "IMMI"]] ], "Immigration" ],
236
+ ["CENS", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "CENS"]] ], "Census" ],
237
+ ["PROB", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "PROB"]] ], "Probate" ],
238
+ ["WILL", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "WILL"]] ], "Will (Event is date of signing)" ],
239
+ ["GRAD", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "GRAD"]] ], "Graduation" ],
240
+ ["RETI", nil] => [:event_detail, 0, nil, :y_or_null, 1, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "RETI"]] ], "Retirement" ],
241
+ ["BAPL", nil] => [:lds_individual_ordinance_bapl, 0, nil, :y_or_null, 0, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "BAPL"]] ], "LDS Baptisim" ],
242
+ ["CONL", nil] => [:lds_individual_ordinance_bapl, 0, nil, :y_or_null, 0, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "CONL"]] ], "LDS Confirmation" ],
243
+ ["ENDL", nil] => [:lds_individual_ordinance_endl, 0, nil, :y_or_null, 0, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "ENDL"]] ], "LDS Endowment" ],
244
+ ["SLGC", nil] => [:lds_individual_ordinance_slgc, 0, nil, :y_or_null, 0, [ [:class, :event_record], [:field, :event_status], [:field, [:event_type, "SLGC"]] ], "LDS Childs Sealing" ],
245
+ ["EVEN", nil] => [:event_detail, 0, nil, nil, 0, [ [:class, :event_record], [:field, [:event_type, "EVEN"]] ], "Misc Event" ],
246
+
247
+ ["NAME", nil] => [:personal_name_structure, 0, nil, :name_string, 120, [ [:class, :name_record], [:field, :value], [:field, [:attr_type,"NAME"]] ], "A Name of the Individual" ],
248
+ ["SEX", nil] => [:event_detail, 0, nil, :sex_value, 1, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type,"SEX"]] ], "M or F" ],
249
+ #gedcom 5.5 actually only allows 1 sex record, with no event. The real world says otherwise.
250
+ #It is also possible to have Intersexuals.
251
+ #There is a spectrum of Male to Female, through varying causes
252
+ #These are the known genetic combinations XX, XY, XXY, XXXY and X only
253
+ #There are also XY people, who appear female or sexless at birth (androgen insensitivity syndrome, or in english, the hormone receptors don't work).
254
+ #There are XX people, who may appear sexless and/or missing some or all of their reproductive organs.
255
+ #Some of these intersexuals can reproduce as males, females, or rarely, both, most not at all.
256
+ #There is also the modern possibility of gender reassignment, which would require an event record, attached to a second sex record.
257
+ ["TITL", nil] => [:event_detail, 0, nil, :string, 120, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "TITL"]] ], "Title" ],
258
+ ["CAST", nil] => [:event_detail, 0, nil, :string, 90, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type,"CAST"]] ], "Caste Name" ],
259
+ ["DSCR", nil] => [:event_detail, 0, nil, :string, 248, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type,"DSCR"]] ], "Physical Description" ],
260
+ ["EDUC", nil] => [:event_detail, 0, nil, :string, 248, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type,"EDUC"]] ], "Scholastic Achievment" ],
261
+ ["IDNO", nil] => [:event_detail, 0, nil, :string, 30, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "IDNO"]] ], "National ID :number" ],
262
+ ["NATI", nil] => [:event_detail, 0, nil, :string, 120, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "NATI"]] ], "National or Tribal Origin" ],
263
+ ["NCHI", nil] => [:event_detail, 0, nil, :number, 3, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "NCHI"]] ], ":number of Children" ],
264
+ ["NMR", nil] => [:event_detail, 0, nil, :number, 3, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "NMR"]] ], ":number of Marriages" ],
265
+ ["OCCU", nil] => [:event_detail, 0, nil, :string, 90, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "OCCU"]] ], "Occupation" ],
266
+ ["PROP", nil] => [:event_detail, 0, nil, :string, 248, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "PROP"]] ], "Real Estate or other Property" ],
267
+ ["RELI", nil] => [:event_detail, 0, nil, :string, 90, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "RELI"]] ], "Religious Affliliation" ],
268
+ ["RESI", nil] => [:event_detail, 0, nil, nil, 0, [ [:class, :individual_attribute_record], [:field, [:value,""]], [:field, [:attr_type, "RESI"]] ], "Residence" ],
269
+ ["SSN", nil] => [:event_detail, 0, nil, :string, 11, [ [:class, :individual_attribute_record], [:field, :value], [:field, [:attr_type, "SSN"]] ], "USA Social Security :number" ],
270
+ #ATTR is not standard gedcom 5.5, which has no misc attribute tag.
271
+ #["_ATTR", nil] => [:attribute_detail, 0, nil, :string, 90, [ [:class, :individual_attribute_record], [:field, :attr_type] ], "Misc Attribute" ],
272
+
273
+ ["ALIA", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:alias_ref, :individual]] ], "Reference to possible duplicate Individual Record" ],
274
+ ["FAMC", :xref] => [:child_to_family_link, 0, nil, nil, 0, [ [:class, :families_individuals], [:field, [:relationship_type, "FAMC"]], [:xref, [:parents_family_ref, :family]] ], "Reference to Parent's Family Record" ],
275
+ ["FAMS", :xref] => [:attached_note, 0, nil, nil, 0, [ [:class, :families_individuals], [:field, [:relationship_type, "FAMS"]], [:xref, [:family_ref, :family]] ], "Reference to Own marriage's Family Record" ],
276
+ ["ASSO", :xref] => [:association_structure, 0, nil, nil, 0, [ [:class, :association_record], [:xref, [:association_ref, :individual]] ], "Reference to An Associated Individual's Record" ],
277
+
278
+ ["SUBM", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ], "Reference to Submitter Record" ],
279
+ ["ANCI", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:ancestor_interest_ref, :submitter]] ], "Reference to Submitter's Record Interested in persons Ancestors" ],
280
+ ["DESI", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:descendant_interest_ref, :submitter]] ], "Reference to Submitter's Record Interested in persons Decendants" ],
281
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
282
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
283
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
284
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
285
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
286
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248,[ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
287
+ ["RFN", nil] => [nil, 0, 1, :registered_ref,90, [ [:field, :registered_ref_id] ], "Registered Resource File and Record ID" ],
288
+ ["AFN", nil] => [nil, 0, 1, :string, 12, [ [:field, :lds_ancestral_file_no] ], "LDS Ancestral File :number" ],
289
+ ["REFN", nil] => [:family_record_refn, 0, nil, :string, 20, [ [:class, :refn_record], [:field, :user_reference_number] ], "User Defined Reference :number" ],
290
+ ["RIN", nil] => [nil, 0, 1, :number, 12, [ [:field, :automated_record_id] ], "System Generated Record ID" ],
291
+ ["CHAN", nil] => [:change_date, 0, 1, nil, 0, [ [:class, :change_date_record] ], "Date this Record was Last Modified" ],
292
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
293
+ },
294
+
295
+ #These Notes, and Source attachments are non-standard GEDCOM 5.5
296
+ :attached_note =>
297
+ {
298
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
299
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
300
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
301
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
302
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
303
+ },
304
+
305
+ #:attribute_detail is Non-Standard gedcom 5.5, which has no such structure, nor is there an ATTR parent tag
306
+ :attribute_detail =>
307
+ {
308
+ ["_VALU", nil] => [:nil, 0, 1, :string, 90, [ [:field, :value] ], "Attribute Description" ],
309
+ ["EVEN", nil] => [:event_detail, 0, nil, nil, 0, [ [:class, :event_record] ], "Event associated with this attribute" ],
310
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
311
+ },
312
+ :individual_event_structure_birt =>
313
+ {
314
+ #RESN is not standard gedcom.
315
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
316
+
317
+ ["TYPE", nil] => [nil, 0, 1, :string, 90, [ [:field, :event_descriptor] ], "Event Description" ],
318
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ], #illegal note attachment, Note gedcom 5.5 compliant.
319
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value] ], "Jurisdictional Place Hierarchy where the Event Occurred" ],
320
+ ["ADDR", nil] => [:address_structure, 0, 1, :string, 60, [ [:class, :address_record], [:field, :address] ], "Address" ],
321
+ ["PHON", nil] => [nil, 0, 3, :string, 25, [ [:field, :phonenumber] ], "Phone :number" ],
322
+ ["AGE", nil] => [nil, 0, 1, :age, 12, [ [:field, :age] ], "Age at the time of the Event" ],
323
+ ["AGNC", nil] => [nil, 0, 1, :string, 120, [ [:field, :agency] ], "Controlling/Resonsible Entity/Authority" ],
324
+ ["CAUS", nil] => [:cause_note_structure_inline,0, 1, :string, 90, [ [:class, :cause_record], [:field, :cause] ], "Cause of the Event" ],
325
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
326
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
327
+ #Subm records in events is not standard gedcom 5.5
328
+ ["SUBM", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ],"Submitter of Record's Information" ],
329
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
330
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
331
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
332
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
333
+ ["FAMC", :xref] => [:individual_event_structure_adop_famc, 0, 1, nil, 0, [ [:class, :adoption_record], [:xref, [:birth_family_ref, :family]] ], "Reference to Birth Parent's Family Record" ],
334
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
335
+ },
336
+ :individual_event_structure_adop =>
337
+ {
338
+ #RESN is not standard gedcom.
339
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
340
+
341
+ ["TYPE", nil] => [nil, 0, 1, :string, 90, [ [:field, :event_descriptor] ], "Event Description" ],
342
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ], #illegal note attachment, Note gedcom 5.5 compliant.
343
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value] ], "Jurisdictional Place Hierarchy where the Event Occurred" ],
344
+ ["ADDR", nil] => [:address_structure, 0, 1, :string, 60, [ [:class, :address_record], [:field, :address] ], "Address" ],
345
+ ["PHON", nil] => [nil, 0, 3, :string, 25, [ [:field, :phonenumber] ], "Phone :number" ],
346
+ ["AGE", nil] => [nil, 0, 1, :age, 12, [ [:field, :age] ], "Age at the time of the Event" ],
347
+ ["AGNC", nil] => [nil, 0, 1, :string, 120, [ [:field, :agency] ], "Controlling/Resonsible Entity/Authority" ],
348
+ ["CAUS", nil] => [:cause_note_structure_inline,0, 1, :string, 90, [ [:class, :cause_record], [:field, :cause] ], "Cause of the Event" ],
349
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
350
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
351
+ #Subm records in events is not standard gedcom 5.5
352
+ ["SUBM", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ],"Submitter of Record's Information" ],
353
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
354
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
355
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
356
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
357
+ ["FAMC", :xref] => [:individual_event_structure_adop_famc, 0, 1, nil, 0, [ [:class, :adoption_record], [:xref, [:adopt_family_ref, :family]] ], "Reference to Adopt Parent's Family Record" ],
358
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
359
+ },
360
+ :individual_event_structure_adop_famc => # /*note reuse of ADOP!!*/
361
+ {
362
+ ["ADOP", nil] => [nil, 0, 1, :whichparent, 4, [ [:field, :adopted_by] ], "Adopted by HUSB | WIFE | BOTH" ],
363
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
364
+ },
365
+ :multimedia_record =>
366
+ { #Record form
367
+ ["FORM", nil] => [nil, 1, 1, :string, 4, [ [:field, :format] ], "bmp | gif | jpeg | ole | pcx | tiff | wav |..." ],
368
+ ["TITL", nil] => [nil, 0, 1, :string, 248, [ [:field, :title] ], "Title of the work" ],
369
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
370
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
371
+ ["BLOB", nil] => [:encoded_multimedia_line, 1, 1, nil, 0, [ [:class, :encoded_line_record] ], "Binary Object" ],
372
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:next_multimedia_ref, :multimedia]] ], "Link to a continued Multimedia Record" ],
373
+ ["REFN", nil] => [:family_record_refn, 0, nil, :string, 20, [ [:class, :refn_record], [:field, :user_reference_number] ], "User Defined Reference :number" ],
374
+ ["RIN", nil] => [nil, 0, 1, :number, 12, [ [:field, :automated_record_id] ], "System Generated Record ID" ],
375
+ ["CHAN", nil] => [:change_date, 0, 1, nil, 0, [ [:class, :change_date_record] ], "Date this Record was Last Modified" ],
376
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
377
+ },
378
+ :multimedia_link =>
379
+ { #/* in line link form*/
380
+ ["FORM", nil] => [nil, 1, 1, :string, 4, [ [:field, :format] ], "bmp | gif | jpeg | ole | pcx | tiff | wav |..." ],
381
+ ["TITL", nil] => [nil, 0, 1, :string, 248, [ [:field, :title] ], "Title of the work" ],
382
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
383
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
384
+ #Filename max length is a touch on the short side, so have altered it to 248 (was 30)
385
+ ["FILE", nil] => [nil, 1, 1, :string, 248, [ [:field, :filename] ], "Multimedia Data's Filename" ],
386
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
387
+ },
388
+ :encoded_multimedia_line =>
389
+ {
390
+ ["CONT", nil] => [nil, 1, nil, :string, 87, [ [:append_nl, :encoded_line] ], "ASCII Encoded Multimedia Line" ],
391
+ },
392
+ :note_record =>
393
+ {
394
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
395
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :note] ], "Continuation on New Line"],
396
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :note] ], "Continuation on Same Line" ],
397
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
398
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
399
+ ["REFN", nil] => [:family_record_refn, 0, nil, :string, 20, [ [:class, :refn_record], [:field, :user_reference_number] ], "User Defined Reference :number" ],
400
+ ["RIN", nil] => [nil, 0, 1, :number, 12, [ [:field, :automated_record_id] ], "System Generated Record ID" ],
401
+ ["CHAN", nil] => [:change_date, 0, 1, nil, 0, [ [:class, :change_date_record] ], "Date this Record was Last Modified" ],
402
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
403
+ },
404
+ :note_structure =>
405
+ {
406
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
407
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
408
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
409
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
410
+ },
411
+ :note_structure_inline =>
412
+ {
413
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
414
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :note] ], "Continuation on New Line"],
415
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :note] ], "Continuation on Same Line" ],
416
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
417
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
418
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
419
+ },
420
+ :repository_record =>
421
+ {
422
+ ["NAME", nil] => [nil, 0, 1, :string, 90, [ [:field, :repository_name] ], "Official Name of the Archive" ],
423
+ ["ADDR", nil] => [:address_structure, 0, 1, :string, 60, [ [:class, :address_record], [:field, :address] ], "Address" ],
424
+ ["PHON", nil] => [nil, 0, 3, :string, 25, [ [:field, :phonenumber] ], "Phone :number" ],
425
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
426
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
427
+ ["REFN", nil] => [:family_record_refn, 0, nil, :string, 20, [ [:class, :refn_record], [:field, :user_reference_number] ], "User Defined Reference :number" ],
428
+ ["RIN", nil] => [nil, 0, 1, :number, 12, [ [:field, :automated_record_id] ], "System Generated Record ID" ],
429
+ ["CHAN", nil] => [:change_date, 0, 1, nil, 0, [ [:class, :change_date_record] ], "Date this Record was Last Modified" ],
430
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
431
+ },
432
+ :source_record =>
433
+ {
434
+ ["DATA", nil] => [:source_record_data, 0, 1, nil, 0, [ [:class, :source_scope_record] ], "Data Description" ],
435
+ ["AUTH", nil] => [:auth_cont_conc, 0, 1, :string, 248, [ [:field, :author], [:push]], "Person or Entity who created the record" ],
436
+ ["TITL", nil] => [:titl_cont_conc, 0, 1, :string, 248, [ [:field, :title], [:push] ], "Title of the Work" ],
437
+ ["ABBR", nil] => [nil, 0, 1, :string, 60, [ [:field, :short_title] ], "Short Title for Filing" ],
438
+ ["PUBL", nil] => [:publ_cont_conc, 0, 1, :string, 248, [ [:field, :publication_details], [:push]], "Publication Details" ],
439
+ ["TEXT", nil] => [:text_cont_conc, 0, 1, :string, 248, [ [:class, :text_record], [:field, :text] ], "Verbatim Copy of the Source Tect" ],
440
+ ["REPO", :xref] => [:source_repository_citation, 0, 1, nil, 0, [ [:class, :repository_citation_record], [:xref, [:repository_ref, :repository]] ], "Repository Record" ],
441
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
442
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
443
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
444
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
445
+ ["REFN", nil] => [:family_record_refn, 0, nil, :string, 20, [ [:class, :refn_record], [:field, :user_reference_number] ], "User Defined Reference :number" ],
446
+ ["RIN", nil] => [nil, 0, 1, :number, 12, [ [:field, :automated_record_id] ], "System Generated Record ID" ],
447
+ ["CHAN", nil] => [:change_date, 0, 1, nil, 0, [ [:class, :change_date_record] ], "Date this Record was Last Modified" ],
448
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
449
+ },
450
+ :source_record_data =>
451
+ {
452
+ ["EVEN", nil] => [:source_record_data_even, 0, nil, :eventlist, 90, [ [:class, :events_list_record], [:field, :recorded_events] ], "List of Events Recorded" ],
453
+ ["AGNC", nil] => [nil, 0, 1, :string, 120, [ [:field, :agency] ], "Controlling/Resonsible Entity/Authority" ],
454
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
455
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
456
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
457
+ },
458
+ :titl_cont_conc =>
459
+ {
460
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :title] ], "Continuation on New Line"],
461
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :title] ], "Continuation on Same Line" ],
462
+ },
463
+ :auth_cont_conc =>
464
+ {
465
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :author] ], "Continuation on New Line"],
466
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :author] ], "Continuation on Same Line" ],
467
+ },
468
+ :text_cont_conc =>
469
+ {
470
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :text] ], "Continuation on New Line"],
471
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :text] ], "Continuation on Same Line" ],
472
+ },
473
+ :publ_cont_conc =>
474
+ {
475
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :publication_details] ], "Continuation on New Line"],
476
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :publication_details] ], "Continuation on Same Line" ],
477
+ },
478
+ :source_record_data_even =>
479
+ {
480
+ ["DATE", nil] => [nil, 0, 1, :date_period, 35, [ [:field, :date_period] ], "Period Covered by Source" ],
481
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value] ], "Jurisdictional Place Hierarchy where the Event Occurred" ],
482
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
483
+ },
484
+ :submission_record =>
485
+ {
486
+ ["SUBM", :xref] => [nil, 0, 1, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ], "Reference to Submitter Record" ],
487
+ ["FAMF", nil] => [nil, 0, 1, :string, 120, [ [:field, :lds_family_file] ], "LDS Family Name for Temple Family File" ],
488
+ ["TEMP", nil] => [nil, 0, 1, :string, 5, [ [:field, :lds_temple_code] ], "Abbreviated LDS Temple Code" ],
489
+ ["ANCE", nil] => [nil, 0, 1, :number, 4, [ [:field, :generations_of_ancestor] ], ":number of generations of Ancestors in this FIle" ],
490
+ ["DESC", nil] => [nil, 0, 1, :number, 4, [ [:field, :generations_of_descendant] ], ":number of generations of Descendants in the File" ],
491
+ ["ORDI", nil] => [nil, 0, 1, :yesno, 3, [ [:field, :process_ordinates] ], "Yes/No (LDS: process for clearing temple ordinances" ],
492
+ ["RIN", nil] => [nil, 0, 1, :number, 12, [ [:field, :automated_record_id] ], "System Generated Record ID" ],
493
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
494
+ },
495
+ :submitter_record =>
496
+ {
497
+ ["NAME", nil] => [nil, 1, 1, :string, 60, [ [:class, :name_record], [:field, :value], [:field, [:attr_type,"NAME"]] , [:pop] ], "Name of the Submitter" ],
498
+ ["ADDR", nil] => [:address_structure, 0, 1, :string, 60, [ [:class, :address_record], [:field, :address] ], "Address" ],
499
+ ["PHON", nil] => [nil, 0, 3, :string, 25, [ [:field, :phone] ], "Phone :number" ],
500
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
501
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
502
+ ["LANG", nil] => [nil, 0, 3, :languagepreference, 90, [ [:field, :language_list] ], "Ordered List of Prefered Language IDs" ],
503
+ ["RFN", nil] => [nil, 0, 1, :string, 30, [ [:field, :lds_submitter_id] ], "LDS Submitters registration :number" ],
504
+ ["RIN", nil] => [nil, 0, 1, :number, 12, [ [:field, :automated_record_id] ], "System Generated Record ID" ],
505
+ ["CHAN", nil] => [:change_date, 0, 1, nil, 0, [ [:class, :change_date_record] ], "Date this Record was Last Modified" ],
506
+ #Notes in SUBM records are not part of the gedcom 5.5 standard
507
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
508
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
509
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
510
+ },
511
+ :address_structure =>
512
+ {
513
+ #RESN is not standard gedcom.
514
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
515
+
516
+ ["CONT", nil] => [nil, 0, nil, :string, 60, [ [:append_nl, :address] ], "Address Continuation on New Line"],
517
+ ["ADR1", nil] => [nil, 0, 1, :string, 60, [ [:field, :address_line1] ], "Formated Address Line 1" ],
518
+ ["ADR2", nil] => [nil, 0, 1, :string, 60, [ [:field, :address_line2] ], "Formated Address Line 2" ],
519
+ ["CITY", nil] => [nil, 0, 1, :string, 60, [ [:field, :city] ], "City"],
520
+ ["STAE", nil] => [nil, 0, 1, :string, 60, [ [:field, :state] ], "State"],
521
+ ["POST", nil] => [nil, 0, 1, :string, 10, [ [:field, :post_code] ], "Postal Code"],
522
+ ["CTRY", nil] => [nil, 0, 1, :string, 60, [ [:field, :country] ], "Country"],
523
+ ["TYPE", nil] => [nil, 0, 1, :string, 16, [ [:field, :address_type] ], "Home, Country, ..."], #Non Standard Gedcom 5.5
524
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
525
+ },
526
+ :association_structure =>
527
+ {
528
+ ["TYPE", nil] => [nil, 1, 1, :recordtype, 4, [ [:field, :associated_record_tag] ], "Associated with FAM,INDI,NOTE,OBJE,REPO,SOUR,SUBM or SUBN" ],
529
+ ["RELA", nil] => [nil, 1, 1, :string, 25, [ [:field, :relationship_description] ], "Relationship"],
530
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
531
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
532
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
533
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
534
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
535
+ },
536
+ :change_date =>
537
+ {
538
+ ["DATE", nil] => [:date_structure, 1, 1, :date_exact, 11, [ [:class, :date_record], [:field, :date_value] ], "Date Record Last Changed" ],
539
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
540
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
541
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
542
+ },
543
+ :child_to_family_link =>
544
+ {
545
+ ["PEDI", nil] => [nil, 0, nil, :pedigree, 7, [ [:field, :pedigree] ], "Pedigree adopted,birth,foster or sealing" ],
546
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
547
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
548
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
549
+ },
550
+ :event_detail =>
551
+ {
552
+ #RESN is not standard gedcom.
553
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
554
+
555
+ ["TYPE", nil] => [nil, 0, 1, :string, 90, [ [:field, :event_descriptor] ], "Event Description" ],
556
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ], #illegal note attachment, Note gedcom 5.5 compliant.
557
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value ]], "Jurisdictional Place Hierarchy where the Event Occurred" ],
558
+ ["ADDR", nil] => [:address_structure, 0, 1, :string, 60, [ [:class, :address_record], [:field, :address] ], "Address" ],
559
+ ["PHON", nil] => [nil, 0, 3, :string, 25, [ [:field, :phonenumber] ], "Phone :number" ],
560
+ ["AGE", nil] => [nil, 0, 1, :age, 12, [ [:field, :age] ], "Age at the time of the Event" ],
561
+ ["AGNC", nil] => [nil, 0, 1, :string, 120, [ [:field, :agency] ], "Controlling/Resonsible Entity/Authority" ],
562
+ ["CAUS", nil] => [:cause_note_structure_inline,0, 1, :string, 90, [ [:class, :cause_record], [:field, :cause] ], "Cause of the Event" ],
563
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
564
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
565
+ #Subm records in events is not standard gedcom 5.5
566
+ ["SUBM", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ],"Submitter of Record's Information" ],
567
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
568
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
569
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
570
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
571
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
572
+ },
573
+ :lds_individual_ordinance_bapl => # /*and CONL*/
574
+ {
575
+ ["STAT", nil] => [nil, 0, 1, :lds_bapt_enum, 10, [ [:field, :lds_date_status] ], "LDS Baptism Date Status" ],
576
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ],
577
+ ["TEMP", nil] => [nil, 0, 1, :string, 5, [ [:field, :lds_temp_code] ], "Abbreviated LDS Temple Code" ],
578
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value] ], "Jurisdictional Place Hierarchy where the Event Occurred" ],
579
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
580
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
581
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
582
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
583
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
584
+ },
585
+ :lds_individual_ordinance_endl =>
586
+ {
587
+ ["STAT", nil] => [nil, 0, 1, :lds_endl_enum, 10, [ [:field, :lds_date_status] ], "LDS Baptism Date Status" ],
588
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ],
589
+ ["TEMP", nil] => [nil, 0, 1, :string, 5, [ [:field, :lds_temp_code] ], "Abbreviated LDS Temple Code" ],
590
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value] ], "Jurisdictional Place Hierarchy where the Event Occurred" ],
591
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
592
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
593
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
594
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
595
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
596
+ },
597
+ :lds_individual_ordinance_slgc =>
598
+ {
599
+ ["STAT", nil] => [nil, 0, 1, :lds_child_seal_enum, 10, [ [:field, :lds_date_status] ], "LDS Baptism Date Status" ],
600
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ],
601
+ ["TEMP", nil] => [nil, 0, 1, :string, 5, [ [:field, :lds_temp_code] ], "Abbreviated LDS Temple Code" ],
602
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value] ], "Jurisdictional Place Hierarchy where the Event Occurred" ],
603
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
604
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
605
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
606
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
607
+ ["FAMC", :xref] => [nil, 1, 1, nil, 0, [ [:xref, [:lds_slgc_family_ref, :family]] ], "Link to Parents Family Record" ],
608
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
609
+ },
610
+ :lds_individual_ordinance_slgs =>
611
+ {
612
+ ["STAT", nil] => [nil, 0, 1, :lds_spouse_seal_enum, 10, [ [:field, :lds_date_status] ], "LDS Baptism Date Status" ],
613
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ],
614
+ ["TEMP", nil] => [nil, 0, 1, :string, 5, [ [:field, :lds_temp_code] ], "Abbreviated LDS Temple Code" ],
615
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value] ], "Jurisdictional Place Hierarchy where the Event Occurred" ],
616
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
617
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
618
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
619
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
620
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
621
+ },
622
+ :cause_note_structure_inline =>
623
+ {
624
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
625
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :cause] ], "Continuation on New Line"],
626
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :cause] ], "Continuation on Same Line" ],
627
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
628
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
629
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
630
+ },
631
+ :personal_name_structure =>
632
+ {
633
+ ["RESN", nil] => [nil, 0, 1, :restriction_value, 7, [ [:field, :restriction] ], "Record Locked or Parts removed for Privacy" ], #NOT GEDCOM 5.5
634
+ ["NPFX", nil] => [nil, 0, 1, :name_piece_list, 30, [ [:field, :prefix] ], "Non-indexed Name Prefix (comma separarted)" ],
635
+ ["GIVN", nil] => [nil, 0, 1, :name_piece_list, 120, [ [:field, :given] ], "Given Names (comma separarted)" ],
636
+ ["NICK", nil] => [nil, 0, 1, :name_piece_list, 120, [ [:field, :nickname] ], "Nickname(s) (comma separarted)" ],
637
+ ["SPFX", nil] => [nil, 0, 1, :name_piece_list, 30, [ [:field, :surname_prefix] ], "Surname Prefix (comma separarted)" ],
638
+ ["SURN", nil] => [nil, 0, 1, :name_piece_list, 120, [ [:field, :surname] ], "Surname(s) (comma separarted)" ],
639
+ ["NSFX", nil] => [nil, 0, 1, :name_piece_list, 30, [ [:field, :suffix] ], "Non-indexed Name Suffix (comma separarted)" ],
640
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
641
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
642
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
643
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
644
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
645
+
646
+ #Non-Standard Gedcom to have an event details in a personal_name_structure. We have added these, as changing one's name requires event details
647
+ ["TYPE", nil] => [nil, 0, 1, :string, 90, [ [:field, :event_descriptor] ], "Event Description" ],
648
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 35, [ [:class, :date_record], [:field, :date_value] ], "Events Date(s)" ], #illegal note attachment, Note gedcom 5.5 compliant.
649
+ ["PLAC", nil] => [:place_structure, 0, 1, :placehierachy, 120, [ [:class, :place_record], [:field, :place_value ]], "Jurisdictional Place Hierarchy where the Event Occurred" ],
650
+ ["ADDR", nil] => [:address_structure, 0, 1, :string, 60, [ [:class, :address_record], [:field, :address] ], "Address" ],
651
+ ["PHON", nil] => [nil, 0, 3, :string, 25, [ [:field, :phonenumber] ], "Phone :number" ],
652
+ ["AGE", nil] => [nil, 0, 1, :age, 12, [ [:field, :age] ], "Age at the time of the Event" ],
653
+ ["AGNC", nil] => [nil, 0, 1, :string, 120, [ [:field, :agency] ], "Controlling/Resonsible Entity/Authority" ],
654
+ ["CAUS", nil] => [:cause_note_structure_inline,0, 1, :string, 90, [ [:class, :cause_record], [:field, :cause] ], "Cause of the Event" ],
655
+ #Subm records in events is not standard gedcom 5.5
656
+ ["SUBM", :xref] => [nil, 0, nil, nil, 0, [ [:xref, [:submitter_ref, :submitter]] ],"Submitter of Record's Information" ],
657
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
658
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
659
+ },
660
+ :place_structure =>
661
+ {
662
+ ["FORM", nil] => [nil, 0, 1, :placehierachy, 30, [ [:field, :place_hierachy] ], "Place Hierachy (comma separarted jurisdictions)" ],
663
+ ["SOUR", :xref] => [:source_citation, 0, nil, nil, 0, [ [:class, :source_citation_record], [:xref, [:source_ref, :source]] ], "Reference to Source Record" ],
664
+ ["SOUR", nil] => [:source_citation_inline, 0, nil, :string, 248, [ [:class, :source_citation_record], [:class, :source_record], [:field, :title] ], "Inline note describing source" ],
665
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
666
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
667
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
668
+ },
669
+ :source_citation =>
670
+ {
671
+ ["PAGE", nil] => [nil, 0, 1, :string, 248, [ [:field, :page] ], "Location within the Source" ],
672
+ ["EVEN", nil] => [:source_citation_even, 0, 1, :event_attribute_enum, 15, [ [:class, :citation_event_type_record],[:field, :event_type] ], "Event Code the source record was made for" ],
673
+ ["DATA", nil] => [:source_citation_data, 0, 1, nil, 0, [ [:class, :citation_data_record] ], "Data Record" ],
674
+ ["QUAY", nil] => [nil, 0, 1, :quality_enum, 1, [ [:field, :quality] ], "Unreliable (0), Questional (1), Secondary (2), Primary (1)" ],
675
+ ["OBJE", :xref] => [nil, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:xref, [:multimedia_ref, :multimedia]], [:pop] ], "Link to a Multimedia Record" ],
676
+ ["OBJE", nil] => [:multimedia_link, 0, nil, nil, 0, [ [:class, :multimedia_citation_record], [:class, :multimedia_record] ], "Inline Multimedia Record" ],
677
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
678
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
679
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
680
+ },
681
+ :source_citation_even =>
682
+ {
683
+ ["ROLE", nil] => [nil, 0, 1, :role, 15, [ [:field, :role] ], "Role in Event (i.e. CHIL, HUSB, WIFE, MOTH ..." ],
684
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
685
+ },
686
+ :source_citation_data =>
687
+ {
688
+ ["DATE", nil] => [:date_structure, 0, 1, :date_value, 90, [ [:class, :date_record], [:field, :date_value] ], "Date event was entered into original source"],
689
+ ["TEXT", nil] => [:text_cont_conc, 0, nil, :string, 248, [ [:class, :text_record], [:field, :text]], "Verbatim Copy of the Source Tect"],
690
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
691
+ },
692
+ :source_citation_inline =>
693
+ { #A source record, less lots of the possible variables
694
+ ["CONT", nil] => [nil, 0, nil, :string, 248, [ [:append_nl, :title] ], "Continuation on New Line"],
695
+ ["CONC", nil] => [nil, 0, nil, :string, 248, [ [:append, :title] ], "Continuation on Same Line" ],
696
+ ["TEXT", nil] => [:text_cont_conc, 0, nil, :string, 248, [ [:class, :text_record], [:field, :text] ], "Verbatim Copy of the Source Tect" ],
697
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
698
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
699
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
700
+ },
701
+ :source_repository_citation =>
702
+ {
703
+ ["NOTE", :xref] => [:note_structure, 0, nil, nil, 0, [ [:class, :note_citation_record], [:xref, [:note_ref, :note]] ], "Link to a Note Record" ],
704
+ ["NOTE", nil] => [:note_structure_inline, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Inline Note Record" ],
705
+ ["CALN", nil] => [:source_repository_citation_caln, 0, nil, :string, 120, [ [:class, :repository_caln], [:field, :call_number] ], "Repository Source Call :number" ],
706
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
707
+ },
708
+ :source_repository_citation_caln =>
709
+ {
710
+ ["MEDI", nil] => [nil, 0, 1, :mediatype_enum, 15, [ [:field, :media_type] ], "Code for Source Media Type" ],
711
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:class, :note_citation_record], [:class, :note_record], [:field, :note] ], "Treat Unknown Tags as Single line notes" ],
712
+ },
713
+
714
+ #Catchall for unknown, or user defined tags.
715
+ :user_subtag =>
716
+ {
717
+ ["NOTE", :user] => [:user_subtag, 0, nil, :string, 248, [ [:append_nl, :note], [:push] ], "Treat Unknown Tags as Single line notes" ],
718
+ }
719
+ }
720
+
721
+ #Create a new GedcomParser instance
722
+ #Optional transmission argument provides an external Transmission object to hold the parsed file.
723
+ def initialize(transmission = Transmission.new)
724
+ @transmission = transmission #We store the loaded records in here.
725
+ @parse_state = ParseState.new :transmission , @transmission #We are starting in a parse state of :transmission on the stack.
726
+ end
727
+
728
+ #Parse a GEDCOM line, adding it to the Transmission class hierarchy.
729
+ #Takes a lineno for reporting errors
730
+ #and the line (as a String) to be tokenised and parsed.
731
+ def parse(lineno, line)
732
+ tokens = GedLine.new *line.chomp.strip.split(/\s/)
733
+ parse_line(lineno, tokens)
734
+ end
735
+
736
+ #Dump the statistics of what we have parsed and stored in the Transission object.
737
+ def summary
738
+ @transmission.summary
739
+ end
740
+
741
+ private
742
+
743
+ #Uses the TAGS hash to determine how to process the line.
744
+ #Take a a line number for error reporting
745
+ #and the tokenised GEDCOM line.
746
+ def process_line(lineno, tokens)
747
+ if (tag_line = TAGS[@parse_state.state]) == nil
748
+ raise "In unknown state (#{@parse_state.state})"
749
+ elsif (tag_spec = tag_line[ tokens.index ]) == nil
750
+ if tokens.tag[0,1] == "_" || @parse_state.state == :user_subtag
751
+ print "Unknown tag #{tokens}. "
752
+ tokens.user_tag
753
+ pp "Converted to #{tokens}"
754
+ process_line(lineno, tokens)
755
+ else
756
+ raise "Tag ([#{tokens.tag},#{tokens.xref}]) not valid in this state (#{@parse_state.state})"
757
+ end
758
+ elsif tag_spec[CHILD_RECORD] != nil #don't push nil states, as these represent terminals
759
+ #Run the handler for this line.
760
+ @transmission.action_handler lineno, tokens, *tag_spec
761
+ #switch to new state
762
+ @parse_state << tag_spec[CHILD_RECORD]
763
+ else
764
+ #Run the handler for this line.
765
+ @transmission.action_handler lineno, tokens, *tag_spec
766
+ end
767
+
768
+ end
769
+
770
+ #Manages the parsing state stack and calling process_line() to create objects to hold the data.
771
+ #Takes a lineno for error reporting
772
+ # and a tokenised GEDCOM line (including tokenizing the data value as a word array).
773
+ def parse_line(lineno, tokens)
774
+ #need to look in the ::TAGS hash for tags that match the level this line is on.
775
+ #Annoyingly, Level 0 has the data and the TAG, reversed for xrefs.
776
+ current_level = @parse_state.level
777
+ new_level = tokens.level
778
+
779
+ if current_level > new_level
780
+ #Reduce the parse state stack until we are at the new level
781
+ while current_level > new_level
782
+ current_level -= 1
783
+ @parse_state.pop
784
+ end
785
+ process_line(lineno, tokens) #We are now at the same level, so we process the line
786
+ elsif current_level == new_level
787
+ process_line(lineno, tokens) #We are already at the same level, so we just process the line
788
+ elsif current_level < new_level
789
+ raise "Level increased by more than 1 (current_level = #{current_level}, new_level = #{new_level})"
790
+ end
791
+ end
792
+
793
+
794
+ end
795
+
796
+
797
+
798
+