モジュール:Citation/CS1/Suggestions

ナビゲーションに移動 検索に移動
モジュールの解説[表示] [編集] [履歴] [キャッシュを破棄]

このモジュールは出典表記形式1出典表記形式2の出典テンプレートで不明な引数が指定されたとき、正しい引数を推測してエラーメッセージに表示するための一覧です。一覧の書式は['不明な引数名'] = '推測される正しい引数名'となっています。また、正しい引数を推測するとき、不明な引数名は予め小文字に変換されますので、この一覧では全て小文字で指定します。

下記はCS1とCS2の出典テンプレートを実装するサブモジュールの一覧です。

CS1とCS2の関連モジュール
モジュール サンドボックス 説明
モジュール:Citation/CS1 モジュール:Citation/CS1/sandbox [編集] レンダリングとサポート用関数
モジュール:Citation/CS1/Configuration モジュール:Citation/CS1/Configuration/sandbox [編集] 翻訳用の表、エラーと識別子の関連設定
モジュール:Citation/CS1/Whitelist モジュール:Citation/CS1/Whitelist/sandbox [編集] CS1とCS2テンプレートの引数一覧(非推奨と廃止された引数を含む)
モジュール:Citation/CS1/Date validation モジュール:Citation/CS1/Date validation/sandbox [編集] 日付の書式検証用関数
モジュール:Citation/CS1/Identifiers モジュール:Citation/CS1/Identifiers/sandbox [編集] 識別子(ISBNDOIPMIDなど)用のサポート関数
モジュール:Citation/CS1/Utilities モジュール:Citation/CS1/Utilities/sandbox [編集] ユーティリティ関数と表
モジュール:Citation/CS1/COinS モジュール:Citation/CS1/COinS/sandbox [編集] CS1とCS2テンプレートのメタデータを出力する関数
モジュール:Citation/CS1/styles.css モジュール:Citation/CS1/sandbox/styles.css [編集] CS1とCS2テンプレートに適用されるCSSスタイル
モジュール:Citation/CS1/Suggestions モジュール:Citation/CS1/Suggestions/sandbox [編集] よく使われる間違った引数名とそれに対応する正しい引数名の一覧

-- Please insert new suggestions in alphabetical order
-- The form is ['incorrect'] = 'correct',

suggestions = {
	['abruf'] = 'access-date',													-- German
	['abruf-verborgen'] = 'access-date',										-- German
	['accessmonth'] = 'access-date',
	['accesso'] = 'access-date',												-- Italian
	['accessyear'] = 'access-date',
	['address'] = 'location',
	['année'] = 'date',															-- French
	['año'] = 'date',
	['año-original'] = 'orig-year',
	['añoacceso'] = 'access-date',												-- Spanish
	['annoaccesso'] = 'access-date',											-- Italian
	['annodiaccesso'] = 'access-date',											-- Italian
	['apellido'] = 'last',														-- Spanish
	['archiv-datum'] = 'archive-date',											-- German
	['archive date'] = 'archive-date',
	['archiv-url'] = 'archive-url',												-- German
	['archive url'] = 'archive-url',											-- Spanish
	['artikelnr'] = 'id',														-- German (as 'id=Article No. ...')
	['artist'] = 'others',
	['auflage'] = 'edition',													-- German
	['auteur'] = 'author',														-- French
	['auther'] = 'author',
	['author link'] = 'author-link',											-- Polish
	['author link2'] = 'author2-link',											-- Polish
	['autor'] = 'author',														-- German (singular and plural)
	['autore'] = 'author',														-- Italian
	['autthor'] = 'author',
	['band'] = 'volume',														-- German
	['bandreihe'] = 'volume',													-- German
	['ch'] = 'language',														-- German (as 'language=de-CH')
	['chapter_title'] = 'chapter',
	['cita'] = 'quote',															-- Spanish
	['citazione'] = 'quote',													-- Italian
	['coauthor'] = 'author',
	['coauthors'] = 'author',
	['coautores'] = 'author',													-- Spanish
	['coautori'] = 'author',													-- Italian
	['cognome'] = 'last',														-- Italian
	['consulté le'] = 'access-date',											-- French
	['czasopismo'] = 'journal',													-- Polish
	['data'] = 'date',															-- Polish, Italian
	['dataarchivio'] = 'archive-date',											-- Italian
	['data dostępu'] = 'access-date',											-- Polish
	['datum'] = 'date',															-- German
	['deadlink'] = 'url-status',
	['deadurl'] = 'url-status',
	['dead-url'] = 'url-status',
	['distributor'] = 'publisher',
	['dnb'] = 'id',																-- German (as 'id={{DNB-IDN|...}}')
	['doi_brokendate'] = 'doi-broken-date',
	['doi_inactivedate'] = 'doi-inactive-date',
	['éditeur'] = 'editor',														-- French
	['editon'] = 'edition',
	['editoin'] = 'edition',
	['editora'] = 'publisher',													-- Portuguese
	['editorial'] = 'publisher',
	['en ligne le'] = 'archive-date',											-- French
	['encyclopædia'] = 'encyclopedia',
	['enlaceautor'] = 'author-link',											-- Spanish
	['fecha'] = 'date',															-- Spanish
	['fechaacceso'] = 'access-date',											-- Spanish
	['fechaarchivo'] = 'archive-date',											-- Spanish
	['filetype'] = 'format',
	['first 1'] = 'first1',
	['foramt'] = 'format',
	['formato'] = 'format',														-- Spanish, Italian, Polish
	['frist'] = 'first',
	['fundstelle'] = 'at',														-- German
	['herausgeber'] = 'editor',													-- German (singular and plural)
	['hrsg'] = 'publisher',														-- German
	['hrsgreihe'] = 'editor',													-- German
	['idioma'] = 'language',													-- Spanish, Italian
	['imię'] = 'first',															-- Polish
	['isbndefekt'] = 'ignore-isbn-error',										-- German
	['isbnformalfalsch'] = 'ignore-isbn-error',									-- German
	['isbnistformalfalsch'] = 'ignore-isbn-error',								-- German
	['isnb'] = 'isbn',
	['issnformalfalsch'] = 'ignore-issn-error',									-- German
	['jahr'] = 'date',															-- German
	['jahrea'] = 'orig-year',													-- German (not a direct replacement, but can be emulated)
	['kapitel'] = 'chapter',													-- German
	['langauge'] = 'language',
	['langue'] = 'language',													-- French
	['last 1'] = 'last1',
	['lieu'] = 'location',														-- French
	['lingua'] = 'language',													-- Italian
	['lire en ligne'] = 'url',													-- French
	['loaction'] = 'location',
	['locatoin'] = 'location',
	['lugar'] = 'location',														-- Spanish
	['miejsce'] = 'location',													-- Polish
	['miesiąc'] = 'date',														-- Polish
	['mois'] = 'date',															-- French
	['monat'] = 'date',															-- German
--	['name'] = 'author',														-- 'name' is often erroneously used for 'title' and 'work' as well, so no suggestion is better than a wrong suggestion
	['nazwisko'] = 'last',														-- Polish
	['nespaper'] = 'newspaper',
	['newpaper'] = 'newspaper',
	['news'] = 'newspaper',
	['nom'] = 'last',															-- French
	['nom1'] = 'last1',															-- French
	['nombre'] = 'first',														-- Spanish
	['nome'] = 'first',															-- Italian
	['nummer'] = 'number',														-- German
	['nummerreihe'] = 'number',													-- German
	['obra'] = 'work',															-- Spanish
	['odpowiedzialność'] = 'agency',											-- Polish
	['offline'] = 'url-status',													-- German (as 'url-status=dead')
	['online'] = 'url',															-- German (not a direct replacement, but can be emulated)
	['opublikowany'] = 'agency',												-- Polish
	['opera'] = 'work',															-- Italian
	['origdate'] = 'orig-year',
	['originaljahr'] = 'orig-year',												-- German
	['originalort'] = 'publication-place',										-- German
	['originalsprache'] = 'language',											-- German
	['originaltitel'] = 'title',												-- German (if 'originaltitel' is specified, any possible contents of 'title' should be put in 'trans-title')
	['ort'] = 'publication-place',												-- German
	['ortea'] = 'publication-place',											-- German (not a direct replacement, but can be emulated)
	['other'] = 'others',
	['oznaczenie'] = 'agency',													-- Polish
	['pagees'] = 'pages',
	['página'] = 'page',														-- Spanish, Italian
	['páginas'] = 'pages',														-- Spanish, Italian
	['passage'] = 'pages',														-- French
	['pagina'] = 'pages',														-- Italian
	['pagine'] = 'pages',														-- Italian
	['périodique'] = 'publisher',												-- French
	['plublisher'] = 'publisher',
	['pmcid'] = 'pmc',
	['praca'] = 'work',															-- Polish
	['prénom'] = 'first',														-- French
	['prénom1'] = 'first1',														-- French
	['ps'] = 'postscript',
	['pub'] = 'publisher',
	['pulbication-place'] = 'publication-place',
	['reihe'] = 'series',														-- German
	['retrieved'] = 'access-date',
	['rok'] = 'date',															-- Polish
	['sammelwerk'] = 'work',													-- German
	['seria'] = 'series',														-- Polish
	['série'] = 'series',														-- French
	['service'] = 'agency',
	['sitioweb'] = 'website',													-- Spanish
	['sito'] = 'website',														-- Italian
	['stron'] = 'page',															-- Polish
	['strony'] = 'pages',														-- Polish
	['spalten'] = 'at',															-- German (not a direct replacement, but can be emulated)
	['sprache'] = 'language',													-- German
	['suscripción'] = 'url-access',												-- Spanish, Polish (as |url-access=subscription)
	['tag'] = 'date',															-- German
	['template doc demo'] = 'template-doc-demo',
	['tile'] = 'title',
	['tite'] = 'title',
	['titel'] = 'title',														-- German
	['titel-p'] = 'title',														-- German ('postscript=none' should be added as well)
	['titelerg'] = 'contribution',												-- German (not a direct replacement, but can be emulated)
	['titolo'] = 'title',														-- Spanish, Italian
	['titre'] = 'title',														-- French
	['títle'] = 'title',
	['título'] = 'title',														-- Spanish
	['transchapter'] = 'trans-chapter',
	['trans_chapter'] = 'trans-chapter',
	['trans_title'] = 'trans-title',
	['transtitle'] = 'trans-title',
	['typ'] = 'author-mask',													-- German (not a direct replacement, but the only valid argument 'typ=wl' can be emulated using 'author-mask')
	['tytuł'] = 'title',														-- Polish
	['ubicación'] = 'location',													-- Spanish
	['urlarchivo'] = 'archive-url',												-- Spanish
	['urlarchivio'] = 'archive-url',											-- Italian
	['urn'] = 'id',																-- German (as 'id={{URN|...}}')
	['übersetzer'] = 'translator',												-- German (singular and plural)
	['verlag'] = 'publisher',													-- German
	['verlagea'] = 'publisher',													-- German (not a direct replacement, but can be emulated)
	['vol'] = 'volume', 
	['volumen'] = 'volume',														-- Spanish
	['werk'] = 'work',															-- German
	['werkerg'] = 'contribution',												-- German (not a direct replacement, but can be emulated)
	['wkautore'] = 'author-link',												-- Italian
	['wolumin'] = 'volume',														-- Polish
	['wydanie'] = 'number',														-- Polish
	['wydawca'] = 'publisher',													-- French
	['zaprezentowany'] = 'publisher',											-- French
	['zdb'] = 'id',																-- German (as 'id={{ZDB|...}}')
	['zitat'] = 'quote',														-- German
	['zugriff'] = 'access-date',												-- German
}



--[[--------------------------< P A T T E R N S >--------------------------------------------------------------

Here we use Lua patterns to make suggestions.  The form is

	['pattern'] = 'correct',

Lua patterns are not REGEX though they are similar.  The escape character is '%', not '\'.
For more information about Lua patterns, see: Extension:Scribunto/Lua_reference_manual#Patterns

Patterns should probably always include the '^' and '$' anchor assertions to prevent a partial
match from incorrectly suggesting the wrong parameter name.  For instance, the pattern 'a[utho]+r'
matches 'author' in the no-longer-supported parameter |author-separator= so the code suggests
'|author='; the same pattern also matches the no-longer-supported parameter |separator= (returning 'ator')
so again, the code suggests '|author='.

One capture is supported, typically the enumerator from an enumerated parameter (the '6' in |author6=, etc.)
The value from the capture replaces $1 in the 'correct' value.

]]

local patterns = {
	['^ac+es+ ?d?a?t?e?$'] = 'access-date',
	['^a[utho]+r$'] = 'author',
	['^a[utho]+r(%d+)$'] = 'author$1',											-- enumerated
	['^pu[blish]+ers?$'] = 'publisher',
	}

return {suggestions = suggestions, patterns=patterns};