lib/cultural_network/import/feature_data.rb
# ##################################################################### #
# create and save the FeatureName objects
create and save the FeatureName objects
create and save the FeatureName objects
def extract_feature_names(doc, feature)
      elements = (doc/'//fname')
      elements.each do |e|
        fn = FeatureName.new
        fn.feature_id = feature.id
        fn.name = extract_geogname(e)
        fn.language_id = attach_language_id(e)
        fn.is_public = true
        fn.writing_system_id = determine_writing_system(e)
        raise "FeatureName #{fn.inspect} not saved!" unless fn.save
        set_timespan(e, fn)
        extract_citations(e, fn)
        if(e/'transliteration')
          secondary_fnames = extract_secondary_feature_names(e, feature, fn)
        end
      end
    end
def extract_feature_names ( doc , feature ) elements = ( doc / '//fname' ) elements . each do | e | fn = FeatureName . new fn . feature_id = feature . id fn . name = extract_geogname ( e ) fn . language_id = attach_language_id ( e ) fn . is_public = true fn . writing_system_id = determine_writing_system ( e ) raise "FeatureName #{fn.inspect} not saved!" unless fn . save set_timespan ( e , fn ) extract_citations ( e , fn ) if ( e / 'transliteration' ) secondary_fnames = extract_secondary_feature_names ( e , feature , fn ) end end end
create and save the FeatureName objects
create and save the FeatureName objects
# Does this FeatureName contain a translation or transliteration?
doc
<not_specific>
feature
<not_specific>