「モジュール:Citation/CS-ja」の版間の差分

削除された内容 追加された内容
事典の名前を二重鍵括弧で括るようにする
閉じ鍵括弧の直後の開き鍵括弧が消える不具合を解消、terminate_name_list()の呼び出しをすべてコメントアウト。参考: Help‐ノート:和書用出典表記形式#chapter引数の有無による括弧の不具合
925行目:
comp = value;
end
end
-- CS-ja独自: 追加処理でも利用する都合で、end_chrの定義位置を変更
end_chr = f.sub(str, -1, -1); -- get the last character of the output string
-- typically duplicate_char is sepc
if utilities.in_array ( f.sub(comp, 1, 1), {== duplicate_char, '「', '『'} ) then -- is first character same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for the
-- preceding segment: 'First element' .. 'sepc next element' .. etc.?
-- CS-ja独自: compが開き鍵括弧で始まる場合も同様に処理を行う
trim = false;
end
end_chr = f.sub(str, -1, -1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr .. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
957 ⟶ 959行目:
str = f.sub(str, 1, -3); -- remove them both
end
-- CS-ja独自: 閉じ鍵括弧の直後にが来を置かないようにする
elseif '」' == end_chr or '』' == end_chr then
trim = true;
972 ⟶ 974行目:
end
end
end
-- CS-ja独自: 開き鍵括弧の直前に読点を置かないようにする
local value_first = f.sub(value, 1, 1);
if end_chr == duplicate_char and ('「' == value_first or '『' == value_first) then
str = f.sub(str, 1, -2);
end
str = str .. value; -- add it to the output string
4,092 ⟶ 4,100行目:
end
end
end
if utilities.is_set (Authors) then
-- 以下はCS-jaでは不要と思われるため、コメントアウト
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors--if =(not terminate_name_listutilities.is_set (Authors, sepcDate); ) then -- when no date, terminateis withset 0it's orin 1parentheses; no Authors sepctermination
-- Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc
end
--end
if utilities.is_set (Editors) then
local in_text = '';
4,111 ⟶ 4,120行目:
post_text = cfg.messages['editors'];
end
-- 以下はCS-jaでは不要と思われるため、コメントアウト
--Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
4,117 ⟶ 4,127行目:
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
-- 以下はCS-jaでは不要と思われるため、コメントアウト
--if utilities.is_set (Editors) and utilities.is_set (Date) then -- when Editors make sure that Authors gets terminated
Authors = terminate_name_list (Authors, sepc); -- terminate with 0 or 1 sepc
-- ContributorsAuthors = terminate_name_list (ContributorsAuthors, sepc); -- terminate with 0 or 1 sepc
end
--end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
--if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no AuthorsContributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc
-- Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc
end
--end
if 'cs-ja2' == Mode then -- CS-ja独自: Modeの値によって日付の表示位置を変える
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext}, sepc );