diff options
author | Ralph Amissah <ralph.amissah@gmail.com> | 2019-06-20 13:40:57 -0400 |
---|---|---|
committer | Ralph Amissah <ralph.amissah@gmail.com> | 2019-10-17 19:07:20 -0400 |
commit | b7347229818ecc8727242ae7275acbf326805cc1 (patch) | |
tree | e67e1a19303931c8fb6180c076e4bd860d93a31b /src/doc_reform/meta/conf_make_meta_json.d | |
parent | topic register sort adjust Aa-Zz (diff) |
harvest html output
Diffstat (limited to 'src/doc_reform/meta/conf_make_meta_json.d')
-rw-r--r-- | src/doc_reform/meta/conf_make_meta_json.d | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/doc_reform/meta/conf_make_meta_json.d b/src/doc_reform/meta/conf_make_meta_json.d index 45d3a5a..7ad4744 100644 --- a/src/doc_reform/meta/conf_make_meta_json.d +++ b/src/doc_reform/meta/conf_make_meta_json.d @@ -387,13 +387,13 @@ static template contentJSONtoDocReformStruct() { _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"); @@ -404,7 +404,9 @@ static template contentJSONtoDocReformStruct() { _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 @@ -490,8 +492,8 @@ static template contentJSONtoDocReformStruct() { 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; |