From b7347229818ecc8727242ae7275acbf326805cc1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 20 Jun 2019 13:40:57 -0400 Subject: harvest html output --- org/meta_conf_make_meta.org | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'org/meta_conf_make_meta.org') diff --git a/org/meta_conf_make_meta.org b/org/meta_conf_make_meta.org index 0f8c8bf..77180e9 100644 --- a/org/meta_conf_make_meta.org +++ b/org/meta_conf_make_meta.org @@ -261,8 +261,10 @@ struct MetaComposite { string classify_subject; string classify_topic_register; string[] classify_topic_register_arr; + string[] creator_author_arr; string creator_author; string creator_author_surname_fn; + string creator_author_surname; string creator_author_email; string creator_illustrator; string creator_translator; @@ -837,13 +839,13 @@ if (_struct_composite.meta.creator_author.empty) { _struct_composite.meta.creator_translator = _json.object["creator"]["translator"].str; } } - string[] authors_arr; + string[] author_arr; string[][string] authors_hash_arr = [ "first" : [], "last" : [], "full" : [], "last_first" : [], "as_input" : [] ]; string[] authors_raw_arr = _struct_composite.meta.creator_author.split(rgx.arr_delimiter); auto _lastname = appender!(char[])(); foreach (author_raw; authors_raw_arr) { - authors_arr ~= author_raw.replace(rgx.raw_author_munge, "$2 $1"); + author_arr ~= author_raw.replace(rgx.raw_author_munge, "$2 $1"); authors_hash_arr["first"] ~= author_raw.replace(rgx.raw_author_munge, "$2"); authors_hash_arr["last"] ~= author_raw.replace(rgx.raw_author_munge, "$1"); authors_hash_arr["full"] ~= author_raw.replace(rgx.raw_author_munge, "$2 $1"); @@ -854,7 +856,9 @@ if (_struct_composite.meta.creator_author.empty) { _lastname = appender!(char[])(); } } - _struct_composite.meta.creator_author = authors_arr.join(", ").chomp.chomp; + _struct_composite.meta.creator_author_arr = author_arr; + _struct_composite.meta.creator_author = author_arr.join(", ").chomp.chomp; + _struct_composite.meta.creator_author_surname = authors_hash_arr["last"][0]; string _author_name_last_first = authors_hash_arr["last_first"].join("; ").chomp.chomp; _struct_composite.meta.creator_author_surname_fn = (_author_name_last_first.length > 0) ? _author_name_last_first @@ -940,8 +944,8 @@ if ("classify" in _json.object) { if ("topic_register" in _json.object["classify"] && (_json.object["classify"]["topic_register"].type().to!string == "string") ) { - _struct_composite.meta.classify_topic_register = _json.object["classify"]["topic_register"].str; - string[] main_topics_ = _struct_composite.meta.classify_topic_register.split(rgx.topic_register_main_terms_split); + _struct_composite.meta.classify_topic_register = _json.object["classify"]["topic_register"].str.strip; + string[] main_topics_ = _struct_composite.meta.classify_topic_register.strip.split(rgx.topic_register_main_terms_split); string[] topics; string topics_tmp; string[] multiple_sub_terms; -- cgit v1.2.3