模組:Citation/CS1/Suggestions

本页使用了标题或全文手工转换
被永久保护的模块
维基百科,自由的百科全书
文档图示 模块文档[查看] [编辑] [历史] [清除缓存]



此列表是在引用模板中的参数未知时使用的建议名单。引用模板中发现未知参数时会生成一个错误消息,软件会基于此列表提醒用户常见的误写。

每项格式如下: ['bad input parameter'] = 'suggested parameter to use'

即输入的有误参数、建议使用的参数。

与此列表比对的有误参数检查前会转为小写,因此列表中的所有输入内容均应为小写形式。


如下文件涉及对CS1与CS2引用模板的支持:

CS1 | CS2模块
线上 沙盒 描述
Gold padlock Module:Citation/CS1 Module:Citation/CS1/sandbox [编辑] 主模块,依输入的模板参数生成相应的引文
Module:Citation/CS1/Configuration Module:Citation/CS1/Configuration/sandbox [编辑] 配置表
Module:Citation/CS1/Whitelist Module:Citation/CS1/Whitelist/sandbox [编辑] 现行与已过时不推荐使用的CS1与CS2参数
Module:Citation/CS1/Date validation Module:Citation/CS1/Date validation/sandbox [编辑] 日期格式验证函数
Module:Citation/CS1/Error Module:Citation/CS1/Error/sandbox [编辑] 错误/维护信息相关函数
Module:Citation/CS1/Identifiers Module:Citation/CS1/Identifiers/sandbox [编辑] 支持命名标识符(ISBN、DOI、PMID等)的函数
Module:Citation/CS1/Language Module:Citation/CS1/Language/sandbox [编辑] 语言相关函数
Module:Citation/CS1/Links Module:Citation/CS1/Links/sandbox [编辑] 维基内、外链相关函数
Module:Citation/CS1/People Module:Citation/CS1/People/sandbox [编辑] 人名列表相关函数
Module:Citation/CS1/Utilities Module:Citation/CS1/Utilities/sandbox [编辑] 简单无副作用的辅助函数(主要为字串/格式相关)
Module:Citation/CS1/COinS Module:Citation/CS1/COinS/sandbox [编辑] 支持CS1与CS2模板元数据渲染的函数
Module:Citation/CS1/styles.css Module:Citation/CS1/sandbox/styles.css [编辑] 为CS1与CS2模板提供CSS样式
Silver padlock Module:Citation/CS1/Suggestions Module:Citation/CS1/Suggestions/sandbox [编辑] 将常见错误参数名映射到有效参数名的列表

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

suggestions = {
--	['acccessdate'] = 'access-date',
--	['accesdate'] = 'access-date',
--	['access date'] = 'access-date',
--	['accessate'] = 'access-date',
--	['accessdare'] = 'access-date',
--	['accessdatte'] = 'access-date',
--	['accessddate'] = 'access-date',
--	['accessdte'] = 'access-date',
--	['accessed'] = 'access-date',
--	['accessedate'] = 'access-date',
--	['accesssdate'] = 'access-date',
--	['accssdate'] = 'access-date',
--	['acessdate'] = 'access-date',
	['address'] = 'location',
	['année'] = 'year', -- French
	['añoacceso'] = 'access-date', -- Spanish, Italian
	['apellido'] = 'last', -- Spanish, Italian
	['archive date'] = 'archive-date',
	['archive url'] = 'archive-url', -- Spanish, Italian
	['artist'] = 'others',
	['auteur'] = 'author', -- French
	['auther'] = 'author',
	['authorformat'] = 'name-list-format',										-- remove after 2016-01-01
	['author-format'] = 'name-list-format',										-- remove after 2016-01-01
	['author link'] = 'author-link',
--	['autor'] = 'author', -- Spanish, Italian
--	['autor2'] = 'author2', -- Spanish, Italian
	['autthor'] = 'author',
	['began'] = 'date',															-- remove after 2016-01-01
	['chapter_title'] = 'chapter',
	['cita'] = 'quote', -- Spanish, Italian
	['coautores'] = 'coauthors', -- Spanish, Italian
	['consulté le'] = 'access-date', -- French
	['deadlink'] = 'dead-url',
	['distributor'] = 'publisher',
	['éditeur'] = 'editor', -- French
	['editon'] = 'edition',
	['editoin'] = 'edition',
	['editorformat'] = 'name-list-format',										-- remove after 2016-01-01
	['editor-format'] = 'name-list-format',										-- remove after 2016-01-01
	['editorgiven'] = 'editor-given',											-- remove after 2016-01-01
	['editorial'] = 'publisher',
	['editorsurname'] = 'editor-surname',										-- remove after 2016-01-01
	['en ligne le'] = 'archive-date', -- French
	['ended'] = 'date',															-- remove after 2016-01-01
	['enlaceautor'] = 'author-link', -- Spanish, Italian
	['fecha'] = 'date', -- Spanish, Italian
	['fechaacceso'] = 'access-date', -- Spanish, Italian
	['fechaarchivo'] = 'archive-date', -- Spanish, Italian
	['filetype'] = 'format',
	['first 1'] = 'first1',
	['foramt'] = 'format',
	['formato'] = 'format', -- Spanish, Italian
	['frist'] = 'first',
	['idioma'] = 'language', -- Spanish, Italian
	['isnb'] = 'isbn',
	['lang'] = 'language',
	['langauge'] = 'language',
	['langue'] = 'language', -- French
	['last 1'] = 'last1',
	['lieu'] = 'location', -- French
	['lire en ligne'] = 'url', -- French
	['loaction'] = 'location',
	['locatoin'] = 'location',
	['mois'] = 'month', -- French
	['month'] = 'date',															-- remove after 2016-01-01
--	['name'] = 'author', -- 'name' is often erroneously used for 'title' and 'work' as well, so no suggestion is better than a wrong suggestion
	['nespaper'] = 'newspaper',
	['newpaper'] = 'newspaper',
	['news'] = 'newspaper',
	['nom'] = 'last', -- French
	['nom1'] = 'last1', -- French
	['nombre'] = 'first', -- Spanish, Italian
	['obra'] = 'work', -- Spanish, Italian
	['origdate'] = 'orig-year',
	['other'] = 'others',
	['pagees'] = 'pages',
	['página'] = 'page', -- Spanish, Italian
	['páginas'] = 'pages', -- Spanish, Italian
	['passage'] = 'pages', -- French
	['périodique'] = 'publisher', -- French
	['plublisher'] = 'publisher',
	['pmcid'] = 'pmc',
	['prénom'] = 'first', -- French
	['prénom1'] = 'first1', -- French
	['ps'] = 'postscript',
	['pub'] = 'publisher',
--	['pubisher'] = 'publisher',
--	['publiser'] = 'publisher',
--	['publishers'] = 'publisher',
--	['publsher'] = 'publisher',
--	['publsiher'] = 'publisher',
	['pulbication-place'] = 'publication-place',
--	['pulbisher'] = 'publisher',
--	['pulisher'] = 'publisher',
	['retrieved'] = 'access-date',
	['separator'] = 'mode',														-- remove after 2016-01-01
	['série'] = 'work', -- French
	['service'] = 'agency',
	['suscripción'] = 'subscription', -- Spanish, Italian
	['tile'] = 'title',
	['tite'] = 'title',
	['titolo'] = 'title', -- Spanish, Italian
	['titre'] = 'title', -- French
	['título'] = 'title', -- Spanish, Italian
	['transchapter'] = 'trans-chapter',
	['translator'] = 'others',
	['transtitle'] = 'trans-title',
	['ubicación'] = 'location', -- Spanish, Italian
	['urlarchivo'] = 'archive-url', -- Spanish, Italian
	['vol'] = 'volume', 
}


--[[--------------------------< 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};