وکیپیڈیا
pnbwiki
https://pnb.wikipedia.org/wiki/%D9%BE%DB%81%D9%84%D8%A7_%D8%B5%D9%81%DB%81
MediaWiki 1.45.0-wmf.9
first-letter
میڈیا
خاص
گل بات
ورتنوالا
ورتن گل بات
وکیپیڈیا
ویونت گل بات
فائل
فائل گل بات
میڈیا وکی
میڈیاوکی گل بات
سانچہ
سانچہ گل بات
ہتھونڈائی
ہتھونڈائی گل بات
گٹھ
گٹھ گل بات
TimedText
TimedText talk
ماڈیول
ماڈیول گل بات
Event
Event talk
خراسان
0
899
691018
682364
2025-07-11T04:43:39Z
2400:ADC7:970:ED00:54BD:6C01:4AA5:472B
691018
wikitext
text/x-wiki
[[File:Califate_750.jpg|thumb|250px|https://ur.m.wikipedia.org/wiki/%D9%81%D8%A7%D8%A6%D9%84:Parthian_Empire_at_its_greatest_extent.png|alt=https://ur.m.wikipedia.org/wiki/%D9%81%D8%A7%D8%A6%D9%84:Parthian_Empire_at_its_greatest_extent.png]]
'''خراسان'''، ایران دا اک اہم تے قدیم صوبہ سی ۔ اس وچ پہلے اوہ علاقے شامل سن جو ہن شمال مغربی [[افغانستان]] وچ شامل نيں۔ ایہ صوبہ مشرق وچ بدخشاں تک پھیلا ہويا سی تے اوہدی شمالی سرحد دریائے جیحون تے خوارزم سن ۔ [[نیشابور]]، [[مرو]]، [[ہرات]] تے [[بلخ]] اس صوبے دے راجگڑھ رہے نيں۔
'''پرانا خراسان''' ({{lang-pal|[[Image:khorasanpahlavi.png|50px]]}}, {{lang-fa|خراسان}} ''Xorāsān/Xorâsân'' {{audio|Khorasan pronounce.ogg|listen}}) فارس دے اتلے لہندے وچّ پیندا اک تریخی [[خطہ]] ہے،<ref name="Britannica">{{cite web |url=http://www.britannica.com/EBchecked/topic/316850/Khorasan |title=Khorasan |quote=''historical region and realm comprising a vast territory now lying in northeastern [[Iran]], southern [[Turkmenistan]], and northern [[Afghanistan]]. The historical region extended, along the north, from the [[Amu Darya]] (Oxus River) westward to the [[Caspian Sea]] and, along the south, from the fringes of the central Iranian deserts eastward to the [[Hindu Kush|mountains of central Afghanistan]]. Arab geographers even spoke of its extending to the boundaries of [[Hindustan|India]].''|publisher=Encyclopædia Britannica Online |date=|accessdate=2010-10-21}}</ref> جس وچّ اج دا [[افغانستان]]، [[ترکمانستان]]، [[ازبکستان]]، [[تاجکستان]] اتے چڑھدا [[ایران]] دے بہت سارے حصے شامل سن۔ اس وچّ کدے کدے [[سوگدا]] اتے [[ماوراء النہر]] علاقہ شامل کیتے جاندے سن۔ دھیان دیو کہ موجودہ ایران وچّ اک خراسان صوبہ ہے، جو اس تریخی خراسان علاقے دا صرف اک صرف ہے۔
==ناں دا ماخذ==
وچکارلی [[فارسی]] وچّ خر دا مطلب [[سورج]] (اج دی فارسی وچّ خورشید) اتے اسان جاں ایان دا مطلب آؤنا ہندا ہے۔ خراسان دا مطلب ہے اوہ جگہ جتھوں سورج آؤندا ہووے یعنی مشرقی زمین۔ ایہہ نام اس لئی پیا کیونکہ خراسان علاقہ ایران دے ولوں چڑھدا وچّ ہے۔<ref name="ref55fivoq">[http://books.google.com/books?id=1_03AAAAIAAJ The Abbasid Revolution], M. A. Shaban, CUP Archive, 1979, ISBN 978-0-521-29534-5, ''... As the word Khurasan means literally the land of the east ...''</ref>
== جغرافیہ ==
خراسان چ پہلے اوہ سارے علاقے شامل سن جہڑے ہن شمال مغربی [[افغانستان]] اے ، تے مشرق چ [[بدخشان]] تک پھیلیا ہوئیا سی ۔ اسدی شمالی سرحد [[آمو دریا]] تے [[خوارزم]] سن ۔ [[نیشاپور]] ، [[مرو]] ،[[ہرات]] ،تے [[بلخ]] اسدے راجگھر رہے نیں ۔ ہن اسدا صدر مقام [[مشہد]] مقدس اے ۔ مشرقی خراسان بمع شہر [[ہرات]] ہن [[افغانستان]] دی حدود چ شامل اے ۔
== تریخ ==
[[فائل:Ancient Khorasan highlighted.jpg|thumb|330px|پرانے نقشے وچّ خراسان دا نام موجود ہے]]
==رقبہ==
خراسان ایران دے اس اتر-پوربی صوبے دا نام ہے، جو اتر وچّ روسی کاسپیئن پردیش نال جڑیا ہویا ہے۔ اترک ندی چاٹ تکّ اسدی بھوگولک سیما نردھارت کردی ہے۔ اسدے پورب وچّ افغانستان، پچھم وچّ استراباد، شاہرد، سیمنان، دمدھان اتے یجد دے ایرانی پرانت اتے دکھن وچّ کیرمان ہے۔ اس پرکار اسدا کھیترپھل 25,000 ورگمیل ہے۔ خراسان دا سارا دھراتلی بھاگ پہاڑی، ماروتھلی جاں نمکین جھیل دا نیواں گرت ہے۔ دکھن وچّ پہاڑی بھاگ دی اچائی 11,000 توں لے کے 13,000 تکّ ہے۔
==کھیتی باڑی اتے کھنج==
خراسان وچّ کھوہاں اتے وچّ وچّ وچّ لپت ہو جان والیاں ندیاں دوارا سنجے جان والے بہت سارے نخلستان ملدے ہن۔ آتریک اتے کشاپھ دیاں اپجاؤ گھاٹیاں وچّ کھادھ انّ، کپاہ، تماکو، چوقندر اتے پھلاں دی کھیتی ہندی ہے۔ ایہہ پرانت کیسر، پستا، گوند، کاشٹھپھل، کمبل، کھال اتے نیلمنی آدی دے لئی پرسدھ ہن۔ اتھے لوہا، سیسہ، لون، سونا، تانبہ اتے بلور وی پایا جاندا ہ۔
==برآمد دیاں وستواں==
میشید خراسان صوبے دی راجدھانی ہے۔ ایہہ سڑک دوارا ہور پرمکھ نگراں نال جڑی ہے۔ ملّ دی نظر توں برآمد دیاں وستواں کرموار: قالین، چمڑہ اتے کھلّ، افیم، عمارتی لکڑی، کپاہ دیاں چیزاں، سلک اتے نیلمنی ہن۔
=ہور ویکھو==
**[[ایران دی تریخ]]
==حوالے==
{{حوالے}}
[[گٹھ:وسطی ایشیا دی تریخ]]
[[گٹھ:جغرافیہ]]
[[گٹھ:تریخ]]
[[گٹھ:ایشیا دی تریخ]]
[[گٹھ:افغانستان]]
[[گٹھ:افغانستان دا جغرافیہ]]
[[گٹھ:صوبے ریاستاں]]
[[گٹھ:علاقے]]
[[گٹھ:ایران]]
e48natdbzpoxi2z3waq557k52qyisiw
شاہ مراد
0
13577
691006
510665
2025-07-10T17:00:20Z
2407:D000:A:4212:E855:9671:34DF:9C95
691006
wikitext
text/x-wiki
{| class="toccolours" style="float: left; margin-left: 1em; width: 20em; font-size: 90%;"
| style="background:#FB607F" align="center" width="130px" colspan=2 |'''<font size="+1" color=white>شاہ مراد<font>'''
|-
|جیون|| 1628 - 1720 [[چکوال]]
|-
|گن|| پنجابی وچ غزل کہن والا پہلا شاعر
|-
|}
شاہ مراد [[پنجابی]] دا اک [[شاعر]] اے۔ اوہ [[چکوال]] وچ جمیا۔ شاہ مراد نوں شاہ مراد حانپوری وی کہیا جاندا اے۔ اوہناں نوں [[پنجابی غزل]] لکھن والا شاعر منیا جاندا اے۔ شاہ مراد دی [[شاعری]] [[فارسی]] تے عراقی زل نال رلدی اے۔ اودی شاعری [[غزل]] دیاں ساریاں ونڈاں ہیگیاں نیں۔
تن سک سک ہویا پتلا کس اگے کہوں جیلا -- لوہوئیں منہ پیلا نال برہوں دے نے جتگے
[[Category:پنجابی شاعر]]
ifjv8b2mf6exwcrmqli3q8ioofq7w41
691008
691006
2025-07-10T17:15:34Z
2407:D000:A:4212:E855:9671:34DF:9C95
691008
wikitext
text/x-wiki
{| class="toccolours" style="float: left; margin-left: 1em; width: 20em; font-size: 90%;"
| style="background:#FB607F" align="center" width="130px" colspan=2 |'''<font size="+1" color=white>شاہ مراد<font> خانپوری'''
|-
|جیون|| 1628ء - 1720ء [[چکوال]]
|-
|گن|| پنجابی وچ غزل دا موڈھی شاعر
|-
|}
حضرت شاہ مراد خانپوری صوفی بزرگ تے [[پنجابی]] فارسی اَتے ریختہ دے اُچ کوٹی دے [[شاعر]] نیں۔
اوہناں دا جنم [[چکوال]] دے اِک گِراں خانپور وچ ہویا۔ اوہناں دے والد دا ناں قاضی جان محمد اَتے دادے دا ناں محمد شیر سی۔ حسبوں نسبوں شاہ مراد خانپوری قریشی صدیقی سن۔ اوہناں دا شجرہ اِکّی واسطیاں نال حضرت ابوبکر صدیق تیکر پہنچدا اے۔ <ref>کلام شاہ مراد خانپوری ، انور بیگ اعوان ، بزم ثقافت چکوال</ref>
شاہ مراد خانپوری ہوراں نوں [[پنجابی غزل]] دا موڈھی شاعر منیا جاندا اے۔
[[Category:پنجابی شاعر]]
n3x5gd73t6i4tmy5a4ijt1sb0eyaplb
691009
691008
2025-07-10T17:26:25Z
2407:D000:A:4212:E855:9671:34DF:9C95
691009
wikitext
text/x-wiki
{| class="toccolours" style="float: left; margin-left: 1em; width: 20em; font-size: 90%;"
| style="background:#FB607F" align="center" width="130px" colspan=2 |'''<font size="+1" color=white>شاہ مراد<font> خانپوری'''
|-
|جیون|| 1628ء - 1720ء [[چکوال]]
|-
|گن|| پنجابی وچ غزل دا موڈھی شاعر
|-
|}
حضرت شاہ مراد خانپوری صوفی بزرگ تے [[پنجابی]] فارسی اَتے ریختہ دے اُچ کوٹی دے [[شاعر]] نیں۔
اوہناں دا جنم [[چکوال]] دے اِک گِراں خانپور وچ ہویا۔ اوہناں دے والد دا ناں قاضی جان محمد اَتے دادے دا ناں محمد شیر سی۔ حسبوں نسبوں شاہ مراد خانپوری قریشی صدیقی سن۔ اوہناں دا شجرہ اِکّی واسطیاں نال حضرت ابوبکر صدیق تیکر پہنچدا اے۔ <ref>کلام شاہ مراد خانپوری ، انور بیگ اعوان ، بزم ثقافت چکوال</ref>
شاہ مراد خانپوری ہوراں نوں [[پنجابی غزل]] دا موڈھی شاعر منیا جاندا اے۔
اوہناں دی شاعری دا اِک نمونہ ویکھو:
خداوندا مِلا مینوں سجن اتنا اُڈیکاں کیوں
اُڈیکاں تے گِناں تارے تے سر نُوں لائیاں لِیکاں کیوں
تیری حالت تُوہِیں جانے مراد اپنی دُعا ایہا
خداوندا مِلا مینوں سجن اتنا اُڈیکاں کیوں
[[Category:پنجابی شاعر]]
kjngzqqnma0z5pu5bvov4uh3wyi0veo
کرسک
0
20651
691025
471935
2025-07-11T05:28:11Z
Andre Engels
653
صفحے نوں [[کورسک]] ول ریڈائرکٹ کیتا
691025
wikitext
text/x-wiki
#REDIRECT [[کورسک]]
gwj34csvbirakqg5p02yxhlw953dj8k
ارخانجلسک
0
20657
691026
603829
2025-07-11T05:28:52Z
Andre Engels
653
صفحے نوں [[آرخانگلسک]] ول ریڈائرکٹ کیتا
691026
wikitext
text/x-wiki
#REDIRECT [[آرخانگلسک]]
j03r8cwep2615xsmxe568ls5a9ry0zq
سانچہ:Lua
10
39380
690992
602486
2025-07-10T16:36:46Z
Abbas dhothar
361
690992
wikitext
text/x-wiki
<includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
{{لوا|Module:Lua banner}}
{{دستاویز}}
<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
</noinclude>
h057cn6byu9zizgskat9qdx21lw09is
ماڈیول:Citation/CS1
828
41269
690969
688402
2025-07-10T15:47:53Z
Abbas dhothar
361
690969
Scribunto
text/plain
require ('strict');
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
each of these counts against the Lua upvalue limit
]]
local validation; -- functions in Module:Citation/CS1/Date_validation
local utilities; -- functions in Module:Citation/CS1/Utilities
local z = {}; -- table of tables in Module:Citation/CS1/Utilities
local identifiers; -- functions and tables in Module:Citation/CS1/Identifiers
local metadata; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[------------------< P A G E S C O P E V A R I A B L E S >---------------
declare variables here that have page-wide scope that are not brought in from
other modules; that are created here and used here
]]
local added_deprecated_cat; -- Boolean flag so that the category is added only once
local added_vanc_errs; -- Boolean flag so we only emit one Vancouver error / category
local added_generic_name_errs; -- Boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered
local added_numeric_name_errs; -- Boolean flag so we only emit one numeric name error / category and stop testing names once an error is encountered
local added_numeric_name_maint; -- Boolean flag so we only emit one numeric name maint category and stop testing names once a category has been emitted
local is_preview_mode; -- true when article is in preview mode; false when using 'Preview page with this template' (previewing the module)
local is_sandbox; -- true when using sandbox modules to render citation
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if utilities.is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a Boolean declared in page scope variables above
]]
local function add_vanc_error (source, position)
if added_vanc_errs then return end
added_vanc_errs = true; -- note that we've added this category
utilities.set_message ('err_vancouver', {source, position});
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a URI scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of TLDs: https://www.iana.org/domains/root/db
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the TLD. tld
is two or more alpha characters. Any preceding '//' (from splitting a URL with a scheme) will be stripped
here. Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and TLD or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource
return false;
end
local patterns = { -- patterns that look like URLs
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and ccTLD (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and TLD
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
'[%a%d]+%:?' -- IPv6 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a URL is a URL
end
end
for _, d in ipairs (cfg.single_letter_2nd_lvl_domains_t) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if utilities.is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when URL is protocol-relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a URL into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.
When not protocol-relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Any URL that does not have news: scheme must have authority indicator (//). TODO: are there other common schemes
like news: that don't use authority indicator?
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol-relative URL
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
if utilities.is_set (authority) then
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if utilities.is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
else
if not scheme:match ('^news:') then -- except for news:..., MediaWiki won't link URLs that do not have authority indicator; TODO: a better way to do this test?
return scheme; -- return scheme only making domain nil which will cause an error message
end
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the
|<param>-link= parameter is ok); else false when value appears to be a valid URL (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from URL;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid URL
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wiki-linked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
check <link> for inter-language interwiki-link prefix. prefix must be a MediaWiki-recognized language
code and must begin with a colon.
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if utilities.is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
elseif link:match ('^%a+:') then -- if the link is what looks like an interwiki
local prefix = link:match ('^(%a+):'):lower(); -- get the interwiki prefix
if cfg.inter_wiki_map[prefix] then -- if prefix is in the map, must have preceding colon
orig = lorig; -- flag as error
end
end
end
if utilities.is_set (orig) then
link = ''; -- unset
utilities.set_message ('err_bad_paramlink', orig); -- URL or wikilink in |title= with |title-link=;
end
return link; -- link if ok, empty string else
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the URL into scheme and domain
portions, or for protocol-relative (//example.com) URLs, just the domain. Use is_url() to validate the two
portions of the URL. If both are valid, or for protocol-relative if domain is valid, return true, else false.
Because it is different from a standard URL, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper URL
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from URL;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a URL. The test will also find external wikilinks
that use protocol-relative URLs. Also finds bare URLs.
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs. The tests that
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol-relative ext. wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare URL with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('^//%S+') or value:match ('%s//%S+') then -- if protocol-relative bare URL: //yyyyy.zzz; authority indicator (//) must be be preceded nothing or by whitespace
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a URL
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list, error_list)
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a URL add an error message
table.insert (error_list, utilities.wrap_style ('parameter', k));
end
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
utilities.set_message ('err_wikilink_in_url', {});
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link (URL, label, source, access)
local err_msg = '';
local domain;
local path;
local base_url;
if not utilities.is_set (label) then
label = URL;
if utilities.is_set (source) then
utilities.set_message ('err_bare_url_missing_title', {utilities.wrap_style ('parameter', source)});
else
error (cfg.messages["bare_url_no_origin"]); -- programmer error; valid parameter name does not have matching meta-parameter
end
end
if not check_url (URL) then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)});
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the URL into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['['] = '%5b', [']'] = '%5d'}); -- replace '[' and ']' with their percent-encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat ({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wiki-markup URL
if utilities.is_set (access) then -- access level (subscription, registration, limited)
base_url = utilities.substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return base_url;
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a Boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
utilities.set_message ('err_deprecated_params', {name}); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wiki-markup) are not kerned.
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc.; not for book titles.
]=]
local function kern_quotes (str)
local cap = '';
local wl_type, label, link;
wl_type, label, link = utilities.is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
str = utilities.substitute (cfg.presentation['kern-right'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = utilities.substitute (cfg.presentation['kern-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label = mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label = mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap = mw.ustring.match (label, "^([\"\'][^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-left'], cap);
end
cap = mw.ustring.match (label, "^(.+[^\'][\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-right'], cap);
end
if 2 == wl_type then
str = utilities.make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate RTL languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO 639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not utilities.is_set (lang) then
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing title part']}); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_tag_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if utilities.is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if utilities.in_array (lang, cfg.script_lang_codes) then
utilities.add_prop_cat ('script', {name, lang})
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['unknown language code']}); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['invalid language code']}); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing prefix']}); -- no language code prefix; add error message
end
script_value = utilities.substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is RTL
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script
value has been wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if utilities.is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang attribute, categorization, etc.; returns empty string on error
if utilities.is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not utilities.is_set ( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return utilities.substitute ( msg, str ); -- including template text
else
return utilities.substitute ( cfg.messages[key], str );
end
end
--[[----------------< W I K I S O U R C E _ U R L _ M A K E >-------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate
label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
local wikisource_prefix = table.concat ({'https://', cfg.this_wiki_code, '.wikisource.org/wiki/'});
wl_type, D, L = utilities.is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent-encoding of fragment marker
end
return ws_url, ws_label, L or D; -- return proper URL or nil and a label or nil
end
--[[----------------< F O R M A T _ P E R I O D I C A L >-----------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=,
and |trans-<periodical>= into a single Periodical meta-parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
if not utilities.is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = utilities.wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (trans_periodical) then
trans_periodical = utilities.wrap_style ('trans-italic-title', trans_periodical);
if utilities.is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when trans-periodical without periodical or script-periodical
periodical = trans_periodical;
utilities.set_message ('err_trans_missing_title', {'periodical'});
end
end
return periodical;
end
--[[------------------< F O R M A T _ C H A P T E R _ T I T L E >---------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used
for error messages).
]]
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ' '); -- replace underscore separators with space characters
chapter = ws_label;
end
if not utilities.is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from module provided quote marks
chapter = utilities.wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, script_chapter, script_chapter_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (chapter_url) then
chapter = external_link (chapter_url, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if utilities.is_set (trans_chapter) then
trans_chapter = utilities.wrap_style ('trans-quoted-title', trans_chapter);
if utilities.is_set (chapter) then
chapter = chapter .. ' ' .. trans_chapter;
else -- here when trans_chapter without chapter or script-chapter
chapter = trans_chapter;
chapter_source = trans_chapter_source:match ('trans%-?(.+)'); -- when no chapter, get matching name from trans-<param>
utilities.set_message ('err_trans_missing_title', {chapter_source});
end
end
return chapter;
end
--[[----------------< H A S _ I N V I S I B L E _ C H A R S >-------------------
This function searches a parameter's value for non-printable or invisible characters.
The search stops at the first match.
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers
(gallery, math, pre, ref) and identifies them with a slightly different error message.
See also coins_cleanup().
Output of this function is an error message that identifies the character or the
Unicode group, or the stripmarker that was detected along with its position (or,
for multi-byte characters, the position of its first byte) in the parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local capture; -- used by stripmarker detection to hold name of the stripmarker
local stripmarker; -- boolean set true when a stripmarker is found
capture = string.match (v, '[%w%p ]*'); -- test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no Unicode characters
return;
end
for _, invisible_char in ipairs (cfg.invisible_chars) do
local char_name = invisible_char[1]; -- the character or group name
local pattern = invisible_char[2]; -- the pattern used to find it
position, _, capture = mw.ustring.find (v, pattern); -- see if the parameter value contains characters that match the pattern
if position and (cfg.invisible_defs.zwj == capture) then -- if we found a zero-width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- it's ok if one of the Indic scripts
position = nil; -- unset position
elseif cfg.emoji_t[mw.ustring.codepoint (v, position+1)] then -- is zwj followed by a character listed in emoji{}?
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and utilities.in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and cfg.invisible_defs.del == capture then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then
err_msg = capture .. ' ' .. char_name;
else
err_msg = char_name .. ' ' .. 'character';
end
utilities.set_message ('err_invisible_char', {err_msg, utilities.wrap_style ('parameter', param), position}); -- add error message
return; -- and done with this parameter
end
end
end
end
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( args )
local origin = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = utilities.select_one ( args, list, 'err_redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >-------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>.
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:
<span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap = '';
local cap2 = '';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = utilities.substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = utilities.substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >---------------------
This function sets default title types (equivalent to the citation including
|type=<default value>) for those templates that have defaults. Also handles the
special case where it is desirable to omit the title type from the rendered citation
(|type=none).
]]
local function set_titletype (cite_class, title_type)
if utilities.is_set (title_type) then
if 'none' == cfg.keywords_xlate[title_type] then
title_type = ''; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< S A F E _ J O I N >-----------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'duplicate character'
if 1 == #duplicate_char then -- for single byte ASCII characters use the string library functions
f.gsub = string.gsub
f.match = string.match
f.sub = string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub = mw.ustring.gsub
f.match = mw.ustring.match
f.sub = mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1, 1) == '<' then -- special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove HTML markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if 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.?
trim = false;
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
str = f.sub(str, 1, -2); -- remove it
elseif end_chr == "'" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5, -1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4, -1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3, -1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2, -1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4, -1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2, -1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1, -3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains HTML markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows HTML markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; -- add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >-----------------------------
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.
Puncutation not allowed.
]]
local function is_suffix (suffix)
if utilities.in_array (suffix, {'Jr', 'Sr', 'Jnr', 'Snr', '1st', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------< I S _ G O O D _ V A N C _ N A M E >-------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin
(read ASCII) characters. When a name uses characters that contain diacritical
marks, those characters are to be converted to the corresponding Latin
character. When a name is written using a non-Latin alphabet or logogram, that
name is to be transliterated into Latin characters. The module doesn't do this
so editors may/must.
This test allows |first= and |last= names to contain any of the letters defined
in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes.
(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$")
or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor
gets confused between character insertion point and cursor position. The test has
been rewritten to use decimal character escape sequence for the individual bytes
of the Unicode characters so that it is not necessary to use an external editor
to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first, suffix, position)
if not suffix then
if first:find ('[,%s]') then -- when there is a space or comma, might be first name/initials + generational suffix
first = first:match ('(.-)[,%s]+'); -- get name/initials
suffix = first:match ('[,%s]+(.+)$'); -- get generational suffix
end
end
if utilities.is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error (cfg.err_msg_supl.suffix, position);
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191%-%s%'%.]*$") then
add_vanc_error (cfg.err_msg_supl['non-Latin char'], position);
return false; -- not a string of Latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered
as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format
because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the
Unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials (first, position)
if first:find (',', 1, true) then
return first; -- commas not allowed; abandon
end
local name, suffix = mw.ustring.match (first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match (first, "^(%u+)$"); -- is it just initials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error (cfg.err_msg_supl.suffix, position); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials_t, names_t = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names_t = mw.text.split (first, '[%s%-]+'); -- split into a sequence of names and possible suffix
while names_t[i] do -- loop through the sequence
if 1 < i and names_t[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names_t[i] = names_t[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names_t[i]) then -- if a legitimate suffix
table.insert (initials_t, ' ' .. names_t[i]); -- add a separator space, insert at end of initials sequence
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials_t, mw.ustring.sub (names_t[i], 1, 1)); -- insert the initial at end of initials sequence
end
i = i + 1; -- bump the counter
end
return table.concat (initials_t); -- Vancouver format does not include spaces.
end
--[[--------------------------< I N T E R W I K I _ P R E F I X E N _ G E T >----------------------------------
extract interwiki prefixen from <value>. Returns two one or two values:
false – no prefixen
nil – prefix exists but not recognized
project prefix, language prefix – when value has either of:
:<project>:<language>:<article>
:<language>:<project>:<article>
project prefix, nil – when <value> has only a known single-letter prefix
nil, language prefix – when <value> has only a known language prefix
accepts single-letter project prefixen: 'd' (wikidata), 's' (wikisource), and 'w' (wikipedia) prefixes; at this
writing, the other single-letter prefixen (b (wikibook), c (commons), m (meta), n (wikinews), q (wikiquote), and
v (wikiversity)) are not supported.
]]
local function interwiki_prefixen_get (value, is_link)
if not value:find (':%l+:') then -- if no prefix
return false; -- abandon; boolean here to distinguish from nil fail returns later
end
local prefix_patterns_linked_t = { -- sequence of valid interwiki and inter project prefixen
'^%[%[:([dsw]):(%l%l+):', -- wikilinked; project and language prefixes
'^%[%[:(%l%l+):([dsw]):', -- wikilinked; language and project prefixes
'^%[%[:([dsw]):', -- wikilinked; project prefix
'^%[%[:(%l%l+):', -- wikilinked; language prefix
}
local prefix_patterns_unlinked_t = { -- sequence of valid interwiki and inter project prefixen
'^:([dsw]):(%l%l+):', -- project and language prefixes
'^:(%l%l+):([dsw]):', -- language and project prefixes
'^:([dsw]):', -- project prefix
'^:(%l%l+):', -- language prefix
}
local cap1, cap2;
for _, pattern in ipairs ((is_link and prefix_patterns_linked_t) or prefix_patterns_unlinked_t) do
cap1, cap2 = value:match (pattern);
if cap1 then
break; -- found a match so stop looking
end
end
if cap1 and cap2 then -- when both then :project:language: or :language:project: (both forms allowed)
if 1 == #cap1 then -- length == 1 then :project:language:
if cfg.inter_wiki_map[cap2] then -- is language prefix in the interwiki map?
return cap1, cap2; -- return interwiki project and interwiki language
end
else -- here when :language:project:
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return cap2, cap1; -- return interwiki project and interwiki language
end
end
return nil; -- unknown interwiki language
elseif not (cap1 or cap2) then -- both are nil?
return nil; -- we got something that looks like a project prefix but isn't; return fail
elseif 1 == #cap1 then -- here when one capture
return cap1, nil; -- length is 1 so return project, nil language
else -- here when one capture and its length it more than 1
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return nil, cap1; -- return nil project, language
end
end
end
--[[--------------------------< L I S T _ P E O P L E >--------------------------
Formats a list of people (authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been
rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
]]
local function list_people (control, people, etal)
local sep;
local namesep;
local format = control.format;
local maximum = control.maximum;
local name_list = {};
if 'vanc' == format then -- Vancouver-like name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub (-1, -1) ~= " " then sep = sep .. " " end
if utilities.is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for other names
for i, person in ipairs (people) do
if utilities.is_set (person.last) then
local mask = person.mask;
local one;
local sep_one = sep;
if utilities.is_set (maximum) and i > maximum then
etal = true;
break;
end
if mask then
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—", n) or nil; -- make a string of (n > 0) mdashes, nil else, to replace name
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
one = mask; -- replace name with mask text (must include name-list separator)
sep_one = " "; -- modify name-list separator
end
else
one = person.last; -- get surname
local first = person.first -- get given name
if utilities.is_set (first) then
if ("vanc" == format) then -- if Vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first, nil, i) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials (first, i); -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
end
if utilities.is_set (person.link) then
one = utilities.make_wikilink (person.link, one); -- link author/editor
end
if one then -- if <one> has a value (name, mdash replacement, or mask text replacement)
local proj, tag = interwiki_prefixen_get (one, true); -- get the interwiki prefixen if present
if 'w' == proj and ('Wikipedia' == mw.site.namespaces.Project['name']) then
proj = nil; -- for stuff like :w:de:<article>, :w is unnecessary TODO: maint cat?
end
if proj then
local proj_name = ({['d'] = 'Wikidata', ['s'] = 'Wikisource', ['w'] = 'Wikipedia'})[proj]; -- :w (wikipedia) for linking from a non-wikipedia project
if proj_name then
one = one .. utilities.wrap_style ('interproj', proj_name); -- add resized leading space, brackets, static text, language name
utilities.add_prop_cat ('interproj-linked-name', proj); -- categorize it; <proj> is sort key
tag = nil; -- unset; don't do both project and language
end
end
if tag == cfg.this_wiki_code then
tag = nil; -- stuff like :en:<article> at en.wiki is pointless TODO: maint cat?
end
if tag then
local lang = cfg.lang_tag_remap[tag] or cfg.mw_languages_by_tag_t[tag];
if lang then -- error messaging done in extract_names() where we know parameter names
one = one .. utilities.wrap_style ('interwiki', lang); -- add resized leading space, brackets, static text, language name
utilities.add_prop_cat ('interwiki-linked-name', tag); -- categorize it; <tag> is sort key
end
end
table.insert (name_list, one); -- add it to the list of names
table.insert (name_list, sep_one); -- add the proper name-list separator
end
end
end
local count = #name_list / 2; -- (number of names + number of separators) divided by 2
if 0 < count then
if 1 < count and not etal then
if 'amp' == format then
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
if 2 == count then
name_list[#name_list-2] = cfg.presentation.sep_nl_and; -- replace last separator with 'and' text
else
name_list[#name_list-2] = cfg.presentation.sep_nl_end; -- replace last separator with '(sep) and' text
end
end
end
name_list[#name_list] = nil; -- erase the last separator
end
local result = table.concat (name_list); -- construct list
if etal and utilities.is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. cfg.messages['et al']; -- we've got a last-first list and etal so add et al.
end
return result, count; -- return name-list string and count of number of names (count used for editor names only)
end
--[[--------------------< M A K E _ C I T E R E F _ I D >-----------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise
returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that
order. year is Year or anchor_year.
]]
local function make_citeref_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if utilities.is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< C I T E _ C L A S S _A T T R I B U T E _M A K E >------------------------------
construct <cite> tag class attribute for this citation.
<cite_class> – config.CitationClass from calling template
<mode> – value from |mode= parameter
]]
local function cite_class_attribute_make (cite_class, mode)
local class_t = {};
table.insert (class_t, 'citation'); -- required for blue highlight
if 'citation' ~= cite_class then
table.insert (class_t, cite_class); -- identify this template for user css
table.insert (class_t, utilities.is_set (mode) and mode or 'cs1'); -- identify the citation style for user css or javascript
else
table.insert (class_t, utilities.is_set (mode) and mode or 'cs2'); -- identify the citation style for user css or javascript
end
for _, prop_key in ipairs (z.prop_keys_t) do
table.insert (class_t, prop_key); -- identify various properties for user css or javascript
end
return table.concat (class_t, ' '); -- make a big string and done
end
--[[---------------------< N A M E _ H A S _ E T A L >--------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on
the theme of et al. If found, the et al. is removed, a flag is set to true and
the function returns the modified name and the flag.
This function never sets the flag to false but returns its previous state because
it may have been set by previous passes through this function or by the associated
|display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; -- get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
utilities.set_message ('err_etal', {param}); -- and set an error if not added
end
end
end
end
return name, etal;
end
--[[---------------------< N A M E _ I S _ N U M E R I C >----------------------
Add an error message and category when <name> parameter value does not contain letters.
Add a maintenance category when <name> parameter value has numeric characters mixed with characters that are
not numeric characters; could be letters and/or punctuation characters.
This function will only emit one error and one maint message for the current template. Does not emit both error
and maint messages/categories for the same parameter value.
returns nothing
]]
local function name_is_numeric (name, name_alias, list_name)
local patterns = {
'^%D+%d', -- <name> must have digits preceded by other characters
'^%D*%d+%D+', -- <name> must have digits followed by other characters
}
if not added_numeric_name_errs and mw.ustring.match (name, '^[%A]+$') then -- if we have not already set an error message and <name> does not have any alpha characters
utilities.set_message ('err_numeric_names', name_alias); -- add an error message
added_numeric_name_errs = true; -- set the flag so we emit only one error message
return; -- when here no point in further testing; abandon
end
if not added_numeric_name_maint then -- if we have already set a maint message
for _, pattern in ipairs (patterns) do -- spin through list of patterns
if mw.ustring.match (name, pattern) then -- digits preceded or followed by anything but digits; %D+ includes punctuation
utilities.set_message ('maint_numeric_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
added_numeric_name_maint = true; -- set the flag so we emit only one maint message
return; -- when here no point in further testing; abandon
end
end
end
end
--[[-----------------< N A M E _ H A S _ M U L T _ N A M E S >------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names.
Multiple names are indicated if there is more than one comma or any "unescaped"
semicolons. Escaped semicolons are ones used as part of selected HTML entities.
If the condition is met, the function adds the multiple name maintenance category.
Same test for first except that commas should not appear in given names (MOS:JR says
that the generational suffix does not take a separator character). Titles, degrees,
postnominals, affiliations, all normally comma separated don't belong in a citation.
<name> – name parameter value
<list_name> – AuthorList, EditorList, etc
<limit> – number of allowed commas; 1 (default) for surnames; 0 for given names
returns nothing
]]
local function name_has_mult_names (name, list_name, limit)
local _, commas, semicolons, nbsps;
limit = limit and limit or 1;
if utilities.is_set (name) then
_, commas = name:gsub (',', ''); -- count the number of commas
_, semicolons = name:gsub (';', ''); -- count the number of semicolons
-- nbsps probably should be its own separate count rather than merged in
-- some way with semicolons because Lua patterns do not support the
-- grouping operator that regex does, which means there is no way to add
-- more entities to escape except by adding more counts with the new
-- entities
_, nbsps = name:gsub (' ',''); -- count nbsps
-- There is exactly 1 semicolon per entity, so subtract nbsps
-- from semicolons to 'escape' them. If additional entities are added,
-- they also can be subtracted.
if limit < commas or 0 < (semicolons - nbsps) then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
end
end
--[=[-------------------------< I S _ G E N E R I C >----------------------------------------------------------
Compares values assigned to various parameters according to the string provided as <item> in the function call.
<item> can have on of two values:
'generic_names' – for name-holding parameters: |last=, |first=, |editor-last=, etc
'generic_titles' – for |title=
There are two types of generic tests. The 'accept' tests look for a pattern that should not be rejected by the
'reject' test. For example,
|author=[[John Smith (author)|Smith, John]]
would be rejected by the 'author' reject test. But piped wikilinks with 'author' disambiguation should not be
rejected so the 'accept' test prevents that from happening. Accept tests are always performed before reject
tests.
Each of the 'accept' and 'reject' sequence tables hold tables for en.wiki (['en']) and local.wiki (['local'])
that each can hold a test sequence table The sequence table holds, at index [1], a test pattern, and, at index
[2], a boolean control value. The control value tells string.find() or mw.ustring.find() to do plain-text search (true)
or a pattern search (false). The intent of all this complexity is to make these searches as fast as possible so
that we don't run out of processing time on very large articles.
Returns
true when a reject test finds the pattern or string
false when an accept test finds the pattern or string
nil else
]=]
local function is_generic (item, value, wiki)
local test_val;
local str_lower = { -- use string.lower() for en.wiki (['en']) and use mw.ustring.lower() or local.wiki (['local'])
['en'] = string.lower,
['local'] = mw.ustring.lower,
}
local str_find = { -- use string.find() for en.wiki (['en']) and use mw.ustring.find() or local.wiki (['local'])
['en'] = string.find,
['local'] = mw.ustring.find,
}
local function test (val, test_t, wiki) -- local function to do the testing; <wiki> selects lower() and find() functions
val = test_t[2] and str_lower[wiki](value) or val; -- when <test_t[2]> set to 'true', plaintext search using lowercase value
return str_find[wiki] (val, test_t[1], 1, test_t[2]); -- return nil when not found or matched
end
local test_types_t = {'accept', 'reject'}; -- test accept patterns first, then reject patterns
local wikis_t = {'en', 'local'}; -- do tests for each of these keys; en.wiki first, local.wiki second
for _, test_type in ipairs (test_types_t) do -- for each test type
for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do -- spin through the list of generic value fragments to accept or reject
for _, wiki in ipairs (wikis_t) do
if generic_value[wiki] then
if test (value, generic_value[wiki], wiki) then -- go do the test
return ('reject' == test_type); -- param value rejected, return true; false else
end
end
end
end
end
end
--[[--------------------------< N A M E _ I S _ G E N E R I C >------------------------------------------------
calls is_generic() to determine if <name> is a 'generic name' listed in cfg.generic_names; <name_alias> is the
parameter name used in error messaging
]]
local function name_is_generic (name, name_alias)
if not added_generic_name_errs and is_generic ('generic_names', name) then
utilities.set_message ('err_generic_name', name_alias); -- set an error message
added_generic_name_errs = true;
end
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding parameters.
]]
local function name_checks (last, first, list_name, last_alias, first_alias)
local accept_name;
if utilities.is_set (last) then
last, accept_name = utilities.has_accept_as_written (last); -- remove accept-this-as-written markup when it wraps all of <last>
if not accept_name then -- <last> not wrapped in accept-as-written markup
name_has_mult_names (last, list_name); -- check for multiple names in the parameter
name_is_numeric (last, last_alias, list_name); -- check for names that have no letters or are a mix of digits and other characters
name_is_generic (last, last_alias); -- check for names found in the generic names list
end
end
if utilities.is_set (first) then
first, accept_name = utilities.has_accept_as_written (first); -- remove accept-this-as-written markup when it wraps all of <first>
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_has_mult_names (first, list_name, 0); -- check for multiple names in the parameter; 0 is number of allowed commas in a given name
name_is_numeric (first, first_alias, list_name); -- check for names that have no letters or are a mix of digits and other characters
name_is_generic (first, first_alias); -- check for names found in the generic names list
end
local wl_type, D = utilities.is_wikilink (first);
if 0 ~= wl_type then
first = D;
utilities.set_message ('err_bad_paramlink', first_alias);
end
end
return last, first; -- done
end
--[[----------------------< E X T R A C T _ N A M E S >-------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters
(or their aliases), and their matching link and mask parameters. Stops searching
when both |lastn= and |firstn= are not found in args after two sequential attempts:
found |last1=, |last2=, and |last3= but doesn't find |last4= and |last5= then the
search is done.
This function emits an error message when there is a |firstn= without a matching
|lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not
required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.'
is stripped from the parameter and a flag (etal) returned that will cause list_people()
to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps
'et al.' out of the template's metadata. When this occurs, an error is emitted.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal = false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias, link_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'err_redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'err_redundant_parameters', i );
link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i );
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
if last then -- error check |lastn= alias for unknown interwiki link prefix; done here because this is where we have the parameter name
local project, language = interwiki_prefixen_get (last, true); -- true because we expect interwiki links in |lastn= to be wikilinked
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', last_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
last = utilities.remove_wiki_link (last); -- remove wikilink markup; show display value only
end
end
if link then -- error check |linkn= alias for unknown interwiki link prefix
local project, language = interwiki_prefixen_get (link, false); -- false because wiki links in |author-linkn= is an error
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', link_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
link = nil; -- unset so we don't link
link_alias = nil;
end
end
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first = name_checks (last, first, list_name, last_alias, first_alias); -- multiple names, extraneous annotation, etc. checks
if first and not last then -- if there is a firstn without a matching lastn
local alias = first_alias:find ('given', 1, true) and 'given' or 'first'; -- get first or given form of the alias
utilities.set_message ('err_first_missing_last', {
first_alias, -- param name of alias missing its mate
first_alias:gsub (alias, {['first'] = 'last', ['given'] = 'surname'}), -- make param name appropriate to the alias form
}); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
local result;
link = link_title_ok (link, link_alias, last, last_alias); -- check for improper wiki-markup
if first then
link = link_title_ok (link, link_alias, first, first_alias); -- check for improper wiki-markup
end
names[n] = {last = last, first = first, link = link, mask = mask, corporate = false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
utilities.set_message ('err_missing_name', {list_name:match ("(%w+)List"):lower(), i - 1}); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names and the etal flag
end
--[[--------------------------< N A M E _ T A G _ G E T >------------------------------------------------------
attempt to decode |language=<lang_param> and return language name and matching tag; nil else.
This function looks for:
<lang_param> as a tag in cfg.lang_tag_remap{}
<lang_param> as a name in cfg.lang_name_remap{}
<lang_param> as a name in cfg.mw_languages_by_name_t
<lang_param> as a tag in cfg.mw_languages_by_tag_t
when those fail, presume that <lang_param> is an IETF-like tag that MediaWiki does not recognize. Strip all
script, region, variant, whatever subtags from <lang_param> to leave just a two or three character language tag
and look for the new <lang_param> in cfg.mw_languages_by_tag_t{}
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil
]]
local function name_tag_get (lang_param)
local lang_param_lc = mw.ustring.lower (lang_param); -- use lowercase as an index into the various tables
local name;
local tag;
name = cfg.lang_tag_remap[lang_param_lc]; -- assume <lang_param_lc> is a tag; attempt to get remapped language name
if name then -- when <name>, <lang_param> is a tag for a remapped language name
if cfg.lang_name_remap[name:lower()][2] ~= lang_param_lc then
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
return name, cfg.lang_name_remap[name:lower()][2]; -- so return name and tag from lang_name_remap[name]; special case to xlate sr-ec and sr-el to sr-cyrl and sr-latn
end
return name, lang_param_lc; -- so return <name> from remap and <lang_param_lc>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- still assuming that <lang_param_lc> is a tag; strip script, region, variant subtags
name = cfg.lang_tag_remap[tag]; -- attempt to get remapped language name with language subtag only
if name then -- when <name>, <tag> is a tag for a remapped language name
return name, tag; -- so return <name> from remap and <tag>
end
if cfg.lang_name_remap[lang_param_lc] then -- not a remapped tag, assume <lang_param_lc> is a name; attempt to get remapped language tag
return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2]; -- for this <lang_param_lc>, return a (possibly) new name and appropriate tag
end
name = cfg.mw_languages_by_tag_t[lang_param_lc]; -- assume that <lang_param_lc> is a tag; attempt to get its matching language name
if name then
return name, lang_param_lc; -- <lang_param_lc> is a tag so return it and <name>
end
tag = cfg.mw_languages_by_name_t[lang_param_lc]; -- assume that <lang_param_lc> is a language name; attempt to get its matching tag
if tag then
return cfg.mw_languages_by_tag_t[tag], tag; -- <lang_param_lc> is a name so return the name from the table and <tag>
end
tag = lang_param_lc:match ('^(%a%a%a?)%-.*'); -- is <lang_param_lc> an IETF-like tag that MediaWiki doesn't recognize? <tag> gets the language subtag; nil else
if tag then
name = cfg.mw_languages_by_tag_t[tag]; -- attempt to get a language name using the shortened <tag>
if name then
return name, tag; -- <lang_param_lc> is an unrecognized IETF-like tag so return <name> and language subtag
end
end
end
--[[-------------------< L A N G U A G E _ P A R A M E T E R >------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code
is recognized by MediaWiki, use the returned name; if not, then use the value that
was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is
assigned to the category for that code: Category:Norwegian-language sources (no).
For valid three-character code languages, the page is assigned to the single category
for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does
not recognize three-character equivalents of two-character codes: code 'ar' is
recognized but code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th
where the language names or codes are separated from each other by commas with
optional space characters.
]]
local function language_parameter (lang)
local tag; -- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags
local lang_subtag; -- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_t = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_t = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_t) do -- reuse lang here because we don't yet know if lang is a language name or a language tag
name, tag = name_tag_get (lang); -- attempt to get name/tag pair for <lang>; <name> has proper capitalization; <tag> is lowercase
if utilities.is_set (tag) then
lang_subtag = tag:gsub ('^(%a%a%a?)%-.*', '%1'); -- for categorization, strip any IETF-like tags from language tag
if cfg.this_wiki_code ~= lang_subtag then -- when the language is not the same as this wiki's language
if 2 == lang_subtag:len() then -- and is a two-character tag
utilities.add_prop_cat ('foreign-lang-source', {name, tag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character tag)
utilities.add_prop_cat ('foreign-lang-source-2', {lang_subtag}, lang_subtag); -- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
utilities.add_prop_cat ('local-lang-source', {name, lang_subtag}); -- categorize it
end
else
name = lang; -- return whatever <lang> has so that we show something
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
name = utilities.make_sep_list (#language_list, language_list);
if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then -- when only one language, find lang name in this wiki lang name; for |language=en-us, 'English' in 'American English'
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[-----------------------< S E T _ C S _ S T Y L E >--------------------------
Gets the default CS style configuration for the given mode.
Returns default separator and either postscript as passed in or the default.
In CS1, the default postscript and separator are '.'.
In CS2, the default postscript is the empty string and the default separator is ','.
]]
local function set_cs_style (postscript, mode)
if utilities.is_set(postscript) then
-- emit a maintenance message if user postscript is the default cs1 postscript
-- we catch the opposite case for cs2 in set_style
if mode == 'cs1' and postscript == cfg.presentation['ps_' .. mode] then
utilities.set_message ('maint_postscript');
end
else
postscript = cfg.presentation['ps_' .. mode];
end
return cfg.presentation['sep_' .. mode], postscript;
end
--[[--------------------------< S E T _ S T Y L E >-----------------------------
Sets the separator and postscript styles. Checks the |mode= first and the
#invoke CitationClass second. Removes the postscript if postscript == none.
]]
local function set_style (mode, postscript, cite_class)
local sep;
if 'cs2' == mode then
sep, postscript = set_cs_style (postscript, 'cs2');
elseif 'cs1' == mode then
sep, postscript = set_cs_style (postscript, 'cs1');
elseif 'citation' == cite_class then
sep, postscript = set_cs_style (postscript, 'cs2');
else
sep, postscript = set_cs_style (postscript, 'cs1');
end
if cfg.keywords_xlate[postscript:lower()] == 'none' then
-- emit a maintenance message if user postscript is the default cs2 postscript
-- we catch the opposite case for cs1 in set_cs_style
if 'cs2' == mode or ('cs1' ~= mode and 'citation' == cite_class) then -- {{citation |title=Title |mode=cs1 |postscript=none}} should not emit maint message
utilities.set_message ('maint_postscript');
end
postscript = '';
end
return sep, postscript
end
--[=[-------------------------< I S _ P D F >-----------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >-----------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message
if the format parameter does not have a matching URL parameter. If the format parameter
is not set and the URL contains a file extension that is recognized as a PDF document
by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if utilities.is_set (format) then
format = utilities.wrap_style ('format', format); -- add leading space, parentheses, resize
if not utilities.is_set (url) then
utilities.set_message ('err_format_missing_url', {fmt_param, url_param}); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if URL is a PDF file then
format = utilities.wrap_style ('format', 'PDF'); -- set format to PDF
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[---------------------< G E T _ D I S P L A Y _ N A M E S >------------------
Returns a number that defines the number of names displayed for author and editor
name lists and a Boolean flag to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,
return the number and the previous state of the 'etal' flag (false by default
but may have been set to true if the name list contains some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number
that is one greater than the number of authors in the list and set the 'etal' flag true.
This will cause the list_people() to display all of the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors'], etc; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
This function sets an error message when |display-xxxxors= value greater than or equal to number of names but
not when <max> comes from {{cs1 config}} global settings. When using global settings, <param> is set to the
keyword 'cs1 config' which is used to supress the normal error. Error is suppressed because it is to be expected
that some citations in an article will have the same or fewer names that the limit specified in {{cs1 config}}.
]]
local function get_display_names (max, count, list_name, etal, param)
if utilities.is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if (max >= count) and ('cs1 config' ~= param) then -- error when local |display-xxxxors= value greater than or equal to number of names; not an error when using global setting
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil;
end
else -- not a valid keyword or number
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[----------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >---------------
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be
some form of p. or pp. abbreviation in the first characters of the parameter content.
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when page begins PX or P# but not Px
where x and X are letters and # is a digit
bad pattern: '^[Pp][PpGg]' matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG
]]
local function extra_text_in_page_check (val, name)
if not val:match (cfg.vol_iss_pg_patterns.good_ppattern) then
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message ('err_extra_text_pages', name); -- add error message
return; -- and done
end
end
end
end
--[[--------------------------< E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K >------------------------
Adds error if |volume= or |issue= has what appears to be some form of redundant 'type' indicator. Applies to
both; this function looks for issue text in both |issue= and |volume= and looks for volume-like text in |voluem=
and |issue=.
For |volume=:
'V.', or 'Vol.' (with or without the dot) abbreviations or 'Volume' in the first characters of the parameter
content (all case insensitive). 'V' and 'v' (without the dot) are presumed to be roman numerals so
are allowed.
For |issue=:
'No.', 'I.', 'Iss.' (with or without the dot) abbreviations, or 'Issue' in the first characters of the
parameter content (all case insensitive); numero styling: 'n°' with degree sign U+00B0, and № precomposed
numero sign U+2116.
Single character values ('v', 'i', 'n') allowed when not followed by separator character ('.', ':', '=', or
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.
<val> is |volume= or |issue= parameter value
<name> is |volume= or |issue= parameter name for error message
<selector> is 'v' for |volume=, 'i' for |issue=
sets error message on failure; returns nothing
]]
local function extra_text_in_vol_iss_check (val, name, selector)
if not utilities.is_set (val) then
return;
end
local handler = 'v' == selector and 'err_extra_text_volume' or 'err_extra_text_issue';
val = val:lower(); -- force parameter value to lower case
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.vi_patterns_t) do -- spin through the sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message (handler, name); -- add error message
return; -- and done
end
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local _, accept = utilities.has_accept_as_written (vparam);
if accept then
utilities.add_prop_cat ('vanc-accept'); -- add properties category
end
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a placeholder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parentheses
local name = name_table[i];
i = i + 1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parentheses
break; -- and done reassembling so
end
i = i + 1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = utilities.is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i + 1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the Vancouver error when a required comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
local accept_name;
v_name, accept_name = utilities.has_accept_as_written (v_name); -- remove accept-this-as-written markup when it wraps all of <v_name>
if accept_name then
last = v_name;
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error (cfg.err_msg_supl.punctuation, i);
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s+")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be initials or generational suffix
if not mw.ustring.match (first, '^%u+$') then -- mw.ustring here so that later we will catch non-Latin characters
suffix = first; -- not initials so assume that whatever we got is a generational suffix
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end
last = table.concat(lastfirstTable, ' ') -- returns a string that is the concatenation of all other names that are not initials and generational suffix
if not utilities.is_set (last) then
first = ''; -- unset
last = v_name; -- last empty because something wrong with first
add_vanc_error (cfg.err_msg_supl.name, i);
end
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error (cfg.err_msg_supl['missing comma'], i); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error (cfg.err_msg_supl.initials, i); -- matches a space between two initials
end
else
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if utilities.is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error (cfg.err_msg_supl.initials, i); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first, suffix, i); -- check first and last before restoring the suffix which may have a non-Latin digit
if utilities.is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '', nil, i);
end
end
link = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i ) or v_link_table[i];
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice in case we have a |first1= without a |last1=; this ...
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst = true;
end
if (utilities.is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or
(true == lastfirst and utilities.is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
utilities.set_message ('err_redundant_parameters', err_name .. '-name-list parameters'); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if utilities.is_set (vxxxxors) then return 2 end;
if utilities.is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc.). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
TODO: explain <invert>
]]
local function is_valid_parameter_value (value, name, possible, ret_val, invert)
if not utilities.is_set (value) then
return ret_val; -- an empty parameter is ok
end
if (not invert and utilities.in_array (value, possible)) then -- normal; <value> is in <possible> table
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
elseif invert and not utilities.in_array (value, possible) then -- invert; <value> is not in <possible> table
return value; -- return <value> as it is
else
utilities.set_message ('err_invalid_param_val', {name, value}); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list, -3, -1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terminate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >-----------------------------------------
returns the concatenation of the formatted volume and issue (or journal article number) parameters as a single
string; or formatted volume or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower)
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then
return '';
end
-- same condition as in format_pages_sheets()
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
local is_numeric_vol = volume and (volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')); -- is only uppercase roman numerals or only digits?
local is_long_vol = volume and (4 < mw.ustring.len(volume)); -- is |volume= value longer than 4 characters?
if volume and (not is_numeric_vol and is_long_vol) then -- when not all digits or Roman numerals, is |volume= longer than 4 characters?
utilities.add_prop_cat ('long-vol'); -- yes, add properties cat
end
if is_journal then -- journal-style formatting
local vol = '';
if utilities.is_set (volume) then
if is_numeric_vol then -- |volume= value all digits or all uppercase Roman numerals?
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, volume}); -- render in bold face
elseif is_long_vol then -- not all digits or Roman numerals; longer than 4 characters?
vol = utilities.substitute (cfg.messages['j-vol'], {sepc, utilities.hyphen_to_dash (volume)}); -- not bold
else -- four or fewer characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, utilities.hyphen_to_dash (volume)}); -- bold
end
end
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '')
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '')
return vol;
end
if 'podcast' == cite_class and utilities.is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower);
elseif utilities.is_set (article) then -- article number alone; when volume alone, handled below
return wrap_msg ('art', {sepc, article}, lower);
end
end
-- all other types of citation
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc, utilities.hyphen_to_dash (volume), issue}, lower);
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc, utilities.hyphen_to_dash (volume)}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if utilities.is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif utilities.is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if utilities.is_set (page) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return utilities.substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return utilities.substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif utilities.is_set (pages) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', utilities.substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', utilities.substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', utilities.substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to an external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, page_orig, pages, pages_orig, at)
local ws_url, ws_label, coins_pages, L; -- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if utilities.is_set (page) then
if utilities.is_set (pages) or utilities.is_set (at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page, page_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif utilities.is_set (pages) then
if utilities.is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages, pages_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif utilities.is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws URL from |at= interwiki link; link portion L becomes tooltip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[[--------------------------< I S _ U N I Q U E _ A R C H I V E _ U R L >------------------------------------
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value
]]
local function is_unique_archive_url (archive, url, c_url, source, date)
if utilities.is_set (archive) then
if archive == url or archive == c_url then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)}); -- add error message
return '', ''; -- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=
end
end
return archive, date;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the
save snapshot URL or to calendar pages. When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command URL
|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org URLs:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this function may return a modified
archive URL:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the URL unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
A secondary function is to return an archive-url timestamp from those urls that have them (archive.org and
archive.today). The timestamp is used by validation.archive_date_check() to see if the value in |archive-date=
matches the timestamp in the archive url.
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.org URL
timestamp = url:match ('//archive.today/(%d%d%d%d%d%d%d%d%d%d%d%d%d%d)/') or -- get timestamp from archive.today urls
url:match ('//archive.today/(%d%d%d%d%.%d%d%.%d%d%-%d%d%d%d%d%d)/'); -- this timestamp needs cleanup
if timestamp then -- if this was an archive.today url ...
return url, date, timestamp:gsub ('[%.%-]', ''); -- return ArchiveURL, ArchiveDate, and timestamp (dots and dashes removed) from |archive-url=, and done
end
-- here for archive.org urls
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine URL
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command URL, we don't want to allow saving of the target page
err_msg = cfg.err_msg_supl.save;
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = cfg.err_msg_supl.liveweb;
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the URL parts for evaluation
if not path then -- malformed in some way; pattern did not match
err_msg = cfg.err_msg_supl.timestamp;
elseif 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = cfg.err_msg_supl.timestamp;
if '*' ~= flag then
local replacement = timestamp:match ('^%d%d%d%d%d%d') or timestamp:match ('^%d%d%d%d'); -- get the first 6 (YYYYMM) or first 4 digits (YYYY)
if replacement then -- nil if there aren't at least 4 digits (year)
replacement = replacement .. string.rep ('0', 14 - replacement:len()); -- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp
url=url:gsub ('(//web%.archive%.org/[^%d]*)%d[^/]*', '%1' .. replacement .. '*', 1) -- for preview, modify ts to 14 digits plus splat for calendar display
end
end
elseif utilities.is_set (path) and 'web/' ~= path then -- older archive URLs do not have the extra 'web/' path element
err_msg = cfg.err_msg_supl.path;
elseif utilities.is_set (flag) and not utilities.is_set (path) then -- flag not allowed with the old form URL (without the 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
elseif utilities.is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
else
return url, date, timestamp; -- return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
end
end
-- if here, something not right so
utilities.set_message ('err_archive_url', {err_msg}); -- add error message and
if is_preview_mode then
return url, date, timestamp; -- preview mode so return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
else
return '', ''; -- return empty strings for ArchiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not utilities.is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
utilities.set_message ('maint_location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (placeholder added by bots that can't find proper title); if matches, return true; nil else
]]
local function is_archived_copy (title)
title = mw.ustring.lower(title); -- switch title to lower case
if title:find (cfg.special_case_translation.archived_copy.en) then -- if title is 'Archived copy'
return true;
elseif cfg.special_case_translation.archived_copy['local'] then
if mw.ustring.find (title, cfg.special_case_translation.archived_copy['local']) then -- mw.ustring() because might not be Latin script
return true;
end
end
end
--[[--------------------------< D I S P L A Y _ N A M E S _ S E L E C T >--------------------------------------
for any of the |display-authors=, |display-editors=, etc parameters, select either the local or global setting.
When both are present, look at <local_display_names> value. When the value is some sort of 'et al.'string,
special handling is required.
When {{cs1 config}} has |display-<namelist>= AND this template has |display-<namelist>=etal AND:
the number of names specified by <number_of_names> is:
greater than the number specified in the global |display-<namelist>= parameter (<global_display_names>)
use global |display-<namelist>= parameter value
set overridden maint category
less than or equal to the number specified in the global |display-<namelist>= parameter
use local |display-<namelist>= parameter value
The purpose of this function is to prevent categorizing a template that has fewer names than the global setting
to keep the etal annotation specified by <local_display_names>.
]]
local function display_names_select (global_display_names, local_display_names, param_name, number_of_names, test)
if global_display_names and utilities.is_set (local_display_names) then -- when both
if 'etal' == local_display_names:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
number_of_names = tonumber (number_of_names); -- convert these to numbers for comparison
local global_display_names_num = tonumber (global_display_names); -- <global_display_names> not set when parameter value is not digits
if number_of_names > global_display_names_num then -- template has more names than global config allows to be displayed?
utilities.set_message ('maint_overridden_setting'); -- set a maint message because global is overriding local |display-<namelist>=etal
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
else
return local_display_names, param_name; -- return local because fewer names so let <local_display_names> control
end
end
-- here when <global_display_names> and <local_display_names> both numbers; <global_display_names> controls
utilities.set_message ('maint_overridden_setting'); -- set a maint message
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
end
-- here when only one of <global_display_names> or <local_display_names> set
if global_display_names then
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
else
return local_display_names, param_name; -- return local
end
end
--[[--------------------------< M O D E _ S E T >--------------------------------------------------------------
fetch global mode setting from {{cs1 config}} (if present) or from |mode= (if present); global setting overrides
local |mode= parameter value. When both are present, emit maintenance message
]]
local function mode_set (Mode, Mode_origin)
local mode;
if cfg.global_cs1_config_t['Mode'] then -- global setting in {{cs1 config}}; nil when empty or assigned value invalid
mode = is_valid_parameter_value (cfg.global_cs1_config_t['Mode'], 'cs1 config: mode', cfg.keywords_lists['mode'], ''); -- error messaging 'param' here is a hoax
else
mode = is_valid_parameter_value (Mode, Mode_origin, cfg.keywords_lists['mode'], '');
end
if cfg.global_cs1_config_t['Mode'] and utilities.is_set (Mode) then -- when template has |mode=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
return mode;
end
--[[--------------------------< Q U O T E _ M A K E >----------------------------------------------------------
create quotation from |quote=, |trans-quote=, and/or script-quote= with or without |quote-page= or |quote-pages=
when any of those three quote parameters are set, this function unsets <PostScript>. When none of those parameters
are set, |quote-page= and |quote-pages= are unset to nil so that they are not included in the template's metadata
]]
local function quote_make (quote, trans_quote, script_quote, quote_page, quote_pages, nopp, sepc, postscript)
if utilities.is_set (quote) or utilities.is_set (trans_quote) or utilities.is_set (script_quote) then
if utilities.is_set (quote) then
if quote:sub(1, 1) == '"' and quote:sub(-1, -1) == '"' then -- if first and last characters of quote are quote marks
quote = quote:sub(2, -2); -- strip them off
end
end
quote = kern_quotes (quote); -- kern if needed
quote = utilities.wrap_style ('quoted-text', quote ); -- wrap in <q>...</q> tags
if utilities.is_set (script_quote) then
quote = script_concatenate (quote, script_quote, 'script-quote'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after quote is wrapped
end
if utilities.is_set (trans_quote) then
if trans_quote:sub(1, 1) == '"' and trans_quote:sub(-1, -1) == '"' then -- if first and last characters of |trans-quote are quote marks
trans_quote = trans_quote:sub(2, -2); -- strip them off
end
quote = quote .. " " .. utilities.wrap_style ('trans-quoted-title', trans_quote );
end
if utilities.is_set (quote_page) or utilities.is_set (quote_pages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (quote_page) then
extra_text_in_page_check (quote_page, 'quote-page'); -- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.
if not nopp then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, quote_page}), '', '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, quote_page}), '', '', '';
end
elseif utilities.is_set (quote_pages) then
extra_text_in_page_check (quote_pages, 'quote-pages'); -- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.
if tonumber(quote_pages) ~= nil and not nopp then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, quote_pages}), '', '';
elseif not nopp then
quote_prefix = utilities.substitute (cfg.messages['pp-prefix'], {sepc, quote_pages}), '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, quote_pages}), '', '';
end
end
quote = quote_prefix .. ": " .. quote;
else
quote = sepc .. " " .. quote;
end
postscript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
elseif utilities.is_set (quote_page) or utilities.is_set (quote_pages) then
quote_page = nil; -- unset; these require |quote=; TODO: error message?
quote_pages = nil;
end
return quote, quote_page, quote_pages, postscript;
end
--[[--------------------------< C H E C K _ P U B L I S H E R _ N A M E >--------------------------------------
look for variations of '<text>: <text>' that might be '<location>: <publisher>' in |publisher= parameter value.
when found, emit a maintenance message; return nil else
<publisher> is the value assigned to |publisher= or |institution=
]]
local function check_publisher_name (publisher)
local patterns_t = {
'^[%w%s]+%s*:%s*[%w%s]+$', -- plain text <location>: <publisher>
'^%[+[%w%s:|]+%]+%s*:%s*[%w%s]+$', -- partially wikilinked [[<location>]]: <publisher>
'^[%w%s]+%s*:%s*%[+[%w%s:|]+%]+$', -- partially wikilinked <location>: [[<publisher>]]
'^%[+[%w%s:|]+%]+%s*:%s*%[+[%w%s:|]+%]+$', -- wikilinked [[<location>]]: [[<publisher>]]
}
for _, pattern in ipairs (patterns_t) do -- spin through the patterns_t sequence
if mw.ustring.match (publisher, pattern) then -- does this pattern match?
utilities.set_message ('maint_publisher_location'); -- set a maint message
return; -- and done
end
end
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args )
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper ( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListStyle;
if cfg.global_cs1_config_t['NameListStyle'] then -- global setting in {{cs1 config}} overrides local |name-list-style= parameter value; nil when empty or assigned value invalid
NameListStyle = is_valid_parameter_value (cfg.global_cs1_config_t['NameListStyle'], 'cs1 config: name-list-style', cfg.keywords_lists['name-list-style'], ''); -- error messaging 'param' here is a hoax
else
NameListStyle = is_valid_parameter_value (A['NameListStyle'], A:ORIGIN('NameListStyle'), cfg.keywords_lists['name-list-style'], '');
end
if cfg.global_cs1_config_t['NameListStyle'] and utilities.is_set (A['NameListStyle']) then -- when template has |name-list-style=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
a, author_etal = parse_vauthors_veditors (args, A['Vauthors'], 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |people= or |credits=; |authors= is deprecated; TODO: constrain |people= and |credits= to cite av media, episode, serial?
end
if utilities.is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], nil, args, 'EditorList'); -- support for |editors= withdrawn
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
end
end
local Chapter = A['Chapter']; -- done here so that we have access to |contribution= from |chapter= aliases
local Chapter_origin = A:ORIGIN ('Chapter');
local Contribution; -- because contribution is required for contributor(s)
if 'contribution' == Chapter_origin then
Contribution = Chapter; -- get the name of the contribution
end
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not utilities.is_set (Contribution) then -- |contributor= requires |contribution=
utilities.set_message ('err_contributor_missing_required_param', 'contribution'); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
utilities.set_message ('err_contributor_missing_required_param', 'author'); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if utilities.select_one (args, cfg.aliases['ContributorList-Last'], 'err_redundant_parameters', 1 ) then -- are there contributor name list parameters?
utilities.set_message ('err_contributor_ignored'); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
local Title = A['Title'];
local TitleLink = A['TitleLink'];
local auto_select = ''; -- default is auto
local accept_link;
TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true); -- test for accept-this-as-written markup
if (not accept_link) and utilities.in_array (TitleLink, {'none', 'pmc', 'doi'}) then -- check for special keywords
auto_select = TitleLink; -- remember selection for later
TitleLink = ''; -- treat as if |title-link= would have been empty
end
TitleLink = link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set
local Section = ''; -- {{cite map}} only; preset to empty string for concatenation if not used
if 'map' == config.CitationClass and 'section' == Chapter_origin then
Section = A['Chapter']; -- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}
Chapter = ''; -- unset for now; will be reset later from |map= if present
end
local Periodical = A['Periodical'];
local Periodical_origin = A:ORIGIN('Periodical');
local ScriptPeriodical = A['ScriptPeriodical'];
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
local TransPeriodical = A['TransPeriodical'];
local TransPeriodical_origin = A:ORIGIN ('TransPeriodical');
if (utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical))) then
local param;
if utilities.is_set (Periodical) then -- get a parameter name from one of these periodical related meta-parameters
Periodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = Periodical_origin -- get parameter name for error messaging
elseif utilities.is_set (TransPeriodical) then
TransPeriodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = TransPeriodical_origin; -- get parameter name for error messaging
elseif utilities.is_set (ScriptPeriodical) then
ScriptPeriodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = ScriptPeriodical_origin; -- get parameter name for error messaging
end
if utilities.is_set (param) then -- if we found one
utilities.set_message ('err_periodical_ignored', {param}); -- emit an error message
end
end
if utilities.is_set (Periodical) then
local i;
Periodical, i = utilities.strip_apostrophe_markup (Periodical); -- strip apostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {Periodical_origin});
end
end
if 'mailinglist' == config.CitationClass then -- special case for {{cite mailing list}}
if utilities.is_set (Periodical) and utilities.is_set (A ['MailingList']) then -- both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', Periodical_origin) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'mailinglist')});
end
Periodical = A ['MailingList']; -- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}
Periodical_origin = A:ORIGIN('MailingList');
end
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
utilities.set_message ('err_missing_periodical', {config.CitationClass, p[config.CitationClass]});
end
end
local Volume;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) then
if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then -- {{citation}} does not render |volume= when these parameters are used
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif utilities.is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
extra_text_in_vol_iss_check (Volume, A:ORIGIN ('Volume'), 'v');
local Issue;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then -- {{citation}} may render |issue= when these parameters are used
Issue = utilities.hyphen_to_dash (A['Issue']);
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (utilities.in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then
Issue = utilities.hyphen_to_dash (A['Issue']);
end
end
local ArticleNumber;
if utilities.in_array (config.CitationClass, {'journal', 'conference'}) or ('citation' == config.CitationClass and utilities.is_set (Periodical) and 'journal' == Periodical_origin) then
ArticleNumber = A['ArticleNumber'];
end
extra_text_in_vol_iss_check (Issue, A:ORIGIN ('Issue'), 'i');
local Page;
local Pages;
local At;
local QuotePage;
local QuotePages;
if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then -- TODO: rewrite to emit ignored parameter error message?
Page = A['Page'];
Pages = utilities.hyphen_to_dash (A['Pages']);
At = A['At'];
QuotePage = A['QuotePage'];
QuotePages = utilities.hyphen_to_dash (A['QuotePages']);
end
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
local Mode = mode_set (A['Mode'], A:ORIGIN('Mode'));
-- separator character and postscript
local sepc, PostScript = set_style (Mode:lower(), A['PostScript'], config.CitationClass);
local Quote;
Quote, QuotePage, QuotePages, PostScript = quote_make (A['Quote'], A['TransQuote'], A['ScriptQuote'], QuotePage, QuotePages, NoPP, sepc, PostScript);
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then
local i = 0;
PublisherName, i = utilities.strip_apostrophe_markup (PublisherName); -- strip apostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i and (0 < i) then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {PublisherName_origin});
end
end
if ('document' == config.CitationClass) and not utilities.is_set (PublisherName) then
utilities.set_message ('err_missing_publisher', {config.CitationClass, 'publisher'});
end
local Newsgroup = A['Newsgroup']; -- TODO: strip apostrophe markup?
local Newsgroup_origin = A:ORIGIN('Newsgroup');
if 'newsgroup' == config.CitationClass then
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then -- general use parameter |publisher= not allowed in cite newsgroup
utilities.set_message ('err_parameter_ignored', {PublisherName_origin});
end
PublisherName = nil; -- ensure that this parameter is unset for the time being; will be used again after COinS
end
if 'book' == config.CitationClass or 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and not utilities.is_set (Periodical)) then
local accept;
PublisherName, accept = utilities.has_accept_as_written (PublisherName); -- check for and remove accept-as-written markup from |publisher= wrapped
if not accept then -- when no accept-as-written markup
check_publisher_name (PublisherName); -- emit maint message when |publisher= might be prefixed with publisher's location
end
end
local URL = A['URL']; -- TODO: better way to do this for URL, ChapterURL, and MapURL?
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then
UrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', 'url');
end
local ChapterURL = A['ChapterURL'];
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then
ChapterUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')});
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (A['MapURL']) and utilities.is_set (MapUrlAccess) then
MapUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {'map-url'});
end
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not utilities.is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if cfg.uncategorized_namespaces[this_page.namespace] then -- is this page's namespace id one of the uncategorized namespace ids?
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _, v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
utilities.select_one (args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'err_redundant_parameters'); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN('Page'), Pages, A:ORIGIN('Pages'), At);
if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
utilities.add_prop_cat ('location-test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
local URL_origin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL_origin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ScriptChapter = A['ScriptChapter'];
local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local TransChapter = A['TransChapter'];
local TransChapter_origin = A:ORIGIN ('TransChapter');
local TransTitle = A['TransTitle'];
local ScriptTitle = A['ScriptTitle'];
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title= for rendering
|encyclopedia= and |article= then map |encyclopedia= to |title= for rendering
|trans-title= maps to |trans-chapter= when |title= is re-mapped
|url= maps to |chapter-url= when |title= is remapped
All other combinations of |encyclopedia=, |title=, and |article= are not modified
]]
local Encyclopedia = A['Encyclopedia']; -- used as a flag by this module and by ~/COinS
local ScriptEncyclopedia = A['ScriptEncyclopedia'];
local TransEncyclopedia = A['TransEncyclopedia'];
if utilities.is_set (Encyclopedia) or utilities.is_set (ScriptEncyclopedia) then -- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}
if 'encyclopaedia' ~= config.CitationClass and 'citation' ~= config.CitationClass then
if utilities.is_set (Encyclopedia) then
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('Encyclopedia')});
else
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('ScriptEncyclopedia')});
end
Encyclopedia = nil; -- unset these because not supported by this template
ScriptEncyclopedia = nil;
TransEncyclopedia = nil;
end
elseif utilities.is_set (TransEncyclopedia) then
utilities.set_message ('err_trans_missing_title', {'encyclopedia'});
end
if ('encyclopaedia' == config.CitationClass) or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then -- when both parameters set emit an error message; {{citation}} only; Periodical not allowed in {{cite encyclopedia}}
utilities.set_message ('err_periodical_ignored', {Periodical_origin});
end
if utilities.is_set (Encyclopedia) or utilities.is_set (ScriptEncyclopedia) then
Periodical = Encyclopedia; -- error or no, set Periodical to Encyclopedia for rendering; {{citation}} could (not legitimately) have both; use Encyclopedia
Periodical_origin = A:ORIGIN ('Encyclopedia');
ScriptPeriodical = ScriptEncyclopedia;
ScriptPeriodical_origin = A:ORIGIN ('ScriptEncyclopedia');
if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then
if not utilities.is_set (Chapter) then
Chapter = Title; -- |encyclopedia= and |title= are set so map |title= params to |article= params for rendering
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterURL_origin = URL_origin;
ChapterUrlAccess = UrlAccess;
ChapterFormat = Format;
if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then
Chapter = utilities.make_wikilink (TitleLink, Chapter);
end
Title = Periodical; -- now map |encyclopedia= params to |title= params for rendering
ScriptTitle = ScriptPeriodical or '';
TransTitle = TransEncyclopedia or '';
Periodical = ''; -- redundant so unset
ScriptPeriodical = '';
URL = '';
Format = '';
TitleLink = '';
end
elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then -- |title= not set
Title = Periodical; -- |encyclopedia= set and |article= set so map |encyclopedia= to |title= for rendering
ScriptTitle = ScriptPeriodical or '';
TransTitle = TransEncyclopedia or '';
Periodical = ''; -- redundant so unset
ScriptPeriodical = '';
end
end
end
-- special case for cite techreport.
local ID = A['ID'];
if (config.CitationClass == "techreport") then -- special case for cite techreport
if utilities.is_set (A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not utilities.is_set (ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'id') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'number')});
end
end
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local Conference = A['Conference'];
local BookTitle = A['BookTitle'];
local TransTitle_origin = A:ORIGIN ('TransTitle');
if 'conference' == config.CitationClass then
if utilities.is_set (BookTitle) then
Chapter = Title;
Chapter_origin = 'title';
-- ChapterLink = TitleLink; -- |chapter-link= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
URL_origin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
TransChapter_origin = TransTitle_origin;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
local use_lowercase = ( sepc == ',' ); -- controls capitalization of certain static text
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
if utilities.is_set (Chapter) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'map') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Chapter_origin)}); -- add error message
end
Chapter = A['Map'];
Chapter_origin = A:ORIGIN('Map');
ChapterURL = A['MapURL'];
ChapterURL_origin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapter_origin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if utilities.is_set ( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if utilities.is_set ( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
local Series = A['Series'];
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local SeriesLink = A['SeriesLink'];
SeriesLink = link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if utilities.is_set (Network) then table.insert(n, Network); end
if utilities.is_set (Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then -- these are mutually exclusive so if both are set TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'season') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'seriesno')}); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if utilities.is_set (Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if utilities.is_set (Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias |episode-link=
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
ChapterFormat = Format;
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then -- link but not URL
Chapter = utilities.make_wikilink (ChapterLink, Chapter);
elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then -- if both are set, URL links episode;
Series = utilities.make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
Format = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if utilities.is_set (Series) and utilities.is_set (SeriesLink) then
Series = utilities.make_wikilink (SeriesLink, Series);
end
Series = utilities.wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- handle type parameter for those CS1 citations that have default values
local TitleType = A['TitleType'];
local Degree = A['Degree'];
if utilities.in_array (config.CitationClass, {'AV-media-notes', 'document', 'interview', 'mailinglist', 'map', 'podcast', 'pressrelease', 'report', 'speech', 'techreport', 'thesis'}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if utilities.is_set (Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if utilities.is_set (TitleType) then -- if type parameter is specified
TitleType = utilities.substitute ( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date = A['Date'];
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
local PublicationDate = A['PublicationDate'];
local Year = A['Year'];
if utilities.is_set (Year) then
validation.year_check (Year); -- returns nothing; emits maint message when |year= doesn't hold a 'year' value
end
if not utilities.is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not utilities.is_set (DF) then
DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template
end
local ArchiveURL;
local ArchiveDate;
local ArchiveFormat = A['ArchiveFormat'];
local archive_url_timestamp; -- timestamp from wayback machine url
ArchiveURL, ArchiveDate, archive_url_timestamp = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN('ArchiveURL'), ArchiveDate); -- add error message when URL or ChapterURL == ArchiveURL
local AccessDate = A['AccessDate'];
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DoiBroken = A['DoiBroken'];
local Embargo = A['Embargo'];
local anchor_year; -- used in the CITEREF identifier
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val = AccessDate, name = A:ORIGIN ('AccessDate')},
['archive-date'] = {val = ArchiveDate, name = A:ORIGIN ('ArchiveDate')},
['date'] = {val = Date, name = Date_origin},
['doi-broken-date'] = {val = DoiBroken, name = A:ORIGIN ('DoiBroken')},
['pmc-embargo-date'] = {val = Embargo, name = A:ORIGIN ('Embargo')},
['publication-date'] = {val = PublicationDate, name = A:ORIGIN ('PublicationDate')},
['year'] = {val = Year, name = A:ORIGIN ('Year')},
};
local error_list = {};
anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);
if utilities.is_set (Year) and utilities.is_set (Date) then -- both |date= and |year= not normally needed;
validation.year_date_check (Year, A:ORIGIN ('Year'), Date, A:ORIGIN ('Date'), error_list);
end
if 0 == #error_list then -- error free dates only; 0 when error_list is empty
local modified = false; -- flag
if utilities.is_set (DF) then -- if we need to reformat dates
modified = validation.reformat_dates (date_parameters_list, DF); -- reformat to DF format, use long month names if appropriate
end
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki
if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then
utilities.set_message ('maint_date_auto_xlated'); -- add maint cat
modified = true;
end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
if archive_url_timestamp and utilities.is_set (ArchiveDate) then
validation.archive_date_check (ArchiveDate, archive_url_timestamp, DF); -- does YYYYMMDD in archive_url_timestamp match date in ArchiveDate
end
else
utilities.set_message ('err_bad_date', {utilities.make_sep_list (#error_list, error_list)}); -- add this error message
end
end -- end of do
if utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) or -- {{cite book}}, {{cite encyclopedia}}; TODO: {{cite conference}} and others?
('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) or -- {{citation}} as an encylopedia citation
('citation' == config.CitationClass and not utilities.is_set (Periodical)) then -- {{citation}} as a book citation
if utilities.is_set (PublicationPlace) then
if not utilities.is_set (PublisherName) then
local date = COinS_date.rftdate and tonumber (COinS_date.rftdate:match ('%d%d%d%d')); -- get year portion of COinS date (because in Arabic numerals); convert string to number
if date and (1850 <= date) then -- location has no publisher; if date is 1850 or later
utilities.set_message ('maint_location_no_publisher'); -- add maint cat
end
else -- PublisherName has a value
if cfg.keywords_xlate['none'] == PublisherName then -- if that value is 'none' (only for book and encyclopedia citations)
PublisherName = ''; -- unset
end
end
end
end
local ID_list = {}; -- sequence table of rendered identifiers
local ID_list_coins = {}; -- table of identifiers and their values from args; key is same as cfg.id_handlers's key
local Class = A['Class']; -- arxiv class identifier
local ID_support = {
{A['ASINTLD'], 'ASIN', 'err_asintld_missing_asin', A:ORIGIN ('ASINTLD')},
{DoiBroken, 'DOI', 'err_doibroken_missing_doi', A:ORIGIN ('DoiBroken')},
{Embargo, 'PMC', 'err_embargo_missing_pmc', A:ORIGIN ('Embargo')},
}
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class, Year=anchor_year}, ID_support);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv=, |citeseerx=, |medrxiv=, |ssrn= required for their templates
if not (args[cfg.id_handlers[config.CitationClass:upper()].parameters[1]] or -- can't use ID_list_coins k/v table here because invalid parameters omitted
args[cfg.id_handlers[config.CitationClass:upper()].parameters[2]]) then -- which causes unexpected parameter missing error message
utilities.set_message ('err_' .. config.CitationClass .. '_missing'); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['medrxiv'] = 'medRxiv', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free
if config.CitationClass == "journal" and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) then -- TODO: remove 'none' once existing citations have been switched to 'off', so 'none' can be used as token for "no title" instead
if 'none' ~= cfg.keywords_xlate[auto_select] then -- if auto-linking not disabled
if identifiers.auto_link_urls[auto_select] then -- manual selection
URL = identifiers.auto_link_urls[auto_select]; -- set URL to be the same as identifier's external link
URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['pmc'] then -- auto-select PMC
URL = identifiers.auto_link_urls['pmc']; -- set URL to be the same as the PMC external link if not embargoed
URL_origin = cfg.id_handlers['PMC'].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['doi'] then -- auto-select DOI
URL = identifiers.auto_link_urls['doi'];
URL_origin = cfg.id_handlers['DOI'].parameters[1];
end
end
if utilities.is_set (URL) then -- set when using an identifier-created URL
if utilities.is_set (AccessDate) then -- |access-date= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_accessdate_missing_url'); -- add an error message
AccessDate = ''; -- unset
end
if utilities.is_set (ArchiveURL) then -- |archive-url= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_archive_missing_url'); -- add an error message
ArchiveURL = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then -- has special case for cite episode
utilities.set_message ('err_citation_missing_title', {'episode' == config.CitationClass and 'series' or 'title'});
end
if utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) and
utilities.in_array (config.CitationClass, {'journal', 'citation'}) and
(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
utilities.set_message ('maint_untitled'); -- add maint cat
end
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = metadata.COinS({
['Periodical'] = utilities.strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = Encyclopedia, -- just a flag; content ignored by ~/COinS
['Chapter'] = metadata.make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup
['Degree'] = Degree; -- cite thesis only
['Title'] = metadata.make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic / accept-as-written markup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date.* has correctly formatted date values if Date is valid;
['Season'] = COinS_date.rftssn,
['Quarter'] = COinS_date.rftquarter,
['Chron'] = COinS_date.rftchron,
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['ArticleNumber'] = ArticleNumber,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list_coins,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, and {{cite ssrn}} AFTER generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, medRxiv, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass and utilities.is_set (Newsgroup) then
PublisherName = utilities.substitute (cfg.messages['newsgroup'], external_link( 'news:' .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));
end
local Editors;
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
local Contributors; -- assembled contributors name list
local contributor_etal;
local Translators; -- assembled translators name list
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local Interviewers;
local interviewers_list = {};
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local interviewer_etal;
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
do
local last_first_list;
local control = {
format = NameListStyle, -- empty string, '&', 'amp', 'and', or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayEditors'], A['DisplayEditors'], A:ORIGIN ('DisplayEditors'), #e);
control.maximum, editor_etal = get_display_names (display_names, #e, 'editors', editor_etal, param);
Editors, EditorCount = list_people (control, e, editor_etal);
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayInterviewers'], A['DisplayInterviewers'], A:ORIGIN ('DisplayInterviewers'), #interviewers_list);
control.maximum, interviewer_etal = get_display_names (display_names, #interviewers_list, 'interviewers', interviewer_etal, param);
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayTranslators'], A['DisplayTranslators'], A:ORIGIN ('DisplayTranslators'), #t);
control.maximum, translator_etal = get_display_names (display_names, #t, 'translators', translator_etal, param);
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayContributors'], A['DisplayContributors'], A:ORIGIN ('DisplayContributors'), #c);
control.maximum, contributor_etal = get_display_names (display_names, #c, 'contributors', contributor_etal, param);
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayAuthors'], A['DisplayAuthors'], A:ORIGIN ('DisplayAuthors'), #a, author_etal);
control.maximum, author_etal = get_display_names (display_names, #a, 'authors', author_etal, param);
last_first_list = list_people (control, a, author_etal);
if utilities.is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if utilities.is_set (Authors) and utilities.is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
-- special case for chapter format so no error message or cat when chapter not supported
if not (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not utilities.is_set (URL) then
if utilities.in_array (config.CitationClass, {"web", "podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
utilities.set_message ('err_cite_web_url');
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then -- ChapterURL may be set when URL is not set;
utilities.set_message ('err_accessdate_missing_url');
AccessDate = '';
end
end
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local OriginalURL
local OriginalURL_origin
local OriginalFormat
local OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if utilities.is_set ( ArchiveURL ) then
if utilities.is_set (ChapterURL) then -- if chapter-url= is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURL_origin = ChapterURL_origin; -- name of |chapter-url= parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's URL
ChapterURL_origin = A:ORIGIN('ArchiveURL') -- name of |archive-url= parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
elseif utilities.is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURL_origin = URL_origin; -- name of URL parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then |archive-url= applies to it
URL = ArchiveURL -- swap-in the archive's URL
URL_origin = A:ORIGIN('ArchiveURL') -- name of archive URL parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
end
elseif utilities.is_set (UrlStatus) then -- if |url-status= is set when |archive-url= is not set
utilities.set_message ('maint_url_status'); -- add maint cat
end
if utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then
local chap_param;
if utilities.is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif utilities.is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif utilities.is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif utilities.is_set (ScriptChapter) then
chap_param = ScriptChapter_origin;
else utilities.is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if utilities.is_set (chap_param) then -- if we found one
utilities.set_message ('err_chapter_ignored', {chap_param}); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if utilities.is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if utilities.is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and utilities.is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. sepc .. ' ';
elseif utilities.is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title
local plain_title = false;
local accept_title;
Title, accept_title = utilities.has_accept_as_written (Title, true); -- remove accept-this-as-written markup when it wraps all of <Title>
if accept_title and ('' == Title) then -- only support forced empty for now "(())"
Title = cfg.messages['notitle']; -- replace by predefined "No title" message
-- TODO: utilities.set_message ( 'err_redundant_parameters', ...); -- issue proper error message instead of muting
ScriptTitle = ''; -- just mute for now
TransTitle = ''; -- just mute for now
plain_title = true; -- suppress text decoration for descriptive title
utilities.set_message ('maint_untitled'); -- add maint cat
end
if not accept_title then -- <Title> not wrapped in accept-as-written markup
if '...' == Title:sub (-3) then -- if ellipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%' .. sepc .. '$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then
utilities.set_message ('maint_archived_copy'); -- add maintenance category before we modify the content of Title
end
if is_generic ('generic_titles', Title) then
utilities.set_message ('err_generic_title'); -- set an error message
end
end
if (not plain_title) and (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'document', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or
('map' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from module provided quote marks
Title = utilities.wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle );
elseif plain_title or ('report' == config.CitationClass) then -- no styling for cite report and descriptive titles (otherwise same as above)
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = utilities.wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-italic-title', TransTitle);
end
if utilities.is_set (TransTitle) then
if utilities.is_set (Title) then
TransTitle = " " .. TransTitle;
else
utilities.set_message ('err_trans_missing_title', {'title'});
end
end
if utilities.is_set (Title) then -- TODO: is this the right place to be making Wikisource URLs?
if utilities.is_set (TitleLink) and utilities.is_set (URL) then
utilities.set_message ('err_wikilink_in_url'); -- set an error message because we can't have both
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle;
else
Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;
end
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (Title:gsub('^[\'"]*(.-)[\'"]*$', '%1')); -- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle;
else
Title = Title .. TransTitle;
end
end
else
Title = TransTitle;
end
if utilities.is_set (Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
local ConferenceURL_origin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
if utilities.is_set (Conference) then
if utilities.is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif utilities.is_set (ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );
end
local Position = '';
if not utilities.is_set (Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if utilities.is_set (Minutes) then
if utilities.is_set (Time) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'minutes') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'time')});
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if utilities.is_set (Time) then
local TimeCaption = A['TimeCaption']
if not utilities.is_set (TimeCaption) then
TimeCaption = cfg.messages['event'];
if sepc ~= '.' then
TimeCaption = TimeCaption:lower();
end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = utilities.is_set (At) and (sepc .. " " .. At) or "";
Position = utilities.is_set (Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Sections = A['Sections']; -- Section (singular) is an alias of Chapter so set earlier
local Inset = A['Inset'];
if utilities.is_set ( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if utilities.is_set ( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif utilities.is_set ( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
local Others = A['Others'];
if utilities.is_set (Others) and 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
if config.CitationClass == "AV-media-notes"
or config.CitationClass == "audio-visual" then -- special maint for AV/M which has a lot of 'false' positives right now
utilities.set_message ('maint_others_avm')
else
utilities.set_message ('maint_others');
end
end
Others = utilities.is_set (Others) and (sepc .. " " .. Others) or "";
if utilities.is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if utilities.is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
local TitleNote = A['TitleNote'];
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%n?%.?$') or Edition:match ('%f[%a][Ee]dition$') then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.
utilities.set_message ('err_extra_text_edition'); -- add error message
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = utilities.is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
local Agency = A['Agency'] or ''; -- |agency= is supported by {{cite magazine}}, {{cite news}}, {{cite press release}}, {{cite web}}, and certain {{citation}} templates
if utilities.is_set (Agency) then -- this testing done here because {{citation}} supports 'news' citations
if utilities.in_array (config.CitationClass, {'magazine', 'news', 'pressrelease', 'web'}) or ('citation' == config.CitationClass and utilities.in_array (Periodical_origin, {"magazine", "newspaper", "work"})) then
Agency = wrap_msg ('agency', {sepc, Agency}); -- format for rendering
else
Agency = ''; -- unset; not supported
utilities.set_message ('err_parameter_ignored', {'agency'}); -- add error message
end
end
Volume = format_volume_issue (Volume, Issue, ArticleNumber, config.CitationClass, Periodical_origin, sepc, use_lowercase);
if utilities.is_set (AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = utilities.substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = utilities.substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if utilities.is_set (ID) then ID = sepc .. " " .. ID; end
local Docket = A['Docket'];
if "thesis" == config.CitationClass and utilities.is_set (Docket) then
ID = sepc .. " Docket " .. Docket .. ID;
end
if "report" == config.CitationClass and utilities.is_set (Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
if utilities.is_set (URL) then
URL = " " .. external_link( URL, nil, URL_origin, UrlAccess );
end
-- We check length of PostScript here because it will have been nuked by
-- the quote parameters. We'd otherwise emit a message even if there wasn't
-- a displayed postscript.
-- TODO: Should the max size (1) be configurable?
-- TODO: Should we check a specific pattern?
if utilities.is_set(PostScript) and mw.ustring.len(PostScript) > 1 then
utilities.set_message ('maint_postscript')
end
local Archived;
if utilities.is_set (ArchiveURL) then
if not utilities.is_set (ArchiveDate) then -- ArchiveURL set but ArchiveDate not set
utilities.set_message ('err_archive_missing_date'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
else
if utilities.is_set (ArchiveDate) then -- ArchiveURL not set but ArchiveDate is set
utilities.set_message ('err_archive_date_missing_url'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
end
if utilities.is_set (ArchiveURL) then
local arch_text;
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cfg.messages['archived-live'],
{external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil) .. ArchiveFormat, ArchiveDate } );
else
Archived = '';
end
if not utilities.is_set (OriginalURL) then
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if utilities.in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. ' ' .. arch_text .. ArchiveDate; -- format already styled
if 'bot: unknown' == UrlStatus then
utilities.set_message ('maint_bot_unknown'); -- and add a category if not already added
else
utilities.add_prop_cat ('unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. " " .. utilities.substitute ( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, ArchiveDate } ); -- format already styled
else
Archived = ''; -- unset for concatenation
end
end
else -- OriginalUrl not set
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = '';
end
local TranscriptURL = A['TranscriptURL']
local TranscriptFormat = A['TranscriptFormat'];
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
local Transcript = A['Transcript'];
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
if utilities.is_set (Transcript) then
if utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );
end
local Publisher;
if utilities.is_set (PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if utilities.is_set (PublisherName) then
if utilities.is_set (PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif utilities.is_set (PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
-- Several of the above rely upon detecting this as nil, so do it last.
if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then
if utilities.is_set (Title) or utilities.is_set (TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
end
end
local Language = A['Language'];
if utilities.is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc.
else
Language=''; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = TitleType; -- move TitleType to TitleNote so that it renders ahead of |event=
TitleType = ''; -- and unset
if utilities.is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if utilities.is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (Periodical) then -- special cases for book cites
if utilities.is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc.
tcommon = safe_join ({Title, TitleNote}, sepc); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join ({TitleType, Series, Language, Volume, Others, Edition, Publisher}, sepc);
else
tcommon = safe_join ({Title, TitleNote, TitleType, Series, Language, Volume, Others, Edition, Publisher}, sepc);
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if utilities.is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join ({Title, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc);
elseif utilities.is_set (Periodical) then -- map in a periodical
tcommon = safe_join ({Title, TitleType, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc);
else -- a sheet or stand-alone map
tcommon = safe_join ({Title, TitleType, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc);
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join ({Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc);
else -- all other CS1 templates
tcommon = safe_join ({Title, TitleNote, Conference, Periodical, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc);
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local Via = A['Via'];
Via = utilities.is_set (Via) and wrap_msg ('via', Via) or '';
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Quote }, sepc );
else
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
local OrigDate = A['OrigDate'];
OrigDate = utilities.is_set (OrigDate) and wrap_msg ('origdate', OrigDate) or '';
if utilities.is_set (Date) then
if utilities.is_set (Authors) or utilities.is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date .. ")" .. OrigDate .. sepc .. " "; -- in parentheses
else -- neither of authors and editors set
if (string.sub(tcommon, -1, -1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigDate; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigDate; -- Date begins with sepc
end
end
end
if utilities.is_set (Authors) then
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Editors) then
local in_text = '';
local post_text = '';
if utilities.is_set (Chapter) and 0 == #c then
in_text = cfg.messages['in'] .. ' ';
if (sepc ~= '.') then
in_text = in_text:lower(); -- lowercase for cs2
end
end
if EditorCount <= 1 then
post_text = ' (' .. cfg.messages['editor'] .. ')'; -- be consistent with no-author, no-date case
else
post_text = ' (' .. cfg.messages['editors'] .. ')';
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
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 and a space
end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif utilities.is_set (Editors) then
if utilities.is_set (Date) then
if EditorCount <= 1 then
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editor'];
else
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); -- Deals with italics, spaces, etc.
if '.' == sepc then -- remove final seperator if present
text = text:gsub ('%' .. sepc .. '$', ''); -- dot must be escaped here
else
text = mw.ustring.gsub (text, sepc .. '$', ''); -- using ustring for non-dot sepc (likely a non-Latin character)
end
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite> element
local options_t = {};
options_t.class = cite_class_attribute_make (config.CitationClass, Mode);
local Ref = is_valid_parameter_value (A['Ref'], A:ORIGIN('Ref'), cfg.keywords_lists['ref'], nil, true); -- nil when |ref=harv; A['Ref'] else
if 'none' ~= cfg.keywords_xlate[(Ref and Ref:lower()) or ''] then
local namelist_t = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist_t = c; -- select it
elseif #a > 0 then -- or an author list
namelist_t = a;
elseif #e > 0 then -- or an editor list
namelist_t = e;
end
local citeref_id;
if #namelist_t > 0 then -- if there are names in namelist_t
citeref_id = make_citeref_id (namelist_t, year); -- go make the CITEREF anchor
if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or '') then -- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison
utilities.set_message ('maint_ref_duplicates_default');
end
else
citeref_id = ''; -- unset
end
options_t.id = Ref or citeref_id;
end
if string.len (text:gsub('%b<>', '')) <= 2 then -- remove html and html-like tags; then get length of what remains;
z.error_cats_t = {}; -- blank the categories list
z.error_msgs_t = {}; -- blank the error messages list
OCinSoutput = nil; -- blank the metadata string
text = ''; -- blank the the citation
utilities.set_message ('err_empty_citation'); -- set empty citation message and category
end
local render_t = {}; -- here we collect the final bits for concatenation into the rendered citation
if utilities.is_set (options_t.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render_t, utilities.substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options_t.id), mw.text.nowiki(options_t.class), text})); -- when |ref= is set or when there is a namelist
else
table.insert (render_t, utilities.substitute (cfg.presentation['cite'], {mw.text.nowiki(options_t.class), text})); -- when |ref=none or when namelist_t empty and |ref= is missing or is empty
end
if OCinSoutput then -- blanked when citation is 'empty' so don't bother to add boilerplate metadata span
table.insert (render_t, utilities.substitute (cfg.presentation['ocins'], OCinSoutput)); -- format and append metadata to the citation
end
local template_name = ('citation' == config.CitationClass) and 'citation' or 'cite ' .. (cfg.citation_class_map_t[config.CitationClass] or config.CitationClass);
local template_link = '[[Template:' .. template_name .. '|' .. template_name .. ']]';
local msg_prefix = '<code class="cs1-code">{{' .. template_link .. '}}</code>: ';
if 0 ~= #z.error_msgs_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, template_link));
table.insert (render_t, ' '); -- insert a space between citation and its error messages
table.sort (z.error_msgs_t); -- sort the error messages list; sorting includes wrapping <span> and <code> tags; hidden-error sorts ahead of visible-error
local hidden = true; -- presume that the only error messages emited by this template are hidden
for _, v in ipairs (z.error_msgs_t) do -- spin through the list of error messages
if v:find ('cs1-visible-error', 1, true) then -- look for the visible error class name
hidden = false; -- found one; so don't hide the error message prefix
break; -- and done because no need to look further
end
end
z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]}); -- add error message prefix to first error message to prevent extraneous punctuation
table.insert (render_t, table.concat (z.error_msgs_t, '; ')); -- make a big string of error messages and add it to the rendering
end
if 0 ~= #z.maint_cats_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, template_link));
table.sort (z.maint_cats_t); -- sort the maintenance messages list
local maint_msgs_t = {}; -- here we collect all of the maint messages
if 0 == #z.error_msgs_t then -- if no error messages
table.insert (maint_msgs_t, msg_prefix); -- insert message prefix in maint message livery
end
for _, v in ipairs( z.maint_cats_t ) do -- append maintenance categories
table.insert (maint_msgs_t, -- assemble new maint message and add it to the maint_msgs_t table
table.concat ({v, ' (', utilities.substitute (cfg.messages[':cat wikilink'], v), ')'})
);
end
table.insert (render_t, utilities.substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs_t, ' '))); -- wrap the group of maint messages with proper presentation and save
end
if not no_tracking_cats then
local sort_key;
local cat_wikilink = 'cat wikilink';
if cfg.enable_sort_keys then -- when namespace sort keys enabled
local namespace_number = mw.title.getCurrentTitle().namespace; -- get namespace number for this wikitext
sort_key = (0 ~= namespace_number and (cfg.name_space_sort_keys[namespace_number] or cfg.name_space_sort_keys.other)) or nil; -- get sort key character; nil for mainspace
cat_wikilink = (not sort_key and 'cat wikilink') or 'cat wikilink sk'; -- make <cfg.messages> key
end
for _, v in ipairs (z.error_cats_t) do -- append error categories
table.insert (render_t, utilities.substitute (cfg.messages[cat_wikilink], {v, sort_key}));
end
if cfg.id_limits_data_load_fail then -- boolean true when load failed
utilities.set_message ('maint_id_limit_load_fail'); -- done here because this maint cat emits no message
end
for _, v in ipairs (z.maint_cats_t) do -- append maintenance categories
table.insert (render_t, utilities.substitute (cfg.messages[cat_wikilink], {v, sort_key}));
end
for _, v in ipairs (z.prop_cats_t) do -- append properties categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v)); -- no sort keys
end
end
return table.concat (render_t); -- make a big string and done
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class, empty)
local name = tostring (name);
local enum_name; -- parameter name with enumerator (if any) replaced with '#'
local state;
local function state_test (state, name) -- local function to do testing of state values
if true == state then return true; end -- valid actively supported parameter
if false == state then
if empty then return nil; end -- empty deprecated parameters are treated as unknowns
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
if 'tracked' == state then
local base_name = name:gsub ('%d', ''); -- strip enumerators from parameter names that have them to get the base name
utilities.add_prop_cat ('tracked-param', {base_name}, base_name); -- add a properties category; <base_name> modifies <key>
return true;
end
return nil;
end
if name:find ('#') then -- # is a cs1|2 reserved character so parameters with # not permitted
return nil;
end
-- replace enumerator digit(s) with # (|last25= becomes |last#=) (mw.ustring because non-Western 'local' digits)
enum_name = mw.ustring.gsub (name, '%d+$', '#'); -- where enumerator is last charaters in parameter name (these to protect |s2cid=)
enum_name = mw.ustring.gsub (enum_name, '%d+([%-l])', '#%1'); -- where enumerator is in the middle of the parameter name; |author#link= is the oddity
if 'document' == cite_class then -- special case for {{cite document}}
state = whitelist.document_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false;
end
if utilities.in_array (cite_class, whitelist.preprint_template_list_t) then -- limited parameter sets allowed for these templates
state = whitelist.limited_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
state = whitelist.preprint_arguments_t[cite_class][name]; -- look in the parameter-list for the template identified by cite_class
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
if utilities.in_array (cite_class, whitelist.unique_param_template_list_t) then -- template-specific parameters for templates that accept parameters from the basic argument list
state = whitelist.unique_arguments_t[cite_class][name]; -- look in the template-specific parameter-lists for the template identified by cite_class
if true == state_test (state, name) then return true; end
end -- if here, fall into general validation
state = whitelist.common_parameters_t[enum_name]; -- all other templates; all normal parameters allowed; this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end
--[=[-------------------------< I N T E R _ W I K I _ C H E C K >----------------------------------------------
check <value> for inter-language interwiki-link markup. <prefix> must be a MediaWiki-recognized language
code. when these values have the form (without leading colon):
[[<prefix>:link|label]] return label as plain-text
[[<prefix>:link]] return <prefix>:link as plain-text
return value as is else
]=]
local function inter_wiki_check (parameter, value)
local prefix = value:match ('%[%[(%a+):'); -- get an interwiki prefix if one exists
local _;
if prefix and cfg.inter_wiki_map[prefix:lower()] then -- if prefix is in the map, needs preceding colon so
utilities.set_message ('err_bad_paramlink', parameter); -- emit an error message
_, value, _ = utilities.is_wikilink (value); -- extract label portion from wikilink
end
return value;
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe. There are two tests made:
{{cite ... |title=Title access-date=2016-03-17}} -- the first parameter has a value and whitespace separates that value from the missing pipe parameter name
{{cite ... |title=access-date=2016-03-17}} -- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc. To prevent false positives XML/HTML
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove XML/HTML tags because attributes: class=, title=, etc.
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
utilities.set_message ('err_missing_pipe', parameter);
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if 'number' == type (param) then
return;
end
param = param:gsub ('%d+', '#'); -- enumerated name-list mask params allow terminal punct; normalize
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
if value:match ('^=') then -- sometimes an extraneous '=' character appears ...
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< H A S _ T W L _ U R L >--------------------------------------------------------
look for The Wikipedia Library urls in url-holding parameters. TWL urls are accessible for readers who are not
active extended confirmed Wikipedia editors. This function emits an error message when such urls are discovered.
looks for: '.wikipedialibrary.idm.oclc.org'
]]
local function has_twl_url (url_params_t)
local url_error_t = {}; -- sequence of url-holding parameters that have a TWL url
for param, value in pairs (url_params_t) do
if value:find ('%.wikipedialibrary%.idm%.oclc%.org') then -- has the TWL base url?
table.insert (url_error_t, utilities.wrap_style ('parameter', param)); -- add parameter name to the list
end
end
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_twl_url', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
return true;
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ U R L >------------------------------------------
look for extraneous url parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_url (non_url_param_t)
local url_error_t = {};
check_for_url (non_url_param_t, url_error_t); -- extraneous url check
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_ext_link', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< _ C I T A T I O N >------------------------------------------------------------
Module entry point
frame – from template call (citation()); may be nil when called from another module
args – table of all cs1|2 parameters in the template (the template frame)
config – table of template-supplied parameter (the #invoke frame)
]]
local function _citation (frame, args, config) -- save a copy in case we need to display an error message in preview mode
if not frame then
frame = mw.getCurrentFrame(); -- if called from another module, get a frame for frame-provided functions
end
-- i18n: set the name that your wiki uses to identify sandbox subpages from sandbox template invoke (or can be set here)
local sandbox = ((config.SandboxPath and '' ~= config.SandboxPath) and config.SandboxPath) or '/sandbox'; -- sandbox path from {{#invoke:Citation/CS1/sandbox|citation|SandboxPath=/...}}
is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true); -- is this invoke the sandbox module?
sandbox = is_sandbox and sandbox or ''; -- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else
cfg = mw.loadData ('Module:Citation/CS1/Configuration' .. sandbox); -- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist' .. sandbox);
utilities = require ('Module:Citation/CS1/Utilities' .. sandbox);
validation = require ('Module:Citation/CS1/Date_validation' .. sandbox);
identifiers = require ('Module:Citation/CS1/Identifiers' .. sandbox);
metadata = require ('Module:Citation/CS1/COinS' .. sandbox);
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the selected cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
is_preview_mode = not utilities.is_set (frame:preprocess ('{{REVISIONID}}'));
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text; -- used as a flag
local capture; -- the single supported capture when matching unknown parameters using patterns
local empty_unknowns = {}; -- sequence table to hold empty unknown params for error message listing
for k, v in pairs( args ) do -- get parameters from the parent (template) frame
v = mw.ustring.gsub (v, '^%s*(.-)%s*$', '%1'); -- trim leading/trailing whitespace; when v is only whitespace, becomes empty string
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
if type (k) ~= 'string' then -- exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text = utilities.set_message ('err_text_ignored', {v});
end
elseif validate (k:lower(), config.CitationClass) then
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, k:lower()}); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
suggestions = mw.loadData ('Module:Citation/CS1/Suggestions' .. sandbox); --load sandbox version of suggestion module when {{#invoke:Citation/CS1/sandbox|...}}; live module else
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no capture in pattern else the capture if a match
if capture then -- if the pattern matches
param = utilities.substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, param}); -- set the suggestion error message
else
error_text = utilities.set_message ('err_parameter_ignored', {k}); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an explicit suggestion?
if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config.CitationClass) then
utilities.set_message ('err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]});
else
utilities.set_message ('err_parameter_ignored', {k});
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
end
args[k] = v; -- save this parameter and its value
elseif not utilities.is_set (v) then -- for empty parameters
if not validate (k, config.CitationClass, true) then -- is this empty parameter a valid parameter
k = ('' == k) and '(empty string)' or k; -- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text
table.insert (empty_unknowns, utilities.wrap_style ('parameter', k)); -- format for error message and add to the list
end
-- crude debug support that allows us to render a citation from module {{#invoke:}} TODO: keep?
-- elseif args[k] ~= nil or (k == 'postscript') then -- when args[k] has a value from {{#invoke}} frame (we don't normally do that)
-- args[k] = v; -- overwrite args[k] with empty string from pframe.args[k] (template frame); v is empty string here
end -- not sure about the postscript bit; that gets handled in parameter validation; historical artifact?
end
if 0 ~= #empty_unknowns then -- create empty unknown error message
utilities.set_message ('err_param_unknown_empty', {
1 == #empty_unknowns and '' or 's',
utilities.make_sep_list (#empty_unknowns, empty_unknowns)
});
end
local non_url_param_t = {}; -- table of parameters and values that are not url-holding parameters
local url_param_t = {}; -- table of url-holding paramters and their values
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v); -- look for invisible characters
end
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
args[k] = inter_wiki_check (k, v); -- when language interwiki-linked parameter missing leading colon replace with wiki-link label
if 'string' == type (k) then -- when parameter k is not positional
if not cfg.url_skip[k] then -- and not in url skip table
non_url_param_t[k] = v; -- make a parameter/value list for extraneous url check
else -- and is in url skip table (a url-holding parameter)
url_param_t[k] = v; -- make a parameter/value list to check for values that are The Wikipedia Library url
end
end
end
has_extraneous_url (non_url_param_t); -- look for url in parameter values where a url does not belong
if has_twl_url (url_param_t) then -- look for url-holding parameters that hold a The Wikipedia Library url
args['url-access'] = 'subscription';
end
return table.concat ({
frame:extensionTag ('templatestyles', '', {src='Module:Citation/CS1' .. sandbox .. '/styles.css'}),
citation0( config, args)
});
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
Template entry point
]]
local function citation (frame)
local config_t = {}; -- table to store parameters from the module {{#invoke:}}
local args_t = frame:getParent().args; -- get template's preset parameters
for k, v in pairs (frame.args) do -- get parameters from the {{#invoke}} frame
config_t[k] = v;
-- args_t[k] = v; -- crude debug support that allows us to render a citation from module {{#invoke:}}; skips parameter validation; TODO: keep?
end
return _citation (frame, args_t, config_t)
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {
citation = citation, -- template entry point
_citation = _citation, -- module entry point
}
swdh50lofyqq0wmp3o2c259fg8s2nxi
690974
690969
2025-07-10T16:03:16Z
Abbas dhothar
361
690974
Scribunto
text/plain
require ('Module:No globals');
local Date2en = require ('ماڈیول:Date2en').convert;
local num_con = require ('ماڈیول:Numeral converter').convert;
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
each of these counts against the Lua upvalue limit
]]
local validation; -- functions in Module:Citation/CS1/Date_validation
local utilities; -- functions in Module:Citation/CS1/Utilities
local z ={}; -- table of tables in Module:Citation/CS1/Utilities
local identifiers; -- functions and tables in Module:Citation/CS1/Identifiers
local metadata; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[------------------< P A G E S C O P E V A R I A B L E S >---------------
declare variables here that have page-wide scope that are not brought in from
other modules; that are created here and used here
]]
local added_deprecated_cat; -- Boolean flag so that the category is added only once
local added_vanc_errs; -- Boolean flag so we only emit one Vancouver error / category
local added_generic_name_errs; -- Boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered
local Frame; -- holds the module's frame table
local is_preview_mode; -- true when article is in preview mode; false when using 'Preview page with this template' (previewing the module)
local is_sandbox; -- true when using sandbox modules to render citation
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if utilities.is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a Boolean declared in page scope variables above
]]
local function add_vanc_error (source, position)
if added_vanc_errs then return end
added_vanc_errs = true; -- note that we've added this category
utilities.set_message ('err_vancouver', {source, position});
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a URI scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and mw.ustring.match (scheme, '^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of TLDs: https://www.iana.org/domains/root/db
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the TLD. tld
is two or more alpha characters. Any preceding '//' (from splitting a URL with a scheme) will be stripped
here. Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and TLD or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = mw.ustring.gsub (domain, '^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not mw.ustring.match (domain, '^[%w]') then -- first character must be letter or digit
return false;
end
if mw.ustring.match (domain, '^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource
return false;
end
local patterns = { -- patterns that look like URLs
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and ccTLD (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and TLD
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if mw.ustring.match (domain, pattern) then
return true; -- if a match then we think that this thing that purports to be a URL is a URL
end
end
for _, d in ipairs ({'cash', 'company', 'today', 'org'}) do -- look for single letter second level domain names for these top level domains
if mw.ustring.match (domain, '%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if utilities.is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when URL is protocol-relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a URL into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.
When not protocol-relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Any URL that does not have news: scheme must have authority indicator (//). TODO: are there other common schemes
like news: that don't use authority indicator?
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = mw.ustring.gsub (url_str, '([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if mw.ustring.match (url_str, '^//%S*') then -- if there is what appears to be a protocol-relative URL
domain = mw.ustring.match (url_str, '^//(%S*)')
elseif mw.ustring.match (url_str, '%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = mw.ustring.match (url_str, '(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
if utilities.is_set (authority) then
authority = mw.ustring.gsub (authority, '//', '', 1); -- replace place 1 pair of '/' with nothing;
if utilities.is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
else
if not mw.ustring.match (scheme, '^news:') then -- except for news:..., MediaWiki won't link URLs that do not have authority indicator; TODO: a better way to do this test?
return scheme; -- return scheme only making domain nil which will cause an error message
end
end
domain = mw.ustring.gsub (domain, '(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the
|<param>-link= parameter is ok); else false when value appears to be a valid URL (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if mw.ustring.find (value, '[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from URL;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid URL
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wiki-linked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
check <link> for inter-language interwiki-link prefix. prefix must be a MediaWiki-recognized language
code and must begin with a colon.
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if utilities.is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif mw.ustring.find (title, '%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
elseif mw.ustring.match (link, '^%a+:') then -- if the link is what looks like an interwiki
local prefix = mw.ustring.match (link, '^(%a+):'):lower(); -- get the interwiki prefix
if cfg.inter_wiki_map[prefix] then -- if prefix is in the map, must have preceding colon
orig = lorig; -- flag as error
end
end
end
if utilities.is_set (orig) then
link = ''; -- unset
utilities.set_message ('err_bad_paramlink', orig); -- URL or wikilink in |title= with |title-link=;
end
return link; -- link if ok, empty string else
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the URL into scheme and domain
portions, or for protocol-relative (//example.com) URLs, just the domain. Use is_url() to validate the two
portions of the URL. If both are valid, or for protocol-relative if domain is valid, return true, else false.
Because it is different from a standard URL, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == mw.ustring.match (url_str, "^%S+$") then -- if there are any spaces in |url=value it can't be a proper URL
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from URL;
if 'news:' == scheme then -- special case for newsgroups
return mw.ustring.match(domain, '^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a URL. The test will also find external wikilinks
that use protocol-relative URLs. Also finds bare URLs.
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs. The tests that
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if mw.ustring.match (value, '%f[%[]%[%a%S*:%S+.*%]') then -- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (mw.ustring.match (value, '%f[%[]%[(%a%S*:%S+).*%]'));
elseif mw.ustring.match (value, '%f[%[]%[//%S+.*%]') then -- if protocol-relative ext. wikilink: [//yyyyy.zzz]
scheme, domain = split_url (mw.ustring.match (value, '%f[%[]%[(//%S+).*%]'));
elseif mw.ustring.match (value, '%a%S*:%S+') then -- if bare URL with scheme; may have leading or trailing plain text
scheme, domain = split_url (mw.ustring.match (value, '(%a%S*:%S+)'));
elseif mw.ustring.match (value, '//%S+') then -- if protocol-relative bare URL: //yyyyy.zzz; may have leading or trailing plain text
scheme, domain = split_url (mw.ustring.match (value, '(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a URL
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list, error_list)
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a URL add an error message
table.insert (error_list, utilities.wrap_style ('parameter', k));
end
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if mw.ustring.match(str, "%[%[.-%]%]" ) ~= nil then
utilities.set_message ('err_wikilink_in_url', {});
end
return mw.ustring.gsub(str, '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link (URL, label, source, access)
local err_msg = '';
local domain;
local path;
local base_url;
if not utilities.is_set (label) then
label = URL;
if utilities.is_set (source) then
utilities.set_message ('err_bare_url_missing_title', {utilities.wrap_style ('parameter', source)});
else
error (cfg.messages["bare_url_no_origin"]);
end
end
if not check_url (URL) then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)});
end
domain, path = mw.ustring.match (URL, '^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the URL into scheme plus domain and path
if path then -- if there is a path portion
path = mw.ustring.gsub (path, '[%[%]]', {['['] = '%5b', [']'] = '%5d'}); -- replace '[' and ']' with their percent-encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat ({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wiki-markup URL
--برای رفع برخی خطاها در ویکی فارسی شرط utilities.is_set(cfg.presentation[access]) را در خط زیر افزودم
if utilities.is_set (access) and utilities.is_set(cfg.presentation[access]) then -- access level (subscription, registration, limited)
base_url = utilities.substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return base_url;
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a Boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
utilities.set_message ('err_deprecated_params', {name}); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wiki-markup) are not kerned.
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc.; not for book titles.
]=]
local function kern_quotes (str)
local cap = '';
local wl_type, label, link;
wl_type, label, link = utilities.is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
str = utilities.substitute (cfg.presentation['kern-right'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = utilities.substitute (cfg.presentation['kern-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label = mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label = mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap = mw.ustring.match (label, "^([\"\'][^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-left'], cap);
end
cap = mw.ustring.match (label, "^(.+[^\'][\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-right'], cap);
end
if 2 == wl_type then
str = utilities.make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate RTL languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO 639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
if mw.ustring.match(script_value, '^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
lang = mw.ustring.match(script_value, '^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not utilities.is_set (lang) then
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing title part']}); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
name = cfg.lang_code_remap[lang] or mw.language.fetchLanguageName( lang, cfg.this_wiki_code ); -- get language name so that we can use it to categorize
if utilities.is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = mw.ustring.gsub (script_value, '^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if utilities.in_array (lang, cfg.script_lang_codes) then
utilities.add_prop_cat ('script', {name, lang})
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['unknown language code']}); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['invalid language code']}); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing prefix']}); -- no language code prefix; add error message
end
script_value = utilities.substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is RTL
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script
value has been wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if utilities.is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang attribute, categorization, etc.; returns empty string on error
if utilities.is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not utilities.is_set ( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return utilities.substitute ( msg, str ); -- including template text
else
return utilities.substitute ( cfg.messages[key], str );
end
end
--[[----------------< W I K I S O U R C E _ U R L _ M A K E >-------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate
label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
local wikisource_prefix = table.concat ({'https://', cfg.this_wiki_code, '.wikisource.org/wiki/'});
wl_type, D, L = utilities.is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = mw.ustring.match (D, '^[Ww]ikisource:(.+)') or mw.ustring.match (D, '^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = mw.ustring.match (D, '^[Ww]ikisource:(.+)') or mw.ustring.match (D, '^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = mw.ustring.match (L, '^[Ww]ikisource:(.+)') or mw.ustring.match (L, '^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = mw.ustring.gsub (ws_url, '%%23', '#'); -- undo percent-encoding of fragment marker
end
return ws_url, ws_label, L or D; -- return proper URL or nil and a label or nil
end
--[[----------------< F O R M A T _ P E R I O D I C A L >-----------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=,
and |trans-<periodical>= into a single Periodical meta-parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
if not utilities.is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = utilities.wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (trans_periodical) then
trans_periodical = utilities.wrap_style ('trans-italic-title', trans_periodical);
if utilities.is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when trans-periodical without periodical or script-periodical
periodical = trans_periodical;
utilities.set_message ('err_trans_missing_title', {'periodical'});
end
end
return periodical;
end
--[[------------------< F O R M A T _ C H A P T E R _ T I T L E >---------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used
for error messages).
]]
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = mw.ustring.gsub (ws_label, '_', ' '); -- replace underscore separators with space characters
chapter = ws_label;
end
if not utilities.is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from module provided quote marks
chapter = utilities.wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, script_chapter, script_chapter_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (chapter_url) then
chapter = external_link (chapter_url, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if utilities.is_set (trans_chapter) then
trans_chapter = utilities.wrap_style ('trans-quoted-title', trans_chapter);
if utilities.is_set (chapter) then
chapter = chapter .. ' ' .. trans_chapter;
else -- here when trans_chapter without chapter or script-chapter
chapter = trans_chapter;
chapter_source = mw.ustring.match (trans_chapter_source, 'trans%-?(.+)'); -- when no chapter, get matching name from trans-<param>
utilities.set_message ('err_trans_missing_title', {chapter_source});
end
end
return chapter;
end
--[[----------------< H A S _ I N V I S I B L E _ C H A R S >-------------------
This function searches a parameter's value for non-printable or invisible characters.
The search stops at the first match.
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers
(gallery, math, pre, ref) and identifies them with a slightly different error message.
See also coins_cleanup().
Output of this function is an error message that identifies the character or the
Unicode group, or the stripmarker that was detected along with its position (or,
for multi-byte characters, the position of its first byte) in the parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local capture; -- used by stripmarker detection to hold name of the stripmarker
local stripmarker; -- boolean set true when a stripmarker is found
capture = string.match (v, '[%w%p ]*'); -- test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no Unicode characters
return;
end
for _, invisible_char in ipairs (cfg.invisible_chars) do
local char_name = invisible_char[1]; -- the character or group name
local pattern = invisible_char[2]; -- the pattern used to find it
position, _, capture = mw.ustring.find (v, pattern); -- see if the parameter value contains characters that match the pattern
if position and (cfg.invisible_defs.zwj == capture) then -- if we found a zero-width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- it's ok if one of the Indic scripts
position = nil; -- unset position
elseif cfg.emoji[mw.ustring.codepoint (v, position+1)] then -- is zwj followed by a character listed in emoji{}?
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and utilities.in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and cfg.invisible_defs.del == capture then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then
err_msg = capture .. ' ' .. char_name;
else
err_msg = char_name .. ' ' .. 'character';
end
utilities.set_message ('err_invisible_char', {err_msg, utilities.wrap_style ('parameter', param), position}); -- add error message
return; -- and done with this parameter
end
end
end
end
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( args )
local origin = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = utilities.select_one ( args, list, 'err_redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >-------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>.
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:
<span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap = '';
local cap2 = '';
if mw.ustring.match(date, "^%d%d%d%d%-%d%d%-%d%d$") then
date = utilities.substitute (cfg.presentation['nowrap1'], date);
elseif mw.ustring.match(date, "^%a+%s*%d%d?,%s+%d%d%d%d$") or mw.ustring.match (date, "^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = mw.ustring.match (date, "^(.*)%s+(%d%d%d%d)$");
date = utilities.substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >---------------------
This function sets default title types (equivalent to the citation including
|type=<default value>) for those templates that have defaults. Also handles the
special case where it is desirable to omit the title type from the rendered citation
(|type=none).
]]
local function set_titletype (cite_class, title_type)
if utilities.is_set (title_type) then
if 'none' == cfg.keywords_xlate[title_type] then
title_type = ''; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< S A F E _ J O I N >-----------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'duplicate character'
if 1 == #duplicate_char then -- for single byte ASCII characters use the string library functions
f.gsub = string.gsub
f.match = string.match
f.sub = string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub = mw.ustring.gsub
f.match = mw.ustring.match
f.sub = mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if mw.ustring.sub(value, 1, 1) == '<' then -- special case of values enclosed in spans and other markup.
comp = mw.ustring.gsub(value, "%b<>", "" ); -- remove HTML markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if 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.?
trim = false;
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
str = f.sub(str, 1, -2); -- remove it
elseif end_chr == "'" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5, -1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4, -1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3, -1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2, -1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4, -1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2, -1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1, -3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains HTML markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows HTML markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; -- add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >-----------------------------
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.
Puncutation not allowed.
]]
local function is_suffix (suffix)
if utilities.in_array (suffix, {'Jr', 'Sr', 'Jnr', 'Snr', '1st', '2nd', '3rd'}) or mw.ustring.match (suffix, '^%dth$') then
return true;
end
return false;
end
--[[--------------------< I S _ G O O D _ V A N C _ N A M E >-------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin
(read ASCII) characters. When a name uses characters that contain diacritical
marks, those characters are to be converted to the corresponding Latin
character. When a name is written using a non-Latin alphabet or logogram, that
name is to be transliterated into Latin characters. The module doesn't do this
so editors may/must.
This test allows |first= and |last= names to contain any of the letters defined
in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes.
(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$")
or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor
gets confused between character insertion point and cursor position. The test has
been rewritten to use decimal character escape sequence for the individual bytes
of the Unicode characters so that it is not necessary to use an external editor
to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first, suffix, position)
if not suffix then
if mw.ustring.find (first, '[,%s]') then -- when there is a space or comma, might be first name/initials + generational suffix
first = mw.ustring.match (first, '(.-)[,%s]+'); -- get name/initials
suffix = mw.ustring.match (first, '[,%s]+(.+)$'); -- get generational suffix
end
end
if utilities.is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error (cfg.err_msg_supl.suffix, position);
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143%-%s%'%.]*$") then
add_vanc_error (cfg.err_msg_supl['non-Latin char'], position);
return false; -- not a string of Latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered
as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format
because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the
Unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials(first, position)
local name, suffix = mw.ustring.match(first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match(first, "^(%u+)$"); -- is it just initials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error (cfg.err_msg_supl.suffix, position); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials, names = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names = mw.text.split (first, '[%s,]+'); -- split into a table of names and possible suffix
while names[i] do -- loop through the table
if 1 < i and mw.ustring.match (names[i], '[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names[i] = mw.ustring.gsub (names[i], '%.', ''); -- remove terminal dot if present
if is_suffix (names[i]) then -- if a legitimate suffix
table.insert (initials, ' ' .. names[i]); -- add a separator space, insert at end of initials table
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials, mw.ustring.sub(names[i], 1, 1)); -- insert the initial at end of initials table
end
i = i + 1; -- bump the counter
end
return table.concat(initials) -- Vancouver format does not include spaces.
end
--[[--------------------------< L I S T _ P E O P L E >--------------------------
Formats a list of people (authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been
rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
]]
local function list_people (control, people, etal)
local sep;
local namesep;
local format = control.format;
local maximum = control.maximum;
local name_list = {};
if 'vanc' == format then -- Vancouver-like name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if mw.ustring.sub (sep, -1, -1) ~= " " then sep = sep .. " " end
if utilities.is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for other names
for i, person in ipairs (people) do
if utilities.is_set (person.last) then
local mask = person.mask;
local one;
local sep_one = sep;
if utilities.is_set (maximum) and i > maximum then
etal = true;
break;
end
if mask then
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—", n) or nil; -- make a string of (n > 0) mdashes, nil else, to replace name
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
one = mask; -- replace name with mask text (must include name-list separator)
sep_one = " "; -- modify name-list separator
end
else
one = person.last; -- get surname
local first = person.first -- get given name
if utilities.is_set (first) then
if ("vanc" == format) then -- if Vancouver format
one = mw.ustring.gsub (one, '%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first, nil, i) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials (first, i); -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
end
if utilities.is_set (person.link) then
one = utilities.make_wikilink (person.link, one); -- link author/editor
end
if one then -- if <one> has a value (name, mdash replacement, or mask text replacement)
table.insert (name_list, one); -- add it to the list of names
table.insert (name_list, sep_one); -- add the proper name-list separator
end
end
end
local count = #name_list / 2; -- (number of names + number of separators) divided by 2
if 0 < count then
if 1 < count and not etal then
if 'amp' == format then
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
if 2 == count then
name_list[#name_list-2] = cfg.presentation.sep_nl_and; -- replace last separator with 'and' text
else
name_list[#name_list-2] = cfg.presentation.sep_nl_end; -- replace last separator with '(sep) and' text
end
end
end
name_list[#name_list] = nil; -- erase the last separator
end
local result = table.concat (name_list); -- construct list
if etal and utilities.is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. ' ' .. cfg.messages['et al']; -- we've got a last-first list and etal so add et al.
end
return result, count; -- return name-list string and count of number of names (count used for editor names only)
end
--[[--------------------< M A K E _ C I T E R E F _ I D >-----------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise
returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that
order. year is Year or anchor_year.
]]
local function make_citeref_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if utilities.is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< C I T E _ C L A S S _A T T R I B U T E _M A K E >------------------------------
construct <cite> tag class attribute for this citation.
<cite_class> – config.CitationClass from calling template
<mode> – value from |mode= parameter
]]
local function cite_class_attribute_make (cite_class, mode)
local class_t = {};
table.insert (class_t, 'citation'); -- required for blue highlight
if 'citation' ~= cite_class then
table.insert (class_t, cite_class); -- identify this template for user css
table.insert (class_t, utilities.is_set (mode) and mode or 'cs1'); -- identify the citation style for user css or javascript
else
table.insert (class_t, utilities.is_set (mode) and mode or 'cs2'); -- identify the citation style for user css or javascript
end
for _, prop_key in ipairs (z.prop_keys_t) do
table.insert (class_t, prop_key); -- identify various properties for user css or javascript
end
return table.concat (class_t, ' '); -- make a big string and done
end
--[[---------------------< N A M E _ H A S _ E T A L >--------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on
the theme of et al. If found, the et al. is removed, a flag is set to true and
the function returns the modified name and the flag.
This function never sets the flag to false but returns its previous state because
it may have been set by previous passes through this function or by the associated
|display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; -- get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if mw.ustring.match (name, pattern) then -- if this 'et al' pattern is found in name
name = mw.ustring.gsub (name, pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
utilities.set_message ('err_etal', {param}); -- and set an error if not added
end
end
end
end
return name, etal;
end
--[[---------------------< N A M E _ I S _ N U M E R I C >----------------------
Add maint cat when name parameter value does not contain letters. Does not catch
mixed alphanumeric names so |last=A. Green (1922-1987) does not get caught in the
current version of this test but |first=(1888) is caught.
returns nothing
]]
local function name_is_numeric (name, list_name)
if utilities.is_set (name) then
if mw.ustring.match (name, '^[%A]+$') then -- when name does not contain any letters
utilities.set_message ('maint_numeric_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
end
end
end
--[[-----------------< N A M E _ H A S _ M U L T _ N A M E S >------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names.
Multiple names are indicated if there is more than one comma or any "unescaped"
semicolons. Escaped semicolons are ones used as part of selected HTML entities.
If the condition is met, the function adds the multiple name maintenance category.
returns nothing
]]
local function name_has_mult_names (name, list_name)
local _, commas, semicolons, nbsps;
if utilities.is_set (name) then
_, commas = mw.ustring.gsub (name, ',', ''); -- count the number of commas
_, semicolons = mw.ustring.gsub (name, ';', ''); -- count the number of semicolons
-- nbsps probably should be its own separate count rather than merged in
-- some way with semicolons because Lua patterns do not support the
-- grouping operator that regex does, which means there is no way to add
-- more entities to escape except by adding more counts with the new
-- entities
_, nbsps = mw.ustring.gsub (name, ' ',''); -- count nbsps
-- There is exactly 1 semicolon per entity, so subtract nbsps
-- from semicolons to 'escape' them. If additional entities are added,
-- they also can be subtracted.
if 1 < commas or 0 < (semicolons - nbsps) then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
end
end
--[=[-------------------------< I S _ G E N E R I C >----------------------------------------------------------
Compares values assigned to various parameters according to the string provided as <item> in the function call.
<item> can have on of two values:
'generic_names' – for name-holding parameters: |last=, |first=, |editor-last=, etc
'generic_titles' – for |title=
There are two types of generic tests. The 'accept' tests look for a pattern that should not be rejected by the
'reject' test. For example,
|author=[[John Smith (author)|Smith, John]]
would be rejected by the 'author' reject test. But piped wikilinks with 'author' disambiguation should not be
rejected so the 'accept' test prevents that from happening. Accept tests are always performed before reject
tests.
Each of the 'accept' and 'reject' sequence tables hold tables for en.wiki (['en']) and local.wiki (['local'])
that each can hold a test sequence table The sequence table holds, at index [1], a test pattern, and, at index
[2], a boolean control value. The control value tells string.find() or mw.ustring.find() to do plain-text search (true)
or a pattern search (false). The intent of all this complexity is to make these searches as fast as possible so
that we don't run out of processing time on very large articles.
Returns
true when a reject test finds the pattern or string
false when an accept test finds the pattern or string
nil else
]=]
local function is_generic (item, value, wiki)
local test_val;
local str_lower = { -- use string.lower() for en.wiki (['en']) and use mw.ustring.lower() or local.wiki (['local'])
['en'] = string.lower,
['local'] = mw.ustring.lower,
}
local str_find = { -- use string.find() for en.wiki (['en']) and use mw.ustring.find() or local.wiki (['local'])
['en'] = string.find,
['local'] = mw.ustring.find,
}
local function test (val, test_t, wiki) -- local function to do the testing; <wiki> selects lower() and find() functions
val = test_t[2] and str_lower[wiki](value) or val; -- when <test_t[2]> set to 'true', plaintext search using lowercase value
return str_find[wiki] (val, test_t[1], 1, test_t[2]); -- return nil when not found or matched
end
local test_types_t = {'accept', 'reject'}; -- test accept patterns first, then reject patterns
local wikis_t = {'en', 'local'}; -- do tests for each of these keys; en.wiki first, local.wiki second
for _, test_type in ipairs (test_types_t) do -- for each test type
for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do -- spin through the list of generic value fragments to accept or reject
for _, wiki in ipairs (wikis_t) do
if generic_value[wiki] then
if test (value, generic_value[wiki], wiki) then -- go do the test
return ('reject' == test_type); -- param value rejected, return true; false else
end
end
end
end
end
end
--[[--------------------------< N A M E _ I S _ G E N E R I C >------------------------------------------------
calls is_generic() to determine if <name> is a 'generic name' listed in cfg.generic_names; <name_alias> is the
parameter name used in error messaging
]]
local function name_is_generic (name, name_alias)
if not added_generic_name_errs and is_generic ('generic_names', name) then
utilities.set_message ('err_generic_name', name_alias); -- set an error message
added_generic_name_errs = true;
end
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding parameters.
]]
local function name_checks (last, first, list_name, last_alias, first_alias)
local accept_name;
if utilities.is_set (last) then
last, accept_name = utilities.has_accept_as_written (last); -- remove accept-this-as-written markup when it wraps all of <last>
if not accept_name then -- <last> not wrapped in accept-as-written markup
name_has_mult_names (last, list_name); -- check for multiple names in the parameter (last only)
name_is_numeric (last, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (last, last_alias); -- check for names found in the generic names list
end
end
if utilities.is_set (first) then
first, accept_name = utilities.has_accept_as_written (first); -- remove accept-this-as-written markup when it wraps all of <first>
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_is_numeric (first, list_name); -- check for names that are composed of digits and punctuation
name_is_generic (first, first_alias); -- check for names found in the generic names list
end
local wl_type, D = utilities.is_wikilink (first);
if 0 ~= wl_type then
first = D;
utilities.set_message ('err_bad_paramlink', first_alias);
end
end
return last, first; -- done
end
--[[----------------------< E X T R A C T _ N A M E S >-------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters
(or their aliases), and their matching link and mask parameters. Stops searching
when both |lastn= and |firstn= are not found in args after two sequential attempts:
found |last1=, |last2=, and |last3= but doesn't find |last4= and |last5= then the
search is done.
This function emits an error message when there is a |firstn= without a matching
|lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not
required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.'
is stripped from the parameter and a flag (etal) returned that will cause list_people()
to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps
'et al.' out of the template's metadata. When this occurs, an error is emitted.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal = false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias, link_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'err_redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'err_redundant_parameters', i );
link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i );
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first = name_checks (last, first, list_name, last_alias, first_alias); -- multiple names, extraneous annotation, etc. checks
if first and not last then -- if there is a firstn without a matching lastn
local alias = mw.ustring.find (first_alias, 'given', 1, true) and 'given' or 'first'; -- get first or given form of the alias
utilities.set_message ('err_first_missing_last', {
first_alias, -- param name of alias missing its mate
mw.ustring.gsub (first_alias, alias, {['first'] = 'last', ['given'] = 'surname'}), -- make param name appropriate to the alias form
}); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
local result;
link = link_title_ok (link, link_alias, last, last_alias); -- check for improper wiki-markup
if first then
link = link_title_ok (link, link_alias, first, first_alias); -- check for improper wiki-markup
end
names[n] = {last = last, first = first, link = link, mask = mask, corporate = false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
utilities.set_message ('err_missing_name', {mw.ustring.match (list_name, "(%w+)List"):lower(), i - 1}); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names and the etal flag
end
--[[--------------------------< N A M E _ T A G _ G E T >------------------------------------------------------
attempt to decode |language=<lang_param> and return language name and matching tag; nil else.
This function looks for:
<lang_param> as a tag in cfg.lang_code_remap{}
<lang_param> as a name in cfg.lang_name_remap{}
<lang_param> as a name in cfg.mw_languages_by_name_t
<lang_param> as a tag in cfg.mw_languages_by_tag_t
when those fail, presume that <lang_param> is an IETF-like tag that MediaWiki does not recognize. Strip all
script, region, variant, whatever subtags from <lang_param> to leave just a two or three character language tag
and look for the new <lang_param> in cfg.mw_languages_by_tag_t{}
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil
]]
local function name_tag_get (lang_param)
local lang_param_lc = mw.ustring.lower (lang_param); -- use lowercase as an index into the various tables
local name;
local tag;
name = cfg.lang_code_remap[lang_param_lc]; -- assume <lang_param_lc> is a tag; attempt to get remapped language name
if name then -- when <name>, <lang_param> is a tag for a remapped language name
return name, lang_param_lc; -- so return <name> from remap and <lang_param_lc>
end
tag = mw.ustring.match (lang_param_lc, '^(%a%a%a?)%-.*'); -- still assuming that <lang_param_lc> is a tag; strip script, region, variant subtags
name = cfg.lang_code_remap[tag]; -- attempt to get remapped language name with language subtag only
if name then -- when <name>, <tag> is a tag for a remapped language name
return name, tag; -- so return <name> from remap and <tag>
end
if cfg.lang_name_remap[lang_param_lc] then -- not a tag, assume <lang_param_lc> is a name; attempt to get remapped language tag
return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2]; -- for this <lang_param_lc>, return a (possibly) new name and appropriate tag
end
tag = cfg.mw_languages_by_name_t[lang_param_lc]; -- assume that <lang_param_lc> is a language name; attempt to get its matching tag
if tag then
return cfg.mw_languages_by_tag_t[tag], tag; -- <lang_param_lc> is a name so return the name from the table and <tag>
end
name = cfg.mw_languages_by_tag_t[lang_param_lc]; -- assume that <lang_param_lc> is a tag; attempt to get its matching language name
if name then
return name, lang_param_lc; -- <lang_param_lc> is a tag so return it and <name>
end
tag = mw.ustring.match (lang_param_lc, '^(%a%a%a?)%-.*'); -- is <lang_param_lc> an IETF-like tag that MediaWiki doesn't recognize? <tag> gets the language subtag; nil else
if tag then
name = cfg.mw_languages_by_tag_t[tag]; -- attempt to get a language name using the shortened <tag>
if name then
return name, tag; -- <lang_param_lc> is an unrecognized IETF-like tag so return <name> and language subtag
end
end
end
--[[-------------------< L A N G U A G E _ P A R A M E T E R >------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code
is recognized by MediaWiki, use the returned name; if not, then use the value that
was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is
assigned to the category for that code: Category:Norwegian-language sources (no).
For valid three-character code languages, the page is assigned to the single category
for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does
not recognize three-character equivalents of two-character codes: code 'ar' is
recognized but code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th
where the language names or codes are separated from each other by commas with
optional space characters.
]]
local function language_parameter (lang)
local tag; -- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags
local lang_subtag; -- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_t = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_t = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_t) do -- reuse lang here because we don't yet know if lang is a language name or a language tag
name, tag = name_tag_get (lang); -- attempt to get name/tag pair for <lang>; <name> has proper capitalization; <tag> is lowercase
if utilities.is_set (tag) then
lang_subtag = mw.ustring.gsub (tag, '^(%a%a%a?)%-.*', '%1'); -- for categorization, strip any IETF-like tags from language tag
if cfg.this_wiki_code ~= lang_subtag then -- when the language is not the same as this wiki's language
if 2 == lang_subtag:len() then -- and is a two-character tag
-- utilities.add_prop_cat ('foreign-lang-source', {name, lang_subtag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
utilities.add_prop_cat ('foreign-lang-source', {name, tag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character tag)
utilities.add_prop_cat ('foreign-lang-source-2', {lang_subtag}, lang_subtag); -- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
utilities.add_prop_cat ('local-lang-source', {name, lang_subtag}); -- categorize it
end
else
name = lang; -- return whatever <lang> has so that we show something
if (name~="Persian") then
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
end
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
name = utilities.make_sep_list (#language_list, language_list);
if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then -- when only one language, find lang name in this wiki lang name; for |language=en-us, 'English' in 'American English'
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
if (name=='Persian') then
return (" " .. wrap_msg ('language', 'فارسی')); -- otherwise wrap with '(in ...)'
else
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
end
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[-----------------------< S E T _ C S _ S T Y L E >--------------------------
Gets the default CS style configuration for the given mode.
Returns default separator and either postscript as passed in or the default.
In CS1, the default postscript and separator are '.'.
In CS2, the default postscript is the empty string and the default separator is ','.
]]
local function set_cs_style (postscript, mode)
if utilities.is_set(postscript) then
-- emit a maintenance message if user postscript is the default cs1 postscript
-- we catch the opposite case for cs2 in set_style
if mode == 'cs1' and postscript == cfg.presentation['ps_' .. mode] then
utilities.set_message ('maint_postscript');
end
else
postscript = cfg.presentation['ps_' .. mode];
end
return cfg.presentation['sep_' .. mode], postscript;
end
--[[--------------------------< S E T _ S T Y L E >-----------------------------
Sets the separator and postscript styles. Checks the |mode= first and the
#invoke CitationClass second. Removes the postscript if postscript == none.
]]
local function set_style (mode, postscript, cite_class)
local sep;
if 'cs2' == mode then
sep, postscript = set_cs_style (postscript, 'cs2');
elseif 'cs1' == mode then
sep, postscript = set_cs_style (postscript, 'cs1');
elseif 'citation' == cite_class then
sep, postscript = set_cs_style (postscript, 'cs2');
else
sep, postscript = set_cs_style (postscript, 'cs1');
end
if cfg.keywords_xlate[postscript:lower()] == 'none' then
-- emit a maintenance message if user postscript is the default cs2 postscript
-- we catch the opposite case for cs1 in set_cs_style
if 'cs2' == mode or 'citation' == cite_class then
utilities.set_message ('maint_postscript');
end
postscript = '';
end
return sep, postscript
end
--[=[-------------------------< I S _ P D F >-----------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return mw.ustring.match (url, '%.pdf$') or mw.ustring.match (url, '%.PDF$') or
mw.ustring.match (url, '%.pdf[%?#]') or mw.ustring.match (url, '%.PDF[%?#]') or
mw.ustring.match (url, '%.PDF#') or mw.ustring.match (url, '%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >-----------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message
if the format parameter does not have a matching URL parameter. If the format parameter
is not set and the URL contains a file extension that is recognized as a PDF document
by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if utilities.is_set (format) then
format = utilities.wrap_style ('format', format); -- add leading space, parentheses, resize
if not utilities.is_set (url) then
utilities.set_message ('err_format_missing_url', {fmt_param, url_param}); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if URL is a PDF file then
format = utilities.wrap_style ('format', 'PDF'); -- set format to PDF
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[---------------------< G E T _ D I S P L A Y _ N A M E S >------------------
Returns a number that defines the number of names displayed for author and editor
name lists and a Boolean flag to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,
return the number and the previous state of the 'etal' flag (false by default
but may have been set to true if the name list contains some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number
that is one greater than the number of authors in the list and set the 'etal' flag true.
This will cause the list_people() to display all of the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors']; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
]]
local function get_display_names (max, count, list_name, etal, param)
if utilities.is_set (max) then
if 'etal' == mw.ustring.gsub(max:lower(), "[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif mw.ustring.match (max, '^%d+$') and tonumber (num_con("en", max)) then -- if is a string of numbers
max = tonumber (num_con("en", max)); -- make it a number
if max >= count then -- if |display-xxxxors= value greater than or equal to number of authors/editors
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil;
end
else -- not a valid keyword or number
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[----------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >---------------
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be
some form of p. or pp. abbreviation in the first characters of the parameter content.
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when page begins PX or P# but not Px
where x and X are letters and # is a digit
bad pattern: '^[Pp][PpGg]' matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG
]]
local function extra_text_in_page_check (val, name)
if not mw.ustring.match (val, cfg.vol_iss_pg_patterns.good_ppattern) then
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do -- spin through the selected sequence table of patterns
if mw.ustring.match (val, pattern) then -- when a match, error so
utilities.set_message ('err_extra_text_pages', name); -- add error message
return; -- and done
end
end
end
end
--[[--------------------------< E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K >------------------------
Adds error if |volume= or |issue= has what appears to be some form of redundant 'type' indicator.
For |volume=:
'V.', or 'Vol.' (with or without the dot) abbreviations or 'Volume' in the first characters of the parameter
content (all case insensitive). 'V' and 'v' (without the dot) are presumed to be roman numerals so
are allowed.
For |issue=:
'No.', 'I.', 'Iss.' (with or without the dot) abbreviations, or 'Issue' in the first characters of the
parameter content (all case insensitive).
Single character values ('v', 'i', 'n') allowed when not followed by separator character ('.', ':', '=', or
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.
<val> is |volume= or |issue= parameter value
<name> is |volume= or |issue= parameter name for error message
<selector> is 'v' for |volume=, 'i' for |issue=
sets error message on failure; returns nothing
]]
local function extra_text_in_vol_iss_check (val, name, selector)
if not utilities.is_set (val) then
return;
end
local patterns = 'v' == selector and cfg.vol_iss_pg_patterns.vpatterns or cfg.vol_iss_pg_patterns.ipatterns;
local handler = 'v' == selector and 'err_extra_text_volume' or 'err_extra_text_issue';
val = val:lower(); -- force parameter value to lower case
for _, pattern in ipairs (patterns) do -- spin through the selected sequence table of patterns
if mw.ustring.match (val, pattern) then -- when a match, error so
utilities.set_message (handler, name); -- add error message
return; -- and done
end
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
local name_table = mw.text.split(vparam, "%s*,%s*"); -- names are separated by commas
local wl_type, label, link; -- wl_type not used here; just a placeholder
local i = 1;
while name_table[i] do
if mw.ustring.match (name_table[i], '^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parentheses
local name = name_table[i];
i = i + 1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if mw.ustring.match (name_table[i], '^.*%)%)$') then -- if this table member has the closing doubled parentheses
break; -- and done reassembling so
end
i = i + 1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = utilities.is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i + 1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the Vancouver error when a required comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
local accept_name;
v_name, accept_name = utilities.has_accept_as_written (v_name); -- remove accept-this-as-written markup when it wraps all of <v_name>
if accept_name then
last = v_name;
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if mw.ustring.find(v_name, '[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error (cfg.err_msg_supl.punctuation, i);
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s+")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be initials or generational suffix
if not mw.ustring.match (first, '^%u+$') then -- mw.ustring here so that later we will catch non-Latin characters
suffix = first; -- not initials so assume that whatever we got is a generational suffix
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end
last = table.concat(lastfirstTable, ' ') -- returns a string that is the concatenation of all other names that are not initials and generational suffix
if not utilities.is_set (last) then
first = ''; -- unset
last = v_name; -- last empty because something wrong with first
add_vanc_error (cfg.err_msg_supl.name, i);
end
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error (cfg.err_msg_supl['missing comma'], i); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error (cfg.err_msg_supl.initials, i); -- matches a space between two initials
end
else
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if utilities.is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error (cfg.err_msg_supl.initials, i); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first, suffix, i); -- check first and last before restoring the suffix which may have a non-Latin digit
if utilities.is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '', nil, i);
end
end
link = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i ) or v_link_table[i];
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice in case we have a |first1= without a |last1=; this ...
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst = true;
end
if (utilities.is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or
(true == lastfirst and utilities.is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
utilities.set_message ('err_redundant_parameters', err_name .. '-name-list parameters'); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if utilities.is_set (vxxxxors) then return 2 end;
if utilities.is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc.). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
TODO: explain <invert>
]]
local function is_valid_parameter_value (value, name, possible, ret_val, invert)
if not utilities.is_set (value) then
return ret_val; -- an empty parameter is ok
end
if (not invert and utilities.in_array (value, possible)) then -- normal; <value> is in <possible> table
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
elseif invert and not utilities.in_array (value, possible) then -- invert; <value> is not in <possible> table
return value; -- return <value> as it is
else
utilities.set_message ('err_invalid_param_val', {name, value}); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list, -3, -1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terminate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >----------------------------------------
returns the concatenation of the formatted volume and issue parameters as a single string; or formatted volume
or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, cite_class, origin, sepc, lower)
if not utilities.is_set (volume) and not utilities.is_set (issue) then
return '';
end
-- same condition as in format_pages_sheets()
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
local is_numeric_vol = volume and (mw.ustring.match (volume, '^[MDCLXVI]+$') or mw.ustring.match (volume, '^%d+$')); -- is only uppercase roman numerals or only digits?
local is_long_vol = volume and (4 < mw.ustring.len(volume)); -- is |volume= value longer than 4 characters?
if volume and (not is_numeric_vol and is_long_vol) then -- when not all digits or Roman numerals, is |volume= longer than 4 characters?
utilities.add_prop_cat ('long-vol'); -- yes, add properties cat
end
if is_journal then -- journal-style formatting
local vol = '';
if utilities.is_set (volume) then
if is_numeric_vol then -- |volume= value all digits or all uppercase Roman numerals?
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, volume}); -- render in bold face
elseif is_long_vol then -- not all digits or Roman numerals; longer than 4 characters?
vol = utilities.substitute (cfg.messages['j-vol'], {sepc, utilities.hyphen_to_dash (volume)}); -- not bold
else -- four or fewer characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, utilities.hyphen_to_dash (volume)}); -- bold
end
end
if utilities.is_set (issue) then
return vol .. utilities.substitute (cfg.messages['j-issue'], issue);
end
return vol;
end
if 'podcast' == cite_class and utilities.is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
-- all other types of citation
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc, utilities.hyphen_to_dash (volume), issue}, lower);
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc, utilities.hyphen_to_dash (volume)}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if utilities.is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif utilities.is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if utilities.is_set (page) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return utilities.substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return utilities.substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif utilities.is_set (pages) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', utilities.substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', utilities.substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', utilities.substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to an external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, page_orig, pages, pages_orig, at)
local ws_url, ws_label, coins_pages, L; -- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if utilities.is_set (page) then
if utilities.is_set (pages) or utilities.is_set (at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page, page_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif utilities.is_set (pages) then
if utilities.is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages, pages_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif utilities.is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws URL from |at= interwiki link; link portion L becomes tooltip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[[--------------------------< I S _ U N I Q U E _ A R C H I V E _ U R L >------------------------------------
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value
]]
local function is_unique_archive_url (archive, url, c_url, source, date)
if utilities.is_set (archive) then
if archive == url or archive == c_url then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)}); -- add error message
return '', ''; -- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=
end
end
return archive, date;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the
save snapshot URL or to calendar pages. When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command URL
|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org URLs:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this function may return a modified
archive URL:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the URL unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.org URL
if (not mw.ustring.match(url, '//web%.archive%.org/')) and (not mw.ustring.match(url, '//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine URL
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if mw.ustring.match(url, '//web%.archive%.org/save/') then -- if a save command URL, we don't want to allow saving of the target page
err_msg = cfg.err_msg_supl.save;
url = mw.ustring.gsub (url, '(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif mw.ustring.match(url, '//liveweb%.archive%.org/') then
err_msg = cfg.err_msg_supl.liveweb;
else
path, timestamp, flag = mw.ustring.match(url, '//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the URL parts for evaluation
if not path then -- malformed in some way; pattern did not match
err_msg = cfg.err_msg_supl.timestamp;
elseif 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = cfg.err_msg_supl.timestamp;
if '*' ~= flag then
local replacement = mw.ustring.match (timestamp, '^%d%d%d%d%d%d') or mw.ustring.match (timestamp, '^%d%d%d%d'); -- get the first 6 (YYYYMM) or first 4 digits (YYYY)
if replacement then -- nil if there aren't at least 4 digits (year)
replacement = replacement .. string.rep ('0', 14 - replacement:len()); -- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp
url=mw.ustring.gsub (url, '(//web%.archive%.org/[^%d]*)%d[^/]*', '%1' .. replacement .. '*', 1) -- for preview, modify ts to 14 digits plus splat for calendar display
end
end
elseif utilities.is_set (path) and 'web/' ~= path then -- older archive URLs do not have the extra 'web/' path element
err_msg = cfg.err_msg_supl.path;
elseif utilities.is_set (flag) and not utilities.is_set (path) then -- flag not allowed with the old form URL (without the 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
elseif utilities.is_set (flag) and not mw.ustring.match (flag, '%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
else
return url, date; -- return ArchiveURL and ArchiveDate
end
end
-- if here, something not right so
utilities.set_message ('err_archive_url', {err_msg}); -- add error message and
if is_preview_mode then
return url, date; -- preview mode so return ArchiveURL and ArchiveDate
else
return '', ''; -- return empty strings for ArchiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not utilities.is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
utilities.set_message ('maint_location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (placeholder added by bots that can't find proper title); if matches, return true; nil else
]]
local function is_archived_copy (title)
title = mw.ustring.lower(title); -- switch title to lower case
if mw.ustring.find (title, cfg.special_case_translation.archived_copy.en) then -- if title is 'Archived copy'
return true;
elseif cfg.special_case_translation.archived_copy['local'] then
if mw.ustring.find (title, cfg.special_case_translation.archived_copy['local']) then -- mw.ustring() because might not be Latin script
return true;
end
end
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args )
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper ( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListStyle = is_valid_parameter_value (A['NameListStyle'], A:ORIGIN('NameListStyle'), cfg.keywords_lists['name-list-style'], '');
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
a, author_etal = parse_vauthors_veditors (args, args.vauthors, 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |authors=
if 'authors' == A:ORIGIN('Authors') then -- but add a maint cat if the parameter is |authors=
utilities.set_message ('maint_authors'); -- because use of this parameter is discouraged; what to do about the aliases is a TODO:
end
end
if utilities.is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], nil, args, 'EditorList'); -- support for |editors= withdrawn
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
end
end
local Chapter = A['Chapter']; -- done here so that we have access to |contribution= from |chapter= aliases
local Chapter_origin = A:ORIGIN ('Chapter');
local Contribution; -- because contribution is required for contributor(s)
if 'contribution' == Chapter_origin then
Contribution = Chapter; -- get the name of the contribution
end
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not utilities.is_set (Contribution) then -- |contributor= requires |contribution=
utilities.set_message ('err_contributor_missing_required_param', 'contribution'); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
utilities.set_message ('err_contributor_missing_required_param', 'author'); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if utilities.select_one (args, cfg.aliases['ContributorList-Last'], 'err_redundant_parameters', 1 ) then -- are there contributor name list parameters?
utilities.set_message ('err_contributor_ignored'); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
local Title = A['Title'];
local TitleLink = A['TitleLink'];
local auto_select = ''; -- default is auto
local accept_link;
TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true); -- test for accept-this-as-written markup
if (not accept_link) and utilities.in_array (TitleLink, {'none', 'pmc', 'doi'}) then -- check for special keywords
auto_select = TitleLink; -- remember selection for later
TitleLink = ''; -- treat as if |title-link= would have been empty
end
TitleLink = link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set
local Section = ''; -- {{cite map}} only; preset to empty string for concatenation if not used
if 'map' == config.CitationClass and 'section' == Chapter_origin then
Section = A['Chapter']; -- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}
Chapter = ''; -- unset for now; will be reset later from |map= if present
end
local Periodical = A['Periodical'];
local Periodical_origin = '';
if utilities.is_set (Periodical) then
Periodical_origin = A:ORIGIN('Periodical'); -- get the name of the periodical parameter
local i;
Periodical, i = utilities.strip_apostrophe_markup (Periodical); -- strip apostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {Periodical_origin});
end
end
if 'mailinglist' == config.CitationClass then -- special case for {{cite mailing list}}
if utilities.is_set (Periodical) and utilities.is_set (A ['MailingList']) then -- both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', Periodical_origin) .. ' and ' .. utilities.wrap_style ('parameter', 'mailinglist')});
end
Periodical = A ['MailingList']; -- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}
Periodical_origin = A:ORIGIN('MailingList');
end
local ScriptPeriodical = A['ScriptPeriodical'];
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
utilities.set_message ('err_missing_periodical', {config.CitationClass, p[config.CitationClass]});
end
end
local Volume;
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) then
if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then -- {{citation}} does not render |volume= when these parameters are used
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif utilities.is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
extra_text_in_vol_iss_check (Volume, A:ORIGIN ('Volume'), 'v');
local Issue;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then -- {{citation}} may render |issue= when these parameters are used
Issue = utilities.hyphen_to_dash (A['Issue']);
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (utilities.in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then
Issue = utilities.hyphen_to_dash (A['Issue']);
end
end
extra_text_in_vol_iss_check (Issue, A:ORIGIN ('Issue'), 'i');
local Page;
local Pages;
local At;
if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then
Page = A['Page'];
Pages = utilities.hyphen_to_dash (A['Pages']);
At = A['At'];
end
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if utilities.is_set (PublisherName) then
local i = 0;
PublisherName, i = utilities.strip_apostrophe_markup (PublisherName); -- strip apostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {PublisherName_origin});
end
end
local Newsgroup = A['Newsgroup']; -- TODO: strip apostrophe markup?
local Newsgroup_origin = A:ORIGIN('Newsgroup');
if 'newsgroup' == config.CitationClass then
if utilities.is_set (PublisherName) then -- general use parameter |publisher= not allowed in cite newsgroup
utilities.set_message ('err_parameter_ignored', {PublisherName_origin});
end
PublisherName = nil; -- ensure that this parameter is unset for the time being; will be used again after COinS
end
local URL = A['URL']; -- TODO: better way to do this for URL, ChapterURL, and MapURL?
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then
UrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', 'url');
end
local ChapterURL = A['ChapterURL'];
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then
ChapterUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {mw.ustring.gsub (A:ORIGIN('ChapterUrlAccess'), '%-access', '')});
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (A['MapURL']) and utilities.is_set (MapUrlAccess) then
MapUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {'map-url'});
end
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not utilities.is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if utilities.in_array (this_page.nsText, cfg.uncategorized_namespaces) then
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _, v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if mw.ustring.match (this_page.text, v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
utilities.select_one (args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'err_redundant_parameters'); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN('Page'), Pages, A:ORIGIN('Pages'), At);
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
utilities.add_prop_cat ('location-test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
local URL_origin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL_origin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ScriptChapter = A['ScriptChapter'];
local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local TransChapter = A['TransChapter'];
local TransChapter_origin = A:ORIGIN ('TransChapter');
local TransTitle = A['TransTitle'];
local ScriptTitle = A['ScriptTitle'];
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title=
|encyclopedia= and |article= then map |encyclopedia= to |title=
|trans-title= maps to |trans-chapter= when |title= is re-mapped
|url= maps to |chapter-url= when |title= is remapped
All other combinations of |encyclopedia=, |title=, and |article= are not modified
]]
local Encyclopedia = A['Encyclopedia']; -- used as a flag by this module and by ~/COinS
if utilities.is_set (Encyclopedia) then -- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}
if 'encyclopaedia' ~= config.CitationClass and 'citation' ~= config.CitationClass then
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('Encyclopedia')});
Encyclopedia = nil; -- unset because not supported by this template
end
end
if ('encyclopaedia' == config.CitationClass) or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then -- when both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', A:ORIGIN ('Encyclopedia')) .. ' and ' .. utilities.wrap_style ('parameter', Periodical_origin)});
end
if utilities.is_set (Encyclopedia) then
Periodical = Encyclopedia; -- error or no, set Periodical to Encyclopedia; allow periodical without encyclopedia
Periodical_origin = A:ORIGIN ('Encyclopedia');
end
if utilities.is_set (Periodical) then -- Periodical is set when |encyclopedia= is set
if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then
if not utilities.is_set (Chapter) then
Chapter = Title; -- |encyclopedia= and |title= are set so map |title= to |article= and |encyclopedia= to |title=
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterURL_origin = URL_origin;
ChapterUrlAccess = UrlAccess;
if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then
Chapter = utilities.make_wikilink (TitleLink, Chapter);
end
Title = Periodical;
ChapterFormat = Format;
Periodical = ''; -- redundant so unset
TransTitle = '';
URL = '';
Format = '';
TitleLink = '';
ScriptTitle = '';
end
elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then -- |title= not set
Title = Periodical; -- |encyclopedia= set and |article= set so map |encyclopedia= to |title=
Periodical = ''; -- redundant so unset
end
end
end
-- special case for cite techreport.
local ID = A['ID'];
if (config.CitationClass == "techreport") then -- special case for cite techreport
if utilities.is_set (A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not utilities.is_set (ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'id') .. ' and ' .. utilities.wrap_style ('parameter', 'number')});
end
end
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local Conference = A['Conference'];
local BookTitle = A['BookTitle'];
local TransTitle_origin = A:ORIGIN ('TransTitle');
if 'conference' == config.CitationClass then
if utilities.is_set (BookTitle) then
Chapter = Title;
Chapter_origin = 'title';
-- ChapterLink = TitleLink; -- |chapter-link= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
URL_origin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
TransChapter_origin = TransTitle_origin;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
-- CS1/2 mode
local Mode = is_valid_parameter_value (A['Mode'], A:ORIGIN('Mode'), cfg.keywords_lists['mode'], '');
-- separator character and postscript
local sepc, PostScript = set_style (Mode:lower(), A['PostScript'], config.CitationClass);
-- controls capitalization of certain static text
local use_lowercase = ( sepc == ',' );
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
if utilities.is_set (Chapter) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'map') .. ' and ' .. utilities.wrap_style ('parameter', Chapter_origin)}); -- add error message
end
Chapter = A['Map'];
Chapter_origin = A:ORIGIN('Map');
ChapterURL = A['MapURL'];
ChapterURL_origin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapter_origin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if utilities.is_set ( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if utilities.is_set ( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
local Series = A['Series'];
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local SeriesLink = A['SeriesLink'];
SeriesLink = link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if utilities.is_set (Network) then table.insert(n, Network); end
if utilities.is_set (Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then -- these are mutually exclusive so if both are set TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'season') .. ' and ' .. utilities.wrap_style ('parameter', 'seriesno')}); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if utilities.is_set (Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if utilities.is_set (Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias |episode-link=
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
ChapterFormat = Format;
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then -- link but not URL
Chapter = utilities.make_wikilink (ChapterLink, Chapter);
elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then -- if both are set, URL links episode;
Series = utilities.make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
Format = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if utilities.is_set (Series) and utilities.is_set (SeriesLink) then
Series = utilities.make_wikilink (SeriesLink, Series);
end
Series = utilities.wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- handle type parameter for those CS1 citations that have default values
local TitleType = A['TitleType'];
local Degree = A['Degree'];
if utilities.in_array (config.CitationClass, {'AV-media-notes', 'interview', 'mailinglist', 'map', 'podcast', 'pressrelease', 'report', 'speech', 'techreport', 'thesis'}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if utilities.is_set (Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if utilities.is_set (TitleType) then -- if type parameter is specified
TitleType = utilities.substitute ( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date = A['Date'];
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
local PublicationDate = A['PublicationDate'];
local Year = num_con("en", A['Year']);
if not utilities.is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not utilities.is_set (DF) then
DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template
end
local ArchiveURL;
local ArchiveDate;
local ArchiveFormat = A['ArchiveFormat'];
ArchiveURL, ArchiveDate = archive_url_check (A['ArchiveURL'], Date2en(A['ArchiveDate']))
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN('ArchiveURL'), Date2en(ArchiveDate)); -- add error message when URL or ChapterURL == ArchiveURL
local AccessDate = A['AccessDate'];
local LayDate = A['LayDate'];
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DoiBroken = A['DoiBroken'];
local Embargo = A['Embargo'];
local anchor_year; -- used in the CITEREF identifier
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val = Date2en(AccessDate), name = A:ORIGIN ('AccessDate')},
['archive-date'] = {val = Date2en(ArchiveDate), name = A:ORIGIN ('ArchiveDate')},
['date'] = {val = Date2en(Date), name = Date_origin},
['doi-broken-date'] = {val = DoiBroken, name = A:ORIGIN ('DoiBroken')},
['pmc-embargo-date'] = {val = Embargo, name = A:ORIGIN ('Embargo')},
['lay-date'] = {val = LayDate, name = A:ORIGIN ('LayDate')},
['publication-date'] = {val = Date2en(PublicationDate), name = A:ORIGIN ('PublicationDate')},
['year'] = {val = Year, name = A:ORIGIN ('Year')},
};
local error_list = {};
anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);
-- start temporary Julian / Gregorian calendar uncertainty categorization
if COinS_date.inter_cal_cat then
utilities.add_prop_cat ('jul-greg-uncertainty');
end
-- end temporary Julian / Gregorian calendar uncertainty categorization
if utilities.is_set (Year) and utilities.is_set (Date) then -- both |date= and |year= not normally needed;
validation.year_date_check (Year, A:ORIGIN ('Year'), Date, A:ORIGIN ('Date'), error_list);
end
if 0 == #error_list then -- error free dates only; 0 when error_list is empty
local modified = false; -- flag
if utilities.is_set (DF) then -- if we need to reformat dates
modified = validation.reformat_dates (date_parameters_list, DF); -- reformat to DF format, use long month names if appropriate
end
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki
if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then
utilities.set_message ('maint_date_auto_xlated'); -- add maint cat
modified = true;
end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
LayDate = date_parameters_list['lay-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
else
utilities.set_message ('err_bad_date', {utilities.make_sep_list (#error_list, error_list)}); -- add this error message
end
end -- end of do
local ID_list = {}; -- sequence table of rendered identifiers
local ID_list_coins = {}; -- table of identifiers and their values from args; key is same as cfg.id_handlers's key
local Class = A['Class']; -- arxiv class identifier
local ID_support = {
{A['ASINTLD'], 'ASIN', 'err_asintld_missing_asin', A:ORIGIN ('ASINTLD')},
{DoiBroken, 'DOI', 'err_doibroken_missing_doi', A:ORIGIN ('DoiBroken')},
{Embargo, 'PMC', 'err_embargo_missing_pmc', A:ORIGIN ('Embargo')},
}
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class}, ID_support);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list) then
if not utilities.is_set (ID_list_coins[config.CitationClass:upper()]) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv= & |citeseerx= required for their templates
utilities.set_message ('err_' .. config.CitationClass .. '_missing'); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free
if config.CitationClass == "journal" and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) then -- TODO: remove 'none' once existing citations have been switched to 'off', so 'none' can be used as token for "no title" instead
if 'none' ~= cfg.keywords_xlate[auto_select] then -- if auto-linking not disabled
if identifiers.auto_link_urls[auto_select] then -- manual selection
URL = identifiers.auto_link_urls[auto_select]; -- set URL to be the same as identifier's external link
URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['pmc'] then -- auto-select PMC
URL = identifiers.auto_link_urls['pmc']; -- set URL to be the same as the PMC external link if not embargoed
URL_origin = cfg.id_handlers['PMC'].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['doi'] then -- auto-select DOI
URL = identifiers.auto_link_urls['doi'];
URL_origin = cfg.id_handlers['DOI'].parameters[1];
end
end
if utilities.is_set (URL) then -- set when using an identifier-created URL
if utilities.is_set (AccessDate) then -- |access-date= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_accessdate_missing_url'); -- add an error message
AccessDate = ''; -- unset
end
if utilities.is_set (ArchiveURL) then -- |archive-url= requires |url=; identifier-created URL is not |url=
utilities.set_message ('err_archive_missing_url'); -- add an error message
ArchiveURL = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then -- has special case for cite episode
utilities.set_message ('err_citation_missing_title', {'episode' == config.CitationClass and 'series' or 'title'});
end
if utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) and
utilities.in_array (config.CitationClass, {'journal', 'citation'}) and
(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
utilities.set_message ('maint_untitled'); -- add maint cat
end
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
local QuotePage = A['QuotePage'];
local QuotePages = utilities.hyphen_to_dash (A['QuotePages']);
-- this is the function call to COinS()
local OCinSoutput = metadata.COinS({
['Periodical'] = utilities.strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = Encyclopedia, -- just a flag; content ignored by ~/COinS
['Chapter'] = metadata.make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup
['Degree'] = Degree; -- cite thesis only
['Title'] = metadata.make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic / accept-as-written markup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date has correctly formatted date if Date is valid;
['Season'] = COinS_date.rftssn,
['Quarter'] = COinS_date.rftquarter,
['Chron'] = COinS_date.rftchron or (not COinS_date.rftdate and Date) or '', -- chron but if not set and invalid date format use Date; keep this last bit?
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list_coins,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, and {{cite ssrn}} AFTER generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass and utilities.is_set (Newsgroup) then
PublisherName = utilities.substitute (cfg.messages['newsgroup'], external_link( 'news:' .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));
end
local Editors;
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
local Contributors; -- assembled contributors name list
local contributor_etal;
local Translators; -- assembled translators name list
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local Interviewers;
local interviewers_list = {};
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local interviewer_etal;
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
do
local last_first_list;
local control = {
format = NameListStyle, -- empty string or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
control.maximum , editor_etal = get_display_names (A['DisplayEditors'], #e, 'editors', editor_etal, A:ORIGIN ('DisplayEditors'));
Editors, EditorCount = list_people (control, e, editor_etal);
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
control.maximum, interviewer_etal = get_display_names (A['DisplayInterviewers'], #interviewers_list, 'interviewers', interviewer_etal, A:ORIGIN ('DisplayInterviewers'));
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
control.maximum, translator_etal = get_display_names (A['DisplayTranslators'], #t, 'translators', translator_etal, A:ORIGIN ('DisplayTranslators'));
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
control.maximum, contributor_etal = get_display_names (A['DisplayContributors'], #c, 'contributors', contributor_etal, A:ORIGIN ('DisplayContributors'));
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
control.maximum, author_etal = get_display_names (A['DisplayAuthors'], #a, 'authors', author_etal, A:ORIGIN ('DisplayAuthors'));
last_first_list = list_people (control, a, author_etal);
if utilities.is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if utilities.is_set (Authors) and utilities.is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
-- special case for chapter format so no error message or cat when chapter not supported
if not (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not utilities.is_set (URL) then
if utilities.in_array (config.CitationClass, {"web", "podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
utilities.set_message ('err_cite_web_url');
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then -- ChapterURL may be set when URL is not set;
utilities.set_message ('err_accessdate_missing_url');
AccessDate = '';
end
end
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local OriginalURL
local OriginalURL_origin
local OriginalFormat
local OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if utilities.is_set ( ArchiveURL ) then
if utilities.is_set (ChapterURL) then -- if chapter-url= is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURL_origin = ChapterURL_origin; -- name of |chapter-url= parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's URL
ChapterURL_origin = A:ORIGIN('ArchiveURL') -- name of |archive-url= parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
elseif utilities.is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURL_origin = URL_origin; -- name of URL parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then |archive-url= applies to it
URL = ArchiveURL -- swap-in the archive's URL
URL_origin = A:ORIGIN('ArchiveURL') -- name of archive URL parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
end
elseif utilities.is_set (UrlStatus) then -- if |url-status= is set when |archive-url= is not set
utilities.set_message ('maint_url_status'); -- add maint cat
end
if utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then
local chap_param;
if utilities.is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif utilities.is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif utilities.is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif utilities.is_set (ScriptChapter) then
chap_param = ScriptChapter_origin;
else utilities.is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if utilities.is_set (chap_param) then -- if we found one
utilities.set_message ('err_chapter_ignored', {chap_param}); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if utilities.is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if utilities.is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and utilities.is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. sepc .. ' ';
elseif utilities.is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title
local plain_title = false;
local accept_title;
Title, accept_title = utilities.has_accept_as_written (Title, true); -- remove accept-this-as-written markup when it wraps all of <Title>
if accept_title and ('' == Title) then -- only support forced empty for now "(())"
Title = cfg.messages['notitle']; -- replace by predefined "No title" message
-- TODO: utilities.set_message ( 'err_redundant_parameters', ...); -- issue proper error message instead of muting
ScriptTitle = ''; -- just mute for now
TransTitle = ''; -- just mute for now
plain_title = true; -- suppress text decoration for descriptive title
utilities.set_message ('maint_untitled'); -- add maint cat
end
if not accept_title then -- <Title> not wrapped in accept-as-written markup
if '...' == mw.ustring.sub (Title, -3) then -- if ellipsis is the last three characters of |title=
Title = mw.ustring.gsub (Title, '(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%' .. sepc .. '$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then
utilities.set_message ('maint_archived_copy'); -- add maintenance category before we modify the content of Title
end
if is_generic ('generic_titles', Title) then
utilities.set_message ('err_generic_title'); -- set an error message
end
end
if (not plain_title) and (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or
('map' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from module provided quote marks
Title = utilities.wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle );
elseif plain_title or ('report' == config.CitationClass) then -- no styling for cite report and descriptive titles (otherwise same as above)
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = utilities.wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-italic-title', TransTitle);
end
if utilities.is_set (TransTitle) then
if utilities.is_set (Title) then
TransTitle = " " .. TransTitle;
else
utilities.set_message ('err_trans_missing_title', {'title'});
end
end
if utilities.is_set (Title) then -- TODO: is this the right place to be making Wikisource URLs?
if utilities.is_set (TitleLink) and utilities.is_set (URL) then
utilities.set_message ('err_wikilink_in_url'); -- set an error message because we can't have both
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle;
else
Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;
end
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (mw.ustring.gsub(Title, '^[\'"]*(.-)[\'"]*$', '%1')); -- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label
if ws_url then
Title = mw.ustring.gsub (Title, '%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle;
else
Title = Title .. TransTitle;
end
end
else
Title = TransTitle;
end
if utilities.is_set (Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
local ConferenceURL_origin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
if utilities.is_set (Conference) then
if utilities.is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif utilities.is_set (ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );
end
local Position = '';
if not utilities.is_set (Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if utilities.is_set (Minutes) then
if utilities.is_set (Time) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'minutes') .. ' and ' .. utilities.wrap_style ('parameter', 'time')});
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if utilities.is_set (Time) then
local TimeCaption = A['TimeCaption']
if not utilities.is_set (TimeCaption) then
TimeCaption = cfg.messages['event'];
if sepc ~= '.' then
TimeCaption = TimeCaption:lower();
end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = utilities.is_set (At) and (sepc .. " " .. At) or "";
Position = utilities.is_set (Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Sections = A['Sections']; -- Section (singular) is an alias of Chapter so set earlier
local Inset = A['Inset'];
if utilities.is_set ( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if utilities.is_set ( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif utilities.is_set ( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
local Others = A['Others'];
if utilities.is_set (Others) and 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
if config.CitationClass == "AV-media-notes"
or config.CitationClass == "audio-visual" then -- special maint for AV/M which has a lot of 'false' positives right now
utilities.set_message ('maint_others_avm')
else
utilities.set_message ('maint_others');
end
end
Others = utilities.is_set (Others) and (sepc .. " " .. Others) or "";
if utilities.is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if utilities.is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
local TitleNote = A['TitleNote'];
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if mw.ustring.match (Edition, '%f[%a][Ee]d%n?%.?$') or mw.ustring.match (Edition, '%f[%a][Ee]dition$') then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.
utilities.set_message ('err_extra_text_edition'); -- add error message
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = utilities.is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
local Agency = A['Agency'];
Agency = utilities.is_set (Agency) and wrap_msg ('agency', {sepc, Agency}) or "";
Volume = format_volume_issue (Volume, Issue, config.CitationClass, Periodical_origin, sepc, use_lowercase);
if utilities.is_set (AccessDate) then
local retrv_text = " " .. Date2en(cfg.messages['retrieved'])
AccessDate = nowrap_date (Date2en(AccessDate)); -- wrap in nowrap span if date in appropriate format
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = utilities.substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = utilities.substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if utilities.is_set (ID) then ID = sepc .. " " .. ID; end
local Docket = A['Docket'];
if "thesis" == config.CitationClass and utilities.is_set (Docket) then
ID = sepc .. " Docket " .. Docket .. ID;
end
if "report" == config.CitationClass and utilities.is_set (Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
if utilities.is_set (URL) then
URL = " " .. external_link( URL, nil, URL_origin, UrlAccess );
end
local Quote = A['Quote'];
local TransQuote = A['TransQuote'];
local ScriptQuote = A['ScriptQuote'];
if utilities.is_set (Quote) or utilities.is_set (TransQuote) or utilities.is_set (ScriptQuote) then
if utilities.is_set (Quote) then
if mw.ustring.sub(Quote, 1, 1) == '"' and mw.ustring.sub(Quote, -1, -1) == '"' then -- if first and last characters of quote are quote marks
Quote = mw.ustring.sub(Quote, 2, -2); -- strip them off
end
end
Quote = utilities.wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
if utilities.is_set (ScriptQuote) then
Quote = script_concatenate (Quote, ScriptQuote, 'script-quote'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after quote is wrapped
end
if utilities.is_set (TransQuote) then
if mw.ustring.sub(TransQuote, 1, 1) == '"' and mw.ustring.sub(TransQuote, -1, -1) == '"' then -- if first and last characters of |trans-quote are quote marks
TransQuote = mw.ustring.sub(TransQuote, 2, -2); -- strip them off
end
Quote = Quote .. " " .. utilities.wrap_style ('trans-quoted-title', TransQuote );
end
if utilities.is_set (QuotePage) or utilities.is_set (QuotePages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (QuotePage) then
extra_text_in_page_check (QuotePage, 'quote-page'); -- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.
if not NoPP then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePage}), '', '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePage}), '', '', '';
end
elseif utilities.is_set (QuotePages) then
extra_text_in_page_check (QuotePages, 'quote-pages'); -- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.
if tonumber(QuotePages) ~= nil and not NoPP then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePages}), '', '';
elseif not NoPP then
quote_prefix = utilities.substitute (cfg.messages['pp-prefix'], {sepc, QuotePages}), '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePages}), '', '';
end
end
Quote = quote_prefix .. ": " .. Quote;
else
Quote = sepc .. " " .. Quote;
end
PostScript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
end
-- We check length of PostScript here because it will have been nuked by
-- the quote parameters. We'd otherwise emit a message even if there wasn't
-- a displayed postscript.
-- TODO: Should the max size (1) be configurable?
-- TODO: Should we check a specific pattern?
if utilities.is_set(PostScript) and mw.ustring.len(PostScript) > 1 then
utilities.set_message ('maint_postscript')
end
local Archived;
if utilities.is_set (ArchiveURL) then
local arch_text;
if not utilities.is_set (ArchiveDate) then
utilities.set_message ('err_archive_missing_date');
ArchiveDate = ''; -- empty string for concatenation
end
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cfg.messages['archived-live'],
{external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil) .. ArchiveFormat, Date2en(ArchiveDate) } );
else
Archived = '';
end
if not utilities.is_set (OriginalURL) then
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if utilities.in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. ' ' .. arch_text .. Date2en(ArchiveDate); -- format already styled
if 'bot: unknown' == UrlStatus then
utilities.set_message ('maint_bot_unknown'); -- and add a category if not already added
else
utilities.set_message ('maint_unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. " " .. utilities.substitute ( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, Date2en(ArchiveDate) } ); -- format already styled
else
Archived = ''; -- unset for concatenation
end
end
else -- OriginalUrl not set
arch_text = cfg.messages['archived-missing'];
if sepc ~= "." then arch_text = arch_text:lower() end
utilities.set_message ('err_archive_missing_url');
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = '';
end
local Lay = '';
local LaySource = A['LaySource'];
local LayURL = A['LayURL'];
local LayFormat = A['LayFormat'];
LayFormat = style_format (LayFormat, LayURL, 'lay-format', 'lay-url');
if utilities.is_set (LayURL) then
if utilities.is_set (LayDate) then LayDate = " (" .. LayDate .. ")" end
if utilities.is_set (LaySource) then
LaySource = " – ''" .. utilities.safe_for_italics (LaySource) .. "''";
else
LaySource = "";
end
if sepc == '.' then
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary'], A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
else
Lay = sepc .. " " .. external_link( LayURL, cfg.messages['lay summary']:lower(), A:ORIGIN('LayURL'), nil ) .. LayFormat .. LaySource .. LayDate
end
elseif utilities.is_set (LayFormat) then -- Test if |lay-format= is given without giving a |lay-url=
Lay = sepc .. LayFormat; -- if set and LayURL not set, then LayFormat has error message
end
local TranscriptURL = A['TranscriptURL']
local TranscriptFormat = A['TranscriptFormat'];
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
local Transcript = A['Transcript'];
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
if utilities.is_set (Transcript) then
if utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );
end
local Publisher;
if utilities.is_set (PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if utilities.is_set (PublisherName) then
if utilities.is_set (PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif utilities.is_set (PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
local TransPeriodical = A['TransPeriodical'];
local TransPeriodical_origin = A:ORIGIN ('TransPeriodical');
-- Several of the above rely upon detecting this as nil, so do it last.
if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then
if utilities.is_set (Title) or utilities.is_set (TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
end
end
local Language = A['Language'];
if utilities.is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc.
else
Language=''; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = TitleType; -- move TitleType to TitleNote so that it renders ahead of |event=
TitleType = ''; -- and unset
if utilities.is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if utilities.is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
if utilities.is_set (Others) then Others = safe_join ({Others, sepc .. " "}, sepc) end -- add terminal punctuation & space; check for dup sepc; TODO why do we need to do this here?
tcommon = safe_join( {Others, Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Edition, Publisher, Agency, Volume}, sepc );
elseif utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (Periodical) then -- special cases for book cites
if utilities.is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc.
tcommon = safe_join( {Title, TitleNote}, sepc ); -- author and other stuff will come after this and before tcommon2
tcommon2 = safe_join( {Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
else
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language, Volume, Others, Edition, Publisher, Agency}, sepc );
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if utilities.is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join( {Title, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
elseif utilities.is_set (Periodical) then -- map in a periodical
tcommon = safe_join( {Title, TitleType, Format, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc );
else -- a sheet or stand-alone map
tcommon = safe_join( {Title, TitleType, Format, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc );
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join( {Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc );
else -- all other CS1 templates
tcommon = safe_join( {Title, TitleNote, Conference, Periodical, Format, TitleType, Series, Language,
Volume, Others, Edition, Publisher, Agency}, sepc );
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local Via = A['Via'];
Via = utilities.is_set (Via) and wrap_msg ('via', Via) or '';
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Lay, Quote }, sepc );
else
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Lay, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
local OrigDate = A['OrigDate'];
OrigDate = utilities.is_set (OrigDate) and wrap_msg ('origdate', OrigDate) or '';
if utilities.is_set (Date) then
if utilities.is_set (Authors) or utilities.is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date .. ")" .. OrigDate .. sepc .. " "; -- in parentheses
else -- neither of authors and editors set
if (string.sub(tcommon, -1, -1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigDate; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigDate; -- Date begins with sepc
end
end
end
if utilities.is_set (Authors) then
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Editors) then
local in_text = " ";
local post_text = "";
if utilities.is_set (Chapter) and 0 == #c then
in_text = in_text .. cfg.messages['in'] .. " "
if (sepc ~= '.') then
in_text = in_text:lower() -- lowercase for cs2
end
end
if EditorCount <= 1 then
post_text = " (" .. cfg.messages['editor'] .. ")"; -- be consistent with no-author, no-date case
else
post_text = " (" .. cfg.messages['editors'] .. ")";
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
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 and a space
end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif utilities.is_set (Editors) then
if utilities.is_set (Date) then
if EditorCount <= 1 then
Editors = Editors .. ", " .. cfg.messages['editor'];
else
Editors = Editors .. ", " .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); -- Deals with italics, spaces, etc.
text = mw.ustring.sub(text, 1, -sepc:len() - 1);
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite> element
local options_t = {};
options_t.class = cite_class_attribute_make (config.CitationClass, Mode);
--فعلاً در ویکی فارسی ref=harv استفاده میشه. پس خط زیر با false وارد میکنیم
--local Ref = is_valid_parameter_value (A['Ref'], A:ORIGIN('Ref'), cfg.keywords_lists['ref'], nil, false); -- nil when |ref=harv; A['Ref'] else
--اما کد بالا رو هم نمیزنم، چون در برخی صفحات جواب نمیده، فعلاً قطعه کد زیر را با تغییراتی از ماڈیول قدیمی استخراج کردم موقتاً
local Ref = A['Ref'];
if (not utilities.is_set(Ref)) or (Ref=='harv') then
Ref = nil; -- set as default when not set externally
end
if 'none' ~= cfg.keywords_xlate[(Ref and Ref:lower()) or ''] then
local namelist_t = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist_t = c; -- select it
elseif #a > 0 then -- or an author list
namelist_t = a;
elseif #e > 0 then -- or an editor list
namelist_t = e;
end
local citeref_id;
if #namelist_t > 0 then -- if there are names in namelist_t
citeref_id = make_citeref_id (namelist_t, year); -- go make the CITEREF anchor
if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or '') then -- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison
utilities.set_message ('maint_ref_duplicates_default');
end
else
citeref_id = ''; -- unset
end
options_t.id = Ref or citeref_id;
end
if string.len (mw.ustring.gsub(text, '%b<>', '')) <= 2 then -- remove html and html-like tags; then get length of what remains;
z.error_cats_t = {}; -- blank the categories list
z.error_msgs_t = {}; -- blank the error messages list
OCinSoutput = nil; -- blank the metadata string
text = ''; -- blank the the citation
utilities.set_message ('err_empty_citation'); -- set empty citation message and category
end
local render_t = {}; -- here we collect the final bits for concatenation into the rendered citation
if utilities.is_set (options_t.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render_t, utilities.substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options_t.id), mw.text.nowiki(options_t.class), text})); -- when |ref= is set or when there is a namelist
else
table.insert (render_t, utilities.substitute (cfg.presentation['cite'], {mw.text.nowiki(options_t.class), text})); -- when |ref=none or when namelist_t empty and |ref= is missing or is empty
end
if OCinSoutput then -- blanked when citation is 'empty' so don't bother to add boilerplate metadata span
table.insert (render_t, utilities.substitute (cfg.presentation['ocins'], OCinSoutput)); -- format and append metadata to the citation
end
local template_name = ('citation' == config.CitationClass) and 'citation' or 'cite ' .. (cfg.citation_class_map_t[config.CitationClass] or config.CitationClass);
local template_link = '[[Template:' .. template_name .. '|' .. template_name .. ']]';
local msg_prefix = '<code class="cs1-code">{{' .. template_link .. '}}</code>: ';
if 0 ~= #z.error_msgs_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, template_link));
table.insert (render_t, ' '); -- insert a space between citation and its error messages
table.sort (z.error_msgs_t); -- sort the error messages list; sorting includes wrapping <span> and <code> tags; hidden-error sorts ahead of visible-error
local hidden = true; -- presume that the only error messages emited by this template are hidden
for _, v in ipairs (z.error_msgs_t) do -- spin through the list of error messages
if mw.ustring.find (v, 'cs1-visible-error', 1, true) then -- look for the visible error class name
hidden = false; -- found one; so don't hide the error message prefix
break; -- and done because no need to look further
end
end
z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]}); -- add error message prefix to first error message to prevent extraneous punctuation
table.insert (render_t, table.concat (z.error_msgs_t, '; ')); -- make a big string of error messages and add it to the rendering
end
if 0 ~= #z.maint_cats_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, template_link));
table.sort (z.maint_cats_t); -- sort the maintenance messages list
local maint_msgs_t = {}; -- here we collect all of the maint messages
if 0 == #z.error_msgs_t then -- if no error messages
table.insert (maint_msgs_t, msg_prefix); -- insert message prefix in maint message livery
end
for _, v in ipairs( z.maint_cats_t ) do -- append maintenance categories
table.insert (maint_msgs_t, -- assemble new maint message and add it to the maint_msgs_t table
table.concat ({v, ' (', utilities.substitute (cfg.messages[':cat wikilink'], v), ')'})
);
end
table.insert (render_t, utilities.substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs_t, ' '))); -- wrap the group of maint messages with proper presentation and save
end
if not no_tracking_cats then
for _, v in ipairs (z.error_cats_t) do -- append error categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.maint_cats_t) do -- append maintenance categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
for _, v in ipairs (z.prop_cats_t) do -- append properties categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v));
end
end
return table.concat (render_t); -- make a big string and done
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class, empty)
local name = tostring (name);
name = mw.ustring.gsub (name, '_', ' ');
local enum_name; -- for enumerated parameters, is name with enumerator replaced with '#'
local state;
local function state_test (state, name) -- local function to do testing of state values
if true == state then return true; end -- valid actively supported parameter
if false == state then
if empty then return nil; end -- empty deprecated parameters are treated as unknowns
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
if 'tracked' == state then
local base_name = mw.ustring.gsub (name, '%d', ''); -- strip enumerators from parameter names that have them to get the base name
utilities.add_prop_cat ('tracked-param', {base_name}, base_name); -- add a properties category; <base_name> modifies <key>
return true;
end
return nil;
end
if mw.ustring.find (name, '#') then -- # is a cs1|2 reserved character so parameters with # not permitted
return nil;
end
if utilities.in_array (cite_class, whitelist.preprint_template_list ) then -- limited parameter sets allowed for these templates
state = whitelist.limited_basic_arguments[name];
if true == state_test (state, name) then return true; end
state = whitelist.preprint_arguments[cite_class][name]; -- look in the parameter-list for the template identified by cite_class
if true == state_test (state, name) then return true; end
-- limited enumerated parameters list
enum_name = mw.ustring.gsub(name, "%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.limited_numbered_arguments[enum_name];
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
if utilities.in_array (cite_class, whitelist.unique_param_template_list) then -- experiment for template-specific parameters for templates that accept parameters from the basic argument list
state = whitelist.unique_arguments[cite_class][name]; -- look in the template-specific parameter-lists for the template identified by cite_class
if true == state_test (state, name) then return true; end
end -- if here, fall into general validation
state = whitelist.basic_arguments[name]; -- all other templates; all normal parameters allowed
if true == state_test (state, name) then return true; end
-- all enumerated parameters allowed
enum_name = mw.ustring.gsub(name, "%d+", "#" ); -- replace digit(s) with # (last25 becomes last#) (mw.ustring because non-Western 'local' digits)
state = whitelist.numbered_arguments[enum_name];
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end
--[=[-------------------------< I N T E R _ W I K I _ C H E C K >----------------------------------------------
check <value> for inter-language interwiki-link markup. <prefix> must be a MediaWiki-recognized language
code. when these values have the form (without leading colon):
[[<prefix>:link|label]] return label as plain-text
[[<prefix>:link]] return <prefix>:link as plain-text
return value as is else
]=]
local function inter_wiki_check (parameter, value)
local prefix = mw.ustring.match (value, '%[%[(%a+):'); -- get an interwiki prefix if one exists
local _;
if prefix and cfg.inter_wiki_map[prefix:lower()] then -- if prefix is in the map, needs preceding colon so
utilities.set_message ('err_bad_paramlink', parameter); -- emit an error message
_, value, _ = utilities.is_wikilink (value); -- extract label portion from wikilink
end
return value;
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe. There are two tests made:
{{cite ... |title=Title access-date=2016-03-17}} -- the first parameter has a value and whitespace separates that value from the missing pipe parameter name
{{cite ... |title=access-date=2016-03-17}} -- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc. To prevent false positives XML/HTML
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = mw.ustring.gsub (value, '%b<>', ''); -- remove XML/HTML tags because attributes: class=, title=, etc.
capture = mw.ustring.match (value, '%s+(%a[%w%-]+)%s*=') or mw.ustring.match (value, '^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
utilities.set_message ('err_missing_pipe', parameter);
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if 'number' == type (param) then
return;
end
param = mw.ustring.gsub (param, '%d+', '#'); -- enumerated name-list mask params allow terminal punct; normalize
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if mw.ustring.match (value, '[,;:]$') then
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
if mw.ustring.match (value, '^=') then -- sometimes an extraneous '=' character appears ...
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ U R L >------------------------------------------
look for extraneous url parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_url (url_param_t)
local url_error_t = {};
check_for_url (url_param_t, url_error_t); -- extraneous url check
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_ext_link', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
This is used by templates such as {{cite book}} to create the actual citation text.
]]
local function citation(frame)
Frame = frame; -- save a copy in case we need to display an error message in preview mode
local sandbox = '/sandbox' -- i18n: replace this rvalue with the name that your wiki uses to identify sandbox subpages
is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true); -- is this invoke the sandbox module?
sandbox = ''--is_sandbox and sandbox or ''; -- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else
local pframe = frame:getParent()
local styles;
cfg = mw.loadData ('Module:Citation/CS1/en/Configuration' .. sandbox); -- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else
whitelist = mw.loadData ('Module:Citation/CS1/en/Whitelist' .. sandbox);
utilities = require ('Module:Citation/CS1/en/Utilities' .. sandbox);
validation = require ('Module:Citation/CS1/en/Date_validation' .. sandbox);
identifiers = require ('Module:Citation/CS1/en/Identifiers' .. sandbox);
metadata = require ('Module:Citation/CS1/en/COinS' .. sandbox);
styles = 'Module:Citation/CS1/en' .. sandbox .. '/styles.css';
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the selected cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
is_preview_mode = not utilities.is_set (frame:preprocess ('{{REVISIONID}}'));
local args = {}; -- table where we store all of the template's arguments
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text; -- used as a flag
local config = {}; -- table to store parameters from the module {{#invoke:}}
for k, v in pairs( frame.args ) do -- get parameters from the {{#invoke}} frame
config[k] = v;
-- args[k] = v; -- crude debug support that allows us to render a citation from module {{#invoke:}}; skips parameter validation; TODO: keep?
end
local capture; -- the single supported capture when matching unknown parameters using patterns
local empty_unknowns = {}; -- sequence table to hold empty unknown params for error message listing
for k, v in pairs( pframe.args ) do -- get parameters from the parent (template) frame
v = mw.ustring.gsub (v, '^%s*(.-)%s*$', '%1'); -- trim leading/trailing whitespace; when v is only whitespace, becomes empty string
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
if type (k) ~= 'string' then -- exclude empty numbered parameters
if mw.ustring.match(v, "%S+") ~= nil then
error_text = utilities.set_message ('err_text_ignored', {v});
end
elseif validate (k:lower(), config.CitationClass) then
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, k:lower()}); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
if is_sandbox then -- did the {{#invoke:}} use sandbox version?
suggestions = mw.loadData( 'Module:Citation/CS1/en/Suggestions' ); -- use the sandbox version
else
suggestions = mw.loadData( 'Module:Citation/CS1/en/Suggestions' ); -- use the live version
end
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = mw.ustring.match (k, pattern); -- the whole match if no capture in pattern else the capture if a match
if capture then -- if the pattern matches
param = utilities.substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, param}); -- set the suggestion error message
else
error_text = utilities.set_message ('err_parameter_ignored', {k}); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an explicit suggestion?
if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config.CitationClass) then
utilities.set_message ('err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]});
else
utilities.set_message ('err_parameter_ignored', {k});
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
end
args[k] = v; -- save this parameter and its value
elseif not utilities.is_set (v) then -- for empty parameters
if not validate (k, config.CitationClass, true) then -- is this empty parameter a valid parameter
k = ('' == k) and '(empty string)' or k; -- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text
table.insert (empty_unknowns, utilities.wrap_style ('parameter', k)); -- format for error message and add to the list
end
-- crude debug support that allows us to render a citation from module {{#invoke:}} TODO: keep?
-- elseif args[k] ~= nil or (k == 'postscript') then -- when args[k] has a value from {{#invoke}} frame (we don't normally do that)
-- args[k] = v; -- overwrite args[k] with empty string from pframe.args[k] (template frame); v is empty string here
end -- not sure about the postscript bit; that gets handled in parameter validation; historical artifact?
end
if 0 ~= #empty_unknowns then -- create empty unknown error message
utilities.set_message ('err_param_unknown_empty', {
1 == #empty_unknowns and '' or 's',
utilities.make_sep_list (#empty_unknowns, empty_unknowns)
});
end
local url_param_t = {};
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v); -- look for invisible characters
end
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
args[k] = inter_wiki_check (k, v); -- when language interwiki-linked parameter missing leading colon replace with wiki-link label
if 'string' == type (k) and not cfg.url_skip[k] then -- when parameter k is not positional and not in url skip table
url_param_t[k] = v; -- make a parameter/value list for extraneous url check
end
end
has_extraneous_url (url_param_t); -- look for url in parameter values where a url does not belong
return table.concat ({
frame:extensionTag ('templatestyles', '', {src=styles}),
citation0( config, args)
});
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {citation = citation};
rpir9w42ijl75pqc1x00nr95bjepxac
691007
690974
2025-07-10T17:02:38Z
Abbas dhothar
361
691007
Scribunto
text/plain
require ('strict');
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
each of these counts against the Lua upvalue limit
]]
local validation; -- functions in Module:Citation/CS1/Date_validation
local utilities; -- functions in Module:Citation/CS1/Utilities
local z = {}; -- table of tables in Module:Citation/CS1/Utilities
local identifiers; -- functions and tables in Module:Citation/CS1/Identifiers
local metadata; -- functions in Module:Citation/CS1/COinS
local cfg = {}; -- table of configuration tables that are defined in Module:Citation/CS1/Configuration
local whitelist = {}; -- table of tables listing valid template parameter names; defined in Module:Citation/CS1/Whitelist
--[[------------------< P A G E S C O P E V A R I A B L E S >---------------
declare variables here that have page-wide scope that are not brought in from
other modules; that are created here and used here
]]
local added_deprecated_cat; -- Boolean flag so that the category is added only once
local added_vanc_errs; -- Boolean flag so we only emit one Vancouver error / category
local added_generic_name_errs; -- Boolean flag so we only emit one generic name error / category and stop testing names once an error is encountered
local added_numeric_name_errs; -- Boolean flag so we only emit one numeric name error / category and stop testing names once an error is encountered
local added_numeric_name_maint; -- Boolean flag so we only emit one numeric name maint category and stop testing names once a category has been emitted
local Frame; -- holds the module's frame table
local is_preview_mode; -- true when article is in preview mode; false when using 'Preview page with this template' (previewing the module)
local is_sandbox; -- true when using sandbox modules to render citation
--#Added
local wikidatacite = false;
--[[--------------------------< F I R S T _ S E T >------------------------------------------------------------
Locates and returns the first set value in a table of values where the order established in the table,
left-to-right (or top-to-bottom), is the order in which the values are evaluated. Returns nil if none are set.
This version replaces the original 'for _, val in pairs do' and a similar version that used ipairs. With the pairs
version the order of evaluation could not be guaranteed. With the ipairs version, a nil value would terminate
the for-loop before it reached the actual end of the list.
]]
local function first_set (list, count)
local i = 1;
while i <= count do -- loop through all items in list
if utilities.is_set( list[i] ) then
return list[i]; -- return the first set list member
end
i = i + 1; -- point to next
end
end
--[[--------------------------< A D D _ V A N C _ E R R O R >----------------------------------------------------
Adds a single Vancouver system error message to the template's output regardless of how many error actually exist.
To prevent duplication, added_vanc_errs is nil until an error message is emitted.
added_vanc_errs is a Boolean declared in page scope variables above
]]
local function add_vanc_error (source, position)
if added_vanc_errs then return end
added_vanc_errs = true; -- note that we've added this category
utilities.set_message ('err_vancouver', {source, position});
end
--[[--------------------------< I S _ S C H E M E >------------------------------------------------------------
does this thing that purports to be a URI scheme seem to be a valid scheme? The scheme is checked to see if it
is in agreement with http://tools.ietf.org/html/std66#section-3.1 which says:
Scheme names consist of a sequence of characters beginning with a
letter and followed by any combination of letters, digits, plus
("+"), period ("."), or hyphen ("-").
returns true if it does, else false
]]
local function is_scheme (scheme)
return scheme and scheme:match ('^%a[%a%d%+%.%-]*:'); -- true if scheme is set and matches the pattern
end
--[=[-------------------------< I S _ D O M A I N _ N A M E >--------------------------------------------------
Does this thing that purports to be a domain name seem to be a valid domain name?
Syntax defined here: http://tools.ietf.org/html/rfc1034#section-3.5
BNF defined here: https://tools.ietf.org/html/rfc4234
Single character names are generally reserved; see https://tools.ietf.org/html/draft-ietf-dnsind-iana-dns-01#page-15;
see also [[Single-letter second-level domain]]
list of TLDs: https://www.iana.org/domains/root/db
RFC 952 (modified by RFC 1123) requires the first and last character of a hostname to be a letter or a digit. Between
the first and last characters the name may use letters, digits, and the hyphen.
Also allowed are IPv4 addresses. IPv6 not supported
domain is expected to be stripped of any path so that the last character in the last character of the TLD. tld
is two or more alpha characters. Any preceding '//' (from splitting a URL with a scheme) will be stripped
here. Perhaps not necessary but retained in case it is necessary for IPv4 dot decimal.
There are several tests:
the first character of the whole domain name including subdomains must be a letter or a digit
internationalized domain name (ASCII characters with .xn-- ASCII Compatible Encoding (ACE) prefix xn-- in the TLD) see https://tools.ietf.org/html/rfc3490
single-letter/digit second-level domains in the .org, .cash, and .today TLDs
q, x, and z SL domains in the .com TLD
i and q SL domains in the .net TLD
single-letter SL domains in the ccTLDs (where the ccTLD is two letters)
two-character SL domains in gTLDs (where the gTLD is two or more letters)
three-plus-character SL domains in gTLDs (where the gTLD is two or more letters)
IPv4 dot-decimal address format; TLD not allowed
returns true if domain appears to be a proper name and TLD or IPv4 address, else false
]=]
local function is_domain_name (domain)
if not domain then
return false; -- if not set, abandon
end
domain = domain:gsub ('^//', ''); -- strip '//' from domain name if present; done here so we only have to do it once
if not domain:match ('^[%w]') then -- first character must be letter or digit
return false;
end
if domain:match ('^%a+:') then -- hack to detect things that look like s:Page:Title where Page: is namespace at Wikisource
return false;
end
local patterns = { -- patterns that look like URLs
'%f[%w][%w][%w%-]+[%w]%.%a%a+$', -- three or more character hostname.hostname or hostname.tld
'%f[%w][%w][%w%-]+[%w]%.xn%-%-[%w]+$', -- internationalized domain name with ACE prefix
'%f[%a][qxz]%.com$', -- assigned one character .com hostname (x.com times out 2015-12-10)
'%f[%a][iq]%.net$', -- assigned one character .net hostname (q.net registered but not active 2015-12-10)
'%f[%w][%w]%.%a%a$', -- one character hostname and ccTLD (2 chars)
'%f[%w][%w][%w]%.%a%a+$', -- two character hostname and TLD
'^%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?', -- IPv4 address
}
for _, pattern in ipairs (patterns) do -- loop through the patterns list
if domain:match (pattern) then
return true; -- if a match then we think that this thing that purports to be a URL is a URL
end
end
for _, d in ipairs (cfg.single_letter_2nd_lvl_domains_t) do -- look for single letter second level domain names for these top level domains
if domain:match ('%f[%w][%w]%.' .. d) then
return true
end
end
return false; -- no matches, we don't know what this thing is
end
--[[--------------------------< I S _ U R L >------------------------------------------------------------------
returns true if the scheme and domain parts of a URL appear to be a valid URL; else false.
This function is the last step in the validation process. This function is separate because there are cases that
are not covered by split_url(), for example is_parameter_ext_wikilink() which is looking for bracketted external
wikilinks.
]]
local function is_url (scheme, domain)
if utilities.is_set (scheme) then -- if scheme is set check it and domain
return is_scheme (scheme) and is_domain_name (domain);
else
return is_domain_name (domain); -- scheme not set when URL is protocol-relative
end
end
--[[--------------------------< S P L I T _ U R L >------------------------------------------------------------
Split a URL into a scheme, authority indicator, and domain.
First remove Fully Qualified Domain Name terminator (a dot following TLD) (if any) and any path(/), query(?) or fragment(#).
If protocol-relative URL, return nil scheme and domain else return nil for both scheme and domain.
When not protocol-relative, get scheme, authority indicator, and domain. If there is an authority indicator (one
or more '/' characters immediately following the scheme's colon), make sure that there are only 2.
Any URL that does not have news: scheme must have authority indicator (//). TODO: are there other common schemes
like news: that don't use authority indicator?
Strip off any port and path;
]]
local function split_url (url_str)
local scheme, authority, domain;
url_str = url_str:gsub ('([%a%d])%.?[/%?#].*$', '%1'); -- strip FQDN terminator and path(/), query(?), fragment (#) (the capture prevents false replacement of '//')
if url_str:match ('^//%S*') then -- if there is what appears to be a protocol-relative URL
domain = url_str:match ('^//(%S*)')
elseif url_str:match ('%S-:/*%S+') then -- if there is what appears to be a scheme, optional authority indicator, and domain name
scheme, authority, domain = url_str:match ('(%S-:)(/*)(%S+)'); -- extract the scheme, authority indicator, and domain portions
if utilities.is_set (authority) then
authority = authority:gsub ('//', '', 1); -- replace place 1 pair of '/' with nothing;
if utilities.is_set(authority) then -- if anything left (1 or 3+ '/' where authority should be) then
return scheme; -- return scheme only making domain nil which will cause an error message
end
else
if not scheme:match ('^news:') then -- except for news:..., MediaWiki won't link URLs that do not have authority indicator; TODO: a better way to do this test?
return scheme; -- return scheme only making domain nil which will cause an error message
end
end
domain = domain:gsub ('(%a):%d+', '%1'); -- strip port number if present
end
return scheme, domain;
end
--[[--------------------------< L I N K _ P A R A M _ O K >---------------------------------------------------
checks the content of |title-link=, |series-link=, |author-link=, etc. for properly formatted content: no wikilinks, no URLs
Link parameters are to hold the title of a Wikipedia article, so none of the WP:TITLESPECIALCHARACTERS are allowed:
# < > [ ] | { } _
except the underscore which is used as a space in wiki URLs and # which is used for section links
returns false when the value contains any of these characters.
When there are no illegal characters, this function returns TRUE if value DOES NOT appear to be a valid URL (the
|<param>-link= parameter is ok); else false when value appears to be a valid URL (the |<param>-link= parameter is NOT ok).
]]
local function link_param_ok (value)
local scheme, domain;
if value:find ('[<>%[%]|{}]') then -- if any prohibited characters
return false;
end
scheme, domain = split_url (value); -- get scheme or nil and domain or nil from URL;
return not is_url (scheme, domain); -- return true if value DOES NOT appear to be a valid URL
end
--[[--------------------------< L I N K _ T I T L E _ O K >---------------------------------------------------
Use link_param_ok() to validate |<param>-link= value and its matching |<title>= value.
|<title>= may be wiki-linked but not when |<param>-link= has a value. This function emits an error message when
that condition exists
check <link> for inter-language interwiki-link prefix. prefix must be a MediaWiki-recognized language
code and must begin with a colon.
]]
local function link_title_ok (link, lorig, title, torig)
local orig;
if utilities.is_set (link) then -- don't bother if <param>-link doesn't have a value
if not link_param_ok (link) then -- check |<param>-link= markup
orig = lorig; -- identify the failing link parameter
elseif title:find ('%[%[') then -- check |title= for wikilink markup
orig = torig; -- identify the failing |title= parameter
elseif link:match ('^%a+:') then -- if the link is what looks like an interwiki
local prefix = link:match ('^(%a+):'):lower(); -- get the interwiki prefix
if cfg.inter_wiki_map[prefix] then -- if prefix is in the map, must have preceding colon
orig = lorig; -- flag as error
end
end
end
if utilities.is_set (orig) then
link = ''; -- unset
utilities.set_message ('err_bad_paramlink', orig); -- URL or wikilink in |title= with |title-link=;
end
return link; -- link if ok, empty string else
end
--[[--------------------------< C H E C K _ U R L >------------------------------------------------------------
Determines whether a URL string appears to be valid.
First we test for space characters. If any are found, return false. Then split the URL into scheme and domain
portions, or for protocol-relative (//example.com) URLs, just the domain. Use is_url() to validate the two
portions of the URL. If both are valid, or for protocol-relative if domain is valid, return true, else false.
Because it is different from a standard URL, and because this module used external_link() to make external links
that work for standard and news: links, we validate newsgroup names here. The specification for a newsgroup name
is at https://tools.ietf.org/html/rfc5536#section-3.1.4
]]
local function check_url( url_str )
if nil == url_str:match ("^%S+$") then -- if there are any spaces in |url=value it can't be a proper URL
return false;
end
local scheme, domain;
scheme, domain = split_url (url_str); -- get scheme or nil and domain or nil from URL;
if 'news:' == scheme then -- special case for newsgroups
return domain:match('^[%a%d%+%-_]+%.[%a%d%+%-_%.]*[%a%d%+%-_]$');
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[=[-------------------------< I S _ P A R A M E T E R _ E X T _ W I K I L I N K >----------------------------
Return true if a parameter value has a string that begins and ends with square brackets [ and ] and the first
non-space characters following the opening bracket appear to be a URL. The test will also find external wikilinks
that use protocol-relative URLs. Also finds bare URLs.
The frontier pattern prevents a match on interwiki-links which are similar to scheme:path URLs. The tests that
find bracketed URLs are required because the parameters that call this test (currently |title=, |chapter=, |work=,
and |publisher=) may have wikilinks and there are articles or redirects like '//Hus' so, while uncommon, |title=[[//Hus]]
is possible as might be [[en://Hus]].
]=]
local function is_parameter_ext_wikilink (value)
local scheme, domain;
if value:match ('%f[%[]%[%a%S*:%S+.*%]') then -- if ext. wikilink with scheme and domain: [xxxx://yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(%a%S*:%S+).*%]'));
elseif value:match ('%f[%[]%[//%S+.*%]') then -- if protocol-relative ext. wikilink: [//yyyyy.zzz]
scheme, domain = split_url (value:match ('%f[%[]%[(//%S+).*%]'));
elseif value:match ('%a%S*:%S+') then -- if bare URL with scheme; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(%a%S*:%S+)'));
elseif value:match ('//%S+') then -- if protocol-relative bare URL: //yyyyy.zzz; may have leading or trailing plain text
scheme, domain = split_url (value:match ('(//%S+)')); -- what is left should be the domain
else
return false; -- didn't find anything that is obviously a URL
end
return is_url (scheme, domain); -- return true if value appears to be a valid URL
end
--[[-------------------------< C H E C K _ F O R _ U R L >-----------------------------------------------------
loop through a list of parameters and their values. Look at the value and if it has an external link, emit an error message.
]]
local function check_for_url (parameter_list, error_list)
for k, v in pairs (parameter_list) do -- for each parameter in the list
if is_parameter_ext_wikilink (v) then -- look at the value; if there is a URL add an error message
table.insert (error_list, utilities.wrap_style ('parameter', k));
end
end
end
--[[--------------------------< S A F E _ F O R _ U R L >------------------------------------------------------
Escape sequences for content that will be used for URL descriptions
]]
local function safe_for_url( str )
if str:match( "%[%[.-%]%]" ) ~= nil then
utilities.set_message ('err_wikilink_in_url', {});
end
return str:gsub( '[%[%]\n]', {
['['] = '[',
[']'] = ']',
['\n'] = ' ' } );
end
--[[--------------------------< E X T E R N A L _ L I N K >----------------------------------------------------
Format an external link with error checking
]]
local function external_link (URL, label, source, access)
local err_msg = '';
local domain;
local path;
local base_url;
if not utilities.is_set (label) then
label = URL;
if utilities.is_set(source) then
--#Modified
utilities.set_message (wikidatacite and 'err_wikidata_bare_url_missing_title' or 'err_bare_url_missing_title', {utilities.wrap_style ('parameter', source)});
else
error (cfg.messages["bare_url_no_origin"]); -- programmer error; valid parameter name does not have matching meta-parameter
end
end
if not check_url (URL) then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)});
end
domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the URL into scheme plus domain and path
if path then -- if there is a path portion
path = path:gsub ('[%[%]]', {['['] = '%5b', [']'] = '%5d'}); -- replace '[' and ']' with their percent-encoded values
URL = table.concat ({domain, path}); -- and reassemble
end
base_url = table.concat ({ "[", URL, " ", safe_for_url (label), "]" }); -- assemble a wiki-markup URL
if utilities.is_set (access) then -- access level (subscription, registration, limited)
base_url = utilities.substitute (cfg.presentation['ext-link-access-signal'], {cfg.presentation[access].class, cfg.presentation[access].title, base_url}); -- add the appropriate icon
end
return base_url;
end
--[[--------------------------< D E P R E C A T E D _ P A R A M E T E R >--------------------------------------
Categorize and emit an error message when the citation contains one or more deprecated parameters. The function includes the
offending parameter name to the error message. Only one error message is emitted regardless of the number of deprecated
parameters in the citation.
added_deprecated_cat is a Boolean declared in page scope variables above
]]
local function deprecated_parameter(name)
if not added_deprecated_cat then
added_deprecated_cat = true; -- note that we've added this category
utilities.set_message ('err_deprecated_params', {name}); -- add error message
end
end
--[=[-------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
Apply kerning to open the space between the quote mark provided by the module and a leading or trailing quote
mark contained in a |title= or |chapter= parameter's value.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wiki-markup) are not kerned.
Replaces Unicode quote marks in plain text or in the label portion of a [[L|D]] style wikilink with typewriter
quote marks regardless of the need for kerning. Unicode quote marks are not replaced in simple [[D]] wikilinks.
Call this function for chapter titles, for website titles, etc.; not for book titles.
]=]
local function kern_quotes (str)
local cap = '';
local wl_type, label, link;
wl_type, label, link = utilities.is_wikilink (str); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
if 1 == wl_type then -- [[D]] simple wikilink with or without quote marks
if mw.ustring.match (str, '%[%[[\"“”\'‘’].+[\"“”\'‘’]%]%]') then -- leading and trailing quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
str = utilities.substitute (cfg.presentation['kern-right'], str);
elseif mw.ustring.match (str, '%[%[[\"“”\'‘’].+%]%]') then -- leading quote marks
str = utilities.substitute (cfg.presentation['kern-left'], str);
elseif mw.ustring.match (str, '%[%[.+[\"“”\'‘’]%]%]') then -- trailing quote marks
str = utilities.substitute (cfg.presentation['kern-right'], str);
end
else -- plain text or [[L|D]]; text in label variable
label = mw.ustring.gsub (label, '[“”]', '\"'); -- replace “” (U+201C & U+201D) with " (typewriter double quote mark)
label = mw.ustring.gsub (label, '[‘’]', '\''); -- replace ‘’ (U+2018 & U+2019) with ' (typewriter single quote mark)
cap = mw.ustring.match (label, "^([\"\'][^\'].+)"); -- match leading double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-left'], cap);
end
cap = mw.ustring.match (label, "^(.+[^\'][\"\'])$") -- match trailing double or single quote but not doubled single quotes (italic markup)
if utilities.is_set (cap) then
label = utilities.substitute (cfg.presentation['kern-right'], cap);
end
if 2 == wl_type then
str = utilities.make_wikilink (link, label); -- reassemble the wikilink
else
str = label;
end
end
return str;
end
--[[--------------------------< F O R M A T _ S C R I P T _ V A L U E >----------------------------------------
|script-title= holds title parameters that are not written in Latin-based scripts: Chinese, Japanese, Arabic, Hebrew, etc. These scripts should
not be italicized and may be written right-to-left. The value supplied by |script-title= is concatenated onto Title after Title has been wrapped
in italic markup.
Regardless of language, all values provided by |script-title= are wrapped in <bdi>...</bdi> tags to isolate RTL languages from the English left to right.
|script-title= provides a unique feature. The value in |script-title= may be prefixed with a two-character ISO 639-1 language code and a colon:
|script-title=ja:*** *** (where * represents a Japanese character)
Spaces between the two-character code and the colon and the colon and the first script character are allowed:
|script-title=ja : *** ***
|script-title=ja: *** ***
|script-title=ja :*** ***
Spaces preceding the prefix are allowed: |script-title = ja:*** ***
The prefix is checked for validity. If it is a valid ISO 639-1 language code, the lang attribute (lang="ja") is added to the <bdi> tag so that browsers can
know the language the tag contains. This may help the browser render the script more correctly. If the prefix is invalid, the lang attribute
is not added. At this time there is no error message for this condition.
Supports |script-title=, |script-chapter=, |script-<periodical>=
]]
local function format_script_value (script_value, script_param)
local lang=''; -- initialize to empty string
local name;
if script_value:match('^%l%l%l?%s*:') then -- if first 3 or 4 non-space characters are script language prefix
lang = script_value:match('^(%l%l%l?)%s*:%s*%S.*'); -- get the language prefix or nil if there is no script
if not utilities.is_set (lang) then
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing title part']}); -- prefix without 'title'; add error message
return ''; -- script_value was just the prefix so return empty string
end
-- if we get this far we have prefix and script
--#modified for faster
name = cfg.lang_tag_remap[lang] or cfg.mw_languages_by_tag_t[lang]; -- get language name so that we can use it to categorize
if utilities.is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = script_value:gsub ('^%l+%s*:%s*', ''); -- strip prefix from script
-- is prefix one of these language codes?
if utilities.in_array (lang, cfg.script_lang_codes) then
utilities.add_prop_cat ('script', {name, lang})
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['unknown language code']}); -- unknown script-language; add error message
end
lang = ' lang="' .. lang .. '" '; -- convert prefix into a lang attribute
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['invalid language code']}); -- invalid language code; add error message
lang = ''; -- invalid so set lang to empty string
end
else
utilities.set_message ('err_script_parameter', {script_param, cfg.err_msg_supl['missing prefix']}); -- no language code prefix; add error message
end
script_value = utilities.substitute (cfg.presentation['bdi'], {lang, script_value}); -- isolate in case script is RTL
return script_value;
end
--[[--------------------------< S C R I P T _ C O N C A T E N A T E >------------------------------------------
Initially for |title= and |script-title=, this function concatenates those two parameter values after the script
value has been wrapped in <bdi> tags.
]]
local function script_concatenate (title, script, script_param)
if utilities.is_set (script) then
script = format_script_value (script, script_param); -- <bdi> tags, lang attribute, categorization, etc.; returns empty string on error
if utilities.is_set (script) then
title = title .. ' ' .. script; -- concatenate title and script title
end
end
return title;
end
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
]]
local function wrap_msg (key, str, lower)
if not utilities.is_set ( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
return utilities.substitute ( msg, str ); -- including template text
else
return utilities.substitute ( cfg.messages[key], str );
end
end
--[[----------------< W I K I S O U R C E _ U R L _ M A K E >-------------------
Makes a Wikisource URL from Wikisource interwiki-link. Returns the URL and appropriate
label; nil else.
str is the value assigned to |chapter= (or aliases) or |title= or |title-link=
]]
local function wikisource_url_make (str)
local wl_type, D, L;
local ws_url, ws_label;
local wikisource_prefix = table.concat ({'https://', cfg.this_wiki_code, '.wikisource.org/wiki/'});
wl_type, D, L = utilities.is_wikilink (str); -- wl_type is 0 (not a wikilink), 1 (simple wikilink), 2 (complex wikilink)
if 0 == wl_type then -- not a wikilink; might be from |title-link=
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 1 == wl_type then -- simple wikilink: [[Wikisource:ws article]]
str = D:match ('^[Ww]ikisource:(.+)') or D:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title
});
ws_label = str; -- label for the URL
end
elseif 2 == wl_type then -- non-so-simple wikilink: [[Wikisource:ws article|displayed text]] ([[L|D]])
str = L:match ('^[Ww]ikisource:(.+)') or L:match ('^[Ss]:(.+)'); -- article title from interwiki link with long-form or short-form namespace
if utilities.is_set (str) then
ws_label = D; -- get ws article name from display portion of interwiki link
ws_url = table.concat ({ -- build a Wikisource URL
wikisource_prefix, -- prefix
str, -- article title without namespace from link portion of wikilink
});
end
end
if ws_url then
ws_url = mw.uri.encode (ws_url, 'WIKI'); -- make a usable URL
ws_url = ws_url:gsub ('%%23', '#'); -- undo percent-encoding of fragment marker
end
return ws_url, ws_label, L or D; -- return proper URL or nil and a label or nil
end
--[[----------------< F O R M A T _ P E R I O D I C A L >-----------------------
Format the three periodical parameters: |script-<periodical>=, |<periodical>=,
and |trans-<periodical>= into a single Periodical meta-parameter.
]]
local function format_periodical (script_periodical, script_periodical_source, periodical, trans_periodical)
if not utilities.is_set (periodical) then
periodical = ''; -- to be safe for concatenation
else
periodical = utilities.wrap_style ('italic-title', periodical); -- style
end
periodical = script_concatenate (periodical, script_periodical, script_periodical_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (trans_periodical) then
trans_periodical = utilities.wrap_style ('trans-italic-title', trans_periodical);
if utilities.is_set (periodical) then
periodical = periodical .. ' ' .. trans_periodical;
else -- here when trans-periodical without periodical or script-periodical
periodical = trans_periodical;
utilities.set_message ('err_trans_missing_title', {'periodical'});
end
end
return periodical;
end
--[[------------------< F O R M A T _ C H A P T E R _ T I T L E >---------------
Format the four chapter parameters: |script-chapter=, |chapter=, |trans-chapter=,
and |chapter-url= into a single chapter meta- parameter (chapter_url_source used
for error messages).
]]
local function format_chapter_title (script_chapter, script_chapter_source, chapter, chapter_source, trans_chapter, trans_chapter_source, chapter_url, chapter_url_source, no_quotes, access)
local ws_url, ws_label, L = wikisource_url_make (chapter); -- make a wikisource URL and label from a wikisource interwiki link
if ws_url then
ws_label = ws_label:gsub ('_', ' '); -- replace underscore separators with space characters
chapter = ws_label;
end
if not utilities.is_set (chapter) then
chapter = ''; -- to be safe for concatenation
else
if false == no_quotes then
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from module provided quote marks
chapter = utilities.wrap_style ('quoted-title', chapter);
end
end
chapter = script_concatenate (chapter, script_chapter, script_chapter_source); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
if utilities.is_set (chapter_url) then
chapter = external_link (chapter_url, chapter, chapter_url_source, access); -- adds bare_url_missing_title error if appropriate
elseif ws_url then
chapter = external_link (ws_url, chapter .. ' ', 'ws link in chapter'); -- adds bare_url_missing_title error if appropriate; space char to move icon away from chap text; TODO: better way to do this?
chapter = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, chapter});
end
if utilities.is_set (trans_chapter) then
trans_chapter = utilities.wrap_style ('trans-quoted-title', trans_chapter);
if utilities.is_set (chapter) then
chapter = chapter .. ' ' .. trans_chapter;
else -- here when trans_chapter without chapter or script-chapter
chapter = trans_chapter;
chapter_source = trans_chapter_source:match ('trans%-?(.+)'); -- when no chapter, get matching name from trans-<param>
utilities.set_message ('err_trans_missing_title', {chapter_source});
end
end
return chapter;
end
--[[----------------< H A S _ I N V I S I B L E _ C H A R S >-------------------
This function searches a parameter's value for non-printable or invisible characters.
The search stops at the first match.
This function will detect the visible replacement character when it is part of the Wikisource.
Detects but ignores nowiki and math stripmarkers. Also detects other named stripmarkers
(gallery, math, pre, ref) and identifies them with a slightly different error message.
See also coins_cleanup().
Output of this function is an error message that identifies the character or the
Unicode group, or the stripmarker that was detected along with its position (or,
for multi-byte characters, the position of its first byte) in the parameter value.
]]
local function has_invisible_chars (param, v)
local position = ''; -- position of invisible char or starting position of stripmarker
local capture; -- used by stripmarker detection to hold name of the stripmarker
local stripmarker; -- boolean set true when a stripmarker is found
capture = string.match (v, '[%w%p ]*'); -- test for values that are simple ASCII text and bypass other tests if true
if capture == v then -- if same there are no Unicode characters
return;
end
for _, invisible_char in ipairs (cfg.invisible_chars) do
local char_name = invisible_char[1]; -- the character or group name
local pattern = invisible_char[2]; -- the pattern used to find it
position, _, capture = mw.ustring.find (v, pattern); -- see if the parameter value contains characters that match the pattern
if position and (cfg.invisible_defs.zwj == capture) then -- if we found a zero-width joiner character
if mw.ustring.find (v, cfg.indic_script) then -- it's ok if one of the Indic scripts
position = nil; -- unset position
elseif cfg.emoji_t[mw.ustring.codepoint (v, position+1)] then -- is zwj followed by a character listed in emoji{}?
position = nil; -- unset position
end
end
if position then
if 'nowiki' == capture or 'math' == capture or -- nowiki and math stripmarkers (not an error condition)
('templatestyles' == capture and utilities.in_array (param, {'id', 'quote'})) then -- templatestyles stripmarker allowed in these parameters
stripmarker = true; -- set a flag
elseif true == stripmarker and cfg.invisible_defs.del == capture then -- because stripmakers begin and end with the delete char, assume that we've found one end of a stripmarker
position = nil; -- unset
else
local err_msg;
if capture and not (cfg.invisible_defs.del == capture or cfg.invisible_defs.zwj == capture) then
err_msg = capture .. ' ' .. char_name;
else
err_msg = char_name .. ' ' .. 'character';
end
utilities.set_message ('err_invisible_char', {err_msg, utilities.wrap_style ('parameter', param), position}); -- add error message
return; -- and done with this parameter
end
end
end
end
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( args )
local origin = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
if origin[k] ~= nil then
return nil;
end
local args, list, v = args, cfg.aliases[k];
if type( list ) == 'table' then
v, origin[k] = utilities.select_one ( args, list, 'err_redundant_parameters' );
if origin[k] == nil then
origin[k] = ''; -- Empty string, not nil
end
elseif list ~= nil then
v, origin[k] = args[list], list;
else
-- maybe let through instead of raising an error?
-- v, origin[k] = args[k], k;
error( cfg.messages['unknown_argument_map'] .. ': ' .. k);
end
-- Empty strings, not nil;
if v == nil then
v = '';
origin[k] = '';
end
tbl = rawset( tbl, k, v );
return v;
end,
});
end
--[[--------------------------< N O W R A P _ D A T E >-------------------------
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>.
When date is DD MMMM YYYY or is MMMM DD, YYYY then wrap in nowrap span:
<span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
DOES NOT yet support MMMM YYYY or any of the date ranges.
]]
local function nowrap_date (date)
local cap = '';
local cap2 = '';
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = utilities.substitute (cfg.presentation['nowrap1'], date);
elseif date:match("^%a+%s*%d%d?,%s+%d%d%d%d$") or date:match ("^%d%d?%s*%a+%s+%d%d%d%d$") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = utilities.substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
--[[--------------------------< S E T _ T I T L E T Y P E >---------------------
This function sets default title types (equivalent to the citation including
|type=<default value>) for those templates that have defaults. Also handles the
special case where it is desirable to omit the title type from the rendered citation
(|type=none).
]]
local function set_titletype (cite_class, title_type)
if utilities.is_set (title_type) then
if 'none' == cfg.keywords_xlate[title_type] then
title_type = ''; -- if |type=none then type parameter not displayed
end
return title_type; -- if |type= has been set to any other value use that value
end
return cfg.title_types [cite_class] or ''; -- set template's default title type; else empty string for concatenation
end
--[[--------------------------< S A F E _ J O I N >-----------------------------
Joins a sequence of strings together while checking for duplicate separation characters.
]]
local function safe_join( tbl, duplicate_char )
local f = {}; -- create a function table appropriate to type of 'duplicate character'
if 1 == #duplicate_char then -- for single byte ASCII characters use the string library functions
f.gsub = string.gsub
f.match = string.match
f.sub = string.sub
else -- for multi-byte characters use the ustring library functions
f.gsub = mw.ustring.gsub
f.match = mw.ustring.match
f.sub = mw.ustring.sub
end
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
for _, value in ipairs( tbl ) do
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
elseif value ~= '' then
if value:sub(1, 1) == '<' then -- special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove HTML markup (<span>string</span> -> string)
else
comp = value;
end
-- typically duplicate_char is sepc
if 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.?
trim = false;
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
str = f.sub(str, 1, -2); -- remove it
elseif end_chr == "'" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = f.sub(str, 1, -4) .. "''"; -- remove them and add back ''
elseif f.sub(str, -5, -1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif f.sub(str, -4, -1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wiki-markup
if f.sub(str, -3, -1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif f.sub(str, -3, -1) == duplicate_char .. '"]' then -- if last three chars of str are sepc"] quoted external link
trim = true;
elseif f.sub(str, -2, -1) == duplicate_char .. "]" then -- if last two chars of str are sepc] external link
trim = true;
elseif f.sub(str, -4, -1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if f.sub(str, -2, -1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = f.sub(str, 1, -3); -- remove them both
end
end
if trim then
if value ~= comp then -- value does not equal comp when value contains HTML markup
local dup2 = duplicate_char;
if f.match(dup2, "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = f.gsub(value, "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows HTML markup
else
value = f.sub(value, 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; -- add it to the output string
end
end
return str;
end
--[[--------------------------< I S _ S U F F I X >-----------------------------
returns true if suffix is properly formed Jr, Sr, or ordinal in the range 1–9.
Puncutation not allowed.
]]
local function is_suffix (suffix)
if utilities.in_array (suffix, {'Jr', 'Sr', 'Jnr', 'Snr', '1st', '2nd', '3rd'}) or suffix:match ('^%dth$') then
return true;
end
return false;
end
--[[--------------------< I S _ G O O D _ V A N C _ N A M E >-------------------
For Vancouver style, author/editor names are supposed to be rendered in Latin
(read ASCII) characters. When a name uses characters that contain diacritical
marks, those characters are to be converted to the corresponding Latin
character. When a name is written using a non-Latin alphabet or logogram, that
name is to be transliterated into Latin characters. The module doesn't do this
so editors may/must.
This test allows |first= and |last= names to contain any of the letters defined
in the four Unicode Latin character sets
[http://www.unicode.org/charts/PDF/U0000.pdf C0 Controls and Basic Latin] 0041–005A, 0061–007A
[http://www.unicode.org/charts/PDF/U0080.pdf C1 Controls and Latin-1 Supplement] 00C0–00D6, 00D8–00F6, 00F8–00FF
[http://www.unicode.org/charts/PDF/U0100.pdf Latin Extended-A] 0100–017F
[http://www.unicode.org/charts/PDF/U0180.pdf Latin Extended-B] 0180–01BF, 01C4–024F
|lastn= also allowed to contain hyphens, spaces, and apostrophes.
(http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
|firstn= also allowed to contain hyphens, spaces, apostrophes, and periods
This original test:
if nil == mw.ustring.find (last, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%']*$")
or nil == mw.ustring.find (first, "^[A-Za-zÀ-ÖØ-öø-ƿDŽ-ɏ%-%s%'%.]+[2-6%a]*$") then
was written outside of the code editor and pasted here because the code editor
gets confused between character insertion point and cursor position. The test has
been rewritten to use decimal character escape sequence for the individual bytes
of the Unicode characters so that it is not necessary to use an external editor
to maintain this code.
\195\128-\195\150 – À-Ö (U+00C0–U+00D6 – C0 controls)
\195\152-\195\182 – Ø-ö (U+00D8-U+00F6 – C0 controls)
\195\184-\198\191 – ø-ƿ (U+00F8-U+01BF – C0 controls, Latin extended A & B)
\199\132-\201\143 – DŽ-ɏ (U+01C4-U+024F – Latin extended B)
]]
local function is_good_vanc_name (last, first, suffix, position)
if not suffix then
if first:find ('[,%s]') then -- when there is a space or comma, might be first name/initials + generational suffix
first = first:match ('(.-)[,%s]+'); -- get name/initials
suffix = first:match ('[,%s]+(.+)$'); -- get generational suffix
end
end
if utilities.is_set (suffix) then
if not is_suffix (suffix) then
add_vanc_error (cfg.err_msg_supl.suffix, position);
return false; -- not a name with an appropriate suffix
end
end
if nil == mw.ustring.find (last, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191%-%s%']*$") or
nil == mw.ustring.find (first, "^[A-Za-z\195\128-\195\150\195\152-\195\182\195\184-\198\191\199\132-\201\143\225\184\128-\225\187\191%-%s%'%.]*$") then
add_vanc_error (cfg.err_msg_supl['non-Latin char'], position);
return false; -- not a string of Latin characters; Vancouver requires Romanization
end;
return true;
end
--[[--------------------------< R E D U C E _ T O _ I N I T I A L S >------------------------------------------
Attempts to convert names to initials in support of |name-list-style=vanc.
Names in |firstn= may be separated by spaces or hyphens, or for initials, a period.
See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35062/.
Vancouver style requires family rank designations (Jr, II, III, etc.) to be rendered
as Jr, 2nd, 3rd, etc. See http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35085/.
This code only accepts and understands generational suffix in the Vancouver format
because Roman numerals look like, and can be mistaken for, initials.
This function uses ustring functions because firstname initials may be any of the
Unicode Latin characters accepted by is_good_vanc_name ().
]]
local function reduce_to_initials (first, position)
if first:find (',', 1, true) then
return first; -- commas not allowed; abandon
end
local name, suffix = mw.ustring.match (first, "^(%u+) ([%dJS][%drndth]+)$");
if not name then -- if not initials and a suffix
name = mw.ustring.match (first, "^(%u+)$"); -- is it just initials?
end
if name then -- if first is initials with or without suffix
if 3 > mw.ustring.len (name) then -- if one or two initials
if suffix then -- if there is a suffix
if is_suffix (suffix) then -- is it legitimate?
return first; -- one or two initials and a valid suffix so nothing to do
else
add_vanc_error (cfg.err_msg_supl.suffix, position); -- one or two initials with invalid suffix so error message
return first; -- and return first unmolested
end
else
return first; -- one or two initials without suffix; nothing to do
end
end
end -- if here then name has 3 or more uppercase letters so treat them as a word
local initials_t, names_t = {}, {}; -- tables to hold name parts and initials
local i = 1; -- counter for number of initials
names_t = mw.text.split (first, '[%s%-]+'); -- split into a sequence of names and possible suffix
while names_t[i] do -- loop through the sequence
if 1 < i and names_t[i]:match ('[%dJS][%drndth]+%.?$') then -- if not the first name, and looks like a suffix (may have trailing dot)
names_t[i] = names_t[i]:gsub ('%.', ''); -- remove terminal dot if present
if is_suffix (names_t[i]) then -- if a legitimate suffix
table.insert (initials_t, ' ' .. names_t[i]); -- add a separator space, insert at end of initials sequence
break; -- and done because suffix must fall at the end of a name
end -- no error message if not a suffix; possibly because of Romanization
end
if 3 > i then
table.insert (initials_t, mw.ustring.sub (names_t[i], 1, 1)); -- insert the initial at end of initials sequence
end
i = i + 1; -- bump the counter
end
return table.concat (initials_t); -- Vancouver format does not include spaces.
end
--[[--------------------------< I N T E R W I K I _ P R E F I X E N _ G E T >----------------------------------
extract interwiki prefixen from <value>. Returns two one or two values:
false – no prefixen
nil – prefix exists but not recognized
project prefix, language prefix – when value has either of:
:<project>:<language>:<article>
:<language>:<project>:<article>
project prefix, nil – when <value> has only a known single-letter prefix
nil, language prefix – when <value> has only a known language prefix
accepts single-letter project prefixen: 'd' (wikidata), 's' (wikisource), and 'w' (wikipedia) prefixes; at this
writing, the other single-letter prefixen (b (wikibook), c (commons), m (meta), n (wikinews), q (wikiquote), and
v (wikiversity)) are not supported.
]]
local function interwiki_prefixen_get (value, is_link)
if not value:find (':%l+:') then -- if no prefix
return false; -- abandon; boolean here to distinguish from nil fail returns later
end
local prefix_patterns_linked_t = { -- sequence of valid interwiki and inter project prefixen
'^%[%[:([dsw]):(%l%l+):', -- wikilinked; project and language prefixes
'^%[%[:(%l%l+):([dsw]):', -- wikilinked; language and project prefixes
'^%[%[:([dsw]):', -- wikilinked; project prefix
'^%[%[:(%l%l+):', -- wikilinked; language prefix
}
local prefix_patterns_unlinked_t = { -- sequence of valid interwiki and inter project prefixen
'^:([dsw]):(%l%l+):', -- project and language prefixes
'^:(%l%l+):([dsw]):', -- language and project prefixes
'^:([dsw]):', -- project prefix
'^:(%l%l+):', -- language prefix
}
local cap1, cap2;
for _, pattern in ipairs ((is_link and prefix_patterns_linked_t) or prefix_patterns_unlinked_t) do
cap1, cap2 = value:match (pattern);
if cap1 then
break; -- found a match so stop looking
end
end
if cap1 and cap2 then -- when both then :project:language: or :language:project: (both forms allowed)
if 1 == #cap1 then -- length == 1 then :project:language:
if cfg.inter_wiki_map[cap2] then -- is language prefix in the interwiki map?
return cap1, cap2; -- return interwiki project and interwiki language
end
else -- here when :language:project:
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return cap2, cap1; -- return interwiki project and interwiki language
end
end
return nil; -- unknown interwiki language
elseif not (cap1 or cap2) then -- both are nil?
return nil; -- we got something that looks like a project prefix but isn't; return fail
elseif 1 == #cap1 then -- here when one capture
return cap1, nil; -- length is 1 so return project, nil language
else -- here when one capture and its length it more than 1
if cfg.inter_wiki_map[cap1] then -- is language prefix in the interwiki map?
return nil, cap1; -- return nil project, language
end
end
end
--[[--------------------------< L I S T _ P E O P L E >--------------------------
Formats a list of people (authors, contributors, editors, interviewers, translators)
names in the list will be linked when
|<name>-link= has a value
|<name>-mask- does NOT have a value; masked names are presumed to have been
rendered previously so should have been linked there
when |<name>-mask=0, the associated name is not rendered
]]
local function list_people (control, people, etal)
local sep;
local namesep;
local format = control.format;
local maximum = control.maximum;
local name_list = {};
if 'vanc' == format then -- Vancouver-like name styling?
sep = cfg.presentation['sep_nl_vanc']; -- name-list separator between names is a comma
namesep = cfg.presentation['sep_name_vanc']; -- last/first separator is a space
else
sep = cfg.presentation['sep_nl']; -- name-list separator between names is a semicolon
namesep = cfg.presentation['sep_name']; -- last/first separator is <comma><space>
end
if sep:sub (-1, -1) ~= " " then sep = sep .. " " end
if utilities.is_set (maximum) and maximum < 1 then return "", 0; end -- returned 0 is for EditorCount; not used for other names
for i, person in ipairs (people) do
if utilities.is_set (person.last) then
local mask = person.mask;
local one;
local sep_one = sep;
if utilities.is_set (maximum) and i > maximum then
etal = true;
break;
end
if mask then
local n = tonumber (mask); -- convert to a number if it can be converted; nil else
if n then
one = 0 ~= n and string.rep("—", n) or nil; -- make a string of (n > 0) mdashes, nil else, to replace name
person.link = nil; -- don't create link to name if name is replaces with mdash string or has been set nil
else
one = mask; -- replace name with mask text (must include name-list separator)
sep_one = " "; -- modify name-list separator
end
else
one = person.last; -- get surname
local first = person.first -- get given name
if utilities.is_set (first) then
if ("vanc" == format) then -- if Vancouver format
one = one:gsub ('%.', ''); -- remove periods from surnames (http://www.ncbi.nlm.nih.gov/books/NBK7271/box/A35029/)
if not person.corporate and is_good_vanc_name (one, first, nil, i) then -- and name is all Latin characters; corporate authors not tested
first = reduce_to_initials (first, i); -- attempt to convert first name(s) to initials
end
end
one = one .. namesep .. first;
end
end
if utilities.is_set (person.link) then
one = utilities.make_wikilink (person.link, one); -- link author/editor
end
if one then -- if <one> has a value (name, mdash replacement, or mask text replacement)
local proj, tag = interwiki_prefixen_get (one, true); -- get the interwiki prefixen if present
if 'w' == proj and ('Wikipedia' == mw.site.namespaces.Project['name']) then
proj = nil; -- for stuff like :w:de:<article>, :w is unnecessary TODO: maint cat?
end
if proj then
proj = ({['d'] = 'ويكي بيانات', ['s'] = 'ويكي مصدر', ['w'] = 'ويكيبيديا'})[proj]; -- :w (wikipedia) for linking from a non-wikipedia project
if proj then
one = one .. utilities.wrap_style ('interproj', proj); -- add resized leading space, brackets, static text, language name
tag = nil; -- unset; don't do both project and language
end
end
if tag == cfg.this_wiki_code then
tag = nil; -- stuff like :en:<article> at en.wiki is pointless TODO: maint cat?
end
if tag then
local lang = cfg.lang_tag_remap[tag] or cfg.mw_languages_by_tag_t[tag];
if lang then -- error messaging done in extract_names() where we know parameter names
one = one .. utilities.wrap_style ('interwiki', lang); -- add resized leading space, brackets, static text, language name
end
end
table.insert (name_list, one); -- add it to the list of names
table.insert (name_list, sep_one); -- add the proper name-list separator
end
end
end
local count = #name_list / 2; -- (number of names + number of separators) divided by 2
if 0 < count then
if 1 < count and not etal then
if 'amp' == format then
name_list[#name_list-2] = " & "; -- replace last separator with ampersand text
elseif 'and' == format then
if 2 == count then
name_list[#name_list-2] = cfg.presentation.sep_nl_and; -- replace last separator with 'and' text
else
name_list[#name_list-2] = cfg.presentation.sep_nl_end; -- replace last separator with '(sep) and' text
end
end
end
name_list[#name_list] = nil; -- erase the last separator
end
local result = table.concat (name_list); -- construct list
if etal and utilities.is_set (result) then -- etal may be set by |display-authors=etal but we might not have a last-first list
result = result .. sep .. cfg.messages['et al']; -- we've got a last-first list and etal so add et al.
end
return result, count; -- return name-list string and count of number of names (count used for editor names only)
end
--[[--------------------< M A K E _ C I T E R E F _ I D >-----------------------
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise
returns an empty string.
namelist is one of the contributor-, author-, or editor-name lists chosen in that
order. year is Year or anchor_year.
]]
local function make_citeref_id (namelist, year)
local names={}; -- a table for the one to four names and year
for i,v in ipairs (namelist) do -- loop through the list and take up to the first four last names
names[i] = v.last
if i == 4 then break end -- if four then done
end
table.insert (names, year); -- add the year at the end
local id = table.concat(names); -- concatenate names and year for CITEREF id
if utilities.is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
--[[--------------------------< C I T E _ C L A S S _A T T R I B U T E _M A K E >------------------------------
construct <cite> tag class attribute for this citation.
<cite_class> – config.CitationClass from calling template
<mode> – value from |mode= parameter
]]
local function cite_class_attribute_make (cite_class, mode)
local class_t = {};
table.insert (class_t, 'citation'); -- required for blue highlight
if 'citation' ~= cite_class then
table.insert (class_t, cite_class); -- identify this template for user css
table.insert (class_t, utilities.is_set (mode) and mode or 'cs1'); -- identify the citation style for user css or javascript
else
table.insert (class_t, utilities.is_set (mode) and mode or 'cs2'); -- identify the citation style for user css or javascript
end
for _, prop_key in ipairs (z.prop_keys_t) do
table.insert (class_t, prop_key); -- identify various properties for user css or javascript
end
return table.concat (class_t, ' '); -- make a big string and done
end
--[[---------------------< N A M E _ H A S _ E T A L >--------------------------
Evaluates the content of name parameters (author, editor, etc.) for variations on
the theme of et al. If found, the et al. is removed, a flag is set to true and
the function returns the modified name and the flag.
This function never sets the flag to false but returns its previous state because
it may have been set by previous passes through this function or by the associated
|display-<names>=etal parameter
]]
local function name_has_etal (name, etal, nocat, param)
if utilities.is_set (name) then -- name can be nil in which case just return
local patterns = cfg.et_al_patterns; -- get patterns from configuration
for _, pattern in ipairs (patterns) do -- loop through all of the patterns
if name:match (pattern) then -- if this 'et al' pattern is found in name
name = name:gsub (pattern, ''); -- remove the offending text
etal = true; -- set flag (may have been set previously here or by |display-<names>=etal)
if not nocat then -- no categorization for |vauthors=
utilities.set_message ('err_etal', {param}); -- and set an error if not added
end
end
end
end
return name, etal;
end
--[[---------------------< N A M E _ I S _ N U M E R I C >----------------------
Add an error message and category when <name> parameter value does not contain letters.
Add a maintenance category when <name> parameter value has numeric characters mixed with characters that are
not numeric characters; could be letters and/or punctuation characters.
This function will only emit one error and one maint message for the current template. Does not emit both error
and maint messages/categories for the same parameter value.
returns nothing
]]
local function name_is_numeric (name, name_alias, list_name)
local patterns = {
'^%D+%d', -- <name> must have digits preceded by other characters
'^%D*%d+%D+', -- <name> must have digits followed by other characters
}
if not added_numeric_name_errs and mw.ustring.match (name, '^[%A]+$') then -- if we have not already set an error message and <name> does not have any alpha characters
utilities.set_message ('err_numeric_names', name_alias); -- add an error message
added_numeric_name_errs = true; -- set the flag so we emit only one error message
return; -- when here no point in further testing; abandon
end
if not added_numeric_name_maint then -- if we have already set a maint message
for _, pattern in ipairs (patterns) do -- spin through list of patterns
if mw.ustring.match (name, pattern) then -- digits preceded or followed by anything but digits; %D+ includes punctuation
utilities.set_message ('maint_numeric_names', cfg.special_case_translation [list_name]); -- add a maint cat for this template
added_numeric_name_maint = true; -- set the flag so we emit only one maint message
return; -- when here no point in further testing; abandon
end
end
end
end
--[[-----------------< N A M E _ H A S _ M U L T _ N A M E S >------------------
Evaluates the content of last/surname (authors etc.) parameters for multiple names.
Multiple names are indicated if there is more than one comma or any "unescaped"
semicolons. Escaped semicolons are ones used as part of selected HTML entities.
If the condition is met, the function adds the multiple name maintenance category.
Same test for first except that commas should not appear in given names (MOS:JR says
that the generational suffix does not take a separator character). Titles, degrees,
postnominals, affiliations, all normally comma separated don't belong in a citation.
<name> – name parameter value
<list_name> – AuthorList, EditorList, etc
<limit> – number of allowed commas; 1 (default) for surnames; 0 for given names
returns nothing
]]
local function name_has_mult_names (name, list_name, limit)
local _, commas, semicolons, nbsps;
limit = limit and limit or 1;
if utilities.is_set (name) then
_, commas = name:gsub (',', ''); -- count the number of commas
_, semicolons = name:gsub (';', ''); -- count the number of semicolons
-- nbsps probably should be its own separate count rather than merged in
-- some way with semicolons because Lua patterns do not support the
-- grouping operator that regex does, which means there is no way to add
-- more entities to escape except by adding more counts with the new
-- entities
_, nbsps = name:gsub (' ',''); -- count nbsps
-- There is exactly 1 semicolon per entity, so subtract nbsps
-- from semicolons to 'escape' them. If additional entities are added,
-- they also can be subtracted.
if limit < commas or 0 < (semicolons - nbsps) then
utilities.set_message ('maint_mult_names', cfg.special_case_translation [list_name]); -- add a maint message
end
end
end
--[=[-------------------------< I S _ G E N E R I C >----------------------------------------------------------
Compares values assigned to various parameters according to the string provided as <item> in the function call.
<item> can have on of two values:
'generic_names' – for name-holding parameters: |last=, |first=, |editor-last=, etc
'generic_titles' – for |title=
There are two types of generic tests. The 'accept' tests look for a pattern that should not be rejected by the
'reject' test. For example,
|author=[[John Smith (author)|Smith, John]]
would be rejected by the 'author' reject test. But piped wikilinks with 'author' disambiguation should not be
rejected so the 'accept' test prevents that from happening. Accept tests are always performed before reject
tests.
Each of the 'accept' and 'reject' sequence tables hold tables for en.wiki (['en']) and local.wiki (['local'])
that each can hold a test sequence table The sequence table holds, at index [1], a test pattern, and, at index
[2], a boolean control value. The control value tells string.find() or mw.ustring.find() to do plain-text search (true)
or a pattern search (false). The intent of all this complexity is to make these searches as fast as possible so
that we don't run out of processing time on very large articles.
Returns
true when a reject test finds the pattern or string
false when an accept test finds the pattern or string
nil else
]=]
local function is_generic (item, value, wiki)
local test_val;
local str_lower = { -- use string.lower() for en.wiki (['en']) and use mw.ustring.lower() or local.wiki (['local'])
['en'] = string.lower,
['local'] = mw.ustring.lower,
}
local str_find = { -- use string.find() for en.wiki (['en']) and use mw.ustring.find() or local.wiki (['local'])
['en'] = string.find,
['local'] = mw.ustring.find,
}
local function test (val, test_t, wiki) -- local function to do the testing; <wiki> selects lower() and find() functions
val = test_t[2] and str_lower[wiki](value) or val; -- when <test_t[2]> set to 'true', plaintext search using lowercase value
return str_find[wiki] (val, test_t[1], 1, test_t[2]); -- return nil when not found or matched
end
local test_types_t = {'accept', 'reject'}; -- test accept patterns first, then reject patterns
local wikis_t = {'en', 'local'}; -- do tests for each of these keys; en.wiki first, local.wiki second
for _, test_type in ipairs (test_types_t) do -- for each test type
for _, generic_value in pairs (cfg.special_case_translation[item][test_type]) do -- spin through the list of generic value fragments to accept or reject
for _, wiki in ipairs (wikis_t) do
if generic_value[wiki] then
if test (value, generic_value[wiki], wiki) then -- go do the test
return ('reject' == test_type); -- param value rejected, return true; false else
end
end
end
end
end
end
--[[--------------------------< N A M E _ I S _ G E N E R I C >------------------------------------------------
calls is_generic() to determine if <name> is a 'generic name' listed in cfg.generic_names; <name_alias> is the
parameter name used in error messaging
]]
local function name_is_generic (name, name_alias)
if not added_generic_name_errs and is_generic ('generic_names', name) then
utilities.set_message ('err_generic_name', name_alias); -- set an error message
added_generic_name_errs = true;
end
end
--[[--------------------------< N A M E _ C H E C K S >--------------------------------------------------------
This function calls various name checking functions used to validate the content of the various name-holding parameters.
]]
local function name_checks (last, first, list_name, last_alias, first_alias)
local accept_name;
if utilities.is_set (last) then
last, accept_name = utilities.has_accept_as_written (last); -- remove accept-this-as-written markup when it wraps all of <last>
if not accept_name then -- <last> not wrapped in accept-as-written markup
name_has_mult_names (last, list_name); -- check for multiple names in the parameter
name_is_numeric (last, last_alias, list_name); -- check for names that have no letters or are a mix of digits and other characters
name_is_generic (last, last_alias); -- check for names found in the generic names list
end
end
if utilities.is_set (first) then
first, accept_name = utilities.has_accept_as_written (first); -- remove accept-this-as-written markup when it wraps all of <first>
if not accept_name then -- <first> not wrapped in accept-as-written markup
name_has_mult_names (first, list_name, 0); -- check for multiple names in the parameter; 0 is number of allowed commas in a given name
name_is_numeric (first, first_alias, list_name); -- check for names that have no letters or are a mix of digits and other characters
name_is_generic (first, first_alias); -- check for names found in the generic names list
end
local wl_type, D = utilities.is_wikilink (first);
if 0 ~= wl_type then
first = D;
utilities.set_message ('err_bad_paramlink', first_alias);
end
end
return last, first; -- done
end
--[[----------------------< E X T R A C T _ N A M E S >-------------------------
Gets name list from the input arguments
Searches through args in sequential order to find |lastn= and |firstn= parameters
(or their aliases), and their matching link and mask parameters. Stops searching
when both |lastn= and |firstn= are not found in args after two sequential attempts:
found |last1=, |last2=, and |last3= but doesn't find |last4= and |last5= then the
search is done.
This function emits an error message when there is a |firstn= without a matching
|lastn=. When there are 'holes' in the list of last names, |last1= and |last3=
are present but |last2= is missing, an error message is emitted. |lastn= is not
required to have a matching |firstn=.
When an author or editor parameter contains some form of 'et al.', the 'et al.'
is stripped from the parameter and a flag (etal) returned that will cause list_people()
to add the static 'et al.' text from Module:Citation/CS1/Configuration. This keeps
'et al.' out of the template's metadata. When this occurs, an error is emitted.
]]
local function extract_names(args, list_name)
local names = {}; -- table of names
local last; -- individual name components
local first;
local link;
local mask;
local i = 1; -- loop counter/indexer
local n = 1; -- output table indexer
local count = 0; -- used to count the number of times we haven't found a |last= (or alias for authors, |editor-last or alias for editors)
local etal = false; -- return value set to true when we find some form of et al. in an author parameter
local last_alias, first_alias, link_alias; -- selected parameter aliases used in error messaging
while true do
last, last_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'err_redundant_parameters', i ); -- search through args for name components beginning at 1
first, first_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'err_redundant_parameters', i );
link, link_alias = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i );
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
if last then -- error check |lastn= alias for unknown interwiki link prefix; done here because this is where we have the parameter name
local project, language = interwiki_prefixen_get (last, true); -- true because we expect interwiki links in |lastn= to be wikilinked
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', last_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
last = utilities.remove_wiki_link (last); -- remove wikilink markup; show display value only
end
end
if link then -- error check |linkn= alias for unknown interwiki link prefix
local project, language = interwiki_prefixen_get (link, false); -- false because wiki links in |author-linkn= is an error
if nil == project and nil == language then -- when both are nil
utilities.set_message ('err_bad_paramlink', link_alias); -- not known, emit an error message -- TODO: err_bad_interwiki?
link = nil; -- unset so we don't link
link_alias = nil;
end
end
last, etal = name_has_etal (last, etal, false, last_alias); -- find and remove variations on et al.
first, etal = name_has_etal (first, etal, false, first_alias); -- find and remove variations on et al.
last, first = name_checks (last, first, list_name, last_alias, first_alias); -- multiple names, extraneous annotation, etc. checks
--#Modified Localized
if first and not last then -- if there is a firstn without a matching lastn
local alias = first_alias:find ('اول', 1, true) and 'اول' or 'أول'; -- get first or given form of the alias
utilities.set_message ('err_first_missing_last', {
first_alias, -- param name of alias missing its mate
first_alias:gsub (alias, {['أول'] ='أخير', ['اول'] = 'اخير'}), -- make param name appropriate to the alias form
}); -- add this error message
elseif not first and not last then -- if both firstn and lastn aren't found, are we done?
count = count + 1; -- number of times we haven't found last and first
if 2 <= count then -- two missing names and we give up
break; -- normal exit or there is a two-name hole in the list; can't tell which
end
else -- we have last with or without a first
local result;
link = link_title_ok (link, link_alias, last, last_alias); -- check for improper wiki-markup
if first then
link = link_title_ok (link, link_alias, first, first_alias); -- check for improper wiki-markup
end
names[n] = {last = last, first = first, link = link, mask = mask, corporate = false}; -- add this name to our names list (corporate for |vauthors= only)
n = n + 1; -- point to next location in the names table
if 1 == count then -- if the previous name was missing
utilities.set_message ('err_missing_name', {list_name:match ("(%w+)List"):lower(), i - 1}); -- add this error message
end
count = 0; -- reset the counter, we're looking for two consecutive missing names
end
i = i + 1; -- point to next args location
end
return names, etal; -- all done, return our list of names and the etal flag
end
--[[--------------------------< N A M E _ T A G _ G E T >------------------------------------------------------
attempt to decode |language=<lang_param> and return language name and matching tag; nil else.
This function looks for:
<lang_param> as a tag in cfg.lang_tag_remap{}
<lang_param> as a name in cfg.lang_name_remap{}
<lang_param> as a name in cfg.mw_languages_by_name_t
<lang_param> as a tag in cfg.mw_languages_by_tag_t
when those fail, presume that <lang_param> is an IETF-like tag that MediaWiki does not recognize. Strip all
script, region, variant, whatever subtags from <lang_param> to leave just a two or three character language tag
and look for the new <lang_param> in cfg.mw_languages_by_tag_t{}
on success, returns name (in properly capitalized form) and matching tag (in lowercase); on failure returns nil
]]
local function name_tag_get (lang_param)
local lang_param_lc = mw.ustring.lower (lang_param); -- use lowercase as an index into the various tables
local name;
local tag;
name = cfg.lang_tag_remap[lang_param_lc]; -- assume <lang_param_lc> is a tag; attempt to get remapped language name
if name then -- when <name>, <lang_param> is a tag for a remapped language name
if cfg.lang_name_remap[name:lower()][2] ~= lang_param_lc then
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
return name, cfg.lang_name_remap[name:lower()][2]; -- so return name and tag from lang_name_remap[name]; special case to xlate sr-ec and sr-el to sr-cyrl and sr-latn
end
return name, lang_param_lc; -- so return <name> from remap and <lang_param_lc>
end
--#Modifed pattern
tag = lang_param_lc:match ('^(%a%a%a?)[%-_].*'); -- still assuming that <lang_param_lc> is a tag; strip script, region, variant subtags
name = cfg.lang_tag_remap[tag]; -- attempt to get remapped language name with language subtag only
if name then -- when <name>, <tag> is a tag for a remapped language name
return name, tag; -- so return <name> from remap and <tag>
end
if cfg.lang_name_remap[lang_param_lc] then -- not a remapped tag, assume <lang_param_lc> is a name; attempt to get remapped language tag
return cfg.lang_name_remap[lang_param_lc][1], cfg.lang_name_remap[lang_param_lc][2]; -- for this <lang_param_lc>, return a (possibly) new name and appropriate tag
end
name = cfg.mw_languages_by_tag_t[lang_param_lc]; -- assume that <lang_param_lc> is a tag; attempt to get its matching language name
if name then
return name, lang_param_lc; -- <lang_param_lc> is a tag so return it and <name>
end
tag = cfg.mw_languages_by_name_t[lang_param_lc]; -- assume that <lang_param_lc> is a language name; attempt to get its matching tag
if tag then
return cfg.mw_languages_by_tag_t[tag], tag; -- <lang_param_lc> is a name so return the name from the table and <tag>
end
--#Modifed pattern
tag = lang_param_lc:match ('^(%a%a%a?)%[%-_].*'); -- is <lang_param_lc> an IETF-like tag that MediaWiki doesn't recognize? <tag> gets the language subtag; nil else
if tag then
name = cfg.mw_languages_by_tag_t[tag]; -- attempt to get a language name using the shortened <tag>
if name then
return name, tag; -- <lang_param_lc> is an unrecognized IETF-like tag so return <name> and language subtag
end
end
end
--[[-------------------< L A N G U A G E _ P A R A M E T E R >------------------
Gets language name from a provided two- or three-character ISO 639 code. If a code
is recognized by MediaWiki, use the returned name; if not, then use the value that
was provided with the language parameter.
When |language= contains a recognized language (either code or name), the page is
assigned to the category for that code: Category:Norwegian-language sources (no).
For valid three-character code languages, the page is assigned to the single category
for '639-2' codes: Category:CS1 ISO 639-2 language sources.
Languages that are the same as the local wiki are not categorized. MediaWiki does
not recognize three-character equivalents of two-character codes: code 'ar' is
recognized but code 'ara' is not.
This function supports multiple languages in the form |language=nb, French, th
where the language names or codes are separated from each other by commas with
optional space characters.
]]
local function language_parameter (lang)
local tag; -- some form of IETF-like language tag; language subtag with optional region, sript, vatiant, etc subtags
local lang_subtag; -- ve populates |language= with mostly unecessary region subtags the MediaWiki does not recognize; this is the base language subtag
local name; -- the language name
local language_list = {}; -- table of language names to be rendered
local names_t = {}; -- table made from the value assigned to |language=
local this_wiki_name = mw.language.fetchLanguageName (cfg.this_wiki_code, cfg.this_wiki_code); -- get this wiki's language name
names_t = mw.text.split (lang, '%s*,%s*'); -- names should be a comma separated list
for _, lang in ipairs (names_t) do -- reuse lang here because we don't yet know if lang is a language name or a language tag
name, tag = name_tag_get (lang); -- attempt to get name/tag pair for <lang>; <name> has proper capitalization; <tag> is lowercase
if utilities.is_set (tag) then
--#Modifed pattern
lang_subtag = tag:gsub ('^(%a%a%a?)[%-_].*', '%1'); -- for categorization, strip any IETF-like tags from language tag
if cfg.this_wiki_code ~= lang_subtag then -- when the language is not the same as this wiki's language
if 2 == lang_subtag:len() then -- and is a two-character tag
utilities.add_prop_cat ('foreign-lang-source', {name, tag}, lang_subtag); -- categorize it; tag appended to allow for multiple language categorization
else -- or is a recognized language (but has a three-character tag)
utilities.add_prop_cat ('foreign-lang-source-2', {lang_subtag}, lang_subtag); -- categorize it differently TODO: support multiple three-character tag categories per cs1|2 template?
end
elseif cfg.local_lang_cat_enable then -- when the language and this wiki's language are the same and categorization is enabled
utilities.add_prop_cat ('local-lang-source', {name, lang_subtag}); -- categorize it
end
else
name = lang; -- return whatever <lang> has so that we show something
utilities.set_message ('maint_unknown_lang'); -- add maint category if not already added
end
table.insert (language_list, name);
name = ''; -- so we can reuse it
end
--#Modified اللغات تظهر بالعربية دائمًا
name = utilities.make_sep_list (#language_list, language_list, " و", " و", " و");
if (1 == #language_list) and (lang_subtag == cfg.this_wiki_code) then -- when only one language, find lang name in this wiki lang name; for |language=en-us, 'English' in 'American English'
return ''; -- if one language and that language is this wiki's return an empty string (no annotation)
end
return (" " .. wrap_msg ('language', name)); -- otherwise wrap with '(in ...)'
--[[ TODO: should only return blank or name rather than full list
so we can clean up the bunched parenthetical elements Language, Type, Format
]]
end
--[[-----------------------< S E T _ C S _ S T Y L E >--------------------------
Gets the default CS style configuration for the given mode.
Returns default separator and either postscript as passed in or the default.
In CS1, the default postscript and separator are '.'.
In CS2, the default postscript is the empty string and the default separator is ','.
]]
local function set_cs_style (postscript, mode)
if utilities.is_set(postscript) then
-- emit a maintenance message if user postscript is the default cs1 postscript
-- we catch the opposite case for cs2 in set_style
if mode == 'cs1' and postscript == cfg.presentation['ps_' .. mode] then
utilities.set_message ('maint_postscript');
end
else
postscript = cfg.presentation['ps_' .. mode];
end
return cfg.presentation['sep_' .. mode], postscript;
end
--[[--------------------------< S E T _ S T Y L E >-----------------------------
Sets the separator and postscript styles. Checks the |mode= first and the
#invoke CitationClass second. Removes the postscript if postscript == none.
]]
local function set_style (mode, postscript, cite_class)
local sep;
if 'cs2' == mode then
sep, postscript = set_cs_style (postscript, 'cs2');
elseif 'cs1' == mode then
sep, postscript = set_cs_style (postscript, 'cs1');
elseif 'citation' == cite_class then
sep, postscript = set_cs_style (postscript, 'cs2');
else
sep, postscript = set_cs_style (postscript, 'cs1');
end
if cfg.keywords_xlate[postscript:lower()] == 'none' then
-- emit a maintenance message if user postscript is the default cs2 postscript
-- we catch the opposite case for cs1 in set_cs_style
if 'cs2' == mode or ('cs1' ~= mode and 'citation' == cite_class) then -- {{citation |title=Title |mode=cs1 |postscript=none}} should not emit maint message
utilities.set_message ('maint_postscript');
end
postscript = '';
end
return sep, postscript
end
--[=[-------------------------< I S _ P D F >-----------------------------------
Determines if a URL has the file extension that is one of the PDF file extensions
used by [[MediaWiki:Common.css]] when applying the PDF icon to external links.
returns true if file extension is one of the recognized extensions, else false
]=]
local function is_pdf (url)
return url:match ('%.pdf$') or url:match ('%.PDF$') or
url:match ('%.pdf[%?#]') or url:match ('%.PDF[%?#]') or
url:match ('%.PDF#') or url:match ('%.pdf#');
end
--[[--------------------------< S T Y L E _ F O R M A T >-----------------------
Applies CSS style to |format=, |chapter-format=, etc. Also emits an error message
if the format parameter does not have a matching URL parameter. If the format parameter
is not set and the URL contains a file extension that is recognized as a PDF document
by MediaWiki's commons.css, this code will set the format parameter to (PDF) with
the appropriate styling.
]]
local function style_format (format, url, fmt_param, url_param)
if utilities.is_set (format) then
format = utilities.wrap_style ('format', format); -- add leading space, parentheses, resize
if not utilities.is_set (url) then
utilities.set_message ('err_format_missing_url', {fmt_param, url_param}); -- add an error message
end
elseif is_pdf (url) then -- format is not set so if URL is a PDF file then
format = utilities.wrap_style ('format', 'PDF'); -- set format to PDF
else
format = ''; -- empty string for concatenation
end
return format;
end
--[[---------------------< G E T _ D I S P L A Y _ N A M E S >------------------
Returns a number that defines the number of names displayed for author and editor
name lists and a Boolean flag to indicate when et al. should be appended to the name list.
When the value assigned to |display-xxxxors= is a number greater than or equal to zero,
return the number and the previous state of the 'etal' flag (false by default
but may have been set to true if the name list contains some variant of the text 'et al.').
When the value assigned to |display-xxxxors= is the keyword 'etal', return a number
that is one greater than the number of authors in the list and set the 'etal' flag true.
This will cause the list_people() to display all of the names in the name list followed by 'et al.'
In all other cases, returns nil and the previous state of the 'etal' flag.
inputs:
max: A['DisplayAuthors'] or A['DisplayEditors'], etc; a number or some flavor of etal
count: #a or #e
list_name: 'authors' or 'editors'
etal: author_etal or editor_etal
This function sets an error message when |display-xxxxors= value greater than or equal to number of names but
not when <max> comes from {{cs1 config}} global settings. When using global settings, <param> is set to the
keyword 'cs1 config' which is used to supress the normal error. Error is suppressed because it is to be expected
that some citations in an article will have the same or fewer names that the limit specified in {{cs1 config}}.
]]
local function get_display_names (max, count, list_name, etal, param)
if utilities.is_set (max) then
if 'etal' == max:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
max = count + 1; -- number of authors + 1 so display all author name plus et al.
etal = true; -- overrides value set by extract_names()
elseif max:match ('^%d+$') then -- if is a string of numbers
max = tonumber (max); -- make it a number
if (max >= count) and ('cs1 config' ~= param) then -- error when local |display-xxxxors= value greater than or equal to number of names; not an error when using global setting
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil;
end
else -- not a valid keyword or number
utilities.set_message ('err_disp_name', {param, max}); -- add error message
max = nil; -- unset; as if |display-xxxxors= had not been set
end
end
return max, etal;
end
--[[----------< E X T R A _ T E X T _ I N _ P A G E _ C H E C K >---------------
Adds error if |page=, |pages=, |quote-page=, |quote-pages= has what appears to be
some form of p. or pp. abbreviation in the first characters of the parameter content.
check page for extraneous p, p., pp, pp., pg, pg. at start of parameter value:
good pattern: '^P[^%.P%l]' matches when page begins PX or P# but not Px
where x and X are letters and # is a digit
bad pattern: '^[Pp][PpGg]' matches when page begins pp, pP, Pp, PP, pg, pG, Pg, PG
]]
local function extra_text_in_page_check (val, name)
if not val:match (cfg.vol_iss_pg_patterns.good_ppattern) then
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.bad_ppatterns) do -- spin through the selected sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message ('err_extra_text_pages', name); -- add error message
return; -- and done
end
end
end
end
--[[--------------------------< E X T R A _ T E X T _ I N _ V O L _ I S S _ C H E C K >------------------------
Adds error if |volume= or |issue= has what appears to be some form of redundant 'type' indicator. Applies to
both; this function looks for issue text in both |issue= and |volume= and looks for volume-like text in |voluem=
and |issue=.
For |volume=:
'V.', or 'Vol.' (with or without the dot) abbreviations or 'Volume' in the first characters of the parameter
content (all case insensitive). 'V' and 'v' (without the dot) are presumed to be roman numerals so
are allowed.
For |issue=:
'No.', 'I.', 'Iss.' (with or without the dot) abbreviations, or 'Issue' in the first characters of the
parameter content (all case insensitive); numero styling: 'n°' with degree sign U+00B0, and № precomposed
numero sign U+2116.
Single character values ('v', 'i', 'n') allowed when not followed by separator character ('.', ':', '=', or
whitespace character) – param values are trimmed of whitespace by MediaWiki before delivered to the module.
<val> is |volume= or |issue= parameter value
<name> is |volume= or |issue= parameter name for error message
<selector> is 'v' for |volume=, 'i' for |issue=
sets error message on failure; returns nothing
]]
local function extra_text_in_vol_iss_check (val, name, selector)
if not utilities.is_set (val) then
return;
end
local handler = 'v' == selector and 'err_extra_text_volume' or 'err_extra_text_issue';
val = val:lower(); -- force parameter value to lower case
for _, pattern in ipairs (cfg.vol_iss_pg_patterns.vi_patterns_t) do -- spin through the sequence table of patterns
if val:match (pattern) then -- when a match, error so
utilities.set_message (handler, name); -- add error message
return; -- and done
end
end
end
--[=[-------------------------< G E T _ V _ N A M E _ T A B L E >----------------------------------------------
split apart a |vauthors= or |veditors= parameter. This function allows for corporate names, wrapped in doubled
parentheses to also have commas; in the old version of the code, the doubled parentheses were included in the
rendered citation and in the metadata. Individual author names may be wikilinked
|vauthors=Jones AB, [[E. B. White|White EB]], ((Black, Brown, and Co.))
]=]
local function get_v_name_table (vparam, output_table, output_link_table)
--#Modified: next line
local name_table = mw.text.split(vparam or "", "%s*,%s*")
local wl_type, label, link; -- wl_type not used here; just a placeholder
local i = 1;
while name_table[i] do
if name_table[i]:match ('^%(%(.*[^%)][^%)]$') then -- first segment of corporate with one or more commas; this segment has the opening doubled parentheses
local name = name_table[i];
i = i + 1; -- bump indexer to next segment
while name_table[i] do
name = name .. ', ' .. name_table[i]; -- concatenate with previous segments
if name_table[i]:match ('^.*%)%)$') then -- if this table member has the closing doubled parentheses
break; -- and done reassembling so
end
i = i + 1; -- bump indexer
end
table.insert (output_table, name); -- and add corporate name to the output table
table.insert (output_link_table, ''); -- no wikilink
else
wl_type, label, link = utilities.is_wikilink (name_table[i]); -- wl_type is: 0, no wl (text in label variable); 1, [[D]]; 2, [[L|D]]
table.insert (output_table, label); -- add this name
if 1 == wl_type then
table.insert (output_link_table, label); -- simple wikilink [[D]]
else
table.insert (output_link_table, link); -- no wikilink or [[L|D]]; add this link if there is one, else empty string
end
end
i = i + 1;
end
return output_table;
end
--[[--------------------------< P A R S E _ V A U T H O R S _ V E D I T O R S >--------------------------------
This function extracts author / editor names from |vauthors= or |veditors= and finds matching |xxxxor-maskn= and
|xxxxor-linkn= in args. It then returns a table of assembled names just as extract_names() does.
Author / editor names in |vauthors= or |veditors= must be in Vancouver system style. Corporate or institutional names
may sometimes be required and because such names will often fail the is_good_vanc_name() and other format compliance
tests, are wrapped in doubled parentheses ((corporate name)) to suppress the format tests.
Supports generational suffixes Jr, 2nd, 3rd, 4th–6th.
This function sets the Vancouver error when a required comma is missing and when there is a space between an author's initials.
]]
local function parse_vauthors_veditors (args, vparam, list_name)
local names = {}; -- table of names assembled from |vauthors=, |author-maskn=, |author-linkn=
local v_name_table = {};
local v_link_table = {}; -- when name is wikilinked, targets go in this table
local etal = false; -- return value set to true when we find some form of et al. vauthors parameter
local last, first, link, mask, suffix;
local corporate = false;
vparam, etal = name_has_etal (vparam, etal, true); -- find and remove variations on et al. do not categorize (do it here because et al. might have a period)
v_name_table = get_v_name_table (vparam, v_name_table, v_link_table); -- names are separated by commas
for i, v_name in ipairs(v_name_table) do
first = ''; -- set to empty string for concatenation and because it may have been set for previous author/editor
local accept_name;
v_name, accept_name = utilities.has_accept_as_written (v_name); -- remove accept-this-as-written markup when it wraps all of <v_name>
if accept_name then
last = v_name;
corporate = true; -- flag used in list_people()
elseif string.find(v_name, "%s") then
if v_name:find('[;%.]') then -- look for commonly occurring punctuation characters;
add_vanc_error (cfg.err_msg_supl.punctuation, i);
end
local lastfirstTable = {}
lastfirstTable = mw.text.split(v_name, "%s+")
first = table.remove(lastfirstTable); -- removes and returns value of last element in table which should be initials or generational suffix
if not mw.ustring.match (first, '^%u+$') then -- mw.ustring here so that later we will catch non-Latin characters
suffix = first; -- not initials so assume that whatever we got is a generational suffix
first = table.remove(lastfirstTable); -- get what should be the initials from the table
end
last = table.concat(lastfirstTable, ' ') -- returns a string that is the concatenation of all other names that are not initials and generational suffix
if not utilities.is_set (last) then
first = ''; -- unset
last = v_name; -- last empty because something wrong with first
add_vanc_error (cfg.err_msg_supl.name, i);
end
if mw.ustring.match (last, '%a+%s+%u+%s+%a+') then
add_vanc_error (cfg.err_msg_supl['missing comma'], i); -- matches last II last; the case when a comma is missing
end
if mw.ustring.match (v_name, ' %u %u$') then -- this test is in the wrong place TODO: move or replace with a more appropriate test
add_vanc_error (cfg.err_msg_supl.initials, i); -- matches a space between two initials
end
else
last = v_name; -- last name or single corporate name? Doesn't support multiword corporate names? do we need this?
end
if utilities.is_set (first) then
if not mw.ustring.match (first, "^%u?%u$") then -- first shall contain one or two upper-case letters, nothing else
add_vanc_error (cfg.err_msg_supl.initials, i); -- too many initials; mixed case initials (which may be ok Romanization); hyphenated initials
end
is_good_vanc_name (last, first, suffix, i); -- check first and last before restoring the suffix which may have a non-Latin digit
if utilities.is_set (suffix) then
first = first .. ' ' .. suffix; -- if there was a suffix concatenate with the initials
suffix = ''; -- unset so we don't add this suffix to all subsequent names
end
else
if not corporate then
is_good_vanc_name (last, '', nil, i);
end
end
link = utilities.select_one ( args, cfg.aliases[list_name .. '-Link'], 'err_redundant_parameters', i ) or v_link_table[i];
mask = utilities.select_one ( args, cfg.aliases[list_name .. '-Mask'], 'err_redundant_parameters', i );
names[i] = {last = last, first = first, link = link, mask = mask, corporate = corporate}; -- add this assembled name to our names list
end
return names, etal; -- all done, return our list of names
end
--[[--------------------------< S E L E C T _ A U T H O R _ E D I T O R _ S O U R C E >------------------------
Select one of |authors=, |authorn= / |lastn / firstn=, or |vauthors= as the source of the author name list or
select one of |editorn= / editor-lastn= / |editor-firstn= or |veditors= as the source of the editor name list.
Only one of these appropriate three will be used. The hierarchy is: |authorn= (and aliases) highest and |authors= lowest;
|editorn= (and aliases) highest and |veditors= lowest (support for |editors= withdrawn)
When looking for |authorn= / |editorn= parameters, test |xxxxor1= and |xxxxor2= (and all of their aliases); stops after the second
test which mimicks the test used in extract_names() when looking for a hole in the author name list. There may be a better
way to do this, I just haven't discovered what that way is.
Emits an error message when more than one xxxxor name source is provided.
In this function, vxxxxors = vauthors or veditors; xxxxors = authors as appropriate.
]]
local function select_author_editor_source (vxxxxors, xxxxors, args, list_name)
local lastfirst = false;
if utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 1 ) or -- do this twice in case we have a |first1= without a |last1=; this ...
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 1 ) or -- ... also catches the case where |first= is used with |vauthors=
utilities.select_one ( args, cfg.aliases[list_name .. '-Last'], 'none', 2 ) or
utilities.select_one ( args, cfg.aliases[list_name .. '-First'], 'none', 2 ) then
lastfirst = true;
end
if (utilities.is_set (vxxxxors) and true == lastfirst) or -- these are the three error conditions
(utilities.is_set (vxxxxors) and utilities.is_set (xxxxors)) or
(true == lastfirst and utilities.is_set (xxxxors)) then
local err_name;
if 'AuthorList' == list_name then -- figure out which name should be used in error message
err_name = 'author';
else
err_name = 'editor';
end
utilities.set_message ('err_redundant_parameters', err_name .. '-name-list parameters'); -- add error message
end
if true == lastfirst then return 1 end; -- return a number indicating which author name source to use
if utilities.is_set (vxxxxors) then return 2 end;
if utilities.is_set (xxxxors) then return 3 end;
return 1; -- no authors so return 1; this allows missing author name test to run in case there is a first without last
end
--[[--------------------------< I S _ V A L I D _ P A R A M E T E R _ V A L U E >------------------------------
This function is used to validate a parameter's assigned value for those parameters that have only a limited number
of allowable values (yes, y, true, live, dead, etc.). When the parameter value has not been assigned a value (missing
or empty in the source template) the function returns the value specified by ret_val. If the parameter value is one
of the list of allowed values returns the translated value; else, emits an error message and returns the value
specified by ret_val.
TODO: explain <invert>
]]
local function is_valid_parameter_value (value, name, possible, ret_val, invert)
if not utilities.is_set (value) then
return ret_val; -- an empty parameter is ok
end
if (not invert and utilities.in_array (value, possible)) then -- normal; <value> is in <possible> table
return cfg.keywords_xlate[value]; -- return translation of parameter keyword
elseif invert and not utilities.in_array (value, possible) then -- invert; <value> is not in <possible> table
return value; -- return <value> as it is
else
utilities.set_message ('err_invalid_param_val', {name, value}); -- not an allowed value so add error message
return ret_val;
end
end
--[[--------------------------< T E R M I N A T E _ N A M E _ L I S T >----------------------------------------
This function terminates a name list (author, contributor, editor) with a separator character (sepc) and a space
when the last character is not a sepc character or when the last three characters are not sepc followed by two
closing square brackets (close of a wikilink). When either of these is true, the name_list is terminated with a
single space character.
]]
local function terminate_name_list (name_list, sepc)
if (string.sub (name_list, -3, -1) == sepc .. '. ') then -- if already properly terminated
return name_list; -- just return the name list
elseif (string.sub (name_list, -1, -1) == sepc) or (string.sub (name_list, -3, -1) == sepc .. ']]') then -- if last name in list ends with sepc char
return name_list .. " "; -- don't add another
else
return name_list .. sepc .. ' '; -- otherwise terminate the name list
end
end
--[[-------------------------< F O R M A T _ V O L U M E _ I S S U E >-----------------------------------------
returns the concatenation of the formatted volume and issue (or journal article number) parameters as a single
string; or formatted volume or formatted issue, or an empty string if neither are set.
]]
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower)
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then
return '';
end
-- same condition as in format_pages_sheets()
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
local is_numeric_vol = volume and (volume:match ('^[MDCLXVI]+$') or volume:match ('^%d+$')); -- is only uppercase roman numerals or only digits?
local is_long_vol = volume and (4 < mw.ustring.len(volume)); -- is |volume= value longer than 4 characters?
if volume and (not is_numeric_vol and is_long_vol) then -- when not all digits or Roman numerals, is |volume= longer than 4 characters?
utilities.add_prop_cat ('long-vol'); -- yes, add properties cat
end
if is_journal then -- journal-style formatting
local vol = '';
if utilities.is_set (volume) then
if is_numeric_vol then -- |volume= value all digits or all uppercase Roman numerals?
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, volume}); -- render in bold face
elseif is_long_vol then -- not all digits or Roman numerals; longer than 4 characters?
vol = utilities.substitute (cfg.messages['j-vol'], {sepc, utilities.hyphen_to_dash (volume)}); -- not bold
else -- four or fewer characters
vol = utilities.substitute (cfg.presentation['vol-bold'], {sepc, utilities.hyphen_to_dash (volume)}); -- bold
end
end
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '')
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '')
return vol;
end
if 'podcast' == cite_class and utilities.is_set (issue) then
return wrap_msg ('issue', {sepc, issue}, lower);
end
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower);
elseif utilities.is_set (article) then -- article number alone; when volume alone, handled below
return wrap_msg ('art', {sepc, article}, lower);
end
end
-- all other types of citation
if utilities.is_set (volume) and utilities.is_set (issue) then
return wrap_msg ('vol-no', {sepc, utilities.hyphen_to_dash (volume), issue}, lower);
elseif utilities.is_set (volume) then
return wrap_msg ('vol', {sepc, utilities.hyphen_to_dash (volume)}, lower);
else
return wrap_msg ('issue', {sepc, issue}, lower);
end
end
--[[-------------------------< F O R M A T _ P A G E S _ S H E E T S >-----------------------------------------
adds static text to one of |page(s)= or |sheet(s)= values and returns it with all of the others set to empty strings.
The return order is:
page, pages, sheet, sheets
Singular has priority over plural when both are provided.
]]
local function format_pages_sheets (page, pages, sheet, sheets, cite_class, origin, sepc, nopp, lower)
if 'map' == cite_class then -- only cite map supports sheet(s) as in-source locators
if utilities.is_set (sheet) then
if 'journal' == origin then
return '', '', wrap_msg ('j-sheet', sheet, lower), '';
else
return '', '', wrap_msg ('sheet', {sepc, sheet}, lower), '';
end
elseif utilities.is_set (sheets) then
if 'journal' == origin then
return '', '', '', wrap_msg ('j-sheets', sheets, lower);
else
return '', '', '', wrap_msg ('sheets', {sepc, sheets}, lower);
end
end
end
local is_journal = 'journal' == cite_class or (utilities.in_array (cite_class, {'citation', 'map', 'interview'}) and 'journal' == origin);
if utilities.is_set (page) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], page), '', '', '';
elseif not nopp then
return utilities.substitute (cfg.messages['p-prefix'], {sepc, page}), '', '', '';
else
return utilities.substitute (cfg.messages['nopp'], {sepc, page}), '', '', '';
end
elseif utilities.is_set (pages) then
if is_journal then
return utilities.substitute (cfg.messages['j-page(s)'], pages), '', '', '';
elseif tonumber(pages) ~= nil and not nopp then -- if pages is only digits, assume a single page number
return '', utilities.substitute (cfg.messages['p-prefix'], {sepc, pages}), '', '';
elseif not nopp then
return '', utilities.substitute (cfg.messages['pp-prefix'], {sepc, pages}), '', '';
else
return '', utilities.substitute (cfg.messages['nopp'], {sepc, pages}), '', '';
end
end
return '', '', '', ''; -- return empty strings
end
--[[--------------------------< I N S O U R C E _ L O C _ G E T >----------------------------------------------
returns one of the in-source locators: page, pages, or at.
If any of these are interwiki links to Wikisource, returns the label portion of the interwiki-link as plain text
for use in COinS. This COinS thing is done because here we convert an interwiki-link to an external link and
add an icon span around that; get_coins_pages() doesn't know about the span. TODO: should it?
TODO: add support for sheet and sheets?; streamline;
TODO: make it so that this function returns only one of the three as the single in-source (the return value assigned
to a new name)?
]]
local function insource_loc_get (page, page_orig, pages, pages_orig, at)
local ws_url, ws_label, coins_pages, L; -- for Wikisource interwiki-links; TODO: this corrupts page metadata (span remains in place after cleanup; fix there?)
if utilities.is_set (page) then
if utilities.is_set (pages) or utilities.is_set (at) then
pages = ''; -- unset the others
at = '';
end
extra_text_in_page_check (page, page_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (page); -- make ws URL from |page= interwiki link; link portion L becomes tooltip label
if ws_url then
page = external_link (ws_url, ws_label .. ' ', 'ws link in page'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
page = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, page});
coins_pages = ws_label;
end
elseif utilities.is_set (pages) then
if utilities.is_set (at) then
at = ''; -- unset
end
extra_text_in_page_check (pages, pages_orig); -- emit error message when |page= value begins with what looks like p., pp., etc.
ws_url, ws_label, L = wikisource_url_make (pages); -- make ws URL from |pages= interwiki link; link portion L becomes tooltip label
if ws_url then
pages = external_link (ws_url, ws_label .. ' ', 'ws link in pages'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
pages = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, pages});
coins_pages = ws_label;
end
elseif utilities.is_set (at) then
ws_url, ws_label, L = wikisource_url_make (at); -- make ws URL from |at= interwiki link; link portion L becomes tooltip label
if ws_url then
at = external_link (ws_url, ws_label .. ' ', 'ws link in at'); -- space char after label to move icon away from in-source text; TODO: a better way to do this?
at = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, at});
coins_pages = ws_label;
end
end
return page, pages, at, coins_pages;
end
--[[--------------------------< I S _ U N I Q U E _ A R C H I V E _ U R L >------------------------------------
add error message when |archive-url= value is same as |url= or chapter-url= (or alias...) value
]]
local function is_unique_archive_url (archive, url, c_url, source, date)
if utilities.is_set (archive) then
if archive == url or archive == c_url then
utilities.set_message ('err_bad_url', {utilities.wrap_style ('parameter', source)}); -- add error message
return '', ''; -- unset |archive-url= and |archive-date= because same as |url= or |chapter-url=
end
end
return archive, date;
end
--[=[-------------------------< A R C H I V E _ U R L _ C H E C K >--------------------------------------------
Check archive.org URLs to make sure they at least look like they are pointing at valid archives and not to the
save snapshot URL or to calendar pages. When the archive URL is 'https://web.archive.org/save/' (or http://...)
archive.org saves a snapshot of the target page in the URL. That is something that Wikipedia should not allow
unwitting readers to do.
When the archive.org URL does not have a complete timestamp, archive.org chooses a snapshot according to its own
algorithm or provides a calendar 'search' result. [[WP:ELNO]] discourages links to search results.
This function looks at the value assigned to |archive-url= and returns empty strings for |archive-url= and
|archive-date= and an error message when:
|archive-url= holds an archive.org save command URL
|archive-url= is an archive.org URL that does not have a complete timestamp (YYYYMMDDhhmmss 14 digits) in the
correct place
otherwise returns |archive-url= and |archive-date=
There are two mostly compatible archive.org URLs:
//web.archive.org/<timestamp>... -- the old form
//web.archive.org/web/<timestamp>... -- the new form
The old form does not support or map to the new form when it contains a display flag. There are four identified flags
('id_', 'js_', 'cs_', 'im_') but since archive.org ignores others following the same form (two letters and an underscore)
we don't check for these specific flags but we do check the form.
This function supports a preview mode. When the article is rendered in preview mode, this function may return a modified
archive URL:
for save command errors, return undated wildcard (/*/)
for timestamp errors when the timestamp has a wildcard, return the URL unmodified
for timestamp errors when the timestamp does not have a wildcard, return with timestamp limited to six digits plus wildcard (/yyyymm*/)
A secondary function is to return an archive-url timestamp from those urls that have them (archive.org and
archive.today). The timestamp is used by validation.archive_date_check() to see if the value in |archive-date=
matches the timestamp in the archive url.
]=]
local function archive_url_check (url, date)
local err_msg = ''; -- start with the error message empty
local path, timestamp, flag; -- portions of the archive.org URL
timestamp = url:match ('//archive.today/(%d%d%d%d%d%d%d%d%d%d%d%d%d%d)/') or -- get timestamp from archive.today urls
url:match ('//archive.today/(%d%d%d%d%.%d%d%.%d%d%-%d%d%d%d%d%d)/'); -- this timestamp needs cleanup
if timestamp then -- if this was an archive.today url ...
return url, date, timestamp:gsub ('[%.%-]', ''); -- return ArchiveURL, ArchiveDate, and timestamp (dots and dashes removed) from |archive-url=, and done
end
-- here for archive.org urls
if (not url:match('//web%.archive%.org/')) and (not url:match('//liveweb%.archive%.org/')) then -- also deprecated liveweb Wayback machine URL
return url, date; -- not an archive.org archive, return ArchiveURL and ArchiveDate
end
if url:match('//web%.archive%.org/save/') then -- if a save command URL, we don't want to allow saving of the target page
err_msg = cfg.err_msg_supl.save;
url = url:gsub ('(//web%.archive%.org)/save/', '%1/*/', 1); -- for preview mode: modify ArchiveURL
elseif url:match('//liveweb%.archive%.org/') then
err_msg = cfg.err_msg_supl.liveweb;
else
path, timestamp, flag = url:match('//web%.archive%.org/([^%d]*)(%d+)([^/]*)/'); -- split out some of the URL parts for evaluation
if not path then -- malformed in some way; pattern did not match
err_msg = cfg.err_msg_supl.timestamp;
elseif 14 ~= timestamp:len() then -- path and flag optional, must have 14-digit timestamp here
err_msg = cfg.err_msg_supl.timestamp;
if '*' ~= flag then
local replacement = timestamp:match ('^%d%d%d%d%d%d') or timestamp:match ('^%d%d%d%d'); -- get the first 6 (YYYYMM) or first 4 digits (YYYY)
if replacement then -- nil if there aren't at least 4 digits (year)
replacement = replacement .. string.rep ('0', 14 - replacement:len()); -- year or yearmo (4 or 6 digits) zero-fill to make 14-digit timestamp
url=url:gsub ('(//web%.archive%.org/[^%d]*)%d[^/]*', '%1' .. replacement .. '*', 1) -- for preview, modify ts to 14 digits plus splat for calendar display
end
end
elseif utilities.is_set (path) and 'web/' ~= path then -- older archive URLs do not have the extra 'web/' path element
err_msg = cfg.err_msg_supl.path;
elseif utilities.is_set (flag) and not utilities.is_set (path) then -- flag not allowed with the old form URL (without the 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
elseif utilities.is_set (flag) and not flag:match ('%a%a_') then -- flag if present must be two alpha characters and underscore (requires 'web/' path element)
err_msg = cfg.err_msg_supl.flag;
else
return url, date, timestamp; -- return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
end
end
-- if here, something not right so
utilities.set_message ('err_archive_url', {err_msg}); -- add error message and
if is_preview_mode then
return url, date, timestamp; -- preview mode so return ArchiveURL, ArchiveDate, and timestamp from |archive-url=
else
return '', ''; -- return empty strings for ArchiveURL and ArchiveDate
end
end
--[[--------------------------< P L A C E _ C H E C K >--------------------------------------------------------
check |place=, |publication-place=, |location= to see if these params include digits. This function added because
many editors misuse location to specify the in-source location (|page(s)= and |at= are supposed to do that)
returns the original parameter value without modification; added maint cat when parameter value contains digits
]]
local function place_check (param_val)
if not utilities.is_set (param_val) then -- parameter empty or omitted
return param_val; -- return that empty state
end
if mw.ustring.find (param_val, '%d') then -- not empty, are there digits in the parameter value
utilities.set_message ('maint_location'); -- yep, add maint cat
end
return param_val; -- and done
end
--[[--------------------------< I S _ A R C H I V E D _ C O P Y >----------------------------------------------
compares |title= to 'Archived copy' (placeholder added by bots that can't find proper title); if matches, return true; nil else
]]
local function is_archived_copy (title)
title = mw.ustring.lower(title); -- switch title to lower case
if title:find (cfg.special_case_translation.archived_copy.en) then -- if title is 'Archived copy'
return true;
elseif cfg.special_case_translation.archived_copy['local'] then
if mw.ustring.find (title, cfg.special_case_translation.archived_copy['local']) then -- mw.ustring() because might not be Latin script
return true;
end
end
end
--[[--------------------------< D I S P L A Y _ N A M E S _ S E L E C T >--------------------------------------
for any of the |display-authors=, |display-editors=, etc parameters, select either the local or global setting.
When both are present, look at <local_display_names> value. When the value is some sort of 'et al.'string,
special handling is required.
When {{cs1 config}} has |display-<namelist>= AND this template has |display-<namelist>=etal AND:
the number of names specified by <number_of_names> is:
greater than the number specified in the global |display-<namelist>= parameter (<global_display_names>)
use global |display-<namelist>= parameter value
set overridden maint category
less than or equal to the number specified in the global |display-<namelist>= parameter
use local |display-<namelist>= parameter value
The purpose of this function is to prevent categorizing a template that has fewer names than the global setting
to keep the etal annotation specified by <local_display_names>.
]]
local function display_names_select (global_display_names, local_display_names, param_name, number_of_names, test)
if global_display_names and utilities.is_set (local_display_names) then -- when both
if 'etal' == local_display_names:lower():gsub("[ '%.]", '') then -- the :gsub() portion makes 'etal' from a variety of 'et al.' spellings and stylings
number_of_names = tonumber (number_of_names); -- convert these to numbers for comparison
local global_display_names_num = tonumber (global_display_names); -- <global_display_names> not set when parameter value is not digits
if number_of_names > global_display_names_num then -- template has more names than global config allows to be displayed?
utilities.set_message ('maint_overridden_setting'); -- set a maint message because global is overriding local |display-<namelist>=etal
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
else
return local_display_names, param_name; -- return local because fewer names so let <local_display_names> control
end
end
-- here when <global_display_names> and <local_display_names> both numbers; <global_display_names> controls
utilities.set_message ('maint_overridden_setting'); -- set a maint message
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
end
-- here when only one of <global_display_names> or <local_display_names> set
if global_display_names then
return global_display_names, 'cs1 config'; -- return global with spoof parameter name (for get_display_names())
else
return local_display_names, param_name; -- return local
end
end
--[[--------------------------< C I T A T I O N 0 >------------------------------------------------------------
This is the main function doing the majority of the citation formatting.
]]
local function citation0( config, args )
--[[
Load Input Parameters
The argument_wrapper facilitates the mapping of multiple aliases to single internal variable.
]]
local A = argument_wrapper ( args );
local i
-- Pick out the relevant fields from the arguments. Different citation templates
-- define different field names for the same underlying things.
local author_etal;
local a = {}; -- authors list from |lastn= / |firstn= pairs or |vauthors=
local Authors;
local NameListStyle;
if cfg.global_cs1_config_t['NameListStyle'] then -- global setting in {{cs1 config}} overrides local |name-list-style= parameter value; nil when empty or assigned value invalid
NameListStyle = is_valid_parameter_value (cfg.global_cs1_config_t['NameListStyle'], 'cs1 config: name-list-style', cfg.keywords_lists['name-list-style'], ''); -- error messaging 'param' here is a hoax
else
NameListStyle = is_valid_parameter_value (A['NameListStyle'], A:ORIGIN('NameListStyle'), cfg.keywords_lists['name-list-style'], '');
end
if cfg.global_cs1_config_t['NameListStyle'] and utilities.is_set (A['NameListStyle']) then -- when template has |name-list-style=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
local Collaboration = A['Collaboration'];
do -- to limit scope of selected
local selected = select_author_editor_source (A['Vauthors'], A['Authors'], args, 'AuthorList');
if 1 == selected then
a, author_etal = extract_names (args, 'AuthorList'); -- fetch author list from |authorn= / |lastn= / |firstn=, |author-linkn=, and |author-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
a, author_etal = parse_vauthors_veditors (args, A['Vauthors'], 'AuthorList'); -- fetch author list from |vauthors=, |author-linkn=, and |author-maskn=
elseif 3 == selected then
Authors = A['Authors']; -- use content of |people= or |credits=; |authors= is deprecated; TODO: constrain |people= and |credits= to cite av media, episode, serial?
end
if utilities.is_set (Collaboration) then
author_etal = true; -- so that |display-authors=etal not required
end
end
local editor_etal;
local e = {}; -- editors list from |editor-lastn= / |editor-firstn= pairs or |veditors=
do -- to limit scope of selected
local selected = select_author_editor_source (A['Veditors'], nil, args, 'EditorList'); -- support for |editors= withdrawn
if 1 == selected then
e, editor_etal = extract_names (args, 'EditorList'); -- fetch editor list from |editorn= / |editor-lastn= / |editor-firstn=, |editor-linkn=, and |editor-maskn=
elseif 2 == selected then
NameListStyle = 'vanc'; -- override whatever |name-list-style= might be
e, editor_etal = parse_vauthors_veditors (args, args.veditors, 'EditorList'); -- fetch editor list from |veditors=, |editor-linkn=, and |editor-maskn=
end
end
local Chapter = A['Chapter']; -- done here so that we have access to |contribution= from |chapter= aliases
local Chapter_origin = A:ORIGIN ('Chapter');
local Contribution; -- because contribution is required for contributor(s)
if 'contribution' == Chapter_origin then
Contribution = Chapter; -- get the name of the contribution
end
local c = {}; -- contributors list from |contributor-lastn= / contributor-firstn= pairs
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (A['Periodical']) then -- |contributor= and |contribution= only supported in book cites
c = extract_names (args, 'ContributorList'); -- fetch contributor list from |contributorn= / |contributor-lastn=, -firstn=, -linkn=, -maskn=
if 0 < #c then
if not utilities.is_set (Contribution) then -- |contributor= requires |contribution=
utilities.set_message ('err_contributor_missing_required_param', 'contribution'); -- add missing contribution error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
if 0 == #a then -- |contributor= requires |author=
utilities.set_message ('err_contributor_missing_required_param', 'author'); -- add missing author error message
c = {}; -- blank the contributors' table; it is used as a flag later
end
end
else -- if not a book cite
if utilities.select_one (args, cfg.aliases['ContributorList-Last'], 'err_redundant_parameters', 1 ) then -- are there contributor name list parameters?
utilities.set_message ('err_contributor_ignored'); -- add contributor ignored error message
end
Contribution = nil; -- unset
end
local Title = A['Title'];
local TitleLink = A['TitleLink'];
local auto_select = ''; -- default is auto
local accept_link;
TitleLink, accept_link = utilities.has_accept_as_written (TitleLink, true); -- test for accept-this-as-written markup
if (not accept_link) and utilities.in_array (TitleLink, {'none', 'pmc', 'doi'}) then -- check for special keywords
auto_select = TitleLink; -- remember selection for later
TitleLink = ''; -- treat as if |title-link= would have been empty
end
TitleLink = link_title_ok (TitleLink, A:ORIGIN ('TitleLink'), Title, 'title'); -- check for wiki-markup in |title-link= or wiki-markup in |title= when |title-link= is set
local Section = ''; -- {{cite map}} only; preset to empty string for concatenation if not used
if 'map' == config.CitationClass and 'section' == Chapter_origin then
Section = A['Chapter']; -- get |section= from |chapter= alias list; |chapter= and the other aliases not supported in {{cite map}}
Chapter = ''; -- unset for now; will be reset later from |map= if present
end
local Periodical = A['Periodical'];
local Periodical_origin = A:ORIGIN('Periodical');
local ScriptPeriodical = A['ScriptPeriodical'];
local ScriptPeriodical_origin = A:ORIGIN('ScriptPeriodical');
local TransPeriodical = A['TransPeriodical'];
local TransPeriodical_origin = A:ORIGIN ('TransPeriodical');
if (utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical))) then
local param;
if utilities.is_set (Periodical) then -- get a parameter name from one of these periodical related meta-parameters
Periodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = Periodical_origin -- get parameter name for error messaging
elseif utilities.is_set (TransPeriodical) then
TransPeriodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = TransPeriodical_origin; -- get parameter name for error messaging
elseif utilities.is_set (ScriptPeriodical) then
ScriptPeriodical = ''; -- unset because not valid {{cite book}} or {{cite encyclopedia}} parameters
param = ScriptPeriodical_origin; -- get parameter name for error messaging
end
if utilities.is_set (param) then -- if we found one
utilities.set_message ('err_periodical_ignored', {param}); -- emit an error message
end
end
if utilities.is_set (Periodical) then
local i;
Periodical, i = utilities.strip_apostrophe_markup (Periodical); -- strip apostrophe markup so that metadata isn't contaminated
if i then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {Periodical_origin});
end
end
if 'mailinglist' == config.CitationClass then -- special case for {{cite mailing list}}
if utilities.is_set (Periodical) and utilities.is_set (A ['MailingList']) then -- both set emit an error TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', Periodical_origin) .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'mailinglist')});
end
Periodical = A ['MailingList']; -- error or no, set Periodical to |mailinglist= value because this template is {{cite mailing list}}
Periodical_origin = A:ORIGIN('MailingList');
end
-- web and news not tested for now because of
-- Wikipedia:Administrators%27_noticeboard#Is_there_a_semi-automated_tool_that_could_fix_these_annoying_"Cite_Web"_errors?
if not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) then -- 'periodical' templates require periodical parameter
-- local p = {['journal'] = 'journal', ['magazine'] = 'magazine', ['news'] = 'newspaper', ['web'] = 'website'}; -- for error message
local p = {['journal'] = 'journal', ['magazine'] = 'magazine'}; -- for error message
if p[config.CitationClass] then
--#Modifed
utilities.set_message ('err_missing_periodical', {cfg.err_msg_supl[config.CitationClass], cfg.err_msg_supl[p[config.CitationClass]]});
end
end
local Volume;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) then
if not utilities.in_array (Periodical_origin, cfg.citation_no_volume_t) then -- {{citation}} does not render |volume= when these parameters are used
Volume = A['Volume']; -- but does for all other 'periodicals'
end
elseif utilities.is_set (ScriptPeriodical) then
if 'script-website' ~= ScriptPeriodical_origin then -- {{citation}} does not render volume for |script-website=
Volume = A['Volume']; -- but does for all other 'periodicals'
end
else
Volume = A['Volume']; -- and does for non-'periodical' cites
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_volume) then -- render |volume= for cs1 according to the configuration settings
Volume = A['Volume'];
end
extra_text_in_vol_iss_check (Volume, A:ORIGIN ('Volume'), 'v');
local Issue;
if 'citation' == config.CitationClass then
if utilities.is_set (Periodical) and utilities.in_array (Periodical_origin, cfg.citation_issue_t) then -- {{citation}} may render |issue= when these parameters are used
Issue = utilities.hyphen_to_dash (A['Issue']);
end
elseif utilities.in_array (config.CitationClass, cfg.templates_using_issue) then -- conference & map books do not support issue; {{citation}} listed here because included in settings table
if not (utilities.in_array (config.CitationClass, {'conference', 'map', 'citation'}) and not (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical))) then
Issue = utilities.hyphen_to_dash (A['Issue']);
end
end
local ArticleNumber;
if utilities.in_array (config.CitationClass, {'journal', 'conference'}) or ('citation' == config.CitationClass and utilities.is_set (Periodical) and 'journal' == Periodical_origin) then
ArticleNumber = A['ArticleNumber'];
end
extra_text_in_vol_iss_check (Issue, A:ORIGIN ('Issue'), 'i');
local Page;
local Pages;
local At;
local QuotePage;
local QuotePages;
if not utilities.in_array (config.CitationClass, cfg.templates_not_using_page) then -- TODO: rewrite to emit ignored parameter error message?
Page = A['Page'];
Pages = utilities.hyphen_to_dash (A['Pages']);
At = A['At'];
QuotePage = A['QuotePage'];
QuotePages = utilities.hyphen_to_dash (A['QuotePages']);
end
local Edition = A['Edition'];
local PublicationPlace = place_check (A['PublicationPlace'], A:ORIGIN('PublicationPlace'));
local Place = place_check (A['Place'], A:ORIGIN('Place'));
local PublisherName = A['PublisherName'];
local PublisherName_origin = A:ORIGIN('PublisherName');
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then
local i = 0;
PublisherName, i = utilities.strip_apostrophe_markup (PublisherName); -- strip apostrophe markup so that metadata isn't contaminated; publisher is never italicized
if i and (0 < i) then -- non-zero when markup was stripped so emit an error message
utilities.set_message ('err_apostrophe_markup', {PublisherName_origin});
end
end
if ('document' == config.CitationClass) and not utilities.is_set (PublisherName) then
utilities.set_message ('err_missing_publisher', {config.CitationClass, 'publisher'});
end
local Newsgroup = A['Newsgroup']; -- TODO: strip apostrophe markup?
local Newsgroup_origin = A:ORIGIN('Newsgroup');
if 'newsgroup' == config.CitationClass then
if utilities.is_set (PublisherName) and (cfg.keywords_xlate['none'] ~= PublisherName) then -- general use parameter |publisher= not allowed in cite newsgroup
utilities.set_message ('err_parameter_ignored', {PublisherName_origin});
end
PublisherName = nil; -- ensure that this parameter is unset for the time being; will be used again after COinS
end
local URL = A['URL']; -- TODO: better way to do this for URL, ChapterURL, and MapURL?
local UrlAccess = is_valid_parameter_value (A['UrlAccess'], A:ORIGIN('UrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (URL) and utilities.is_set (UrlAccess) then
UrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', 'url');
end
local ChapterURL = A['ChapterURL'];
local ChapterUrlAccess = is_valid_parameter_value (A['ChapterUrlAccess'], A:ORIGIN('ChapterUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (ChapterURL) and utilities.is_set (ChapterUrlAccess) then
ChapterUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {A:ORIGIN('ChapterUrlAccess'):gsub ('%-access', '')});
end
local MapUrlAccess = is_valid_parameter_value (A['MapUrlAccess'], A:ORIGIN('MapUrlAccess'), cfg.keywords_lists['url-access'], nil);
if not utilities.is_set (A['MapURL']) and utilities.is_set (MapUrlAccess) then
MapUrlAccess = nil;
utilities.set_message ('err_param_access_requires_param', {'map-url'});
end
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local no_tracking_cats = is_valid_parameter_value (A['NoTracking'], A:ORIGIN('NoTracking'), cfg.keywords_lists['yes_true_y'], nil);
-- check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories
if not utilities.is_set (no_tracking_cats) then -- ignore if we are already not going to categorize this page
if cfg.uncategorized_namespaces[this_page.namespace] then -- is this page's namespace id one of the uncategorized namespace ids?
no_tracking_cats = "true"; -- set no_tracking_cats
end
for _, v in ipairs (cfg.uncategorized_subpages) do -- cycle through page name patterns
if this_page.text:match (v) then -- test page name against each pattern
no_tracking_cats = "true"; -- set no_tracking_cats
break; -- bail out if one is found
end
end
end
-- check for extra |page=, |pages= or |at= parameters. (also sheet and sheets while we're at it)
utilities.select_one (args, {'page', 'p', 'pp', 'pages', 'at', 'sheet', 'sheets'}, 'err_redundant_parameters'); -- this is a dummy call simply to get the error message and category
local coins_pages;
Page, Pages, At, coins_pages = insource_loc_get (Page, A:ORIGIN('Page'), Pages, A:ORIGIN('Pages'), At);
local NoPP = is_valid_parameter_value (A['NoPP'], A:ORIGIN('NoPP'), cfg.keywords_lists['yes_true_y'], nil);
if utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- both |publication-place= and |place= (|location=) allowed if different
utilities.add_prop_cat ('location-test'); -- add property cat to evaluate how often PublicationPlace and Place are used together
if PublicationPlace == Place then
Place = ''; -- unset; don't need both if they are the same
end
elseif not utilities.is_set (PublicationPlace) and utilities.is_set (Place) then -- when only |place= (|location=) is set ...
PublicationPlace = Place; -- promote |place= (|location=) to |publication-place
end
if PublicationPlace == Place then Place = ''; end -- don't need both if they are the same
local URL_origin = A:ORIGIN('URL'); -- get name of parameter that holds URL
local ChapterURL_origin = A:ORIGIN('ChapterURL'); -- get name of parameter that holds ChapterURL
local ScriptChapter = A['ScriptChapter'];
local ScriptChapter_origin = A:ORIGIN ('ScriptChapter');
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local TransChapter = A['TransChapter'];
local TransChapter_origin = A:ORIGIN ('TransChapter');
local TransTitle = A['TransTitle'];
local ScriptTitle = A['ScriptTitle'];
--[[
Parameter remapping for cite encyclopedia:
When the citation has these parameters:
|encyclopedia= and |title= then map |title= to |article= and |encyclopedia= to |title= for rendering
|encyclopedia= and |article= then map |encyclopedia= to |title= for rendering
|trans-title= maps to |trans-chapter= when |title= is re-mapped
|url= maps to |chapter-url= when |title= is remapped
All other combinations of |encyclopedia=, |title=, and |article= are not modified
]]
local Encyclopedia = A['Encyclopedia']; -- used as a flag by this module and by ~/COinS
local ScriptEncyclopedia = A['ScriptEncyclopedia'];
local TransEncyclopedia = A['TransEncyclopedia'];
if utilities.is_set (Encyclopedia) or utilities.is_set (ScriptEncyclopedia) then -- emit error message when Encyclopedia set but template is other than {{cite encyclopedia}} or {{citation}}
if 'encyclopaedia' ~= config.CitationClass and 'citation' ~= config.CitationClass then
if utilities.is_set (Encyclopedia) then
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('Encyclopedia')});
else
utilities.set_message ('err_parameter_ignored', {A:ORIGIN ('ScriptEncyclopedia')});
end
Encyclopedia = nil; -- unset these because not supported by this template
ScriptEncyclopedia = nil;
TransEncyclopedia = nil;
end
elseif utilities.is_set (TransEncyclopedia) then
utilities.set_message ('err_trans_missing_title', {'encyclopedia'});
end
if ('encyclopaedia' == config.CitationClass) or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Periodical) and utilities.is_set (Encyclopedia) then -- when both parameters set emit an error message; {{citation}} only; Periodical not allowed in {{cite encyclopedia}}
utilities.set_message ('err_periodical_ignored', {Periodical_origin});
end
if utilities.is_set (Encyclopedia) or utilities.is_set (ScriptEncyclopedia) then
Periodical = Encyclopedia; -- error or no, set Periodical to Encyclopedia for rendering; {{citation}} could (not legitimately) have both; use Encyclopedia
Periodical_origin = A:ORIGIN ('Encyclopedia');
ScriptPeriodical = ScriptEncyclopedia;
ScriptPeriodical_origin = A:ORIGIN ('ScriptEncyclopedia');
if utilities.is_set (Title) or utilities.is_set (ScriptTitle) then
if not utilities.is_set (Chapter) then
Chapter = Title; -- |encyclopedia= and |title= are set so map |title= params to |article= params for rendering
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle')
TransChapter = TransTitle;
ChapterURL = URL;
ChapterURL_origin = URL_origin;
ChapterUrlAccess = UrlAccess;
ChapterFormat = Format;
if not utilities.is_set (ChapterURL) and utilities.is_set (TitleLink) then
Chapter = utilities.make_wikilink (TitleLink, Chapter);
end
Title = Periodical; -- now map |encyclopedia= params to |title= params for rendering
ScriptTitle = ScriptPeriodical or '';
TransTitle = TransEncyclopedia or '';
Periodical = ''; -- redundant so unset
ScriptPeriodical = '';
URL = '';
Format = '';
TitleLink = '';
end
elseif utilities.is_set (Chapter) or utilities.is_set (ScriptChapter) then -- |title= not set
Title = Periodical; -- |encyclopedia= set and |article= set so map |encyclopedia= to |title= for rendering
ScriptTitle = ScriptPeriodical or '';
TransTitle = TransEncyclopedia or '';
Periodical = ''; -- redundant so unset
ScriptPeriodical = '';
end
end
end
-- special case for cite techreport.
local ID = A['ID'];
if (config.CitationClass == "techreport") then -- special case for cite techreport
if utilities.is_set (A['Number']) then -- cite techreport uses 'number', which other citations alias to 'issue'
if not utilities.is_set (ID) then -- can we use ID for the "number"?
ID = A['Number']; -- yes, use it
else -- ID has a value so emit error message
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'id') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'number')});
end
end
end
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
local ChapterLink -- = A['ChapterLink']; -- deprecated as a parameter but still used internally by cite episode
local Conference = A['Conference'];
local BookTitle = A['BookTitle'];
local TransTitle_origin = A:ORIGIN ('TransTitle');
if 'conference' == config.CitationClass then
if utilities.is_set (BookTitle) then
Chapter = Title;
Chapter_origin = 'title';
-- ChapterLink = TitleLink; -- |chapter-link= is deprecated
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
URL_origin = '';
ChapterFormat = Format;
TransChapter = TransTitle;
TransChapter_origin = TransTitle_origin;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
elseif 'speech' ~= config.CitationClass then
Conference = ''; -- not cite conference or cite speech so make sure this is empty string
end
-- CS1/2 mode
local Mode;
if cfg.global_cs1_config_t['Mode'] then -- global setting in {{cs1 config}} overrides local |mode= parameter value; nil when empty or assigned value invalid
Mode = is_valid_parameter_value (cfg.global_cs1_config_t['Mode'], 'cs1 config: mode', cfg.keywords_lists['mode'], ''); -- error messaging 'param' here is a hoax
else
Mode = is_valid_parameter_value (A['Mode'], A:ORIGIN('Mode'), cfg.keywords_lists['mode'], '');
end
if cfg.global_cs1_config_t['Mode'] and utilities.is_set (A['Mode']) then -- when template has |mode=<something> which global setting has overridden
utilities.set_message ('maint_overridden_setting'); -- set a maint message
end
-- separator character and postscript
local sepc, PostScript = set_style (Mode:lower(), A['PostScript'], config.CitationClass);
-- controls capitalization of certain static text
local use_lowercase = ( sepc == ',' );
-- cite map oddities
local Cartography = "";
local Scale = "";
local Sheet = A['Sheet'] or '';
local Sheets = A['Sheets'] or '';
if config.CitationClass == "map" then
if utilities.is_set (Chapter) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'map') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', Chapter_origin)}); -- add error message
end
Chapter = A['Map'];
Chapter_origin = A:ORIGIN('Map');
ChapterURL = A['MapURL'];
ChapterURL_origin = A:ORIGIN('MapURL');
TransChapter = A['TransMap'];
ScriptChapter = A['ScriptMap']
ScriptChapter_origin = A:ORIGIN('ScriptMap')
ChapterUrlAccess = MapUrlAccess;
ChapterFormat = A['MapFormat'];
Cartography = A['Cartography'];
if utilities.is_set ( Cartography ) then
Cartography = sepc .. " " .. wrap_msg ('cartography', Cartography, use_lowercase);
end
Scale = A['Scale'];
if utilities.is_set ( Scale ) then
Scale = sepc .. " " .. Scale;
end
end
-- Account for the oddities that are {{cite episode}} and {{cite serial}}, before generation of COinS data.
local Series = A['Series'];
if 'episode' == config.CitationClass or 'serial' == config.CitationClass then
local SeriesLink = A['SeriesLink'];
SeriesLink = link_title_ok (SeriesLink, A:ORIGIN ('SeriesLink'), Series, 'series'); -- check for wiki-markup in |series-link= or wiki-markup in |series= when |series-link= is set
local Network = A['Network'];
local Station = A['Station'];
local s, n = {}, {};
-- do common parameters first
if utilities.is_set (Network) then table.insert(n, Network); end
if utilities.is_set (Station) then table.insert(n, Station); end
ID = table.concat(n, sepc .. ' ');
if 'episode' == config.CitationClass then -- handle the oddities that are strictly {{cite episode}}
local Season = A['Season'];
local SeriesNumber = A['SeriesNumber'];
if utilities.is_set (Season) and utilities.is_set (SeriesNumber) then -- these are mutually exclusive so if both are set TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'season') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'seriesno')}); -- add error message
SeriesNumber = ''; -- unset; prefer |season= over |seriesno=
end
-- assemble a table of parts concatenated later into Series
if utilities.is_set (Season) then table.insert(s, wrap_msg ('season', Season, use_lowercase)); end
if utilities.is_set (SeriesNumber) then table.insert(s, wrap_msg ('seriesnum', SeriesNumber, use_lowercase)); end
if utilities.is_set (Issue) then table.insert(s, wrap_msg ('episode', Issue, use_lowercase)); end
Issue = ''; -- unset because this is not a unique parameter
Chapter = Title; -- promote title parameters to chapter
ScriptChapter = ScriptTitle;
ScriptChapter_origin = A:ORIGIN('ScriptTitle');
ChapterLink = TitleLink; -- alias |episode-link=
TransChapter = TransTitle;
ChapterURL = URL;
ChapterUrlAccess = UrlAccess;
ChapterURL_origin = URL_origin;
ChapterFormat = Format;
Title = Series; -- promote series to title
TitleLink = SeriesLink;
Series = table.concat(s, sepc .. ' '); -- this is concatenation of season, seriesno, episode number
if utilities.is_set (ChapterLink) and not utilities.is_set (ChapterURL) then -- link but not URL
Chapter = utilities.make_wikilink (ChapterLink, Chapter);
elseif utilities.is_set (ChapterLink) and utilities.is_set (ChapterURL) then -- if both are set, URL links episode;
Series = utilities.make_wikilink (ChapterLink, Series);
end
URL = ''; -- unset
TransTitle = '';
ScriptTitle = '';
Format = '';
else -- now oddities that are cite serial
Issue = ''; -- unset because this parameter no longer supported by the citation/core version of cite serial
Chapter = A['Episode']; -- TODO: make |episode= available to cite episode someday?
if utilities.is_set (Series) and utilities.is_set (SeriesLink) then
Series = utilities.make_wikilink (SeriesLink, Series);
end
Series = utilities.wrap_style ('italic-title', Series); -- series is italicized
end
end
-- end of {{cite episode}} stuff
-- handle type parameter for those CS1 citations that have default values
local TitleType = A['TitleType'];
local Degree = A['Degree'];
if utilities.in_array (config.CitationClass, {'AV-media-notes', 'document', 'interview', 'mailinglist', 'map', 'podcast', 'pressrelease', 'report', 'speech', 'techreport', 'thesis'}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if utilities.is_set (Degree) and "Thesis" == TitleType then -- special case for cite thesis
TitleType = Degree .. ' ' .. cfg.title_types ['thesis']:lower();
end
end
if utilities.is_set (TitleType) then -- if type parameter is specified
TitleType = utilities.substitute ( cfg.messages['type'], TitleType); -- display it in parentheses
-- TODO: Hack on TitleType to fix bunched parentheses problem
end
-- legacy: promote PublicationDate to Date if neither Date nor Year are set.
local Date = A['Date'];
local Date_origin; -- to hold the name of parameter promoted to Date; required for date error messaging
local PublicationDate = A['PublicationDate'];
local Year = A['Year'];
if not utilities.is_set (Date) then
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
if not utilities.is_set (Date) and utilities.is_set (PublicationDate) then -- use PublicationDate when |date= and |year= are not set
Date = PublicationDate; -- promote PublicationDate to Date
PublicationDate = ''; -- unset, no longer needed
Date_origin = A:ORIGIN('PublicationDate'); -- save the name of the promoted parameter
else
Date_origin = A:ORIGIN('Year'); -- save the name of the promoted parameter
end
else
Date_origin = A:ORIGIN('Date'); -- not a promotion; name required for error messaging
end
if PublicationDate == Date then PublicationDate = ''; end -- if PublicationDate is same as Date, don't display in rendered citation
--[[
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where
we get the date used in the metadata.
Date validation supporting code is in Module:Citation/CS1/Date_validation
]]
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], '');
if not utilities.is_set (DF) then
DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template
end
local ArchiveURL;
local ArchiveDate;
local ArchiveFormat = A['ArchiveFormat'];
local archive_url_timestamp; -- timestamp from wayback machine url
--#Added Block to add category for unarchived URLs
if utilities.is_set(URL) and not utilities.is_set(A['ArchiveURL']) and not wikidatacite
and not URL:match('//archive%.org/') -- no need for ArchiveURL if the URL is from archive cite! by User:Mr. Ibrahem
then
utilities.add_prop_cat ('no_archive');
end
ArchiveURL, ArchiveDate, archive_url_timestamp = archive_url_check (A['ArchiveURL'], A['ArchiveDate'])
ArchiveFormat = style_format (ArchiveFormat, ArchiveURL, 'archive-format', 'archive-url');
ArchiveURL, ArchiveDate = is_unique_archive_url (ArchiveURL, URL, ChapterURL, A:ORIGIN('ArchiveURL'), ArchiveDate); -- add error message when URL or ChapterURL == ArchiveURL
local AccessDate = A['AccessDate'];
local COinS_date = {}; -- holds date info extracted from |date= for the COinS metadata by Module:Date verification
local DoiBroken = A['DoiBroken'];
local Embargo = A['Embargo'];
local anchor_year; -- used in the CITEREF identifier
do -- create defined block to contain local variables error_message, date_parameters_list, mismatch
local error_message = '';
-- AirDate has been promoted to Date so not necessary to check it
local date_parameters_list = {
['access-date'] = {val = AccessDate, name = A:ORIGIN ('AccessDate')},
['archive-date'] = {val = ArchiveDate, name = A:ORIGIN ('ArchiveDate')},
['date'] = {val = Date, name = Date_origin},
['doi-broken-date'] = {val = DoiBroken, name = A:ORIGIN ('DoiBroken')},
['pmc-embargo-date'] = {val = Embargo, name = A:ORIGIN ('Embargo')},
['publication-date'] = {val = PublicationDate, name = A:ORIGIN ('PublicationDate')},
['year'] = {val = Year, name = A:ORIGIN ('Year')},
};
local error_list = {};
anchor_year, Embargo = validation.dates(date_parameters_list, COinS_date, error_list);
if utilities.is_set (Year) and utilities.is_set (Date) then -- both |date= and |year= not normally needed;
validation.year_date_check (Year, A:ORIGIN ('Year'), Date, A:ORIGIN ('Date'), error_list);
end
if 0 == #error_list then -- error free dates only; 0 when error_list is empty
local modified = false; -- flag
if utilities.is_set (DF) then -- if we need to reformat dates
modified = validation.reformat_dates (date_parameters_list, DF); -- reformat to DF format, use long month names if appropriate
end
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate
modified = true;
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category
end
-- for those wikis that can and want to have English date names translated to the local language; not supported at en.wiki
if cfg.date_name_auto_xlate_enable and validation.date_name_xlate (date_parameters_list, cfg.date_digit_auto_xlate_enable ) then
utilities.set_message ('maint_date_auto_xlated'); -- add maint cat
modified = true;
end
if modified then -- if the date_parameters_list values were modified
AccessDate = date_parameters_list['access-date'].val; -- overwrite date holding parameters with modified values
ArchiveDate = date_parameters_list['archive-date'].val;
Date = date_parameters_list['date'].val;
DoiBroken = date_parameters_list['doi-broken-date'].val;
PublicationDate = date_parameters_list['publication-date'].val;
end
if archive_url_timestamp and utilities.is_set (ArchiveDate) then
validation.archive_date_check (ArchiveDate, archive_url_timestamp, DF); -- does YYYYMMDD in archive_url_timestamp match date in ArchiveDate
end
else
utilities.set_message ('err_bad_date', {utilities.make_sep_list (#error_list, error_list)}); -- add this error message
end
end -- end of do
if utilities.in_array (config.CitationClass, {'book', 'encyclopaedia'}) or -- {{cite book}}, {{cite encyclopedia}}; TODO: {{cite conference}} and others?
('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) or -- {{citation}} as an encylopedia citation
('citation' == config.CitationClass and not utilities.is_set (Periodical)) then -- {{citation}} as a book citation
if utilities.is_set (PublicationPlace) then
if not utilities.is_set (PublisherName) then
local date = COinS_date.rftdate and tonumber (COinS_date.rftdate:match ('%d%d%d%d')); -- get year portion of COinS date (because in Arabic numerals); convert string to number
if date and (1850 <= date) then -- location has no publisher; if date is 1850 or later
utilities.set_message ('maint_location_no_publisher'); -- add maint cat
end
else -- PublisherName has a value
if cfg.keywords_xlate['none'] == PublisherName then -- if that value is 'none' (only for book and encyclopedia citations)
PublisherName = ''; -- unset
end
end
end
end
local ID_list = {}; -- sequence table of rendered identifiers
local ID_list_coins = {}; -- table of identifiers and their values from args; key is same as cfg.id_handlers's key
local Class = A['Class']; -- arxiv class identifier
local ID_support = {
{A['ASINTLD'], 'ASIN', 'err_asintld_missing_asin', A:ORIGIN ('ASINTLD')},
{DoiBroken, 'DOI', 'err_doibroken_missing_doi', A:ORIGIN ('DoiBroken')},
{Embargo, 'PMC', 'err_embargo_missing_pmc', A:ORIGIN ('Embargo')},
}
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class}, ID_support);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, {{cite ssrn}}, before generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- |arxiv= or |eprint= required for cite arxiv; |biorxiv=, |citeseerx=, |medrxiv=, |ssrn= required for their templates
if not (args[cfg.id_handlers[config.CitationClass:upper()].parameters[1]] or -- can't use ID_list_coins k/v table here because invalid parameters omitted
args[cfg.id_handlers[config.CitationClass:upper()].parameters[2]]) then -- which causes unexpected parameter missing error message
utilities.set_message ('err_' .. config.CitationClass .. '_missing'); -- add error message
end
Periodical = ({['arxiv'] = 'arXiv', ['biorxiv'] = 'bioRxiv', ['citeseerx'] = 'CiteSeerX', ['medrxiv'] = 'medRxiv', ['ssrn'] = 'Social Science Research Network'})[config.CitationClass];
end
-- Link the title of the work if no |url= was provided, but we have a |pmc= or a |doi= with |doi-access=free
if config.CitationClass == "journal" and not utilities.is_set (URL) and not utilities.is_set (TitleLink) and not utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) then -- TODO: remove 'none' once existing citations have been switched to 'off', so 'none' can be used as token for "no title" instead
if 'none' ~= cfg.keywords_xlate[auto_select] then -- if auto-linking not disabled
if identifiers.auto_link_urls[auto_select] then -- manual selection
URL = identifiers.auto_link_urls[auto_select]; -- set URL to be the same as identifier's external link
URL_origin = cfg.id_handlers[auto_select:upper()].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['pmc'] then -- auto-select PMC
URL = identifiers.auto_link_urls['pmc']; -- set URL to be the same as the PMC external link if not embargoed
URL_origin = cfg.id_handlers['PMC'].parameters[1]; -- set URL_origin to parameter name for use in error message if citation is missing a |title=
elseif identifiers.auto_link_urls['doi'] then -- auto-select DOI
URL = identifiers.auto_link_urls['doi'];
URL_origin = cfg.id_handlers['DOI'].parameters[1];
end
end
if utilities.is_set (URL) then -- set when using an identifier-created URL
if utilities.is_set (AccessDate) then -- |access-date= requires |url=; identifier-created URL is not |url=
--#Modified
utilities.set_message ('err_accessdate_missing_url', A:ORIGIN('AccessDate')); -- add an error message
AccessDate = ''; -- unset
end
if utilities.is_set (ArchiveURL) then -- |archive-url= requires |url=; identifier-created URL is not |url=
--#Modified
utilities.set_message ('err_archive_missing_url', {A:ORIGIN('ArchiveURL')}); -- add an error message
ArchiveURL = ''; -- unset
end
end
end
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not utilities.is_set (Title) and not utilities.is_set (TransTitle) and not utilities.is_set (ScriptTitle) then -- has special case for cite episode
--#Modified Block
utilities.set_message (wikidatacite and 'err_wikidata_citation_missing_title' or 'err_citation_missing_title', {'episode' == config.CitationClass and 'series' or 'title'});
end
if utilities.in_array (cfg.keywords_xlate[Title], {'off', 'none'}) and
utilities.in_array (config.CitationClass, {'journal', 'citation'}) and
(utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and
('journal' == Periodical_origin or 'script-journal' == ScriptPeriodical_origin) then -- special case for journal cites
Title = ''; -- set title to empty string
utilities.set_message ('maint_untitled'); -- add maint cat
end
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and utilities.is_set (Encyclopedia)) then
if utilities.is_set (Chapter) and utilities.is_set (Title) and utilities.is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
local coins_author = a; -- default for coins rft.au
if 0 < #c then -- but if contributor list
coins_author = c; -- use that instead
end
-- this is the function call to COinS()
local OCinSoutput = metadata.COinS({
['Periodical'] = utilities.strip_apostrophe_markup (Periodical), -- no markup in the metadata
['Encyclopedia'] = Encyclopedia, -- just a flag; content ignored by ~/COinS
['Chapter'] = metadata.make_coins_title (coins_chapter, ScriptChapter), -- Chapter and ScriptChapter stripped of bold / italic / accept-as-written markup
['Degree'] = Degree; -- cite thesis only
['Title'] = metadata.make_coins_title (coins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic / accept-as-written markup
['PublicationPlace'] = PublicationPlace,
['Date'] = COinS_date.rftdate, -- COinS_date.* has correctly formatted date values if Date is valid;
['Season'] = COinS_date.rftssn,
['Quarter'] = COinS_date.rftquarter,
['Chron'] = COinS_date.rftchron,
['Series'] = Series,
['Volume'] = Volume,
['Issue'] = Issue,
['ArticleNumber'] = ArticleNumber,
['Pages'] = coins_pages or metadata.get_coins_pages (first_set ({Sheet, Sheets, Page, Pages, At, QuotePage, QuotePages}, 7)), -- pages stripped of external links
['Edition'] = Edition,
['PublisherName'] = PublisherName or Newsgroup, -- any apostrophe markup already removed from PublisherName
['URL'] = first_set ({ChapterURL, URL}, 2),
['Authors'] = coins_author,
['ID_list'] = ID_list_coins,
['RawPage'] = this_page.prefixedText,
}, config.CitationClass);
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, and {{cite ssrn}} AFTER generation of COinS data.
if utilities.in_array (config.CitationClass, whitelist.preprint_template_list_t) then -- we have set rft.jtitle in COinS to arXiv, bioRxiv, CiteSeerX, medRxiv, or ssrn now unset so it isn't displayed
Periodical = ''; -- periodical not allowed in these templates; if article has been published, use cite journal
end
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include some static text
if 'newsgroup' == config.CitationClass and utilities.is_set (Newsgroup) then
PublisherName = utilities.substitute (cfg.messages['newsgroup'], external_link( 'news:' .. Newsgroup, Newsgroup, Newsgroup_origin, nil ));
end
local Editors;
local EditorCount; -- used only for choosing {ed.) or (eds.) annotation at end of editor name-list
local Contributors; -- assembled contributors name list
local contributor_etal;
local Translators; -- assembled translators name list
local translator_etal;
local t = {}; -- translators list from |translator-lastn= / translator-firstn= pairs
t = extract_names (args, 'TranslatorList'); -- fetch translator list from |translatorn= / |translator-lastn=, -firstn=, -linkn=, -maskn=
local Interviewers;
local interviewers_list = {};
interviewers_list = extract_names (args, 'InterviewerList'); -- process preferred interviewers parameters
local interviewer_etal;
-- Now perform various field substitutions.
-- We also add leading spaces and surrounding markup and punctuation to the
-- various parts of the citation, but only when they are non-nil.
do
local last_first_list;
local control = {
format = NameListStyle, -- empty string, '&', 'amp', 'and', or 'vanc'
maximum = nil, -- as if display-authors or display-editors not set
mode = Mode
};
do -- do editor name list first because the now unsupported coauthors used to modify control table
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayEditors'], A['DisplayEditors'], A:ORIGIN ('DisplayEditors'), #e);
control.maximum, editor_etal = get_display_names (display_names, #e, 'editors', editor_etal, param);
Editors, EditorCount = list_people (control, e, editor_etal);
if 1 == EditorCount and (true == editor_etal or 1 < #e) then -- only one editor displayed but includes etal then
EditorCount = 2; -- spoof to display (eds.) annotation
end
end
do -- now do interviewers
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayInterviewers'], A['DisplayInterviewers'], A:ORIGIN ('DisplayInterviewers'), #interviewers_list);
control.maximum, interviewer_etal = get_display_names (display_names, #interviewers_list, 'interviewers', interviewer_etal, param);
Interviewers = list_people (control, interviewers_list, interviewer_etal);
end
do -- now do translators
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayTranslators'], A['DisplayTranslators'], A:ORIGIN ('DisplayTranslators'), #t);
control.maximum, translator_etal = get_display_names (display_names, #t, 'translators', translator_etal, param);
Translators = list_people (control, t, translator_etal);
end
do -- now do contributors
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayContributors'], A['DisplayContributors'], A:ORIGIN ('DisplayContributors'), #c);
control.maximum, contributor_etal = get_display_names (display_names, #c, 'contributors', contributor_etal, param);
Contributors = list_people (control, c, contributor_etal);
end
do -- now do authors
local display_names, param = display_names_select (cfg.global_cs1_config_t['DisplayAuthors'], A['DisplayAuthors'], A:ORIGIN ('DisplayAuthors'), #a, author_etal);
control.maximum, author_etal = get_display_names (display_names, #a, 'authors', author_etal, param);
last_first_list = list_people (control, a, author_etal);
if utilities.is_set (Authors) then
Authors, author_etal = name_has_etal (Authors, author_etal, false, 'authors'); -- find and remove variations on et al.
if author_etal then
Authors = Authors .. ' ' .. cfg.messages['et al']; -- add et al. to authors parameter
end
else
Authors = last_first_list; -- either an author name list or an empty string
end
end -- end of do
if utilities.is_set (Authors) and utilities.is_set (Collaboration) then
Authors = Authors .. ' (' .. Collaboration .. ')'; -- add collaboration after et al.
end
end
local ConferenceFormat = A['ConferenceFormat'];
local ConferenceURL = A['ConferenceURL'];
ConferenceFormat = style_format (ConferenceFormat, ConferenceURL, 'conference-format', 'conference-url');
Format = style_format (Format, URL, 'format', 'url');
-- special case for chapter format so no error message or cat when chapter not supported
if not (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia))) then
ChapterFormat = style_format (ChapterFormat, ChapterURL, 'chapter-format', 'chapter-url');
end
if not utilities.is_set (URL) then
if utilities.in_array (config.CitationClass, {"web", "podcast", "mailinglist"}) or -- |url= required for cite web, cite podcast, and cite mailinglist
('citation' == config.CitationClass and ('website' == Periodical_origin or 'script-website' == ScriptPeriodical_origin)) then -- and required for {{citation}} with |website= or |script-website=
utilities.set_message ('err_cite_web_url');
end
-- do we have |accessdate= without either |url= or |chapter-url=?
if utilities.is_set (AccessDate) and not utilities.is_set (ChapterURL) then -- ChapterURL may be set when URL is not set;
--#Modified
utilities.set_message ('err_accessdate_missing_url', A:ORIGIN('AccessDate'));
AccessDate = '';
end
end
local UrlStatus = is_valid_parameter_value (A['UrlStatus'], A:ORIGIN('UrlStatus'), cfg.keywords_lists['url-status'], '');
local OriginalURL
local OriginalURL_origin
local OriginalFormat
local OriginalAccess;
UrlStatus = UrlStatus:lower(); -- used later when assembling archived text
if utilities.is_set ( ArchiveURL ) then
if utilities.is_set (ChapterURL) then -- if chapter-url= is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
OriginalURL_origin = ChapterURL_origin; -- name of |chapter-url= parameter for error messages
OriginalFormat = ChapterFormat; -- and original |chapter-format=
if 'live' ~= UrlStatus then
ChapterURL = ArchiveURL -- swap-in the archive's URL
ChapterURL_origin = A:ORIGIN('ArchiveURL') -- name of |archive-url= parameter for error messages
ChapterFormat = ArchiveFormat or ''; -- swap in archive's format
ChapterUrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
elseif utilities.is_set (URL) then
OriginalURL = URL; -- save copy of original source URL
OriginalURL_origin = URL_origin; -- name of URL parameter for error messages
OriginalFormat = Format; -- and original |format=
OriginalAccess = UrlAccess;
if 'live' ~= UrlStatus then -- if URL set then |archive-url= applies to it
URL = ArchiveURL -- swap-in the archive's URL
URL_origin = A:ORIGIN('ArchiveURL') -- name of archive URL parameter for error messages
Format = ArchiveFormat or ''; -- swap in archive's format
UrlAccess = nil; -- restricted access levels do not make sense for archived URLs
end
end
elseif utilities.is_set (UrlStatus) then -- if |url-status= is set when |archive-url= is not set
utilities.set_message ('maint_url_status'); -- add maint cat
end
--*******
if utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'pressrelease', 'podcast', 'newsgroup', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or -- if any of the 'periodical' cites except encyclopedia
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) then
local chap_param;
if utilities.is_set (Chapter) then -- get a parameter name from one of these chapter related meta-parameters
chap_param = A:ORIGIN ('Chapter')
elseif utilities.is_set (TransChapter) then
chap_param = A:ORIGIN ('TransChapter')
elseif utilities.is_set (ChapterURL) then
chap_param = A:ORIGIN ('ChapterURL')
elseif utilities.is_set (ScriptChapter) then
chap_param = ScriptChapter_origin;
else utilities.is_set (ChapterFormat)
chap_param = A:ORIGIN ('ChapterFormat')
end
if utilities.is_set (chap_param) then -- if we found one
utilities.set_message ('err_chapter_ignored', {chap_param}); -- add error message
Chapter = ''; -- and set them to empty string to be safe with concatenation
TransChapter = '';
ChapterURL = '';
ScriptChapter = '';
ChapterFormat = '';
end
else -- otherwise, format chapter / article title
local no_quotes = false; -- default assume that we will be quoting the chapter parameter value
if utilities.is_set (Contribution) and 0 < #c then -- if this is a contribution with contributor(s)
if utilities.in_array (Contribution:lower(), cfg.keywords_lists.contribution) then -- and a generic contribution title
no_quotes = true; -- then render it unquoted
end
end
Chapter = format_chapter_title (ScriptChapter, ScriptChapter_origin, Chapter, Chapter_origin, TransChapter, TransChapter_origin, ChapterURL, ChapterURL_origin, no_quotes, ChapterUrlAccess); -- Contribution is also in Chapter
if utilities.is_set (Chapter) then
Chapter = Chapter .. ChapterFormat ;
if 'map' == config.CitationClass and utilities.is_set (TitleType) then
Chapter = Chapter .. ' ' .. TitleType; -- map annotation here; not after title
end
Chapter = Chapter .. sepc .. ' ';
elseif utilities.is_set (ChapterFormat) then -- |chapter= not set but |chapter-format= is so ...
Chapter = ChapterFormat .. sepc .. ' '; -- ... ChapterFormat has error message, we want to see it
end
end
-- Format main title
local plain_title = false;
local accept_title;
Title, accept_title = utilities.has_accept_as_written (Title, true); -- remove accept-this-as-written markup when it wraps all of <Title>
if accept_title and ('' == Title) then -- only support forced empty for now "(())"
Title = cfg.messages['notitle']; -- replace by predefined "No title" message
-- TODO: utilities.set_message ( 'err_redundant_parameters', ...); -- issue proper error message instead of muting
ScriptTitle = ''; -- just mute for now
TransTitle = ''; -- just mute for now
plain_title = true; -- suppress text decoration for descriptive title
utilities.set_message ('maint_untitled'); -- add maint cat
end
if not accept_title then -- <Title> not wrapped in accept-as-written markup
if '...' == Title:sub (-3) then -- if ellipsis is the last three characters of |title=
Title = Title:gsub ('(%.%.%.)%.+$', '%1'); -- limit the number of dots to three
elseif not mw.ustring.find (Title, '%.%s*%a%.$') and -- end of title is not a 'dot-(optional space-)letter-dot' initialism ...
not mw.ustring.find (Title, '%s+%a%.$') then -- ...and not a 'space-letter-dot' initial (''Allium canadense'' L.)
Title = mw.ustring.gsub(Title, '%' .. sepc .. '$', ''); -- remove any trailing separator character; sepc and ms.ustring() here for languages that use multibyte separator characters
end
if utilities.is_set (ArchiveURL) and is_archived_copy (Title) then
utilities.set_message ('maint_archived_copy'); -- add maintenance category before we modify the content of Title
end
if is_generic ('generic_titles', Title) then
utilities.set_message ('err_generic_title'); -- set an error message
end
end
if (not plain_title) and (utilities.in_array (config.CitationClass, {'web', 'news', 'journal', 'magazine', 'document', 'pressrelease', 'podcast', 'newsgroup', 'mailinglist', 'interview', 'arxiv', 'biorxiv', 'citeseerx', 'medrxiv', 'ssrn'}) or
('citation' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)) and not utilities.is_set (Encyclopedia)) or
('map' == config.CitationClass and (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical)))) then -- special case for cite map when the map is in a periodical treat as an article
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from module provided quote marks
Title = utilities.wrap_style ('quoted-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle );
elseif plain_title or ('report' == config.CitationClass) then -- no styling for cite report and descriptive titles (otherwise same as above)
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = utilities.wrap_style ('italic-title', Title);
Title = script_concatenate (Title, ScriptTitle, 'script-title'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after title is wrapped
TransTitle = utilities.wrap_style ('trans-italic-title', TransTitle);
end
if utilities.is_set (TransTitle) then
if utilities.is_set (Title) then
TransTitle = " " .. TransTitle;
else
utilities.set_message ('err_trans_missing_title', {'title'});
end
end
if utilities.is_set (Title) then -- TODO: is this the right place to be making Wikisource URLs?
if utilities.is_set (TitleLink) and utilities.is_set (URL) then
utilities.set_message ('err_wikilink_in_url'); -- set an error message because we can't have both
TitleLink = ''; -- unset
end
if not utilities.is_set (TitleLink) and utilities.is_set (URL) then
Title = external_link (URL, Title, URL_origin, UrlAccess) .. TransTitle .. Format;
URL = ''; -- unset these because no longer needed
Format = "";
elseif utilities.is_set (TitleLink) and not utilities.is_set (URL) then
local ws_url;
ws_url = wikisource_url_make (TitleLink); -- ignore ws_label return; not used here
if ws_url then
Title = external_link (ws_url, Title .. ' ', 'ws link in title-link'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], TitleLink, Title});
Title = Title .. TransTitle;
else
Title = utilities.make_wikilink (TitleLink, Title) .. TransTitle;
end
else
local ws_url, ws_label, L; -- Title has italic or quote markup by the time we get here which causes is_wikilink() to return 0 (not a wikilink)
ws_url, ws_label, L = wikisource_url_make (Title:gsub('^[\'"]*(.-)[\'"]*$', '%1')); -- make ws URL from |title= interwiki link (strip italic or quote markup); link portion L becomes tooltip label
if ws_url then
Title = Title:gsub ('%b[]', ws_label); -- replace interwiki link with ws_label to retain markup
Title = external_link (ws_url, Title .. ' ', 'ws link in title'); -- space char after Title to move icon away from italic text; TODO: a better way to do this?
Title = utilities.substitute (cfg.presentation['interwiki-icon'], {cfg.presentation['class-wikisource'], L, Title});
Title = Title .. TransTitle;
else
Title = Title .. TransTitle;
end
end
else
Title = TransTitle;
end
if utilities.is_set (Place) then
Place = " " .. wrap_msg ('written', Place, use_lowercase) .. sepc .. " ";
end
local ConferenceURL_origin = A:ORIGIN('ConferenceURL'); -- get name of parameter that holds ConferenceURL
if utilities.is_set (Conference) then
if utilities.is_set (ConferenceURL) then
Conference = external_link( ConferenceURL, Conference, ConferenceURL_origin, nil );
end
Conference = sepc .. " " .. Conference .. ConferenceFormat;
elseif utilities.is_set (ConferenceURL) then
Conference = sepc .. " " .. external_link( ConferenceURL, nil, ConferenceURL_origin, nil );
end
local Position = '';
if not utilities.is_set (Position) then
local Minutes = A['Minutes'];
local Time = A['Time'];
if utilities.is_set (Minutes) then
if utilities.is_set (Time) then --TODO: make a function for this and similar?
utilities.set_message ('err_redundant_parameters', {utilities.wrap_style ('parameter', 'minutes') .. cfg.presentation['sep_list_pair'] .. utilities.wrap_style ('parameter', 'time')});
end
Position = " " .. Minutes .. " " .. cfg.messages['minutes'];
else
if utilities.is_set (Time) then
local TimeCaption = A['TimeCaption']
if not utilities.is_set (TimeCaption) then
TimeCaption = cfg.messages['event'];
--#Commented line
--if sepc ~= '.' then TimeCaption = TimeCaption:lower(); end
end
Position = " " .. TimeCaption .. " " .. Time;
end
end
else
Position = " " .. Position;
At = '';
end
Page, Pages, Sheet, Sheets = format_pages_sheets (Page, Pages, Sheet, Sheets, config.CitationClass, Periodical_origin, sepc, NoPP, use_lowercase);
At = utilities.is_set (At) and (sepc .. " " .. At) or "";
Position = utilities.is_set (Position) and (sepc .. " " .. Position) or "";
if config.CitationClass == 'map' then
local Sections = A['Sections']; -- Section (singular) is an alias of Chapter so set earlier
local Inset = A['Inset'];
if utilities.is_set ( Inset ) then
Inset = sepc .. " " .. wrap_msg ('inset', Inset, use_lowercase);
end
if utilities.is_set ( Sections ) then
Section = sepc .. " " .. wrap_msg ('sections', Sections, use_lowercase);
elseif utilities.is_set ( Section ) then
Section = sepc .. " " .. wrap_msg ('section', Section, use_lowercase);
end
At = At .. Inset .. Section;
end
local Others = A['Others'];
if utilities.is_set (Others) and 0 == #a and 0 == #e then -- add maint cat when |others= has value and used without |author=, |editor=
if config.CitationClass == "AV-media-notes"
or config.CitationClass == "audio-visual" then -- special maint for AV/M which has a lot of 'false' positives right now
utilities.set_message ('maint_others_avm')
else
utilities.set_message ('maint_others');
end
end
Others = utilities.is_set (Others) and (sepc .. " " .. Others) or "";
if utilities.is_set (Translators) then
Others = safe_join ({sepc .. ' ', wrap_msg ('translated', Translators, use_lowercase), Others}, sepc);
end
if utilities.is_set (Interviewers) then
Others = safe_join ({sepc .. ' ', wrap_msg ('interview', Interviewers, use_lowercase), Others}, sepc);
end
local TitleNote = A['TitleNote'];
TitleNote = utilities.is_set (TitleNote) and (sepc .. " " .. TitleNote) or "";
if utilities.is_set (Edition) then
if Edition:match ('%f[%a][Ee]d%n?%.?$') or Edition:match ('%f[%a][Ee]dition$') then -- Ed, ed, Ed., ed., Edn, edn, Edn., edn.
utilities.set_message ('err_extra_text_edition'); -- add error message
end
Edition = " " .. wrap_msg ('edition', Edition);
else
Edition = '';
end
Series = utilities.is_set (Series) and wrap_msg ('series', {sepc, Series}) or ""; -- not the same as SeriesNum
local Agency = A['Agency'] or ''; -- |agency= only supported in {{cite news}}, {{cite press release}}, {{cite web}} and certain {{citation}} templates
if utilities.is_set (Agency) then -- this testing done here because {{citation}} supports 'news' citations
if utilities.in_array (config.CitationClass, {'news', 'pressrelease', 'web'}) or ('citation' == config.CitationClass and utilities.in_array (Periodical_origin, {"newspaper", "work"})) then
Agency = wrap_msg ('agency', {sepc, Agency}); -- format for rendering
else
Agency = ''; -- unset; not supported
utilities.set_message ('err_parameter_ignored', {'agency'}); -- add error message
end
end
Volume = format_volume_issue (Volume, Issue, ArticleNumber, config.CitationClass, Periodical_origin, sepc, use_lowercase);
if utilities.is_set (AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
--#Commented line
--if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if mode is cs2, lower case
AccessDate = utilities.substitute (retrv_text, AccessDate); -- add retrieved text
AccessDate = utilities.substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
if utilities.is_set (ID) then ID = sepc .. " " .. ID; end
local Docket = A['Docket'];
if "thesis" == config.CitationClass and utilities.is_set (Docket) then
ID = sepc .. " Docket " .. Docket .. ID;
end
if "report" == config.CitationClass and utilities.is_set (Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
if utilities.is_set (URL) then
URL = " " .. external_link( URL, nil, URL_origin, UrlAccess );
end
local Quote = A['Quote'];
local TransQuote = A['TransQuote'];
local ScriptQuote = A['ScriptQuote'];
if utilities.is_set (Quote) or utilities.is_set (TransQuote) or utilities.is_set (ScriptQuote) then
if utilities.is_set (Quote) then
if Quote:sub(1, 1) == '"' and Quote:sub(-1, -1) == '"' then -- if first and last characters of quote are quote marks
Quote = Quote:sub(2, -2); -- strip them off
end
end
Quote = kern_quotes (Quote); -- kern if needed
Quote = utilities.wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
if utilities.is_set (ScriptQuote) then
Quote = script_concatenate (Quote, ScriptQuote, 'script-quote'); -- <bdi> tags, lang attribute, categorization, etc.; must be done after quote is wrapped
end
if utilities.is_set (TransQuote) then
if TransQuote:sub(1, 1) == '"' and TransQuote:sub(-1, -1) == '"' then -- if first and last characters of |trans-quote are quote marks
TransQuote = TransQuote:sub(2, -2); -- strip them off
end
Quote = Quote .. " " .. utilities.wrap_style ('trans-quoted-title', TransQuote );
end
if utilities.is_set (QuotePage) or utilities.is_set (QuotePages) then -- add page prefix
local quote_prefix = '';
if utilities.is_set (QuotePage) then
extra_text_in_page_check (QuotePage, 'quote-page'); -- add to maint cat if |quote-page= value begins with what looks like p., pp., etc.
if not NoPP then
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePage}), '', '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePage}), '', '', '';
end
elseif utilities.is_set (QuotePages) then
extra_text_in_page_check (QuotePages, 'quote-pages'); -- add to maint cat if |quote-pages= value begins with what looks like p., pp., etc.
if tonumber(QuotePages) ~= nil and not NoPP then -- if only digits, assume single page
quote_prefix = utilities.substitute (cfg.messages['p-prefix'], {sepc, QuotePages}), '', '';
elseif not NoPP then
quote_prefix = utilities.substitute (cfg.messages['pp-prefix'], {sepc, QuotePages}), '', '';
else
quote_prefix = utilities.substitute (cfg.messages['nopp'], {sepc, QuotePages}), '', '';
end
end
Quote = quote_prefix .. ": " .. Quote;
else
Quote = sepc .. " " .. Quote;
end
PostScript = ""; -- cs1|2 does not supply terminal punctuation when |quote= is set
end
-- We check length of PostScript here because it will have been nuked by
-- the quote parameters. We'd otherwise emit a message even if there wasn't
-- a displayed postscript.
-- TODO: Should the max size (1) be configurable?
-- TODO: Should we check a specific pattern?
if utilities.is_set(PostScript) and mw.ustring.len(PostScript) > 1 then
utilities.set_message ('maint_postscript')
end
local Archived;
if utilities.is_set (ArchiveURL) then
if not utilities.is_set (ArchiveDate) then -- ArchiveURL set but ArchiveDate not set
--#Modified
utilities.set_message ('err_archive_missing_date', {A:ORIGIN('ArchiveURL')});
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
else
if utilities.is_set (ArchiveDate) then -- ArchiveURL not set but ArchiveDate is set
utilities.set_message ('err_archive_date_missing_url'); -- emit an error message
ArchiveURL = ''; -- empty string for concatenation
ArchiveDate = ''; -- empty string for concatenation
end
end
if utilities.is_set (ArchiveURL) then
local arch_text;
if "live" == UrlStatus then
arch_text = cfg.messages['archived'];
--#Commented line
--if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. ' ' .. utilities.substitute ( cfg.messages['archived-live'],
{external_link( ArchiveURL, arch_text, A:ORIGIN('ArchiveURL'), nil) .. ArchiveFormat, ArchiveDate } );
else
Archived = '';
end
if not utilities.is_set (OriginalURL) then
--#Modified
utilities.set_message ('err_archive_missing_url', {A:ORIGIN('ArchiveURL')});
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (OriginalURL) then -- UrlStatus is empty, 'dead', 'unfit', 'usurped', 'bot: unknown'
if utilities.in_array (UrlStatus, {'unfit', 'usurped', 'bot: unknown'}) then
arch_text = cfg.messages['archived-unfit'];
--#Commented line
--if sepc ~= "." then arch_text = arch_text:lower() end
Archived = sepc .. ' ' .. arch_text .. ArchiveDate; -- format already styled
if 'bot: unknown' == UrlStatus then
utilities.set_message ('maint_bot_unknown'); -- and add a category if not already added
else
utilities.set_message ('maint_unfit'); -- and add a category if not already added
end
else -- UrlStatus is empty, 'dead'
arch_text = cfg.messages['archived-dead'];
--#Commented line
--if sepc ~= "." then arch_text = arch_text:lower() end
if utilities.is_set (ArchiveDate) then
Archived = sepc .. " " .. utilities.substitute ( arch_text,
{ external_link( OriginalURL, cfg.messages['original'], OriginalURL_origin, OriginalAccess ) .. OriginalFormat, ArchiveDate } ); -- format already styled
else
Archived = ''; -- unset for concatenation
end
end
else -- OriginalUrl not set
--#Modified
utilities.set_message ('err_archive_missing_url', {A:ORIGIN('ArchiveURL')});
Archived = ''; -- empty string for concatenation
end
elseif utilities.is_set (ArchiveFormat) then
Archived = ArchiveFormat; -- if set and ArchiveURL not set ArchiveFormat has error message
else
Archived = '';
end
local TranscriptURL = A['TranscriptURL']
local TranscriptFormat = A['TranscriptFormat'];
TranscriptFormat = style_format (TranscriptFormat, TranscriptURL, 'transcript-format', 'transcripturl');
local Transcript = A['Transcript'];
local TranscriptURL_origin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
if utilities.is_set (Transcript) then
if utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, Transcript, TranscriptURL_origin, nil );
end
Transcript = sepc .. ' ' .. Transcript .. TranscriptFormat;
elseif utilities.is_set (TranscriptURL) then
Transcript = external_link( TranscriptURL, nil, TranscriptURL_origin, nil );
end
local Publisher;
if utilities.is_set (PublicationDate) then
PublicationDate = wrap_msg ('published', PublicationDate);
end
if utilities.is_set (PublisherName) then
if utilities.is_set (PublicationPlace) then
Publisher = sepc .. " " .. PublicationPlace .. ": " .. PublisherName .. PublicationDate;
else
Publisher = sepc .. " " .. PublisherName .. PublicationDate;
end
elseif utilities.is_set (PublicationPlace) then
Publisher= sepc .. " " .. PublicationPlace .. PublicationDate;
else
Publisher = PublicationDate;
end
-- Several of the above rely upon detecting this as nil, so do it last.
if (utilities.is_set (Periodical) or utilities.is_set (ScriptPeriodical) or utilities.is_set (TransPeriodical)) then
if utilities.is_set (Title) or utilities.is_set (TitleNote) then
Periodical = sepc .. " " .. format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
else
Periodical = format_periodical (ScriptPeriodical, ScriptPeriodical_origin, Periodical, TransPeriodical, TransPeriodical_origin);
end
end
local Language = A['Language'];
if utilities.is_set (Language) then
Language = language_parameter (Language); -- format, categories, name from ISO639-1, etc.
else
Language=''; -- language not specified so make sure this is an empty string;
--[[ TODO: need to extract the wrap_msg from language_parameter
so that we can solve parentheses bunching problem with Format/Language/TitleType
]]
end
--[[
Handle the oddity that is cite speech. This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be " (Speech)" so that
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).
]]
if "speech" == config.CitationClass then -- cite speech only
TitleNote = TitleType; -- move TitleType to TitleNote so that it renders ahead of |event=
TitleType = ''; -- and unset
if utilities.is_set (Periodical) then -- if Periodical, perhaps because of an included |website= or |journal= parameter
if utilities.is_set (Conference) then -- and if |event= is set
Conference = Conference .. sepc .. " "; -- then add appropriate punctuation to the end of the Conference variable before rendering
end
end
end
-- Piece all bits together at last. Here, all should be non-nil.
-- We build things this way because it is more efficient in LUA
-- not to keep reassigning to the same string variable over and over.
local tcommon;
local tcommon2; -- used for book cite when |contributor= is set
if utilities.in_array (config.CitationClass, {"book", "citation"}) and not utilities.is_set (Periodical) then -- special cases for book cites
if utilities.is_set (Contributors) then -- when we are citing foreword, preface, introduction, etc.
tcommon = safe_join ({Title, TitleNote}, sepc); -- author and other stuff will come after this and before tcommon2
--#Mdified Arabic style make vol last
tcommon2 = safe_join({TitleType, Series, Language, Others, Edition, Publisher, Volume}, sepc);
else
--#Mdified Arabic style make vol last
tcommon = safe_join( {Title, TitleNote, TitleType, Series, Language, Others, Edition, Publisher, Volume}, sepc);
end
elseif 'map' == config.CitationClass then -- special cases for cite map
if utilities.is_set (Chapter) then -- map in a book; TitleType is part of Chapter
tcommon = safe_join ({Title, Edition, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc);
elseif utilities.is_set (Periodical) then -- map in a periodical
tcommon = safe_join ({Title, TitleType, Periodical, Scale, Series, Language, Cartography, Others, Publisher, Volume}, sepc);
else -- a sheet or stand-alone map
tcommon = safe_join ({Title, TitleType, Edition, Scale, Series, Language, Cartography, Others, Publisher}, sepc);
end
elseif 'episode' == config.CitationClass then -- special case for cite episode
tcommon = safe_join ({Title, TitleNote, TitleType, Series, Language, Edition, Publisher}, sepc);
else -- all other CS1 templates
--#Mdified Arabic style make vol last
tcommon = safe_join ({Title, TitleNote, Conference, Periodical, TitleType, Series, Language, Others, Edition, Publisher, Agency, Volume}, sepc);
end
if #ID_list > 0 then
ID_list = safe_join( { sepc .. " ", table.concat( ID_list, sepc .. " " ), ID }, sepc );
else
ID_list = ID;
end
local Via = A['Via'];
Via = utilities.is_set (Via) and wrap_msg ('via', Via) or '';
local idcommon;
if 'audio-visual' == config.CitationClass or 'episode' == config.CitationClass then -- special case for cite AV media & cite episode position transcript
idcommon = safe_join( { ID_list, URL, Archived, Transcript, AccessDate, Via, Quote }, sepc );
else
idcommon = safe_join( { ID_list, URL, Archived, AccessDate, Via, Quote }, sepc );
end
local text;
local pgtext = Position .. Sheet .. Sheets .. Page .. Pages .. At;
local OrigDate = A['OrigDate'];
OrigDate = utilities.is_set (OrigDate) and wrap_msg ('origdate', OrigDate) or '';
if utilities.is_set (Date) then
if utilities.is_set (Authors) or utilities.is_set (Editors) then -- date follows authors or editors when authors not set
Date = " (" .. Date .. ")" .. OrigDate .. sepc .. " "; -- in parentheses
else -- neither of authors and editors set
if (string.sub(tcommon, -1, -1) == sepc) then -- if the last character of tcommon is sepc
Date = " " .. Date .. OrigDate; -- Date does not begin with sepc
else
Date = sepc .. " " .. Date .. OrigDate; -- Date begins with sepc
end
end
end
if utilities.is_set (Authors) then
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Authors termination
Authors = terminate_name_list (Authors, sepc); -- when no date, terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Editors) then
local in_text = '';
local post_text = '';
if utilities.is_set (Chapter) and 0 == #c then
in_text = cfg.messages['in'] .. ' ';
--#Modified Commented Bock
-- if (sepc ~= '.') then
-- in_text = in_text:lower(); -- lowercase for cs2
-- end
end
if EditorCount <= 1 then
post_text = ' (' .. cfg.messages['editor'] .. ')'; -- be consistent with no-author, no-date case
else
post_text = ' (' .. cfg.messages['editors'] .. ')';
end
Editors = terminate_name_list (in_text .. Editors .. post_text, sepc); -- terminate with 0 or 1 sepc and a space
end
if utilities.is_set (Contributors) then -- book cite and we're citing the intro, preface, etc.
local by_text = sepc .. ' ' .. cfg.messages['by'] .. ' ';
--#Modified Commented Line
--if (sepc ~= '.') then by_text = by_text:lower() end -- lowercase for cs2
Authors = by_text .. Authors; -- author follows title so tweak it here
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 and a space
end
if (not utilities.is_set (Date)) then -- when date is set it's in parentheses; no Contributors termination
Contributors = terminate_name_list (Contributors, sepc); -- terminate with 0 or 1 sepc and a space
end
text = safe_join( {Contributors, Date, Chapter, tcommon, Authors, Place, Editors, tcommon2, pgtext, idcommon }, sepc );
else
text = safe_join( {Authors, Date, Chapter, Place, Editors, tcommon, pgtext, idcommon }, sepc );
end
elseif utilities.is_set (Editors) then
if utilities.is_set (Date) then
if EditorCount <= 1 then
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editor'];
else
Editors = Editors .. cfg.presentation['sep_name'] .. cfg.messages['editors'];
end
else
if EditorCount <= 1 then
Editors = Editors .. " (" .. cfg.messages['editor'] .. ")" .. sepc .. " "
else
Editors = Editors .. " (" .. cfg.messages['editors'] .. ")" .. sepc .. " "
end
end
text = safe_join( {Editors, Date, Chapter, Place, tcommon, pgtext, idcommon}, sepc );
else
if utilities.in_array (config.CitationClass, {"journal", "citation"}) and utilities.is_set (Periodical) then
text = safe_join( {Chapter, Place, tcommon, pgtext, Date, idcommon}, sepc );
else
text = safe_join( {Chapter, Place, tcommon, Date, pgtext, idcommon}, sepc );
end
end
if utilities.is_set (PostScript) and PostScript ~= sepc then
text = safe_join( {text, sepc}, sepc ); -- Deals with italics, spaces, etc.
if '.' == sepc then -- remove final seperator if present
text = text:gsub ('%' .. sepc .. '$', ''); -- dot must be escaped here
else
text = mw.ustring.gsub (text, sepc .. '$', ''); -- using ustring for non-dot sepc (likely a non-Latin character)
end
end
text = safe_join( {text, PostScript}, sepc );
-- Now enclose the whole thing in a <cite> element
local options_t = {};
options_t.class = cite_class_attribute_make (config.CitationClass, Mode);
local Ref = is_valid_parameter_value (A['Ref'], A:ORIGIN('Ref'), cfg.keywords_lists['ref'], nil, true); -- nil when |ref=harv; A['Ref'] else
--#Added Block auto add CITEREF
if Ref and mw.ustring.sub(Ref,1,7) ~= 'CITEREF' then
Ref = 'CITEREF' .. Ref
end
if 'none' ~= cfg.keywords_xlate[(Ref and Ref:lower()) or ''] then
local namelist_t = {}; -- holds selected contributor, author, editor name list
local year = first_set ({Year, anchor_year}, 2); -- Year first for legacy citations and for YMD dates that require disambiguation
if #c > 0 then -- if there is a contributor list
namelist_t = c; -- select it
elseif #a > 0 then -- or an author list
namelist_t = a;
elseif #e > 0 then -- or an editor list
namelist_t = e;
end
local citeref_id;
if #namelist_t > 0 then -- if there are names in namelist_t
citeref_id = make_citeref_id (namelist_t, year); -- go make the CITEREF anchor
if mw.uri.anchorEncode (citeref_id) == ((Ref and mw.uri.anchorEncode (Ref)) or '') then -- Ref may already be encoded (by {{sfnref}}) so citeref_id must be encoded before comparison
utilities.set_message ('maint_ref_duplicates_default');
end
else
citeref_id = ''; -- unset
end
options_t.id = Ref or citeref_id;
end
if string.len (text:gsub('%b<>', '')) <= 2 then -- remove html and html-like tags; then get length of what remains;
z.error_cats_t = {}; -- blank the categories list
z.error_msgs_t = {}; -- blank the error messages list
OCinSoutput = nil; -- blank the metadata string
text = ''; -- blank the the citation
utilities.set_message ('err_empty_citation'); -- set empty citation message and category
end
local render_t = {}; -- here we collect the final bits for concatenation into the rendered citation
if utilities.is_set (options_t.id) then -- here we wrap the rendered citation in <cite ...>...</cite> tags
table.insert (render_t, utilities.substitute (cfg.presentation['cite-id'], {mw.uri.anchorEncode(options_t.id), mw.text.nowiki(options_t.class), text})); -- when |ref= is set or when there is a namelist
else
table.insert (render_t, utilities.substitute (cfg.presentation['cite'], {mw.text.nowiki(options_t.class), text})); -- when |ref=none or when namelist_t empty and |ref= is missing or is empty
end
if OCinSoutput then -- blanked when citation is 'empty' so don't bother to add boilerplate metadata span
table.insert (render_t, utilities.substitute (cfg.presentation['ocins'], OCinSoutput)); -- format and append metadata to the citation
end
local template_name = ('citation' == config.CitationClass) and 'citation' or 'cite ' .. (cfg.citation_class_map_t[config.CitationClass] or config.CitationClass);
--#Added line
template_name = cfg.ar_temps_names[template_name:lower()] or template_name
local template_link = '[[قالب:' .. template_name .. '|' .. template_name .. ']]';
local msg_prefix = '<code class="cs1-code">{{' .. template_link .. '}}</code>: ';
if 0 ~= #z.error_msgs_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_e, template_link));
table.insert (render_t, ' '); -- insert a space between citation and its error messages
table.sort (z.error_msgs_t); -- sort the error messages list; sorting includes wrapping <span> and <code> tags; hidden-error sorts ahead of visible-error
local hidden = true; -- presume that the only error messages emited by this template are hidden
for _, v in ipairs (z.error_msgs_t) do -- spin through the list of error messages
if v:find ('cs1-visible-error', 1, true) then -- look for the visible error class name
hidden = false; -- found one; so don't hide the error message prefix
break; -- and done because no need to look further
end
end
z.error_msgs_t[1] = table.concat ({utilities.error_comment (msg_prefix, hidden), z.error_msgs_t[1]}); -- add error message prefix to first error message to prevent extraneous punctuation
--#Modified
table.insert (render_t, utilities.make_sep_error_list(#z.error_msgs_t, z.error_msgs_t)); -- make a big string of error messages and add it to the rendering
end
if 0 ~= #z.maint_cats_t then
mw.addWarning (utilities.substitute (cfg.messages.warning_msg_m, template_link));
table.sort (z.maint_cats_t); -- sort the maintenance messages list
local maint_msgs_t = {}; -- here we collect all of the maint messages
if 0 == #z.error_msgs_t then -- if no error messages
table.insert (maint_msgs_t, msg_prefix); -- insert message prefix in maint message livery
end
for _, v in ipairs( z.maint_cats_t ) do -- append maintenance categories
table.insert (maint_msgs_t, -- assemble new maint message and add it to the maint_msgs_t table
table.concat ({v, ' (', utilities.substitute (cfg.messages[':cat wikilink'], v), ')'})
);
end
table.insert (render_t, utilities.substitute (cfg.presentation['hidden-maint'], table.concat (maint_msgs_t, ' '))); -- wrap the group of maint messages with proper presentation and save
end
if not no_tracking_cats then
local sort_key;
local cat_wikilink = 'cat wikilink';
if cfg.enable_sort_keys then -- when namespace sort keys enabled
local namespace_number = mw.title.getCurrentTitle().namespace; -- get namespace number for this wikitext
sort_key = (0 ~= namespace_number and (cfg.name_space_sort_keys[namespace_number] or cfg.name_space_sort_keys.other)) or nil; -- get sort key character; nil for mainspace
cat_wikilink = (not sort_key and 'cat wikilink') or 'cat wikilink sk'; -- make <cfg.messages> key
end
for _, v in ipairs (z.error_cats_t) do -- append error categories
table.insert (render_t, utilities.substitute (cfg.messages[cat_wikilink], {v, sort_key}));
end
for _, v in ipairs (z.maint_cats_t) do -- append maintenance categories
table.insert (render_t, utilities.substitute (cfg.messages[cat_wikilink], {v, sort_key}));
end
for _, v in ipairs (z.prop_cats_t) do -- append properties categories
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v)); -- no sort keys
end
end
return table.concat (render_t); -- make a big string and done
end
--[[--------------------------< V A L I D A T E >--------------------------------------------------------------
Looks for a parameter's name in one of several whitelists.
Parameters in the whitelist can have three values:
true - active, supported parameters
false - deprecated, supported parameters
nil - unsupported parameters
]]
local function validate (name, cite_class, empty)
local name = tostring (name);
local enum_name; -- parameter name with enumerator (if any) replaced with '#'
local state;
local function state_test (state, name) -- local function to do testing of state values
if true == state then return true; end -- valid actively supported parameter
if false == state then
if empty then return nil; end -- empty deprecated parameters are treated as unknowns
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
if 'tracked' == state then
local base_name = name:gsub ('%d', ''); -- strip enumerators from parameter names that have them to get the base name
utilities.add_prop_cat ('tracked-param', {base_name}, base_name); -- add a properties category; <base_name> modifies <key>
return true;
end
return nil;
end
if name:find ('#') then -- # is a cs1|2 reserved character so parameters with # not permitted
return nil;
end
-- replace wnumerator digit(s) with # (|last25= becomes |last#=) (mw.ustring because non-Western 'local' digits)
enum_name = mw.ustring.gsub (name, '%d+$', '#'); -- where enumerator is last charaters in parameter name (these to protect |s2cid=)
enum_name = mw.ustring.gsub (enum_name, '%d+([%-l])', '#%1'); -- where enumerator is in the middle of the parameter name; |author#link= is the oddity
if 'document' == cite_class then -- special case for {{cite document}}
state = whitelist.document_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false;
end
if utilities.in_array (cite_class, whitelist.preprint_template_list_t) then -- limited parameter sets allowed for these templates
state = whitelist.limited_parameters_t[enum_name]; -- this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
state = whitelist.preprint_arguments_t[cite_class][name]; -- look in the parameter-list for the template identified by cite_class
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end -- end limited parameter-set templates
if utilities.in_array (cite_class, whitelist.unique_param_template_list_t) then -- template-specific parameters for templates that accept parameters from the basic argument list
state = whitelist.unique_arguments_t[cite_class][name]; -- look in the template-specific parameter-lists for the template identified by cite_class
if true == state_test (state, name) then return true; end
end -- if here, fall into general validation
state = whitelist.common_parameters_t[enum_name]; -- all other templates; all normal parameters allowed; this list holds enumerated and nonenumerated parameters
if true == state_test (state, name) then return true; end
return false; -- not supported because not found or name is set to nil
end
--[=[-------------------------< I N T E R _ W I K I _ C H E C K >----------------------------------------------
check <value> for inter-language interwiki-link markup. <prefix> must be a MediaWiki-recognized language
code. when these values have the form (without leading colon):
[[<prefix>:link|label]] return label as plain-text
[[<prefix>:link]] return <prefix>:link as plain-text
return value as is else
]=]
local function inter_wiki_check (parameter, value)
local prefix = value:match ('%[%[(%a+):'); -- get an interwiki prefix if one exists
local _;
if prefix and cfg.inter_wiki_map[prefix:lower()] then -- if prefix is in the map, needs preceding colon so
utilities.set_message ('err_bad_paramlink', parameter); -- emit an error message
_, value, _ = utilities.is_wikilink (value); -- extract label portion from wikilink
end
return value;
end
--[[--------------------------< M I S S I N G _ P I P E _ C H E C K >------------------------------------------
Look at the contents of a parameter. If the content has a string of characters and digits followed by an equal
sign, compare the alphanumeric string to the list of cs1|2 parameters. If found, then the string is possibly a
parameter that is missing its pipe. There are two tests made:
{{cite ... |title=Title access-date=2016-03-17}} -- the first parameter has a value and whitespace separates that value from the missing pipe parameter name
{{cite ... |title=access-date=2016-03-17}} -- the first parameter has no value (whitespace after the first = is trimmed by MediaWiki)
cs1|2 shares some parameter names with XML/HTML attributes: class=, title=, etc. To prevent false positives XML/HTML
tags are removed before the search.
If a missing pipe is detected, this function adds the missing pipe maintenance category.
]]
local function missing_pipe_check (parameter, value)
local capture;
value = value:gsub ('%b<>', ''); -- remove XML/HTML tags because attributes: class=, title=, etc.
capture = value:match ('%s+(%a[%w%-]+)%s*=') or value:match ('^(%a[%w%-]+)%s*='); -- find and categorize parameters with possible missing pipes
if capture and validate (capture) then -- if the capture is a valid parameter name
utilities.set_message ('err_missing_pipe', parameter);
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ P U N C T >--------------------------------------
look for extraneous terminal punctuation in most parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_punc (param, value)
if 'number' == type (param) then
return;
end
param = param:gsub ('%d+', '#'); -- enumerated name-list mask params allow terminal punct; normalize
if cfg.punct_skip[param] then
return; -- parameter name found in the skip table so done
end
if value:match ('[,;:]$') then
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
if value:match ('^=') then -- sometimes an extraneous '=' character appears ...
utilities.set_message ('maint_extra_punct'); -- has extraneous punctuation; add maint cat
end
end
--[[--------------------------< H A S _ E X T R A N E O U S _ U R L >------------------------------------------
look for extraneous url parameter values; parameters listed in skip table are not checked
]]
local function has_extraneous_url (url_param_t)
local url_error_t = {};
check_for_url (url_param_t, url_error_t); -- extraneous url check
if 0 ~= #url_error_t then -- non-zero when there are errors
table.sort (url_error_t);
utilities.set_message ('err_param_has_ext_link', {utilities.make_sep_list (#url_error_t, url_error_t)}); -- add this error message
end
end
--[[--------------------------< C I T A T I O N >--------------------------------------------------------------
This is used by templates such as {{cite book}} to create the actual citation text.
]]
local function _citation(frame, allargs, config)
if not frame then
frame = mw.getCurrentFrame(); -- if called from another module, get a frame for frame-provided functions
end
local args = {};
--#Modified line
local sandbox = ((config.SandboxPath and '' ~= config.SandboxPath) and config.SandboxPath) or '/ملعب'; -- sandbox path from {{#invoke:Citation/CS1/sandbox|citation|SandboxPath=/...}}
is_sandbox = nil ~= string.find (frame:getTitle(), sandbox, 1, true); -- is this invoke the sandbox module?
sandbox = is_sandbox and sandbox or ''; -- use i18n sandbox to load sandbox modules when this module is the sandox; live modules else
local styles;
--#Added for ltr
local tmp_cfg;
tmp_cfg = mw.loadData ('Module:Citation/CS1/Configuration' .. sandbox); -- load sandbox versions of support modules when {{#invoke:Citation/CS1/sandbox|...}}; live modules else
whitelist = mw.loadData ('Module:Citation/CS1/Whitelist' .. sandbox);
utilities = require ('Module:Citation/CS1/Utilities' .. sandbox);
validation = require ('Module:Citation/CS1/Date_validation' .. sandbox);
identifiers = require ('Module:Citation/CS1/Identifiers' .. sandbox);
metadata = require ('Module:Citation/CS1/COinS' .. sandbox);
styles = 'Module:Citation/CS1' .. sandbox .. '/styles.css';
--#Added block for ltr
for k,v in pairs(tmp_cfg) do
cfg[k] = v
end
utilities.set_selected_modules (cfg); -- so that functions in Utilities can see the selected cfg tables
identifiers.set_selected_modules (cfg, utilities); -- so that functions in Identifiers can see the selected cfg tables and selected Utilities module
validation.set_selected_modules (cfg, utilities); -- so that functions in Date validataion can see selected cfg tables and the selected Utilities module
metadata.set_selected_modules (cfg, utilities); -- so that functions in COinS can see the selected cfg tables and selected Utilities module
z = utilities.z; -- table of error and category tables in Module:Citation/CS1/Utilities
is_preview_mode = not utilities.is_set (frame:preprocess ('{{REVISIONID}}'));
--local args = {}; -- table where we store all of the template's arguments
local suggestions = {}; -- table where we store suggestions if we need to loadData them
local error_text; -- used as a flag
--#Added block for filtering some parameters
if allargs['wikidatacite'] == '1' then
wikidatacite = true
allargs['wikidatacite'] = nil
end
---------------------
--#Added block for ltr
local ch_lang = allargs['اللغة'] or allargs['لغة'] or allargs['language'] or allargs['lang']
--# Added by Mr. Ibrahem to stop ltr formatting
local no_ltr = allargs['noltr']
if ch_lang and ch_lang ~= '' and no_ltr == nil then
local isltr = true
local rtl_lang = {
'ar', 'العربية', 'arabic',
'fa', 'الفارسية', 'persian',
'ur', 'urdu', 'الأردية',
'ku', 'kurdish', 'الكردية',
'he', 'hebrew',
'arc', 'aramaic',
'dv', 'divehi',
'ha', 'hausa',
'khw', 'khowar',
'ks', 'kashmiri',
'ps', 'pashto',
'yi', 'yiddish',
'ota', -- تركية عثمانية
}
local ch_langs = mw.text.split(ch_lang, '[,، ]')
for k, v in pairs(ch_langs) do
for k2, v2 in pairs(rtl_lang) do
if (mw.ustring.lower(v) == v2) then
isltr = false
break
end
end
if (not isltr) then break end
end
if isltr then
local cfg2
cfg2 = mw.loadData('Module:Citation/CS1/Configuration ltr' .. sandbox);
for k, v in pairs(cfg2) do
cfg[k] = v
end
end
end
----------------------
local capture; -- the single supported capture when matching unknown parameters using patterns
local empty_unknowns = {}; -- sequence table to hold empty unknown params for error message listing
for k, v in pairs( allargs ) do -- get parameters from the parent (template) frame
v = mw.ustring.gsub (v, '^%s*(.-)%s*$', '%1'); -- trim leading/trailing whitespace; when v is only whitespace, becomes empty string
if v ~= '' then
if ('string' == type (k)) then
k = mw.ustring.gsub (k, '%d', cfg.date_names.local_digits); -- for enumerated parameters, translate 'local' digits to Western 0-9
end
if not validate( k, config.CitationClass ) then
if type (k) ~= 'string' then -- exclude empty numbered parameters
if v:match("%S+") ~= nil then
error_text = utilities.set_message ('err_text_ignored', {v});
end
elseif validate (k:lower(), config.CitationClass) then
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, k:lower()}); -- suggest the lowercase version of the parameter
else
if nil == suggestions.suggestions then -- if this table is nil then we need to load it
suggestions = mw.loadData ('Module:Citation/CS1/Suggestions' .. sandbox); --load sandbox version of suggestion module when {{#invoke:Citation/CS1/sandbox|...}}; live module else
end
for pattern, param in pairs (suggestions.patterns) do -- loop through the patterns to see if we can suggest a proper parameter
capture = k:match (pattern); -- the whole match if no capture in pattern else the capture if a match
if capture then -- if the pattern matches
param = utilities.substitute (param, capture); -- add the capture to the suggested parameter (typically the enumerator)
if validate (param, config.CitationClass) then -- validate the suggestion to make sure that the suggestion is supported by this template (necessary for limited parameter lists)
error_text = utilities.set_message ('err_parameter_ignored_suggest', {k, param}); -- set the suggestion error message
else
error_text = utilities.set_message ('err_parameter_ignored', {k}); -- suggested param not supported by this template
v = ''; -- unset
end
end
end
if not utilities.is_set (error_text) then -- couldn't match with a pattern, is there an explicit suggestion?
if (suggestions.suggestions[ k:lower() ] ~= nil) and validate (suggestions.suggestions[ k:lower() ], config.CitationClass) then
utilities.set_message ('err_parameter_ignored_suggest', {k, suggestions.suggestions[ k:lower() ]});
else
utilities.set_message ('err_parameter_ignored', {k});
v = ''; -- unset value assigned to unrecognized parameters (this for the limited parameter lists)
end
end
end
end
args[k] = v; -- save this parameter and its value
elseif not utilities.is_set (v) then -- for empty parameters
if not validate (k, config.CitationClass, true) then -- is this empty parameter a valid parameter
k = ('' == k) and '(empty string)' or k; -- when k is empty string (or was space(s) trimmed to empty string), replace with descriptive text
table.insert (empty_unknowns, utilities.wrap_style ('parameter', k)); -- format for error message and add to the list
end
-- crude debug support that allows us to render a citation from module {{#invoke:}} TODO: keep?
-- elseif args[k] ~= nil or (k == 'postscript') then -- when args[k] has a value from {{#invoke}} frame (we don't normally do that)
-- args[k] = v; -- overwrite args[k] with empty string from pframe.args[k] (template frame); v is empty string here
end -- not sure about the postscript bit; that gets handled in parameter validation; historical artifact?
end
if 0 ~= #empty_unknowns then -- create empty unknown error message
utilities.set_message ('err_param_unknown_empty', {
1 == #empty_unknowns and '' or 's',
utilities.make_sep_list (#empty_unknowns, empty_unknowns)
});
end
local url_param_t = {};
for k, v in pairs( args ) do
if 'string' == type (k) then -- don't evaluate positional parameters
has_invisible_chars (k, v); -- look for invisible characters
end
has_extraneous_punc (k, v); -- look for extraneous terminal punctuation in parameter values
missing_pipe_check (k, v); -- do we think that there is a parameter that is missing a pipe?
args[k] = inter_wiki_check (k, v); -- when language interwiki-linked parameter missing leading colon replace with wiki-link label
if 'string' == type (k) and not cfg.url_skip[k] then -- when parameter k is not positional and not in url skip table
url_param_t[k] = v; -- make a parameter/value list for extraneous url check
end
end
has_extraneous_url (url_param_t); -- look for url in parameter values where a url does not belong
return table.concat ({
frame:extensionTag ('templatestyles', '', {src=styles}),
citation0( config, args)
});
end
local function citation(frame)
local allargs = {};
local config = {}; -- table to store parameters from the module {{#invoke:}}
for k, v in pairs( frame.args ) do -- get parameters from the {{#invoke}} frame
config[k] = v;
if k ~= "CitationClass" and k ~= "SandboxPath" then
allargs[k] = v;
end
end
local pframe = frame:getParent()
for k, v in pairs( pframe.args ) do
if k ~= "وصلة مكسورة" then
allargs[k] = v;
end
end
return _citation(frame, allargs, config)
end
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
return {citation = citation,
_citation = _citation};
cmmafnod59nbs7u43cg8go1vqukffue
احمد بن موسی بن جعفر
0
78097
691011
643065
2025-07-10T19:57:27Z
Mohsen1355
41539
691011
wikitext
text/x-wiki
{{خانہ معلومات امام زادہ
| عنوان = احمد بن موسی شاہ چراغ
| تصویر =
| سائز تصویر =
| عنوان تصویر =احمد بن موسی دا روضہ (شیراز، ایران)
| نام = احمد بن موسی بن جعفرؑ
| وجہ شہرت =امام موسی کاظمؑ دے فرزند
| کنیت =
| لقب = شاہ چراغ
| تاریخ پیدائش =
| جائے پیدائش =
| وفات =
|شہادت =۱۷ رجب ۲۰۳ هجری قمری
| مدفن = شیراز
| سکونت =
| والد = [[امام موسی کاظمؑ]]
| والدہ = ام احمد
| شریک حیات =
| اولاد =
| عمر =
}}
'''احمد بن موسی بن جعفر'''، شاہ چراغ تے سید السادات الاعاظم دے القاب توں مشہور [[امام موسی کاظم (ع)]] دے فرزند نيں۔ ایران دے مشہور امام زادیاں وچوں اک نيں۔ انہاں نے [[مامون الرشید]] دی خلافت دے دور وچ ایران دا سفر کیتا تے [[امام علی رضا ]] دی [[شہادت]] دی خبر سننے دے بعد اوہ [[شیراز]] وچ ہی رک گئے تے اوتھے [[شہید]] ہوئے۔ شیراز وچ انہاں دا مقبرہ مدتاں مخفی سی ۔
== ولادت تے نسب ==
انہاں دی تاریخ ولادت واضح نئيں اے۔ انہاں دے والد [[موسی بن جعفر ]] شیعاں دے ستويں [[امام]] تے انہاں دی والدہ دا نام ام احمد سی ۔<ref>مجلسی، بحارالانوار، ۱۴۰۳ق، ج۴۸، ص۳۰۸</ref><ref>سید محسن امین، اعیان الشیعہ، ج۱۰ص ۲۸۵</ref>
== مقام و منزلت ==
نقل ہويا اے کہ احمد بن موسی بہت کریم سن تے [[امام موسی کاظم (ع)]] انہاں نوں بہت مندے سن ۔<ref>اربلی، کشف الغمہ، ج۲، ص ۲۳۶</ref><ref>ابن صباغ، الفصول المہمہ، ج۲، ص۹۶۱</ref>
[[شیخ مفید]] وی احمد بن موسی دا ذکر بزرگی تے عظمت دے نال کردے نيں۔ اوہ کہندے نيں: احمد بن موسی کریم النفس، جلیل القدر تے پرہیز گار انسان سن ۔ انہاں دے والد انہاں نوں دوست رکھدے سن تے انہاں نوں دوسرے بیٹےآں اُتے مقدم کردے سن ۔ امام کاظم (ع) نے اپنا یسیرہ نامی مشہور مزرعہ انہاں نوں عطا کر دتا سی ۔ احمد بن موسی نے 1000 غلاماں نوں آزاد کیتا۔<ref>مفید، الارشاد، ج۲، ص۲۴۴</ref>
اسی طرح توں [[شیخ مفید]] اک روایت [[اسماعیل بن موسی بن جعفر ]] توں نقل کردے نيں: اک سفر وچ میرے والد دے 20 خادم احمد بن موسی دے ہمراہ سن تے اوہ سب انہاں دے نال احترام توں پیش آ رہے سن ۔ جدوں وی اوہ اٹھتے تے بیٹھتے سن اوہ سب وی انہاں دے احترام وچ انہاں دے نال اٹھتے تے بیٹھتے سن ۔ میرے والد ہمیشہ احمد اُتے عنایت فرماندے سن تے انہاں توں ٖغافل نئيں ہُندے سن تے انہاں توں نظراں نئيں بھیرتے سن ۔<ref>مفید، الارشاد، ج۲، ص۲۴۵</ref>
[[کشی]] نے احمد بن موسی دا شمار اپنے عصر دے فضلاء وچوں کیتا اے تے انہاں دا نام انہاں محدثین وچ شمار کیتا اے جنہاں نے اپنے والد تے اجداد بزرگوار توں بہت سی [[احادیث]] نقل کيتیاں نيں تے اوہ ہور ذکر کردے نيں کہ احمد بن موسی نے اپنے ہتھاں نال [[قرآن کریم]] تحریر لکھیا سی ۔<ref>کشی، رجال کشی، ص۲۹۴</ref>
== امامت امام کاظم دی شہادت دے بعد ==
اگرچہ ستويں امام دی [[شہادت]] دے بعد بعض لوگاں نے احمد بن موسی دی [[امامت]] دے گمان وچ انہاں دے والدہ ام احمد دے گھر دے باہر اجتماع کیتا لیکن انہاں نے واضح الفاظ وچ اعلان کیتا:
جداں آپ لوگ میری بیعت وچ نيں ویسے ہی میں اپنے بھائی [[امام علی رضا|علی بن موسی الرضا]] (ع) دی [[بیعت]] وچ ہاں تے میرے والد دے بعد اوہ ولی خدا، رہبر تے میرے والد دے جانشین نيں۔
اس دے بعد تمام لوگاں نے امام رضا (ع) دی بیعت کر لی تے امام نے اپنے بھائی دے حق دعا کيتی۔<ref>بحرالعلوم، ج۲ص ۲۷.</ref> اس دے باوجود بعض فرق نویس تے ملل و نحل دے مصنفین نے احمدیہ نامی فرقہ دا ذکر کیتا اے جو احمد بن موسی دے پیروکار سن ۔ جنہاں نے [[امام موسی کاظم (ع)]] دی شہادت دے بعد انہاں دی امامت نوں قبول کر لیا سی ۔<ref>شہرستانی، الملل و النحل، ۱۳۳۰ش، ج۱، ص۱۶۹</ref><ref>اشعری، مقالات الاسلامیین، ص۳۰</ref><ref>نوبختی، فرق الشیعہ، ۱۴۰۴ق، ص۸۵</ref>
== قیام احمد بن موسی ==
بعض منابع نے عباسی حکومت دے خلاف احمد بن موسی دے قیام دا تذکرہ کیتا اے۔ لیکن انہاں دے جزئیات تے کیفیت دی طرف کوئی اشارہ نئيں کیتا اے۔ ایہ تاریخی گزارشات انہاں دے [[ابن طباطبا]] دے قیام وچ ہمراہی دی حکایت کردیاں نیں۔<ref>کشی، رجال کشی، ص۴۷۲</ref>
== ایران دی طرف ہجرت ==
احمد بن موسی نے اک عظیم کاروان دے نال جس دی تعداد 3 ہزار توں 15 ہزار تک نقل ہوئی اے، ایران دی طرف ہجرت کيتی۔<ref>سید جعفر مرتضی، زندگانی سیاسی امام ہشتم، ص۲۱۴</ref><ref>تشید، قیام سادات علوی، ص۱۶۹.</ref><ref>سلطان الواعظین، شبہای پیشاور، ص۱۱۷</ref> اس مہاجرت دی دو دلیل ذکر ہوئی اے:
1۔ اپنے بھائی امام علی بن موسی الرضا (ع) دے خون دا بدلہ لینے دے لئے جو [[مامون الرشید]] دے ہتھوں [[شہید]] ہوئے سن ۔<ref>بیہقی، جامع الانساب</ref>
2۔ اپنے بھائی دے دیدار دے لئے جو اس وقت مرو وچ سن تے اثنائے راہ انہاں نوں انہاں دی [[شہادت]] دی خبر ملی۔<ref>سلطان الواعظین، شبہای پیشاور، ص۱۱۸</ref><ref>فرصت شیرازی، آثار العجم، ص۳۴۵</ref>
== انہاں دی تے انہاں دے ساتھیاں دی شہادت ==
قتلغ خان نے جو شیراز دا حاکم تے [[مامون]] دا کارندہ سی، خان زینان نامی جگہ اُتے جو شیراز توں 8 فرسخ دے فاصلہ اُتے اے، احمد بن موسی تے انہاں دے ہمراہ کاروان نال ملاقات کیتی تے انہاں نوں امام رضا (ع) دی شہادت دی خبر دتی۔ ایہ خبر انہاں دے ارادیاں نوں کمزور کرنے دا سبب بنی تے اوہ سب منتشر ہوگئے۔ احمد نے اپنے قریبیاں دے نال شیراز دا رخ کیتا تے اوتھے جنگ وچ شہید ہوئے۔<ref>شوشتری، تحفہ العالم، ص۲۸</ref>
== انہاں دی قبر دا آشکار ہونا ==
تاریخ دی کتاباں وچ انہاں دی قبر دے آشکار ہونے دے سلسلہ وچ کئی اقوال ذکر ہوئے نيں:
1۔ چوتھی صدی ہجری دے اواخر تے پنجويں صدی ہجری دے اوائل تک انہاں دی قبر دے بارے وچ کوئی گل تاریخی منابع وچ موجود نئيں اے۔<ref>زاہدی، احمد بن موسی(ع)، فصل نامہ سخن تاریخ، ص ۹۸</ref> بعض مصادر جداں ریاض الانساب ملک الکتاب شیرازی و بحر الانساب تیموری نے چوتھی صدی ہجری وچ [[عضد الدولہ دیلمی]] (338۔372) دے زمانہ وچ انہاں دی قبر دے کشف ہونے دے سلسلہ وچ خبر دتی اے۔ بعض مآخذ دا دعوی اے کہ احمد بن موسی دی قبر 300 سال تک مخفی رہی تے آخر کار عضد الدولہ دیلمی<ref>مجد الاشرف، آثار الاحمدیہ، ص۲ – ۸</ref> دے زمانہ وچ ظاہر ہوئی۔
2۔ ملحقات انوار النعمانیہ دے لباب الانساب بیہقی تے سید محسن امین عاملی دے لب الانساب نیشاپوری توں نقل دے مطابق، شیراز وچ احمد بن موسی دی قبر دے آشکار ہونے دا واقعہ پنجويں صدی ہجری دے اوائل وچ پیش آیا اے۔
3۔ دوسرے مصادر جداں شد الآزار، سفرنامہ ابن بطوطہ تے نزہۃ القلوب جو اٹھويں صدی ہجری وچ لکھے گئے نيں، نے انہاں دی قبر دے ظاہر ہونے دا زمانہ ستويں و اٹھويں صدی ہجری لکھیا اے۔<ref>زاہدی، احمد بن موسی(ع)، فصل نامہ سخن تاریخ، ص ۹۸</ref> بعض منابع دے مطابق انہاں دی قبر ابو بکر اتابک (653۔658)<ref>فرصت شیرازی، آثار العجم، ص ۴۴۵</ref> دے نزدیکی تے انہاں دے وزیر امیر مقرب الدین دے زمانہ وچ کشف ہوئی تے انہاں دا جنازہ انہاں دی انگوٹھی دی وجہ توں پہچانا گیا جس دے نگینہ اُتے العزۃ للہ احمد بن موسی نقش سی ۔<ref>زرکوب شیرازی، شیراز نامہ، ص ۵۹</ref><ref>مجد الاشرف، آثار الحمدیه، ص ۲-۸</ref><ref>جنید شیرازی، شدّ الازار فی حظ الاوزار عن زوار المزار، ص ۲۸۹</ref>
آپ دی شہادت دے چار سو پنجاہ سال بعد امیر عضد الدولہ، مقرب الدین، مسعود ابن بدر دیلمی (متوفی ۶۶۵ھ ) دے زمانہ تک کسی دے علم وچ نہ سی کہ کہ آپ دا مزار مقدس کتھے اے ۔ ا یک پھولدار ٹیلے دے گرد و نواح وچ کچھ لوگاں دے مکانات سن ۔ اس ٹیلے دے دامن وچ اک بزرگ خاتون دا جھونپڑ ا سی ۔ اوہ عورت ہر شب جمعہ کچھ حصہ بیت جانے دے بعد اس پھولاں والے ٹیلے اُتے بہت روشن چراغ دیکھیا کردی جس دی روشنی صبح تک جاری رہندی ۔ اس خاتون نے چند شب جمعہ باقاعدگی توں اس چراغ دا مشاہدہ کیتا تے دیکھیا کہ اس روشنی دے عمل وچ کچھ فرق نہ آیا ۔ بڑھیا نے سوچا کہ شاید اس ٹیلے اُتے کسی ولی اللہ دا مقبرہ ہو ؟۔ بہتر اے کہ اس امر دی اطلاع امیر [[عضد الدولہ دیلمی]] ناں دتی جائے ۔ صبح اوہ عورت امیر عضدالدولہ دے محل وچ گئی تے ساری کیفیت بیان کيتی ۔ امیر ایہ سن کر حیران رہ گیا ۔ مصاحبین نے کہیا: ’’یہ بوڑھی عورت اے، مختلف خیالات دل وچ لنگھدے نيں ۔ بڑھاپے دے سبب اسنوں نیند نئيں آندی تے نگاہاں وچ ایسی چیزاں پھرتی نيں جنہاں نوں حقیقت سمجھدی اے ‘‘۔ اک نے کہیا ،’’یہ بوڑھی عورت غریب اے، امیر توں کچھ حاصل کرنے تے سوال کرنے دا ذریعہ تلاش کیتا اے تا کہ اسنوں کچھ مل سکے ‘‘۔
عضدالدولہ نے انہاں دی باتاں سن کر کہیا ،’’تواڈی باتاں درست نئيں نيں۔ ایسی باتاں توں دور رہنا بہتر اے ۔ اس عورت دی باتاں دا میرے دل پہ گہرا اثر ہو چکيا اے، اس لئے کہ اس دا بیان اے کہ صرف جمعہ دی راتاں نوں چراغ نظر آندا اے ۔ شب جمعہ دے علاوہ کچھ نظر نئيں آندا ‘‘۔ تسلی دے لئے دوبارہ دریافت کیتا ۔ بڑھیا نے کہیا ،’’صرف جمعہ دی رات ایسا ہُندا اے ۔ دوسری راتاں وچ نئيں ہُندا ‘‘۔امیر عضدالدولہ نے فیصلہ کیتا کہ جمعہ دی رات اوہ بڑھیا دے گھر جا کے چراغ دی کیفیت دا خود مشاہدہ کرے گا ۔ شب جمعہ، امیر عضدالدولہ بڑھیا دے گھر پہنچ گیا ۔ محو استراحت ہويا تے بڑھیا توں کہیا جدوں چراغ دی کیفیت ظاہر ہونے لگے تو مینوں بیدار کر دینا تاکہ وچ خود اس دا مشاہدہ کراں ۔ رات دا تیسرا پہر گزریا تو اس خاتون نے دیکھیا کہ چراغ روشن اے تے عام دناں دی نسبت اوہدی روشنی بہت زیادہ اے ۔ بڑھیا بہت خوش ہوئی تے بولی ’’اے شاہ چراغ ‘‘۔
پھر اوہ امیر عضد الدولہ دے سرہانے گئی تے بیدار کردے تن مرتبہ پکاری ’’اے شاہ چراغ ‘‘۔امیر عضدالدولہ نیند توں بیدار ہويا ۔ چراغ پہ نظر پئی تو حیران ہويا تے اپنے خواص توں کچھ افراد دے ہمراہ ٹیلے اُتے گیا ۔ ٹیلے اُتے پہنچیا تو انہاں نوں کچھ نظر نہ آیا ۔ نیچے اترے تو چراغ مشعل دی طرح روشن پایا ۔ ست مرتبہ اس عمل دا اعادہ کیتا ۔ امیر عضدالدولہ تے اس دے درباریاں وچوں ہر آدمی حیران سی کہ اس عجیب و غریب چراغ دی حقیقت کیتا اے ؟۔ سب حیران و فکرمند اپنے گھراں نوں واپس چل دیئے ۔ اسی سوچ و فکر وچ امیر دی اکھ لگ گئی ۔ خواب وچ اک بزرگ سید نظر آئے جنہاں نے فرمایا،’’اے عضدالدولہ ! کس خیال وچ ہو ؟۔ ایہ میرا مدفن اے تے وچ سید احمد بن حضرت امام موسیٰ کاظم ہاں ۔ تسلی رکھو تے کسی معتمد نوں میرے مدفن دے پاس بھیجو ۔ ميں نے تواڈے لئے اک انگشتری رکھی اے ‘‘۔
سیدنا شاہ چراغ توں خوشخبری سن کر عضد الدولہ نیند توں بیدار ہو گیا تے شدت ذوق توں صبح تک جاگتا رہیا ۔ صبح امراء و صلحاء، علماء و معززین نوں دربار وچ جمع کرکے گذشتہ شب دے خواب دا واقعہ بیان کیتا تے مشورہ طلب کیتا کہ اس بارے وچ کیتا کرنا چاہئے ؟۔ علماء نے جواب دتا کہ قبر مطہر دا دوبارہ کھولنا حرام اے ۔ جے فی الواقع ایہ میر احمد کامدفن اے تو پھر ایسا کرنا امامزادہ دی ہتک عزت دا باعث اے ۔ تمام لوگ متحیر سن تے انہاں نوں کچھ نہ سوجھتا سی کہ کیتا کیتا جائے ؟۔ اسی سوچ بچار وچ سن کہ کسی نے امیر عضدالدولہ توں کہیا کہ اس پہاڑ وچ شیراز دی جانب اک پیر بزرگ نيں جنہاں نوں عفیف الدین دے نام توں پکاریا جاندا اے۔ طویل مدت توں دنیا جہان توں بے خبر اس پہاڑ وچ عبادت الٰہی وچ مشغول نيں ۔ ضرورت دے بغیر کسی توں نئيں ملدے ۔ پیر عفیف الدین نوں بلا کر ایہ سارا واقعہ انہاں توں بیان کیتا جائے کہ ایہ کیتا بھید اے ؟۔
اس شخص دا مشورہ سن کر ارکان دولت تے علمائے اکابر نے کہیا کہ ایہ بہترین تجویز اے ۔ اسيں وچوں جسنوں حکم ہو گا انہاں نوں لانے دے لئے حاضر نيں ۔ امیر عضدالدولہ نے کہیا ،’’بہتر اے کہ ایسے خدا رسیدہ بزرگ دی خدمت وچ حاضر ہو کے وچ خود احوال واقعی عرض کراں ۔ اس تجویز دے بعد امیر عضد الدولہ چند خاص درباریاں تے علماء سمیت پیر روشن ضمیر دی خدمت عالیہ وچ حاضر ہويا ۔ سلام و آداب بجا لانے دے بعد چراغ، خواب تے انگشتری دا سارا واقعہ بیان کیتا ۔ جناب پیر عفیف الدین نے فرمایا ،’’یہ خواب سچ اے ۔ گزشتہ رات ميں نے وی ایہی خواب دیکھیا اے ۔ آپ قبر اقدس کھولنے دا حکم دے داں، اس وچ کوئی نقصان نہ ہو گا ۔ دیکھئے کیتا ظاہر ہُندا اے ‘‘۔ ایہ سن کر امیر عضدالدولہ باغ باغ ہو گیا ۔ شہر واپس آکے حکم دتا کہ کل اس جگہ نوں کھودا جائے ۔
دوسرے روز اس جگہ نوں کھودا گیا تو پتھر دی بنی لوح مزار ظاہر ہوئی ۔ امیر نوں اطلاع دتی گئی ۔ امیر اکابرین شہر، علماء و امراء دے ہمراہ اوتھے حاضر ہويا ۔ انہاں سب نے تختی دیکھی جس اُتے کوفی رسم الخط وچ دو سطراں لکھی سن،
'''{{حدیث|اَلْعِزَّۃُلِلّٰہْ ، اَلْسَّیَّدْ مِیْراَحْمَدْ بِنْ مُوْسٰی اَلْکَاظِم }}'''
تختی اُتے کندہ عبارت اس خواب دے مطابق سی جو امیر نے دیکھیا سی ۔ سب نوں یقین کامل ہو گیا ۔ امیر [[عضد الدولہ]] نے حکم دتا کہ قبر شریف اُتے لکھی ہوئی پتھر دی سل نوں ہٹایا جائے ۔ جدوں پتھر دی سل ہٹائی گئی تو اک وسیع تہہ خانہ نظر آیا ۔ امیر نے اک شخص پیر عفیف االدین دی خدمت وچ بھیجدے پیغام عرض کیتا،’’ ہن آپ دی تشریف آور ی دا وقت آن پہنچیا اے ۔ تشریف لائیے کہ حضرت سید میر احمد دی خدمت اقدس وچ جا کے انگشتری حاصل کيتی جا سکے ‘‘۔
== شاہ چراغ لقب دا انتساب ==
[[فائل:ضریح قبر احمد بن موسی بن جعفر.jpg|thumb|احمد بن موسی (ع) دی ضریح]]
اس لقب دا سرچشمہ داستاناں، افسانے تے متاخرین دیاں کتاباں نيں۔ قدیم منابع وچ اس سلسلہ وچ کوئی گل ذکر نئيں ہوئی اے۔<ref>برای نمونہ مراجعہ کراں: مجلسی، بحارالانوار، ۱۴۰۳ق، ج۴۸، ص۳۰۸</ref>
== مدفن ==
انہاں دے محل دفن دے سلسلہ وچ تن اقوال نقل ہوئے نيں:
* خراسان<ref>جامع الانساب، ج۱، ص۷۸</ref>
* نامعلوم<ref>ابن عنبہ، عمده الطالب، ص۱۹۷ (حاشیہ)</ref>
* شیراز۔ (بزرگان و مورخین دے درمیان مشہور قول)<ref>مستوفی، نزھه القلوب، ص۱۷۲</ref><ref>قزوینی، فلک النجاه، ص۲۳۷</ref><ref>مامقانی، تنقیح المقال، ج۱، ص۹۷</ref><ref>ابن بطوطہ، سفرنامہ، ج۱، ص۲۲۹</ref>
== اولاد ==
انساب دے بوہت سارے علماء نے احمد بن موسی نوں لا ولد ذکر کیتا اے۔<ref>المعقبین، ص۴۳</ref><ref>سر السلسله العلویہ، ص۴۳</ref><ref>تہذیب الانساب، ص۱۴۷</ref> البتہ انہاں دے نظریات دے برخلاف بعض انہاں نوں صاحب اولاد مندے نيں۔ ضامن شدقم نے انہاں دے چار بیٹے محمد، علی، عبد اللہ تے داود ذکر کيتے نيں۔<ref>تحفه الازہار، ج۳ص ۲۹۶</ref> فیض قمی نے امام زادہ ابراہیم نوں جو [[قم]] وچ مدفون نيں، انہاں دا بیٹا شمار کیتا اے۔<ref>گنجنہ آثار قم، ج۲ص ۳۶۴-۳۷۱</ref>
== حوالے ==
{{طومار}}
{{حوالے|3}}
{{طومار خاتمہ}}
== مآخذ ==
{{ستون آ|2}}
* اربلی (۶۹۳ ق)، کشف الغمہ فی معرفة الأئمہ، بنی ہاشمی، تبریز، ۱۳۸۱ ق، چاپ اول
* بحر العلوم، سید جعفر، تحفة العالم في شرح خطبة المعالم، مکتبہ صادق، چاپ دوم، تہران، ۱۴۰۱ق
* زاہدی، سید یاسین، «احمد بن موسی (ع)»، مجلہ سخن تاریخ، تابستان ۱۳۸۸ش، شماره ۵
* شہرستانی، محمد بن عبد الکریم، الملل و النحل، تہران، امیر کبیر، چاپ اول، ۱۳۳۰ش
* مفید، الإرشاد فی معرفة حجج الله علی العباد، کنگره شیخ مفید، قم، ۱۴۱۳ ق
* نوبختی، حسن بن موسی، فرق الشیعہ، دار الاضواء، بیروت، ۱۴۰۴ق
* کشی، محمد، اختیار معرفہ الرجال، دانشگاه مشہد، ۱۳۴۸ش
* مجلسی، محمد باقر، بحار الأنوار الجامعة لدُرر اخبار الائمة الاطہار، بیروت، دار الاحیاء التراث العربی، چاپ سوم، ۱۴۰۳ق
{{ستون خ}}
== بیرونی لینک ==
* [http://www.shahecheragh.ir/default.asp امام زادہ شاہ چراغ دے حرم دی ویب سائٹ] {{Webarchive|url=https://web.archive.org/web/20151016163737/http://www.shahecheragh.ir/default.asp |date=2015-10-16 }}
* [http://shahecheragh.ir/page.asp?tid=105 متن و ترجمہ زیارت نامہ احمد بن موسی(ع)] {{Webarchive|url=https://web.archive.org/web/20140725190656/http://www.shahecheragh.ir/page.asp?tid=105 |date=2014-07-25 }}
* [http://shahecheragh.ir/page.asp?tid=3636 عکس ہای پانوراما ۳۶۰ درجہ حرم مطہر حضرت شاه چراغ(ع)] {{Webarchive|url=https://web.archive.org/web/20150826125918/http://shahecheragh.ir/page.asp?tid=3636 |date=2015-08-26 }}
{{امام موسی کاظم}}
{{اصحاب امام رضا}}
{{خاندان رسالت}}
[[گٹھ:امام کاظم دی اولاد]]
[[گٹھ:شیراز وچ مدفون افراد]]
[[گٹھ:اصحاب امام علی رضا]]
[[گٹھ:بنی عباوہدی حکومت دے مقتولین]]
8aw9gt1daiaykwbiddonv0sx5qg34nr
حزب اللہ مسلح طاقت
0
90427
691010
687930
2025-07-10T18:24:35Z
CommonsDelinker
60
Removing [[:c:File:Hezzzzbollah.jpg|Hezzzzbollah.jpg]], it has been deleted from Commons by [[:c:User:Ymblanter|Ymblanter]] because: per [[:c:Commons:Deletion requests/File:Hezzzzbollah.jpg|]].
691010
wikitext
text/x-wiki
{{معلومات-حرب}}[[حزب اللہ]] درمیانے درجے دی فوج دی مسلح طاقت اے۔ <ref name="haaretz.com"/> {{Efn|One study is more specific, saying that Hezbollah's armaments and intelligence capabilities compare with a medium-sized European state.<ref name="isopod" />}} حزب اللہ نوں عام طور اُتے دنیا دی سب توں طاقتور غیر سرکاری ریاستی طاقت ، <ref>{{حوالہ ویب|url=http://www.mei.edu/content/article/hezbollah-syria-long-haul|title=Hezbollah: In Syria for the Long Haul|publisher=Middle East Institute|first=Nicholas|last=Blanford|date=Nov 18, 2014}}</ref><ref>{{حوالہ ویب|url=https://www.vice.com/en_us/article/paintballing-with-hezbollah-0000151-v19n3|title=Paintballing with Hezbollah|website=Vice Magazine|first=Mitchell|last=Prothero|date=March 26, 2012}}</ref> {{Efn|A few sources describe Hezbollah as a Lebanese state actor.<ref name="auto3" />}} تے لبنانی فوج توں زیادہ مضبوط سمجھیا جاندا اے۔ <ref name="NYT052020132">{{cite news|url=https://www.nytimes.com/2013/05/21/world/middleeast/syria-developments.html?pagewanted=all&_r=0|title=Hezbollah's Role in Syria War Shakes the Lebanese|first=Anne|last=Barnard|work=New York Times|date=May 20, 2013|accessdate=June 20, 2013}}</ref><ref>{{cite news|title=Hezbollah Upsets The Balance in Lebanon|url=http://www.voanews.com/content/lebanon-syria-hezbollah/1682124.html|newspaper=Voice of America|date=June 14, 2013|first=Jamie|last=Dettmer}}</ref> اک ہائبرڈ فورس ، گروپ "مضبوط روايتی تے غیر روايتی فوجی صلاحیتاں" نوں برقرار رکھدا اے۔<ref name="fas.org3">{{cite news|url=https://fas.org/sgp/crs/mideast/R41446.pdf|title=Hezbollah: Background and Issues for Congress|publisher=Congressional Research Service|date=January 3, 2011|first1=Casey L.|last1=Addis|first2=Christopher M.|last2=Blanchard}}</ref> [[2006 لبنان دی جنگ|2006 دی لبنان جنگ دے]] بعد توں پارٹی دی لڑائی دی صلاحیت وچ کافی حد تک اضافہ ہويا اے۔ <ref name="fas.org2">{{cite news|url=https://fas.org/sgp/crs/mideast/R41446.pdf|title=Hezbollah: Background and Issues for Congress|publisher=Congressional Research Service|date=January 3, 2011|first1=Casey L.|last1=Addis|first2=Christopher M.|last2=Blanchard}}</ref><ref name="auto2">{{cite news|url=http://www.haaretz.com/news/un-hezbollah-has-increased-military-strength-since-2006-war-1.231869|title=UN: Hezbollah has increased military strength since 2006 war|newspaper=Haaretz|date=October 25, 2007|accessdate=September 5, 2013}}</ref> .
{{حزب اللہ}}
حزب اللہ اپنی افرادی قوت نوں ظاہر نئيں کردا اے تے تخمینے وڈے پیمانے اُتے مختلف ہُندے نيں۔ 2017 وچ ، جین دا اندازہ اے کہ حزب اللہ دے پاس 25،000 توں زیادہ کل وقتی جنگجو نيں تے شاید 20،000 توں 30،000 تحفظ پسند نيں۔ <ref name="closer"/> {{Efn|In 2016, the Israeli newspaper ''[[ہاریتز]]'' said that Hezbollah had about 20,000 active duty troops and 25,000 reservists.<ref name="haaretz.com" /> In 2015, the [[Center for Strategic and International Studies]] said that Hezbollah had a low of 5,000 full time fighters and 15,000 reservists.<ref>{{cite web|url=https://csis-prod.s3.amazonaws.com/s3fs-public/legacy_files/files/publication/150615_Nerguizian_Levant_Mil_Bal_Report_w_cover_v2.pdf|title=The Military Balance in a Shattered Levant|date=June 15, 2015|publisher=Center for Strategic and International Studies|first=Aram|last=Nerguizian|access-date=October 1, 2020|archive-date=December 9, 2019|archive-url=https://web.archive.org/web/20191209005752/https://csis-prod.s3.amazonaws.com/s3fs-public/legacy_files/files/publication/150615_Nerguizian_Levant_Mil_Bal_Report_w_cover_v2.pdf|dead-url=yes}}</ref> The [[US State Department]] wrote that Hezbollah had at least 7,000 active fighters and up to 10,000 reserves.<ref>{{cite web|url=https://community.apan.org/wg/tradoc-g2/ace-threats-integration/m/documents/211605/download|title=Threat Tactics Report: Hizballah|date=Jan 2017|publisher=TRADOC G-2 Intelligence Support Activity (TRISA) / Complex Operational Environment and Threat Integration Directorate (CTID) / US Army|first=Angela|last=Williams}}</ref> Hezbollah members regularly claim that the party has 50,000-70,000 combatants.<ref name="closer" />}} انہاں دی مالی اعانت ایران دے ذریعہ کيتی جاندی [[ایران|ہے]] تے ایران دی [[سپاہ پاسداران انقلاب اسلامی|اسلامی انقلابی گارڈ کور دے]] ذریعہ تربیت حاصل کيتی جاندی اے۔ حزب اللہ دا فوجی بجٹ ہر سال اک ارب ڈالر دے حساب توں چلدا اے۔ <ref name="reuters.com2">{{cite news|url=https://www.reuters.com/article/us-syria-hezbollah-special-report-idUSBRE98P0AI20130926|title=Special Report: Hezbollah gambles all in Syria|date=26 September 2016|work=Reuters|first=Samia|last=Nakhoul}}</ref>.
حزب اللہ دی فوجی طاقت کسی حد تک انہاں دے پاس موجود راکٹ دی مقدار تے معیار اُتے مبنی اے ، <ref name="pando.com">{{حوالہ ویب|url=https://pando.com/2015/07/02/war-nerd-how-many-soldiers-does-hezbollah-have-and-why-it-so-hard-find-out/|title=The War Nerd: How many soldiers does Hezbollah actually have?|date=2 July 2015|publisher=Pando|first=Gary|last=Brecher|access-date=1 October 2020|archivedate=3 February 2019|archiveurl=https://web.archive.org/web/20190203142146/https://pando.com/2015/07/02/war-nerd-how-many-soldiers-does-hezbollah-have-and-why-it-so-hard-find-out/}}</ref> جو اوہ اپنے بنیادی دشمن [[اسرائیل|اسرائیل دے]] خلاف استعمال کردے نيں۔ اسرائیل دے خلاف گروپ دی حکمت عملی وچ راکٹاں نوں جارحانہ ہتھیاراں دے طور اُتے استعمال کيتا گیا اے جو ہلکی انفنٹری تے اینٹی آرمر یونٹاں دے نال مل کے جنوبی لبنان وچ اپنی فائرنگ دی پوزیشناں دا دفاع کردے نيں۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}</ref> حزب اللہ دے کل راکٹ گنتی دا تخمینہ 40،000 <ref name="citogenesis">{{حوالہ ویب|url=https://csis-prod.s3.amazonaws.com/s3fs-public/legacy_files/files/publication/141007_Iran_Rocket_Missile_forces.pdf|title=Iran's Rocket and Missile Forces and Strategic Options|last=Anthony H. Cordesman|others=with the assistance of Scott Modell, Aaron Lin, and Michael Peacock|date=October 7, 2014|publisher=Center for Strategic and International Studies|access-date=October 1, 2020|archivedate=October 18, 2017|archiveurl=https://web.archive.org/web/20171018131618/https://csis-prod.s3.amazonaws.com/s3fs-public/legacy_files/files/publication/141007_Iran_Rocket_Missile_forces.pdf}}</ref> توں لے کے ڈیڑھ لکھ تک اے ، <ref name="jpost.com">{{حوالہ ویب|url=http://www.jpost.com/Arab-Israeli-Conflict/Analysis-Hezbollah-powerful-but-more-stretched-than-ever-457035|title=Analysis: Ten years after war Hezbollah powerful but more stretched than ever|website=Jerusalem Post|first=Yaakov|last=Lappin|date=June 16, 2016}}</ref> جو زیادہ تر ملکاں دے مقابلے وچ کافی زیادہ اے ۔ ورےورےصروےصروے
حزب اللہ دے پاس محدود تعداد وچ اینٹی ایرکرافٹ تے اینٹی شپ میزائل نيں ، نال ہی ہزاراں اینٹی ٹینک میزائل وی موجود نيں ، جنہاں نوں استعمال کرنے وچ اوہ ہنر مند نيں۔ <ref name="defense-update.com"/> اس گروپ دے پاس لبنان وچ ہوائی جہاز ، ٹینک یا بکتر بند گاڑیاں نئيں نيں ، کیونجے اوہ اسرائیلی فضائی بالادستی دا مقابلہ نئيں کرسکدے نيں۔ <ref name="haaretz.com"/><ref>{{حوالہ ویب|url=http://militaryedge.org/armaments/assorted-vehicles/|title=Assorted Vehicles|date=5 December 2013|publisher=Military Edge/Foundation for Defense of Democracies|access-date=1 October 2020|archivedate=11 July 2018|archiveurl=https://web.archive.org/web/20180711190948/https://militaryedge.org/armaments/assorted-vehicles/}}</ref> {{Efn|Hezbollah did use armored vehicles in the [[Qalamoun offensive (July–August 2017)|Arsal campaign]] on the Lebanese border against the HTS and ISIS non-state actors.}} اُتے ، حزب اللہ پڑوسی ملک [[شام|شام]] وچ کوچ نوں برقرار رکھدا اے ، جس وچ ٹی 55 تے [[ٹی - 72|ٹی 72]] ٹینک شامل نيں۔ اس گروپ نے جنوبی لبنان وچ وڈی تعداد وچ ہتھیاراں دے ذخیرے ، سرنگاں ، تے بنکر بنائے نيں تے اس دے پاس انٹیلیجنس آلات دا اک بہت وڈا سامان اے ۔ ورےورےصروےصروے
حزب اللہ دی تدبیراندی قوتاں کور تے پوشیدہ ، براہ راست فائر تے لڑائی دے پوزیشناں دی تیاری نيں ، جدوں کہ انہاں دی کمزوریاں وچ تدبیر دی جنگ ، چھوٹے ہتھیاراں دا نشانہ بنانے ، <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> تے فضائی دفاع شامل نيں۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> اگرچہ حزب اللہ ہلکی انفنٹری تے اینٹی ٹینک اسکواڈ نوں اچھی طرح توں سمجھیا جاندا اے ، <ref name="pando.com"/><ref name="thetower.org">{{حوالہ ویب|url=http://www.thetower.org/article/the-new-hezbollah-israels-next-war-will-be-a-godawful-mess/|title=The New Hezbollah: Israel's Next War Will Be A Godawful Mess|website=The Tower Magazine|first=David|last=Daoud|date=September 2016}}</ref> مجموعی طور اُتے حزب اللہ [[اسرائیلی دفاعی افواج|اسرائیل دی دفاعی فورسز دے]] مقابلے وچ "مقداری تے معیاری" کمزور اے۔ ورےورےصروےصروے
ذرائع عام طور اُتے اس گل اُتے متفق نيں کہ روايتی جنگ وچ حزب اللہ دی طاقت دا موازنہ [[عرب ملکاں|عرب دنیا]] وچ ریاستی عسکریت پسنداں توں [[عرب ملکاں|ہے]] ۔ <ref name="newsweek.com">{{حوالہ ویب|url=http://www.newsweek.com/2017/01/20/hezbollah-real-winner-battle-aleppo-539558.html|title=Hezbollah is the real winner of the battle of Aleppo|first=Sulome|last=Anderson|date=9 January 2017|website=Newsweek}}</ref> {{Efn|The Chief of General Staff of the IDF, [[Benny Gantz]], said in 2014 that "Hezbollah is now stronger than any Arab army" although this seems hyperbolic.<ref name="Worall" />}} 2009 دے جائزے وچ ایہ نتیجہ اخذ کيتا گیا اے کہ حزب اللہ "اک تربیت یافتہ ، اچھی طرح توں مسلح ، انتہائی محرک ، تے انتہائی ترقی یافتہ جنگ لڑنے والی مشین" سی {{Efn|Others make similar judgements: "what … the United States had dismissed as a ragtag group of terrorists was, in fact, a sophisticated, well-trained, and very well-armed fighting machine"<ref>Danielle Pletka, Vice President, Foreign and Defense Policy Studies, American Enterprise Institute, Washington, DC. Congressional Hearing. ''Assessing the Strength of Hezbollah: Hearing Before the Subcommittee on Near Eastern and South and Central Asian Affairs of the Committee on Foreign Relations''. United States Senate One Hundred Eleventh Congress, Second Session. June 8, 2010. https://www.gpo.gov/fdsys/pkg/CHRG-111shrg62141/html/CHRG-111shrg62141.htm.</ref>}} تے "واحد عرب یا مسلمان وجود وچ کامیابی دے نال اسرائیلیاں دا مقابلہ کرنا۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> ورےورےصروےصروے
حزب اللہ عام طور اُتے انہاں دے فوجی آپریشناں {{Efn|"Ibrahim Mousawi, head of Hezbollah's media relations, said the party doesn't comment on its military policies."<ref name="auto8">{{cite news|url=https://www.wsj.com/articles/SB10001424127887324784404578141240450216114|title=Gaza Fight Hints at Hezbollah Arsenal|first=Farnaz|last=Fassihi|date=5 December 2012|newspaper=Wall Street Journal}}</ref>}} اُتے گل نئيں کردا اے تے انہاں دی طاقت تے صلاحیتاں دے بارے وچ درست تے قابل اعتماد معلومات اکثر نہ ہونے یا درجہ بند رہندی اے۔ <ref>Hezbollah: The Dynamics of Recruitment. Major Leroy Bryant Butler. School of Advanced Military Studies. United States Army Command and General Staff College Fort Leavenworth, Kansas</ref> حزب اللہ ، اسرائیل تے ہور دے پاس تحریک دی صلاحیتاں نوں غلط انداز وچ لیانے دی وجوہات ہوسکدی نيں۔ حزب اللہ دی مجموعی طاقت تے افرادی قوت دا تخمینہ وڈے پیمانے اُتے مختلف اے۔ {{Efn|In 2006, for example, assessments within the IDF of Hezbollah ranged from a "gang" to an "Iranian commando division."<ref name="jj" />}}.
== تریخ ==
=== پس منظر ===
[[فائل:1988 distribution of Lebanon's main religious groups.tif|thumb| لبنان وچ شیعہ آبادی دی تقسیم۔]]
1975 وچ لبنان خانہ جنگی دا شکار ہوئے گیا۔ تن سال بعد ، [[تنظیم آزادی فلسطین|فلسطین لبریشن آرگنائزیشن]] نے فوج نوں اکٹھا کرنے تے ریاست اسرائیل نوں تباہ کرنے دی کوشش وچ لبنان دے زیادہ تر جنوبی علاقےآں اُتے قبضہ کر ليا سی۔ اسرائیل نے سن 1982 وچ حملہ کيتا تے پی ایل او نوں تباہ کردتا ، لیکن اس نے جنوبی لبنان اُتے قبضہ کر ليا تے اس علاقہ اُتے قبضہ کرنے دے لئی اک عیسائی پراکسی ملیشیا ، ساؤتھ لبنان آرمی (ایس ایل اے) تشکیل دی۔ اسرائیلی سرحد دی لمبائی وچ چلنے والے اس تنگ پٹی نوں ، "سیکیورٹی زون" کہیا گیا۔ گوریلا تے حامیاں نے قبضہ کرنے والےآں اُتے حملہ کيتا۔ "لبنانی شیعہ ، جو جنوبی لبنان اُتے اسرائیلی قبضے توں لڑنے دے لئی فوجاں اکٹھا کرنے دی خواہش توں کارفرما اے ، نے 1982 وچ حزب اللہ (پارٹی آف گاڈ) دی بنیاد رکھی ،" اس تنظیم دا ناں 1985 وچ رکھیا گیا سی تے تنظیم نو کيتی گئی سی۔ <ref name="auto3">Bloom, Catherine (2008) "The Classification of Hezbollah in Both International and Non-International Armed Conflicts," Annual Survey of International & Comparative Law: Vol. 14: Iss. 1, Article 5. Available at: http://digitalcommons.law.ggu.edu/annlsurvey/vol14/iss1/5</ref>.
=== 1980 دی دہائی ===
[[فائل:Veiled Shia woman in southern Lebanon beside Hizballah slogan.png|سجے|thumb| سن 1980 دی دہائی وچ حزب اللہ دے نعرے دے نال جنوبی لبنان وچ اک پردہ شیعہ خاتون۔]]
سن 1982 وچ ، سیکڑاں ایرانی پاسداران دستےآں نے لبنان دی ناہموار [[وادی بقاع|وادی بیکاہ]] دا سفر کيتا تے اسلامی عمال تے دعو پارٹی سمیت مختلف بنیاد پرست شیعہ گروہاں دی تربیت شروع کيتی۔ <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> جنوبی لبنان اُتے جاری خانہ جنگی تے اسرائیل دے قبضے نے اک بنیاد پرستی دا ماحول جتھے حزب اللہ دی مذہبی جنونیت پروان چڑھ گئی۔ "شام تے ایران دونے دی رسد ، مالی تے فوجی مدد کيتی وجہ توں اس تحریک نے تیزی توں زور پھڑ لیا" <ref name="auto3"/> تے اسرائیل نوں [[گوریلا جنگ|گوریلا جنگ وچ ]] شامل کيتا۔ جنوبی لبنان دا جسمانی جغرافیہ سبز تے پہاڑی اے جو گہری وادیاں دے نال اے ، جو محافظ دے حق وچ اے تے حزب اللہ دی "کلاسک" گوریلا جنگ دے لئی مثالی سی۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> حزب اللہ دے ابتدائی حکمت عملی وچ انسانی لہر دے حملے شامل سن ، جداں [[ایران عراق جنگ|ایران - عراق جنگ]] وچ ایران نے استعمال کيتا سی ، جس وچ حزب اللہ دے کچھ عناصر نے حصہ لیا سی ، <ref name="archive.org5"/> تے اغوا ، ہوائی جہاز دے اغوا ، تے وڈے پیمانے اُتے خودکش حملےآں جداں دہشت گردانہ تدبیر۔ اسرائیل دے جنگ دے عزم نوں مجروح کيتا۔ {{Efn|At this time in Lebanon, terrorism was seen as unconventional warfare and a legitimate extension of political struggle.<ref name="imcia" />}} حزب اللہ ہراساں کرنے تے مارنے دے لئی مختصر چھاپےآں وچ مصروف سی تے اس نے علاقے اُتے قبضہ کرنے دی کوشش نئيں کيتی۔ اگرچہ ابتدا وچ بہت ہی کامیاب ، <ref name="Worall">James Worrall, Simon Mabon, Gordon Clubb. (2011) ''Hezbollah: From Islamic Resistance to Government''. p. 44–46 {{آئی ایس بی این|1440831343}}</ref> انہاں انتخابات نے ہلاکتاں تے عوام دی رائے وچ تنظیم نوں بھاری لاگت پائی۔ [[سی آئی اے|سنٹرل انٹیلیجنس ایجنسی]] (سی آئی اے) نے سن 1985 وچ کہیا سی کہ گروپ دی کمان تے کنٹرول "عملی طور اُتے عدم موجود اے " تے اس تنظیم نوں درجہ بندی نئيں بلکہ ذاتی وفاداریاں ، ذاتی دشمنیاں تے خاندانی تعلقات توں تعبیر کيتا اے۔ <ref name="imcia">Directorate of Intelligence, (8 November 1985) ''Lebanon: Amal and Hizballah– The Line Between Politics and Terrorism'', in ''Near East and South Asia Review''. Central Intelligence Agency.</ref> اس وقت ، بیروت وچ متعدد علما تے ائمہ دے ذریعہ آپریشنل فیصلے غیر موثر طریقے توں منظور کیتے گئے ، جو اگلے خط توں دور سن ۔ حزب اللہ دے پاس فوجی ڈھانچہ تے آپریشن ، رسد ، مواصلات ، انٹلیجنس ، تربیت تے بھرتیاں دی وکھ ذمہ داری سی۔ <ref name="castle">Directorate of Intelligence, (October 1985). ''Lebanon's Hizballah: The Rising Tide of Shia Radicalism: An Intelligence Assessment''. Central Intelligence Agency.</ref> درجہ بندی دی ایہ کمی عصری کھبے بازو دی آزادی دی تحریکاں دی طرح سی۔ <ref name="peace">Stepanova, Ekaterina (2008) ''Terrorism in Asymmetrical Conflict: Ideological and Structural Aspects'' SIPRI Research Report No. 23, Oxford University Press {{آئی ایس بی این|9780199533558}}</ref> 1985–1986 دے آس پاس دے حربے بنیادی طور اُتے بارودی سرنگاں لگاندے ، IEDs نوں دھماکے توں اڑاندے تے کدی کدائيں اسرائیلیاں اُتے فائرنگ دے لئی مسلح افراد دے گروہاں نوں جمع کردے سن ۔ حزب اللہ اس وقت اسنیپنگ دا استعمال نئيں کر پایا سی۔ آئی ڈی ایف دے اک انٹلیجنس افسر نے 1980 دی دہائی دے وسط وچ حزب اللہ نوں "راگ ٹیگ گروپ" دے طور اُتے بیان کيتا جو "ہر بار ناکام رہیا ،" تے 2014 دا جائزہ اس مدت دے دوران اس گروپ دی تدبیراندی کارکردگی نوں ناقص تے "انتہائی شوقیہ" سمجھدا اے۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> سی آئی اے دا کہنا اے کہ 1986 دے موسم بہار توں پہلے پارٹی دے حملے فوجی کارروائیاں دی بجائے "مایوسی دی غیر اعلانیہ حرکت" سن ۔ .
[[فائل:CIA–Hizballah Infiltration Routes.png|thumb| سیکیورٹی زون وچ حزب اللہ دی دراندازی دا نقشہ۔]]
ان پریشانیاں دے باوجود ، پارٹی دا سائز بڑھدا ہی چلا گیا ، تے 1986 وچ سی آئی اے نے اپنی فوجی طاقت نوں لبنان دی وڈی ملیشیاواں دے مقابلے دا سمجھیا۔ <ref name="wolf">{{حوالہ ویب|url=https://www.cia.gov/library/readingroom/docs/CIA-RDP86T01017R000807950001-1.pdf|title=Hizballah's Rise: The US Stake|last=Directorate of Intelligence|date=21 October 1986|publisher=Central Intelligence Agency|access-date=1 October 2020|archivedate=1 January 2018|archiveurl=https://web.archive.org/web/20180101135513/https://www.cia.gov/library/readingroom/docs/CIA-RDP86T01017R000807950001-1.pdf}}</ref> حزب اللہ تے نیڑے توں وابستہ گروپاں دی کل رکنیت 1983 وچ "کئی سو" توں ودھ کے 1984 وچ 2،000 توں 3،000 ہوئے گئی <ref>{{حوالہ ویب|url=https://www.cia.gov/library/readingroom/docs/CIA-RDP05-01507R000100050025-3.pdf|title=Lebanon: Hizballah Increasing Its Ranks|last=Directorate of Intelligence|date=October 1984|publisher=Central Intelligence Agency|access-date=2020-10-01|archivedate=2017-01-23|archiveurl=https://web.archive.org/web/20170123214612/https://www.cia.gov/library/readingroom/docs/CIA-RDP05-01507R000100050025-3.pdf}}</ref> تے 1985 وچ کچھ ہزار ، <ref name="castle">Directorate of Intelligence, (October 1985). ''Lebanon's Hizballah: The Rising Tide of Shia Radicalism: An Intelligence Assessment''. Central Intelligence Agency.</ref> تے 1986 دے وسط وچ اس گروپ نے 5،000 جنگجوواں نوں اک تقریب وچ شامل کيتا۔ وادی بیکا دے قصبے بعلب وچ ۔ 1986 وچ حزب اللہ عددی اعتبار توں چھوٹا سی ، لیکن رجحانات حزب اللہ دے حق وچ سن ۔ اس وقت ، تنظیم دے بوہت سارے پارٹ ٹائم جنگجو سن تے بوہت گھٹ کل وقتی ممبر سن ، جس توں اوہ ہلاکتاں اُتے حساس سن ۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> تنظیم دی "اسرائیلی فوج تے اسرائیل دی پراکسی ملیشیا فورسز توں لڑنے وچ مہارت" ، ہور حزب اللہ دے حریف امل دی بدعنوانی تے نا اہلی ، اعتبار تے عوامی حمایت وچ اضافے دے لئی اہم سی۔ جنوبی لبنان وچ ، عمال نوں وڈے پیمانے اُتے "انتہائی اعتدال پسند" تے اسرائیل دے رہنے دی جگہ دے طور اُتے دیکھیا جاندا سی ، جس دی وجہ توں بوہت سارے بنیاد پرست شیعہ حزب اللہ دی حمایت کر رہے سن ۔ حزب اللہ نوں امل دے حزب اللہ نواز دھڑاں دی حمایت حاصل سی جو امل دی اعلیٰ قیادت توں وکھ ہوگئے سن ۔ اس وقت حزب اللہ دی حیثیت دا اندازہ مختلف اے۔ سی آئی اے نے اس وقت اس گل دا اندازہ کيتا کہ "حزب اللہ دی اسرائیل تے اس دے سرجناں توں مقابلہ کرنے دی پالیسی کم کر رہی اے " تے حزب اللہ نے ایس ایل اے تے امل دے خلاف جنگ وچ "کوالٹی ایج" حاصل کيتا ، جدوں کہ اک آزاد جائزہ وچ کہیا گیا اے کہ 1987 تک حزب اللہ دی تزویراندی حیثیت خراب ہُندی جارہی سی۔ 18 اپریل 1987 نوں ، ایس ایل اے دی اک مضبوط چوکی اُتے حزب اللہ دی انسانی لہر دا حملہ ناکام ہوگیا تے اس دے نتیجے وچ 24 افراد ہلاک ہوگئے ، جس وچ اک ہی دن وچ تنظیم دے کل وقتی جنگجوواں وچوں 5 فیصد ہلاک ہوگئے۔ اس دھچکے دے نتیجے وچ تے دوسرے اسنوں پسند کردے نيں ، حزب اللہ اپنی حکمت عملی تبدیل کرنے اُتے مجبور ہوگئی۔ اسرائیلیاں دے زیر اثر تے لبنان دے متعدد فرقےآں تے سیاسی جماعتاں دے زیر اثر ، حزب اللہ نوں تیزی توں سیکھنے تے اپنی تدبیراں ، حکمت عملی تے تنظیم نوں دوبارہ استعمال کرنے اُتے مجبور کيتا گیا۔ <ref name="Worall">James Worrall, Simon Mabon, Gordon Clubb. (2011) ''Hezbollah: From Islamic Resistance to Government''. p. 44–46 {{آئی ایس بی این|1440831343}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/1440831343|1440831343]]</ref>.
خودکش حملےآں نے "نفیس ، مربوط ، تے وقتی حملےآں" تے مختصر ، فوری گھات لگانے والےآں نوں راستہ فراہم کیہ۔ مئی 1987 وچ ، حزب اللہ نے مشترکہ ہتھیاراں دی حیثیت توں پیادہ تے توپخانے نوں مربوط کرنا شروع کيتا تے "اسرائیلی ہیلی کاپٹراں اُتے حملہ کرنے دی اپنی صلاحیت نوں بہتر بنایا ، تے میدان جنگ توں زخمیاں نوں نکالنے وچ بہتری دا مظاہرہ کيتا۔" ایہ گروپ 1986 دے آس پاس اسکواڈ دے سائز دے حملےآں توں پلاٹون تے کمپنی دے سائز دے حملےآں وچ منتقل ہويا تے اس نے ستمبر 1987 وچ متعدد اہداف اُتے بیک وقت حملہ کيتا۔ 1980 دی دہائی دے آخر وچ پارٹی دے حملے بہتر منصوبہ بند بن گئے تے پیچیدگی وچ تیار ہويا ، خاص طور اُتے اگ دی مدد کرنے وچ ۔ حزب اللہ نے سن 1980 دی دہائی دے آخر وچ زیادہ تر درمیانے درجے دے کمانڈراں نوں ہٹا دتا ، تے انہاں دا اختیار مقامی کمانڈراں نوں سونپ دتا ، جس توں آپریشنل کارکردگی تے سلامتی دونے وچ بہتری آئی۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> تنظیم نے اپنے ڈھیلے توں منسلک تحفظ پسنداں دی صفاں نوں تراش دتا تے اپنی تدبیراں IEDs ، گھاتاں تے بالواسطہ اگ دی طرف وی تبدیل کردتی۔ <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> اصل وچ حزب اللہ اسرائیلیاں دے خلاف برسرپیکار کئی ملیشیاواں وچوں صرف اک سی ، لیکن 1985 تک ایہ اہمیت دا حامل سی <ref name="soar">Creveld, Martin van, "The Second Lebanon War: A Re-assessment", Infinity Journal, Issue No. 3, Summer 2011, pages 4-7.</ref> تے 1980 دی دہائی دے آخر تک ایہ واضح طور اُتے غالب سی۔ {{Efn|Other factions fighting the Israelis were Amal, the Syrian Social Nationalist Party, the Lebanese Communist Party, the CAO, the [[Arab Socialist Ba'ath Party – Lebanon Region|Lebanese Baath Party]], and various Palestinian factions.}}.
[[فائل:Hizballah fighters patrol Shia neighborhoods in southern Beirut.png|سجے|thumb| جنوبی بیروت وچ مسلح حزب اللہ جنگجو اک محلے وچ گشت کردے نيں۔]]
[[فائل:CIA map- Syrian and Hezbollah presence in Beirut.png|thumb| 1987 وچ حزب اللہ دا نقشہ تے بیروت اُتے شامی کنٹرول۔]]
مئی 1988 وچ ، کئی سالاں دی دشمنی تے جھڑپاں دے بعد ، حزب اللہ نے بیروت دے جنوبی نواحی علاقےآں نوں کنٹرول کرنے دے لئی عمال دے نال اک مختصر لیکن شدید جنگ لڑی ، <ref>{{حوالہ رسالہ|url=https://www.cia.gov/library/readingroom/docs/CIA-RDP06T00412R000707380022-2.pdf|title=Shia Militia Fighting in West Beirut: Advantage Hezbollah|last=Directorate of Intelligence|date=12 May 1988|publisher=Central Intelligence Agency}} {{Webarchive|url=https://web.archive.org/web/20170122215200/https://www.cia.gov/library/readingroom/docs/CIA-RDP06T00412R000707380022-2.pdf |date=22 January 2017 }}</ref> جس وچ اس وقت ملک دی تقریبا of اک چوتھائی آبادی سی۔ <ref name="wolf"/> چونکہ امل دا شام توں اتحاد سی ، حزب اللہ دی اس وقت لبنان اُتے قابض شامی فوج دے فوجیاں دے نال وی جھڑپ ہوئی۔ حزب اللہ نے اسٹریٹ فائٹنگ وچ کامیابی حاصل کيتی تے ہدف بنا کے قتل کرنے تے بدنامیاں دی حوصلہ افزائی کيتی۔ جدوں توں امل تے حزب اللہ اتحادیاں توں بھیک منگ رہے نيں۔ <ref name="auto6">James Worrall, Simon Mabon, Gordon Clubb. ''Hezbollah: From Islamic Resistance to Government''. {{آئی ایس بی این|978-1440831348}}. p. 49</ref> اگرچہ حزب اللہ نے عسکری طور اُتے فتح حاصل کيتی ، لیکن جلد ہی انہاں نے اپنی سرزمین اُتے سخت [[شریعت|شرعی]] قانون نافذ کيتا ، جداں کافی تے غیر منحرف خواتین اُتے پابندی عائد کردتی ، تے اپنے لوکاں دے دل و دماغ ضائع کردتے ۔ <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref><ref name="meme">{{حوالہ رسالہ|url=http://smallwarsjournal.com/jrnl/art/hezbollahs-strategy-and-tactics-in-the-security-zone-from-1985-to-2000|title=Hezbollah's Strategy and Tactics in the Security Zone from 1985 to 2000|first=Iver|last=Gabrielson|publisher=Small Wars Foundation|date=July 11, 2013}}</ref> زیادہ تر لبنانی شیعہ نئيں نيں ، تے ایتھے تک کہ لبنان دے بیشتر شیعہ وی اسلامی ریاست وچ رہنا نئيں چاہندے نيں۔ <ref name="tomorrow">{{حوالہ رسالہ|url=https://www.gpo.gov/fdsys/pkg/CHRG-111shrg62141/html/CHRG-111shrg62141.htm|title=Assessing the Strength of Hezbollah|last=Augustus Richard Norton|date=June 8, 2010}}</ref> سخت گیر شیعہ مذہبی قانون دی حمایت توں حزب اللہ دی حمایت بہت زیادہ اے۔ عوامی حمایت وچ کمی تے سیاحت نوں گرنے دے نال ، حزب اللہ نوں اک اسلامی جمہوریہ دی اپنی بیان بازی چھڈنے تے 1992 وچ لبنانی سیاست وچ آنے اُتے مجبور کيتا گیا۔ اس واقعے دے بعد توں ہی حزب اللہ "لبنانائزنگ" تے لبنانی معاشرے وچ ہور مربوط ہُندا جارہیا اے۔ <ref>{{حوالہ ویب|url=https://wikileaks.org/plusd/cables/04BEIRUT3713_a.html|title=Lebanon: The Two Faces of Hizballah; Part One -- the Potential for "libanisation" of Hizballah|last=|date=July 30, 2004|publisher=WikiLeaks}}</ref> بعد وچ حزب اللہ دی جانب توں معاشرتی ادارے بنانے ، لڑائی توں تباہ شدہ مکانات دی تعمیر نو ، تے شیعہ علاقےآں وچ گند نکاسی ، نوکریاں تے بجلی لیانے دیاں کوششاں عوامی حمایت وچ اضافے دے لئی اہم سن۔ 1989 وچ [[طائف معاہدہ|طائف معاہدے]] نے لبنانی خانہ جنگی دا خاتمہ کيتا تے حزب اللہ نوں [[اسرائیلی دفاعی افواج]](IDF )کے خلاف اپنی فوجی کوششاں تیز کرنے دی اجازت دی۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref>.
=== 1990 دی دہائی ===
1990 دی دہائی دے اوائل وچ اس گروہ وچ تیزی توں بہتری آئی ، جس وچ 1990 وچ ہلاک ہونے والے ہر اسرائیلی فوجی دے پنج جنگجوواں دے ہارنے توں ودھ کے 1993 وچ 1.5 ہوئے گیا سی ، جو تناسب تقریبا دہائی دے آخر تک برقرار رہے گا۔ <ref name="exploring">DeVore, M. (2012). Exploring the Iran-Hezbollah Relationship: A Case Study of how State Sponsorship affects Terrorist Group Decision-Making. ''Perspectives On Terrorism'', 6(4-5).</ref> حزب اللہ نے 1990 وچ انسانی لہر دے حملےآں دا خاتمہ کيتا تے دو یونٹاں دے نال حملہ کرنا شروع کيتا: اک حملہ ٹیم تے فائر سپورٹ ٹیم 81 دے نال ملی میٹر مارٹر۔ <ref name="small">Armor magazine, January–February 2002</ref> حکمت عملی دی مہارت وچ اس بہتری دے لئی جنگی تجربے نوں جمع کرنا اہم سی ، <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> تے 1990 دی دہائی دے اوائل تک حزب اللہ دے حملےآں نوں "محتاط منصوبہ بندی تے اچھی طرح توں چلنے والی پیشہ ورانہ مہارت دی خصوصیت دتی گئی۔" <ref>Augustus Richard Norton (2014) ''Hezbollah: A Short History''. Princeton University Press.</ref> حزب اللہ نے 1990 دی دہائی دے اوائل وچ اپنے اسرائیلی مخالفین نوں آئینہ دار کردے ہوئے عملے دے کماں نوں سرشار انجام دتا۔ بہتر ذہانت تے بحالی دی صلاحیتاں مجموعی طور اُتے لڑنے دی بہتر صلاحیت دے وی وڈے محرک سن ۔ 1992 وچ ، [[حسن نصر اللہ|حسن نصراللہ]] نے [[حسن نصر اللہ|حزب اللہ]] دا کنٹرول سنبھال لیا ، تے عام طور اُتے ایہ سمجھیا جاندا اے کہ اوہ مضبوط قیادت فراہم کردا سی۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> 1980 دی دہائی دے آخر تے 1990 دی دہائی دے اوائل دے دوران ، پارٹی نے مقدار توں زیادہ معیار اُتے انکار کردتا ، کافی حد تک بہتر تربیت تے ہور اسلحہ وی جمع کيتا: 1990 دی دہائی دے اوائل تک ، انہاں نے "اک اہم اسلحہ جمع کيتا سی۔" <ref name="Worall">James Worrall, Simon Mabon, Gordon Clubb. (2011) ''Hezbollah: From Islamic Resistance to Government''. p. 44–46 {{آئی ایس بی این|1440831343}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/1440831343|1440831343]]</ref> اس وقت انہاں دے چھوٹے ہتھیاراں وچ [[اے۔کے 47|اے دے 47]] تے [[ایم 16|ایم 16 رائفلز]] ، بنگلور ٹارپیڈو ، ہینڈ گرنیڈ ، [[آر پی جی - 7|آر پی جی]] ، تے [[ایم 16|ایم]] [[اے۔کے 47|40]] ریکولیس رائفل شامل سن ۔ اس ہتھیاراں وچ اضافے دے لئی ایران وڈی حد تک ذمہ دار سی تے اس نے ہر مہینے دمشق وچ اسلحہ تے بارود دے طیارے اڑائے۔ <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> حزب اللہ نے 1990 دی دہائی دے اوائل وچ مکمل جنگی یونیفارم متعارف کروائے تے انہاں دی چھوٹی یونٹ دی حکمت عملی تے فیلڈ سکیورٹی وچ بہتری لائی۔ .
1990 دی دہائی دے دوران ، حزب اللہ نے آئی ڈی ایف دے نال بلیاں دا ماؤس چھیڑا ، حزب اللہ دے نال تیزی توں جدید ترین IEDs تے IDF دا مقابلہ ہويا۔ ہوسکدا اے کہ حزب اللہ نے 1995 دے اوائل وچ ہی آئی ڈی ایف دے خلاف سیل فون توں پھٹنے والے آئی ای ڈیز دا استعمال کيتا ہوئے۔ <ref name="cap">Captain Daniel Helmer, ''The Poor Man's FBCB2: R U Ready 4 the 3G Celfone?''. Armor magazine, November–December 2006.</ref> قبضے دی مدت دے دوران اسرائیلی ہلاکتاں دا بنیادی ذریعہ IEDs ہون گے ، تے 1995 توں لے کے 2000 تک ہر سال تقریبا 50٪ IED حملےآں وچ اضافہ ہويا۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> ستمبر 29 ، 1992 نوں ، تنظیم نے متعدد چوکیوں اُتے اپنا پہلا مربوط حملہ کيتا۔ <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> 1993 وچ حزب اللہ نے اسرائیل دے نال ست دن دی تیز لڑائی وچ مصروف رہیا ، جس دے نتیجے وچ لبنانی انفراسٹرکچر تے عام شہریاں نوں بہت زیادہ نقصان پہنچیا لیکن حزب اللہ یا اسرائیل وچوں کسی نوں وی دیرپا فوجی نقصان نئيں پہنچیا۔ اس تنازعہ وچ حزب اللہ دے ذریعہ سویلین اسرائیلی علاقےآں اُتے داغے گئے کتیوشا راکٹاں دا پہلا وڈا استعمال وی دیکھیا گیا ، ایہ اک تدبیر اے جو پی ایل او نے اک دہائی پہلے استعمال کيتا سی تے ایہ مستقبل وچ حزب اللہ دی اک تعریفی عمل بن جائے گا۔ حزب اللہ دے اس دے پہلے استعمال کيتا AT-3 Sagger ستمبر 9، 1992 نوں اینٹی ٹینک گائیڈڈ میزائل (ATGM) تے اس دے سب توں پہلے استعمال کيتا AT-4 spigot دے 1997 وچ میزائل، ايسے سال حزب اللہ دے طاقتور امریکی حاصل کيتی ٹو ATGM. پارٹی دے ذریعہ اینٹی ٹینک ہتھیاراں دا استعمال شورش دی مدت دے دوران معیار وچ مستقل اضافہ ہويا۔ <ref name="small">Armor magazine, January–February 2002</ref> 1998 تک حزب اللہ نے انہاں میزائلاں توں تن مرککوا ایم دے 3 اہم جنگی ٹینک تباہ کردتے سن ۔ <ref>Captain Tom J. Meyer, ''Active Protective Systems: Impregnable Armor or Simply Enhanced Survivability?'' Armor magazine, May–June 1998</ref> حزب اللہ نے سن 1997 1997.. وچ سنجیدگی توں اینٹی ٹینک حکمت عملی تیار کرنا شروع کيتی سی ، جس وچ اس گل اُتے توجہ دتی جارہی سی کہ اوہ اسرائیل دے جدید ترین رد عمل دا شکار ہتھیاراں نوں شکست دینے دے لئی متعدد بار اک ٹینک اُتے ايسے جگہ توں ٹکراسکے ، ایہ حربہ جو اج وی حزب اللہ دے ذخیرے دا اک حصہ اے۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> اگرچہ اس وقت حزب اللہ دی اے ٹی جی ایم ہتھیاراں - تے اج وی - IDF دے سپائیک سسٹم توں کدرے کمتر اے ، لیکن مرکاوا ٹینک نوں تباہ کرنے وچ کامیاب ہونا اک نفسیاتی فتح سی۔ حزب اللہ نے اس دوران مارٹر تے توپ خانہ استعمال کرنے دی انہاں دی صلاحیت وچ وی بہتری لائی۔ اُتے ، حزب اللہ دے تمام ہتھیار اِنّے کامیاب نئيں سن ۔ اگرچہ حزب اللہ نے SA-7 'Grail' اینٹی ائیرکرافٹ میزائل حاصل کیتے تے نومبر 1991 وچ انہاں نوں پہلے فائر کيتا ، لیکن انہاں نوں اسرائیلی طیارےآں اُتے حملہ کرنے وچ تقریبا کوئی کامیابی نئيں ہوئے گی۔ حزب اللہ دی طیارہ توں بچنے دی صلاحیتاں اس گروپ دی سب توں وڈی کمزوری وچوں اک نيں۔ حزب اللہ جنگجوواں نے اس عرصے وچ "بنیادی لائٹ انفنٹری حکمت عملی" استعمال کیتے ، <ref name="auto4">Exum, Andrew (c. 2012) ''Hizbollah: a military history''. Thesis. Department of War Studies, King's College London.</ref> جداں IED ، مارٹر ، تے چھوٹے گھاتیاں۔ <ref name="seinfeld">{{حوالہ ویب|url=http://www.washingtoninstitute.org/uploads/Documents/pubs/ResearchNote35-Pollak-2.pdf|title=Research Notes No 35: The Transformation of Hezbollah by Its Involvement in Syria|publisher=The Washington Institute for Near East Policy|first=Nadav|last=Pollak|date=August 2016|access-date=2020-10-01|archivedate=2020-08-27|archiveurl=https://web.archive.org/web/20200827064407/https://www.washingtoninstitute.org/uploads/Documents/pubs/ResearchNote35-Pollak-2.pdf}}</ref>.
[[فائل:Katyousha operation2006.jpg|سجے|thumb| ایم 16 رائفلز دے نال حزب اللہ دے جنگجوواں نے 1996 وچ "اپریل دی جنگ" دے دوران BM-21 Grad "Katyusha" راکٹ لانچر فائر کيتا سی۔]]
1995 دے آس پاس ، جنگجوواں دا اک چھوٹا گروہ خانہ جنگی وچ مسلماناں دی تربیت دے لئی بوسنیا گیا۔ <ref>Levitt, Mathew. ''Hezbollah: The Global Footprint of Lebanon's Party of God'' (2015) p. 149 {{آئی ایس بی این|978-1626162013}}</ref> ایہ شاید حزب اللہ دی پہلی مہم جوئی کوشش سی۔ حزب اللہ نوں اخلاقی طور اُتے قابل قبول خودکش حملےآں دا پتہ چلدا رہیا ، لیکن انہاں دا استعمال مرحلہ وار اس لئی نکلیا کہ اوہ ہن تکتیلی طور اُتے موثر نئيں سن ۔ اس گروہ نے 1990 دی دہائی وچ صرف چار خودکش حملے کیتے سن ۔ <ref name="meme"/> ایہ عدم تشدد دی شکلاں دی طرف پارٹی دے طویل مدتی رجحان دا اک حصہ اے۔ <ref name="peace">Stepanova, Ekaterina (2008) ''Terrorism in Asymmetrical Conflict: Ideological and Structural Aspects'' SIPRI Research Report No. 23, Oxford University Press {{آئی ایس بی این|9780199533558}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/9780199533558|9780199533558]]</ref> 1990 دی دہائی دے دوران حزب اللہ نے خاص طور اُتے ایس ایل اے وچ شیعہ دستےآں نوں انحراف ، ویران ، یا انٹیلی جنس دے لئی نشانہ بنایا۔ تنظیم دے PSYOPS تے پروپیگنڈا وار دے استعمال دے نال نال ، اس SLA دے اندر حوصلے پست کرنے دا باعث بنی۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> شورش دا سلسلہ چلدے ہی ایس ایل اے دے حوصلے پست ، تے حتی کہ IDF دے حوصلے پست ہوگئے۔ اگرچہ شورش 1990 دی دہائی دے اوائل وچ کدی کدی "پیچیدہ" دکھادی دیندی سی ، لیکن 1996 دے آپریشن انگور آف وراٹ نے تشدد دی سطح وچ بہت اضافہ کيتا۔ حزب اللہ تے اسرائیل سولہ روزہ مہم وچ شامل سن جنہاں اُتے ہزاراں راکٹ تے توپ خانے توں حملہ ہويا سی تے لڑائی تیز ہوگئی سی۔ حزب اللہ نے تنازعات دے دوران اسرائیل اُتے سیکڑاں راکٹ داغے ، تے انہاں دی "راکٹ دی کارکردگی [خاص طور اُتے 1993 توں 1996 دے درمیان] بہتر ہوئی سی۔" اس مہم دا اختتام اپریل دے تحریری تفہیم دے نال ہويا ، جس نے "کھیل دے قواعد" نوں اچھی طرح توں سمجھیا تے جے دونے طرف توں "سرخ لکیراں" عبور کيتیاں گئیاں تاں ، خاص طور اُتے عام شہریاں اُتے حملےآں دی جوابی کارروائی کيتی اجازت دتی گئی۔ <ref name="tomorrow"/> اس دے بعد توں ، حزب اللہ نے ایکسیلریشن تے ڈیٹرنینس دے مخصوص اسٹراٹیجک نظریے اُتے عمل کيتا اے۔
[[فائل:Hezbollah guerrillas.jpg|سجے|thumb| حزب اللہ گوریلا 1998 وچ کٹیوشا راکٹ دے نال کھڑے نيں۔]]
[[فائل:Tempo of Hezbollah attacks, 1994-2000.png|thumb|300x300px| 1990 دی دہائی دے دوران حزب اللہ دے حملےآں دی تعداد وچ خاطر خواہ اضافہ ہويا۔]]
[[فائل:Hezbollah parade, 2000.jpg|سجے|thumb| اسرائیلی قبضے دے خاتمے دے بعد حزب اللہ پریڈ۔]]
1996 دے تنازعہ دے بعد جنگ دا مختصر طور اُتے خاتمہ ہويا جدوں حزب اللہ لڑائی توں باز آیا ، لیکن اس تحریک دی رسد "لچکدار" سی تے اس دے بعد اس گروپ نے ڈرامائی انداز وچ تشدد دی سطح نوں ودھیا دتا۔ <ref name="auto7">James Worrall, Simon Mabon, Gordon Clubb ''Hezbollah: From Islamic Resistance to Government''. {{آئی ایس بی این|978-1440831348}} p. 50</ref> جدوں کہ حزب اللہ نے 1985–1989 تک 100 تے 1990 توں 1995 تک دے چھ سالہ عرصہ وچ 1،030 حملے کیتے ، اس نے 1996–2000 دے دوران 4،928 حملے کیتے <ref name="bonjour">Guérin, Alexandre. (2009) ''Le Hezbollah Face Aux Forces Armées Conventionnelles Perspective Historique Des Modes D'action''. Centre de Doctrine d'Emploi des Forces – Division Recherge et Retour d'Expérience.</ref> جنہاں وچ تن سال تک ہر ماہ گھٹ توں گھٹ 50 حملے تے اس توں زیادہ سن ۔ صرف 1999 وچ 1500 حملے ہوئے۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> {{Efn|These numbers are self-reported by Hezbollah.}} 1987 دے آس پاس ایس ایل اے تے آئی ڈی ایف چوکیوں اُتے لٹل حملےآں دے ہتھکنڈے نوں ترک کرنے دے بعد ، حزب اللہ نے اک دہائی دے بعد یکسر تبدیل شدہ ہتھکنڈاں دے نال اس مشق دا آغاز کيتا۔ 18 ستمبر 1997 نوں ، حزب اللہ نے بیک وقت 25 چوکیوں اُتے حملہ کيتا تے کمک نوں نشانہ بنانے دے لئی اے ٹی جی ایم ٹیماں دا استعمال کيتا۔ قبضے دے اختتام تک ، حزب اللہ بھاری ہتھیاراں دا استعمال کر رہیا سی تے دشمن دے نال گھنٹےآں طویل فائر فائٹرز وچ مصروف رہیا۔ اکتوبر 1998 وچ ، حزب اللہ نے سب توں پہلے دھماکہ خیز مواد توں تیار کردہ اک گھسنے والا ، اک ایسا نفیس تے طاقتور IED تعینات کيتا جو تقریبا کسی وی بکتر نوں گھس سکدا اے۔ <ref>Gordon, Michael R. (2013) ''The Endgame: The Inside Story of the Struggle for Iraq, from George W. Bush to Barack Obama.'' {{آئی ایس بی این|978-0307388940}} p. 154</ref> حزب اللہ 1998 ، 1999 تے 2000 نوں شورش دا اپنا کامیاب ترین سال سمجھدی اے ، تے 1997 تے 1998 وچ مشترکہ اسرائیلی تے ایس ایل اے دی ہلاکتاں حزب اللہ دی نسبت ودھ گئياں۔ تجزیہ کار آئیور گبریئلسن دا اک تحقیقی مقالہ ایہ دلیل پیش کردا اے کہ 1990 دی دہائی دے آخر تک حزب اللہ "حکمت عملی توں ماہر" تنظیم بن چکی اے۔ شناخت تے اسرائیل دے کمزور پہلو نوں ہدف بنانے دی طرف توں، جانی نقصان، حزب اللہ دی جنگ جیتنے دے لئی قابل سی چھڈنے . بڑھدے ہوئے تشدد ، کمزور حوصلے تے گھر وچ شدید سیاسی دباؤ دے درمیان ، لبنان وچ جنگ اسرائیل دے لئی بہت زیادہ ہوگئی۔ 24 مئی 2000 دی صبح 6:48 بجے ، آئی ڈی ایف 18 سالاں وچ پہلی بار جنوبی لبنان توں روانہ ہويا ، تے ایس ایل اے ملیشیا فوری طور اُتے گر گیا۔ اگرچہ حسن نصراللہ نے اک بار ایس ایل اے دے ممبراں نوں انہاں دے بستراں اُتے "ذبح" کرنے دا وعدہ کيتا سی ، لیکن بدلہ لینے دی کوئی واردات نئيں ہوئی۔
=== 2000 دی دہائی ===
2000 توں 2006 تک ، حزب اللہ نے لتانی ندی دے جنوب وچ جنوبی لبنان وچ وڈے پیمانے اُتے فوجی انفراسٹرکچر دی تعمیر دے لئی اک تزویراندی انتخاب کيتا۔ اس دے علاوہ ، حزب اللہ نے اے ٹی 14 کورنیٹ جداں جدید اینٹی ٹینک میزائلاں دے حصول دے ذریعہ انہاں دے ہتھیاراں دی مقدار تے معیار وچ بے حد اضافہ کيتا۔ اسرائیلی انخلا توں عین پہلے حزب اللہ نے جنوبی لبنان وچ اہم فوجی انفراسٹرکچر تعمیر کيتا سی۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> {{Efn|But some sources say infrastructure construction in the south began as early as 1996.<ref name="jj" />}} IDF تے آزاد مبصرین جاندے سن کہ حزب اللہ نے کچھ بنیادی ڈھانچہ تعمیر کيتا اے ، لیکن اس دا پیمانہ متوقع نئيں سی۔ بین المذاہب دی مدت محدود ، چھڑپھڑ لڑائی تے دونے طرف توں کچھ ہلاکتاں دی نشاندہی کيتی گئی تھی: 2001 تے 2004 دے درمیان حزب اللہ نے صرف 16 حملے کیتے۔ <ref name="bonjour">Guérin, Alexandre. (2009) ''Le Hezbollah Face Aux Forces Armées Conventionnelles Perspective Historique Des Modes D'action''. Centre de Doctrine d'Emploi des Forces – Division Recherge et Retour d'Expérience.</ref> حزب اللہ اسرائیل دا مطالعہ کردا رہیا تے سیکھے گئے اسباق نوں اپناندا رہیا ، تے اس گروپ نے اسرائیل دے بارے وچ معلومات اکٹھا کرنے وچ وڈی تعداد وچ کوششاں کيتیاں ۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> اعلیٰ نقل و حرکت دی اپنی حکمت عملی نوں تبدیل کردے ہوئے ، حزب اللہ پہلے توں تعمیر شدہ بنکر ، ذخیرہ اندوزی ، تے لڑائی پوزیشناں دے نال نسبتا طے ہوگیا۔ اس دوران ، حزب اللہ نے ایران توں اپنی پہلی یو اے وی وی حاصل کيتیاں تے عسکریت پسنداں نوں عراق وچ بھیجیا تاکہ اوہ امریکیوں دے خلاف گوریلا جنگ لڑنے دے لئی " خصوصی گروپ " دی تربیت کرن۔
[[فائل:Hezbollah Defensive System in Southern Lebanon.png|thumb| جنوبی لبنان وچ حزب اللہ دے دفاعی نظام دا نقشہ۔]]
2006 وچ ، حزب اللہ نے اسرائیل دے اندر اک اسرائیلی سرحدی گشت اُتے گھات لگیا کر حملہ کيتا ، اٹھ اسرائیلی فوجی ہلاک تے دو اسرائیلی فوجیاں نوں اغوا کرلیا ، قید حزب اللہ دے قیدیاں دی رہائی دے لئی سودے بازی دی ناکام کوشش وچ ۔ اسرائیل نے زبردست طاقت دے نال جواب دتا ، تے 34 روزہ 2006 دی لبنان جنگ نوں جنم دتا۔ جنگ دے دوران ، حزب اللہ نوں "اک منظم ، تربیت یافتہ تے اچھی طرح توں سازوسامان دی طاقت" تے "سخت جدوجہد" دے طور اُتے بیان کيتا گیا سی۔ <ref>{{حوالہ ویب|url=https://www.nytimes.com/2006/07/26/world/middleeast/26strategy.html|title=Israel Finding a Difficult Foe in Hezbollah|date=26 July 2006|website=The New York Times|first=Steven|last=Erlanger|first2=Thom|last2=Shanker}}</ref> 2006 وچ حزب اللہ نے غیر متناسب ، مربوط اسٹینڈ آف تے اگ توں انکار دی حکمت عملی اپنائی۔ <ref>{{حوالہ ویب|url=https://www.dvidshub.net/publication/issues/33530|title=ARMOR Magazine – 11.05.2012|last=|date=|publisher=}}</ref> حزب اللہ نے جنوبی لبنان دے دفاع تے [[اسرائیلی دفاعی افواج|آئی ڈی ایف]] اُتے حملہ کرنے دے لئی ہلکی انفنٹری ، بنکر ، تے اینٹی ٹینک ٹیماں دا استعمال کردے ہوئے آبادی والے اسرائیلی علاقےآں تے شہراں اُتے راکٹ داغے۔ اس گروپ نے دیہات وچ مقیم چھوٹے خود کفیل یونٹاں اُتے توجہ مرکوز کيتی سی ، جو کسی حد تک موثر کمانڈ اینڈ کنٹرول ڈھانچے تے کم نقل و حرکت دے نال گھریلو محاذ نوں بڑھاوا دیندے نيں۔ <ref name="seinfeld"/> 2006 وچ ، حزب اللہ نے "کمپلیکس ویب ڈیفنس" استعمال کيتا۔ "یہ باہمی طور اُتے دفاعی پوزیشناں دی حمایت کرنے دی خصوصیت اے ، لچکدار ، بے کار مواصلات توں باہم جڑے ہوئے تے ذخیرہ اندوز تے چھپی ہوئی فراہمی دے ذریعہ برقرار رہندی اے۔ جنگجو اکثر اوقات بے قاعدہ سن ، لیکن اوہ اچھی طرح توں تربیت یافتہ سن تے بہت اچھے توں اعلیٰ آن لائن اینٹی ٹینک تے اینٹی پرسنل ہتھیاراں توں لیس سن ۔ اوہ لچکدار ، پہلے توں ترتیب والے منصوبےآں اُتے عملدرآمد کرنے دی اہلیت رکھدے سن تے نچلے تاکتیکی سطح اُتے چستی دا مظاہرہ کردے سن ۔ " <ref>Lieutenant Colonel Kenny D. Harper and Colonel (Retired) William R. Betson. Complex Web Defense Experiment. Armor magazine January–February 2010.</ref> حزب اللہ دیہات تے ہور سویلین علاقےآں توں لڑنے دے لئی راضی سی ، جو جنگ دے قوانین دی خلاف ورزی دے باوجود ، حکمت عملی توں فائدہ مند سی۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> خطے تے آب و ہوا نے بکتر بند تے تدبیر دی جنگ وچ اسرائیل دے فائدے دی نفی دی تے پیدل چلنے دی مہارت دا تجربہ کيتا ، جتھے حزب اللہ سب توں مضبوط سی۔ حزب اللہ دی تدبیراں ، ہلکی انفنٹری ، اینٹی ٹینک ہتھیاراں تے اسرائیل اُتے راکٹ فائر سمیت ، 1990 دے عہد دے حکمت عملی دا تسلسل سی۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref>
یہ گروپ زیادہ روايتی بن گیا سی ، جو گوریلا تنظیم توں ہائبرڈ ایکٹر وچ تبدیل ہوئے گیا سی ، جس وچ نقصان نوں جذب کرنے تے وقت گزرنے دے نال اعلیٰ شدت توں لڑنے نوں برقرار رکھنے دی صلاحیت موجود سی۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> اس جنگ دا اختتام اقوام متحدہ دی سلامتی کونسل دی قرارداد 1701 تے غیر نتیجہ نتیجہ سی۔ کسی وی فریق نے اپنے مقاصد حاصل نئيں کیتے۔ <ref name="soar">Creveld, Martin van, "The Second Lebanon War: A Re-assessment", Infinity Journal, Issue No. 3, Summer 2011, pages 4-7.</ref> حزب اللہ نے "الہی فتح" دا دعوی کيتا۔ <ref name="divine">William M. Arkin, ''Divining Victory: Airpower in the 2006 Israel-Hezbollah War'' (2007) pp. 36–37 {{آئی ایس بی این|978-1585661688}}</ref> حزب اللہ نے 2006 دی جنگ وچ انہاں دی بنیادی کوتاہی نوں انہاں دے فضائی دفاع دی کمی دی نشاندہی دی ، جس نوں انہاں نے اک "سنجیدہ مسئلہ" تے اس دا ازالہ کرنا انہاں دا بنیادی کم سمجھیا۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> نشاندہی ، چھوٹی یونٹ دی تدبیراں ، تے میدان جنگ دے ہتھکنڈاں ، اسلحے دے ڈپواں ، تے لڑائی دے تھاںواں دی نمائش دی جانے والی ہور کمزوریاں۔ ہور ایہ کہ ، اقوام متحدہ دی سلامتی کونسل دی قرارداد جس نے جنگ دا خاتمہ کيتا حزب اللہ نوں اس دے زیرزمین بنکراں تے قلعےآں دا گھنے نیٹ ورک ترک کرنے اُتے مجبور کيتا تے جنوبی لبنان نوں لبنان دی مسلح افواج دے لئی اقوام متحدہ دے امن فوجیاں دے حوالے کردتا ، جسنوں UNIFIL کہیا جاندا اے۔ اگرچہ اس گروہ دے اسلحہ سازی ، آپریشنل سیکیورٹی تے انٹیلیجنس نے سن 2000 تے 2006 دے درمیان بہت زیادہ بہتری لیائی ، لیکن گروپ دی قوت دے ڈھانچے یا تزویراندی قابلیت وچ واضح طور اُتے بہتری آئی اے۔ اس بارے وچ حالے تک کوئی اجماعی اتفاق رائے نئيں اے کہ آیا جنگ حزب اللہ دے لئی حکمت عملی توں فائدہ مند سی۔ گروپ دی شیعہ برادری ، مجموعی طور اُتے لبنان تے اس جنگ دے بعد مشرق وسطی وچ مقبولیت پائی۔ <ref name="seinfeld"/>
=== 2006 دے بعد ===
[[فائل:Hezbollah guys.jpg|سجے|thumb| 2006 دی جنگ دے بعد پریڈ اُتے حزب اللہ جنگجو]]
2006 دی جنگ دے بعد ، حزب اللہ نے انہاں دے ہتھیاراں تے تدبیراں دے بعد ایکشن جائزہ لیا ۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> حزب اللہ نے اپنے بنکراں دی کارکردگی دا مظاہرہ کيتا تے پینڈو علاقےآں وچ "سیکیورٹی جیباں" توں باڑ پھاڑ کر فائرنگ کيتی۔ حزب اللہ دے جائزے توں معلوم ہويا اے کہ اس گروہ دے "پنڈ دے محافظ" محافظاں ، تقریبا شورش توں وابستہ سابق فوجیاں نے عمدہ کارکردگی دا مظاہرہ کيتا اے۔ اطلاعات دے مطابق حزب اللہ دے جنگجو اپنے مقامی خطہ نوں گہرائی توں جاندے سن ، انہاں دے مشن نوں سمجھدے سن ، تے انہاں نوں فتح اُتے مکمل اعتماد سی۔ [[سپاہ پاسداران انقلاب اسلامی|اسلامی انقلابی گارڈ کارپس]] قدس فورس (IRGC-QF) نے حزب اللہ دے لئی اک سبق سکھیا ہويا جائزہ وی لکھیا ، جس نے مبینہ طور اُتے اس دی متعدد سفارشات نوں اپنایا سی۔ <ref>Michael R. Gordon. ''The Endgame: The Inside Story of the Struggle for Iraq, from George W. Bush to Barack Obama'' (2013). p. 316</ref> {{Efn|Or perhaps the IRGC-QF and Hezbollah together wrote one review; sources dither.}} جنگ دے بعد ، IRGC-QF نے مٹریئل ، فنڈنگ ، ٹریننگ ، تے انٹیلیجنس شیئرنگ دی منتقلی وچ اضافہ کيتا۔ <ref name="sendnudes"/> جنگ دے بعد شمالی اسرائیل اُتے عملی طور اُتے حالے تک کوئی راکٹ فائر نئيں ہويا اے تے حزب اللہ انہاں چند حملےآں توں انکار کردا اے جو اس طرح ہُندے نيں۔ <ref name="soar">Creveld, Martin van, "The Second Lebanon War: A Re-assessment", Infinity Journal, Issue No. 3, Summer 2011, pages 4-7.</ref>
2006 دی جنگ دے بعد توں ، حزب اللہ نے اپنے ہتھیاراں دے ہتھیاراں ، افرادی قوت تے انٹیلیجنس آلات دی خاطر خواہ اضافہ کيتا اے۔ اس گروپ نوں روايتی تے غیر روايتی جنگی صلاحیتاں دے نال ہائبرڈ اداکار دی درسی کتاب دی تعریف دے طور اُتے وسیع پیمانے اُتے استعمال کيتا جاندا اے۔ <ref name="auto23">Piotrowski, Marcin Andrzej. (2 March 2015) ''Hezbollah: The Model of a Hybrid Threat'' The Polish Institute of International Affairs Bulletin, No. 24 (756).</ref><ref>Department of the Army Headquarters. (November 2010) ''TC 7-100 Hybrid Threat''.</ref> اک ہائبرڈ اداکار دی حیثیت توں ، حزب اللہ دی بنیادی کمزوری آبادی دے درمیان چھپنے دے لئی شہریاں دی مدد نوں برقرار رکھنا اے جدوں کہ جنگ شروع ہوئی تاں عام شہریاں نوں بہت زیادہ نقصان پہنچیا۔ اس دی وجہ توں حزب اللہ عوامی حمایت نوں برقرار رکھنے تے جنگ توں بچنے دے لئی اپنے اقدامات نوں جواز بنائے۔ <ref name="dvidshub.net">{{حوالہ ویب|url=https://www.dvidshub.net/publication/issues/8255|title=Preparing for Hybrid Threats|first=William|last=Fleser|date=May–June 2010|publisher=United States Army John F. Kennedy Special Warfare Center and School, Fort Bragg, N.C.}}</ref> 2011 وچ شام وچ خانہ جنگی دے آغاز دے بعد توں ہی حزب اللہ نے اپنی افرادی قوت دی اک خاصی رقم ملک وچ تعینات کردتی اے ، جتھے ایہ گروپ انسداد بغاوت تے وڈے پیمانے اُتے کارروائیاں وچ مصروف اے۔ زیادہ تر ذرائع متفق نيں کہ اس تعیناتی توں حزب اللہ دے حوصلے تے عوامی شبیہہ نوں نقصان پہنچیا اے جدوں کہ اس تنظیم دی اتحادی افواج دے نال وڈے پیمانے اُتے ہتھکنڈاں تے باہمی تعاون دی صلاحیت نوں بہتر بنایا گیا اے۔ 2017 تک ، حزب اللہ دی فوجی کارروائیاں وچ شام وچ اسد حکومت کیتی پشت پناہی دے لئی تعینات ہزاراں جنگجو شامل نيں ، عراق وچ شیعہ اکثریتی پاپولر موبلائزیشن فورسز دی تربیت حاصل کرنے والے عراق وچ تقریبا 250 250 توں 500 جنگجوواں تے یمن وچ اک خفیہ ٹرین اینڈ سپورٹ اُتے تقریبا 50 جنگجو شامل نيں۔ حوثی باغیاں دے لئی مشن
35 سالاں دے دوران ، حزب اللہ "لبنان دی سب توں طاقتور تے مقبول تنظیم" دے طور اُتے "انقلاب اُتے مبنی سازشی سازاں دے اک نسبتا چھوٹے گروہ" توں تیار ہويا۔ <ref name="tomorrow"/> ایہ گروپ "عسکریت پسنداں دے اک چھوٹے توں کیڈر" توں بدل کے اک نیم فوجی تنظیم تے اک علاقائی فوجی اداکار بن گیا۔ <ref name="seinfeld"/> پروفیسر آگسٹس رچرڈ نورٹن دا کہنا اے کہ حزب اللہ دی طویل المدت کامیابی دی بنیادی وجوہات اسرائیلی قبضہ ، ادارہ سازی ، مغرب مخالف عالمی نظریہ ، تقویٰ ، عملیت پسندی تے ایرانی حمایت دے خلاف مزاحمت سن۔ اسکالر ایوار گیبریلسن دا کہنا اے کہ حزب اللہ دی فتح دی سب توں وڈی وجوہات اس دی "عملیت ، معاشرتی خدمات تے سیاسی شرکت" سن۔ <ref name="meme"/> اینڈریو ایکوم دا کہنا اے کہ حزب اللہ متحرک (متشدد) تے غیر متحرک لائن آف آپریشن نوں جوڑ دے جیت گیا۔ <ref name="auto4">Exum, Andrew (c. 2012) ''Hizbollah: a military history''. Thesis. Department of War Studies, King's College London.</ref> اس دی تریخ وچ ، تنظیم نے شورش ، سب ریاستی تنازعہ ، ہائبرڈ وارفیئر تے انسداد شورش سمیت متعدد طرح دی جنگ لڑی اے۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref>
حزب اللہ نوں بے رحم تے متکبر دے طور اُتے بیان کيتا جاندا اے ، اوہ سیاسی تبدیلی نوں متاثر کرنے تے سخت طاقت نوں ترجیح دینے دے لئی جسمانی طاقت استعمال کرنے دے لئی تیار اے۔ <ref name="auto6">James Worrall, Simon Mabon, Gordon Clubb. ''Hezbollah: From Islamic Resistance to Government''. {{آئی ایس بی این|978-1440831348}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1440831348|978-1440831348]]. p. 49</ref> پارٹی دی حکمت عملی وچ انتہا پسندانہ بیان بازی ، تدبیر احتیاط تے طویل مدتی رسک لینے نوں ملایا گیا اے۔ دلیل ، اس دی طاقت دا بنیادی وسیلہ اس دا موثر ، مستقل تشدد اے۔ <ref name="wremb"/> متعدد ذرائع دا کہنا اے کہ حزب اللہ دی لڑائی دی طاقت اک ایسی بنیاد اے جس دی بنیاد اُتے اس دی سیاسی طاقت ، عوامی حمایت تے قانونی حیثیت موجود اے۔ جداں کہ 2017 وچ حزب اللہ دے اک جنگجو نے کہیا سی ، "یا تاں آپ مضبوط نيں یا آپ کمزور نيں ، تے جے آپ کمزور نيں تاں آپ کھا جاندے نيں۔ ہن ، حزب اللہ مضبوط اے۔ " <ref>{{حوالہ ویب|url=https://www.nytimes.com/2017/08/27/world/middleeast/hezbollah-iran-syria-israel-lebanon.html|title=Iran Out to Remake Mideast With Arab Enforcer: Hezbollah|first=Ben|last=Hubbard|date=27 August 2017|website=New York Times}}</ref>
== تربیت ==
عمومی طور اُتے ، حزب اللہ اپنے بیشتر تربيتی کیمپ چلاندے نيں ، [[ایران]] دی [[سپاہ پاسداران انقلاب اسلامی|اسلامی انقلابی گارڈ کور]] خاص طور اُتے قدس فورس نے لازمی کردار ادا کيتا اے۔ آئی آر جی سی لبنان وچ تربيتی کیمپ چلا رہیا اے ، جدوں کہ حزب اللہ دے جنگجو ہور اعلیٰ تربیت دے لئی ایران گئے نيں۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}</ref><ref name="auto2"/> حزب اللہ اپنے بوہت سارے کیمپ وی چلاندا اے ، خاص طور اُتے تعارفی تربیت دے لئی۔ <ref name="Magnus">Magnus Ranstorp (2006) "The Hizballah Training Camps of Lebanon," In James Forest, ed., ''The Making of a Terrorist: Recruitment, Training, and Root Causes'', Vol. 2. Westport: Praeger Security International. {{آئی ایس بی این|978-0275985455}}</ref> اس گل دا اندازہ کہ حزب اللہ دی ایران وچ کِنّی تربیت ہُندی اے لیکن ایہ زیادہ تر تربیت لبنان وچ ہُندی اے۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> حزب اللہ دے وڈے پیمانے اُتے دے مقابلے وچ لبنان وچ ہونے والا کيتا جا سکدا اے زیادہ اعلیٰ درجے دی تربیت دے لئی ایران نوں اراکین نوں بھیجنے دے لئی کہ کیہ جاندا اے، لیکن کِنے حزب اللہ دے حامیاں دی اندازےآں فوجی تربیت دے لئی بیتہاشا مختلف ہُندیاں نيں، 2006 ء توں "سینکڑاں" توں لے کے ایران اُتے کيتا گیا اے <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> دی سینکڑاں ہزاراں۔ <ref name="archive.org5"/> عام طور اُتے ، حزب اللہ نوں مسلح تے تربیت دینے وچ IRGC دی ڈگری اُتے کوئی ماہر اتفاق رائے نئيں اے۔ <ref name="uhhhhhhhh">Anthony H. Cordesman, Martin Kleiber. Iran's Military Forces and Warfighting Capabilities (2007) p. 79 {{آئی ایس بی این|978-0-89206-501-1}}</ref>
ڈیزائن دے لحاظ توں ، حزب اللہ دے تربيتی کیمپ اسرائیلی تربيتی کیمپاں دی تشکیل تے متاثر نيں ، جنہاں دا مطالعہ حزب اللہ کردا اے۔ <ref name="live">Saramifar, Younes. (2015). ''Living with the AK-47''. {{آئی ایس بی این|978-1443875523}}</ref> تربيتی کیمپ حزب اللہ دے کنٹرول وچ لبنان دے دور دراز علاقےآں وچ واقع نيں تے وردی دار محافظاں اُتے مشتمل چوکیوں دے ذریعہ انہاں دی حفاظت کيتی جاندی اے۔ سہولیات وچ عام طور اُتے فائرنگ دی حداں ، حملہ آور کورسز تے شہری جنگی تھاںواں شامل نيں تے بعض اوقات ڈرائیونگ دی پٹریاں تے IED حدود وی شامل نيں۔ سب توں وڈا کیمپ ، جو [[وادی بقاع|وادی]] مغرب وچ واقع اے ، [[وادی بقاع|وادی بیقہ]] وچ واقع اے ، جس وچ لبنانی گائاں تے مرکزی گلیاں اُتے اک مذاق اڑایا گیا اے ۔ <ref name="csmonitor">{{حوالہ ویب|url=http://www.csmonitor.com/World/Middle-East/2013/1204/Look-who-s-training-Hezbollah-prepares-for-war-video|title=Look who's training: Hezbollah prepares for war|first=Nicholas|last=Blanford|date=4 December 2013|website=Christian Science Monitor}}</ref> انتظامی علما سمیت تمام ممبراں نوں 45 دن دے نیم فوجی دستے توں فارغ التحصیل ہونا پڑدا اے۔ <ref name="Magnus">Magnus Ranstorp (2006) "The Hizballah Training Camps of Lebanon," In James Forest, ed., ''The Making of a Terrorist: Recruitment, Training, and Root Causes'', Vol. 2. Westport: Praeger Security International. {{آئی ایس بی این|978-0275985455}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0275985455|978-0275985455]]</ref> اس دی میزبانی لبنان وچ کيتی گئی اے تے لڑنے دے لئی اوہ بنیادی مہارتاں سکھاندے نيں ، جدوں کہ کل وقتی جنگجو آخر کار دھماکا خیز مواد یا اے ٹی جی ایم جداں میدان وچ مہارت حاصل کرن گے۔ <ref name="seinfeld"/>
تربیت وچ لمبی مارچ ، ہتھیاراں توں واقفیت ، جاسوسی تے مشاہدہ ، تے نیویگیشن دی مہارتاں شامل نيں۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> مبینہ طور اُتے جنگجوواں نوں پہلے توں دیکھنے والے مارٹر ، بالواسطہ اگ ، <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> تے ATGM ، خاص طور اُتے TOW میزائلاں ، AT-3 سیگرز تے کورنیٹس دے استعمال وچ اچھی طرح تربیت حاصل اے۔ <ref name="theweek.com">{{حوالہ ویب|url=http://theweek.com/articles/601435/russia-teaching-hezbollah-some-terrifying-new-tricks|title=Russia is teaching Hezbollah some terrifying new tricks|date=27 January 2016|website=The Week|first=Darien|last=Cavanaugh}}</ref> جنگجو بلیک آؤٹ وین وچ تربيتی کیمپاں وچ منتقل کیتے جانے تے انہاں دے استاداں یا ساتھیاں دی شناخت دے بارے وچ بوہت گھٹ معلومات رکھدے نيں۔ <ref name="l">Levitt, Mathew. Hezbollah: The Global Footprint of Lebanon's Party of God (2015) p. 390 {{آئی ایس بی این|978-1626162013}}</ref> اسنیپنگ تے لائٹ انفنٹری دی حزب اللہ دی صلاحیتاں دا احترام کيتا جاندا اے ، <ref name="understandingwar"/> ممبراں دے نال ، "میدان وچ جاسوسی تے انٹیلیجنس جمع کرنے وچ انتہائی ہنر مند۔" <ref name="Magnus">Magnus Ranstorp (2006) "The Hizballah Training Camps of Lebanon," In James Forest, ed., ''The Making of a Terrorist: Recruitment, Training, and Root Causes'', Vol. 2. Westport: Praeger Security International. {{آئی ایس بی این|978-0275985455}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0275985455|978-0275985455]]</ref> حزب اللہ سنائپرز نوں اکثر بہتر تربیت یافتہ قرار دتا جاندا اے تے "گفتگو توں پرہیز کردے نيں ، دوسرےآں دے نال مغرور سلوک کردے نيں ، چنگا لباس بناتے نيں تے چھوٹی گلاں نال نفرت کردے نيں۔" اوہ اکثر ریاضی وچ تعلیم حاصل کرنے والے کالج توں تعلیم یافتہ ہُندے نيں تے انہاں نوں بظاہر کسی غیر ملکی بولی تے تخلیقی تحریر وچ کلاس لینے دی ضرورت ہُندی اے۔ <ref name="live">Saramifar, Younes. (2015). ''Living with the AK-47''. {{آئی ایس بی این|978-1443875523}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1443875523|978-1443875523]]</ref> بعد وچ حزب اللہ سنائپرز نے اک افغان شیعہ اسنپر یونٹ بنایا۔ <ref>{{حوالہ ویب|url=https://www.defensenews.com/home/2016/07/18/iran-deploys-hezbollah-trained-afghan-sniper-brigade-in-syria/|title=Iran Deploys Hezbollah-Trained Afghan Sniper Brigade in Syria|first=Barbara|last=Opall-Rome|date=8 August 2017|publisher=}}</ref> حزب اللہ نوں امریکی تے اسرائیلی فوجی دستورالعمل دی تربیت دتی گئی اے جو اپوزیشن ، نقل و حرکت ، انٹلیجنس اجتماع تے رات دے وقت دے ہتھکنڈاں اُتے زور دیندے نيں۔ <ref name="web.archive.org">{{حوالہ ویب|url=http://www.janes.com/security/international_security/news/jwit/jwit060726_1_n.shtml|title=Group profile: Hizbullah|date=22 August 2006|publisher=Jane's Information Group|archiveurl=https://web.archive.org/web/20060822074836/http://www.janes.com/security/international_security/news/jwit/jwit060726_1_n.shtml|archivedate=22 August 2006}}</ref>
ذرائع نے حزب اللہ نوں امن دے وقت وچ "محتاط ، صابر، [اور] انٹلیجنس اکٹھا کرنے وچ راضی" قرار دتا اے جو عملے دا کم تے طویل مدتی منصوبہ بندی کردے نيں۔ <ref name="nytimes.com"/> حزب اللہ دے فعال ڈیوٹی جنگجو باقاعدگی توں اچھی طرح توں تربیت یافتہ تے نظم و ضبط دے نال بیان کیتے جاندے نيں۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref><ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref><ref>Schneider, B., Post, J., Kindt, M. (Eds.), ''The World's Most Threatening Terrorist Networks and Criminal Gangs''. 2009. {{آئی ایس بی این|978-0230618091}}</ref>
اس دے نتیجے وچ ، حزب اللہ نے 1980 دی دہائی توں اپنے "عسکری حرباں تے بھرتی دی تکنیکاں دے بارے وچ جانکاری" دی منظوری دے دتی اے۔ <ref name="castlesinthesky">{{حوالہ رسالہ|url=https://www.cia.gov/library/readingroom/docs/CIA-RDP88-01203R000100250002-2.pdf|title=Lebanon: Hizballah Spreading the Word|author=Directorate of Intelligence|date=December 21, 1987}} {{Webarchive|url=https://web.archive.org/web/20201029193533/https://www.cia.gov/library/readingroom/docs/CIA-RDP88-01203R000100250002-2.pdf |date=October 29, 2020 }}</ref> اس پارٹی نے زیادہ تر ساتھی شیعہ گروہاں ، جداں عراق وچ شیعہ ملیشیاواں نوں امریکی قبضے دے دوران تے اس دے بعد تربیت دتی اے تے مبینہ طور اُتے لبنان تے ہور جگہاں اُتے [[حوثی|حوثیاں]] ، شامیاں تے عراقیاں نوں تربیت دتی اے۔ <ref name="thedailybeast.com">{{حوالہ ویب|url=http://www.thedailybeast.com/articles/2016/01/11/russia-is-arming-hezbollah-say-two-of-the-group-s-field-commanders.html|title=Russia Is Arming Hezbollah, Say Two of the Group's Field Commanders|first=Jesse|last=Rosenfeld|date=11 January 2016|website=The Daily Beast}}</ref> ایران دا IRGC-QF حزب اللہ دے نال کم کرنا پسند کردا اے کیونجے اوہ عربی بولنے والے نيں تے ایران نوں علیحدگی دی ڈگری فراہم کردے نيں۔ حزب اللہ دی عراقی عسکریت پسنداں دی تربیت خاص طور اُتے چھوٹے ہتھیاراں ، جاسوساں ، چھوٹے یونٹ دی تدبیراں ، تے مواصلات اُتے مرکوز سی ، جس وچ IED حملےآں ، EFP دے استعمال تے اغواء اُتے اثر انداز کرنے اُتے توجہ دتی جارہی اے۔ تربیت وچ ذہانت تے سنائپر مہارت وی شامل سی۔ <ref>Matthew Levitt, Hezbollah: The Global Footprint of Lebanon's Party of God (2015) p. 302 {{آئی ایس بی این|978-1626162013}}</ref> حد توں زیادہ حد تک ، حزب اللہ نے تیونس ، الجیریا ، مصر ، فلسطینی علاقےآں تے خلیجی ریاستاں دے بنیاد پرستاں سمیت بوہت سارے عام اسلامی بنیاد پرستاں دی تربیت دی اے۔ اس حوالے توں قابل اعتراض اطلاعات نيں کہ حزب اللہ نے لبنانی فوج دے بوہت گھٹ اہلکاراں نوں وی تربیت دتی اے۔ <ref>{{حوالہ ویب|url=http://www.analyst-network.com/article.php?art_id=3060|archiveurl=https://web.archive.org/web/20090729003843/http://www.analyst-network.com/article.php?art_id=3060|archivedate=29 July 2009|title=Lebanese soldiers reportedly receive Hizballah missile training|last=|date=29 July 2009|publisher=International Analyst Network}}</ref> پارٹی دی تربیت دا احترام کيتا جاندا اے۔ <ref>{{حوالہ ویب|url=http://russiancouncil.ru/en/analytics-and-comments/analytics/the-fifth-assault-corps-back-to-order-in-syria-/|title=The Fifth Assault Corps. Back to Order in Syria?|first=Grigory|last=Lukyanov|website=russiancouncil.ru}}</ref> 2017 وچ ، حزب اللہ دے اک کمانڈر نے دعوی کيتا سی کہ 120،000 جنگجو حزب اللہ دے تربيتی کیمپاں توں گزر چکے نيں۔ <ref name="middleeasteye.net">{{حوالہ ویب|url=http://www.middleeasteye.net/news/hezbollahs-aleppo-victory-any-cost-1412427712|title=Hezbollah's war in Aleppo: Victory at any cost, even to civilians|last=Mona Alami|date=9 February 2017|publisher=Middle East Eye}}</ref> حزب اللہ دی افرادی قوت دا تخمینہ وڈے پیمانے اُتے مختلف اے۔ مثال دے طور اُتے ، 2002 وچ امریکی محکمہ خارجہ نے کہیا کہ حزب اللہ دے چند سو کارکن تے کچھ ہزار مددگار سن ۔ <ref name="shu">{{حوالہ ویب|url=https://2009-2017.state.gov/documents/organization/10319.pdf|title=Patterns of Global Terrorism 2001|last=United States Department of State|date=May 2002}}</ref>
=== تریخ ===
[[فائل:Hezbollah fighters on march.jpg|thumb| حزب اللہ دے ممبران۔]]
سن 1984 وچ ، لبنان وچ شیخ عبد اللہ بیرکس وچ تربیت حاصل کيتی گئی سی ، جنگجو رات دے وقت بیرکاں وچ سوندے سن تے ہوائی حملےآں دے خوف توں دن دے وقت روانہ ہوئے جاندے سن ۔ <ref>''Terrorist Threat in the Middle East'' Central Intelligence Agency. November 1984.</ref> 1994 وچ وادی بیدا ميں اسرائیلی فضائی حملےآں دے بعد ، انہاں نے وادی بیدا ميں چھوٹے خیمےآں تے فاکس ہولس دی مدد توں ہور تربیت حاصل کيتی۔ 2006 دی جنگ دے خاتمے دے بعد افرادی قوت دے وڈے تقاضے سامنے آئے جس دی وجہ توں اس گروپ نوں اپنی تربیت دی سہولیات نوں بڑھانا پيا ، تے اس دے بعد توں حزب اللہ کافی وڈے تے تعمیراتی تربيتی کیمپ قائم کرچکيا اے۔ <ref name="csmonitor"/><ref name="closer"/>
1980 دی دہائی دے اوائل وچ ، حزب اللہ دے کچھ جنگجو ایران گئے سن تے انہاں نے عراقی فوج دے خلاف ایران - عراق جنگ وچ جنگ کيتی سی۔ <ref name="archive.org5">{{حوالہ ویب|url=http://memri.org/bin/latestnews.cgi?ID=IA44808|archiveurl=https://web.archive.org/web/20090211103949/http://memri.org/bin/latestnews.cgi?ID=IA44808|archivedate=11 February 2009|title=The Iranian Roots of Hizbullah|last=Dr. Nimrod Raphaeli|date=11 February 2009|publisher=MEMRI}}</ref> 1990 دی دہائی وچ ، آئی آر جی سی نے جدید گوریلا جنگ نوں فروغ دینے دے لئی حزب اللہ نوں دراندازی دی تکنیک ، دھماکہ خیز مواد تے انٹیلیجنس کارروائیاں دی تربیت دی۔ <ref name="Magnus">Magnus Ranstorp (2006) "The Hizballah Training Camps of Lebanon," In James Forest, ed., ''The Making of a Terrorist: Recruitment, Training, and Root Causes'', Vol. 2. Westport: Praeger Security International. {{آئی ایس بی این|978-0275985455}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0275985455|978-0275985455]]</ref> [[حسن نصر اللہ|حسن نصراللہ]] سمیت اعلیٰ رہنماواں نے مبینہ طور اُتے 1980 دی دہائی دے آخر وچ شمالی کوریا وچ کئی مہینےآں تک تربیت حاصل کيتی سی۔ <ref name="paris">{{حوالہ ویب|url=http://www.oss.net/dynamaster/file_archive/060902/26241feaf4766b4d441a3a78917cd55c/Intelligence%20Online%20on%20Hezbolllah.pdf|title=Paris Intelligence Online No. 529|last=|date=September 7, 2006|publisher=|access-date=October 1, 2020|archivedate=July 3, 2021|archiveurl=https://web.archive.org/web/20210703065517/http://www.oss.net/dynamaster/file_archive/060902/26241feaf4766b4d441a3a78917cd55c/Intelligence%20Online%20on%20Hezbolllah.pdf}}</ref>
2000 دے اوائل وچ ابتدائی جنگجوواں تے ایرانی رابطہ افسران دی تعداد وچ واضح طور اُتے کمی واقع ہوئی جدوں ایہ گروہ شورش دے عروج توں گر گیا۔ <ref name="echo">Cordesman, Anthony H. (July 15, 2006) ''Iran's Support of the Hezbollah in Lebanon''. Center for Strategic and International Studies.</ref> لبنان وچ ایران دے زیرقیادت براہ راست تربيتی کیمپ 2006 دے لگ بھگ ختم ہويا تے تربیت دے لئی ایران دا سفر 2010 دی دہائی وچ زخمی ہوگیا سی کیونجے شام وچ لڑائی دے بعد اس دی جگہ لے لی گئی سی۔ <ref name="seinfeld"/> ایران وچ تربیت لبنان دے عملی مقابلے وچ وڈے پیمانے اُتے ہتھیاراں دی تربیت دا موقع فراہم کردی اے۔
2006 توں تے خاص طور اُتے اس شام دی خانہ جنگی وچ اس گروپ دی شمولیت ، حزب اللہ اک وڈے پیمانے اُتے افرادی قوت دی تیاری وچ مصروف اے۔ کچھ مبصرین دا مشورہ اے کہ اس توں تنظیم دے معیار وچ کمی واقع ہوئی اے ، <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> اگرچہ حزب اللہ دے جنگجو دعوی کردے نيں کہ ایسا نئيں اے۔ 2006 توں ، اس گروپ نے لبنان وچ شہری جنگ اُتے توجہ مرکوز کردے ہوئے تربيتی کیمپ بنائے نيں۔ <ref name="understandingwar"/> تجربہ کار جنگجو تربيتی کیمپاں وچ انسٹرکٹر دے کردار دے لئی اگلی لائناں توں گھمدے نيں۔ <ref name="Magnus">Magnus Ranstorp (2006) "The Hizballah Training Camps of Lebanon," In James Forest, ed., ''The Making of a Terrorist: Recruitment, Training, and Root Causes'', Vol. 2. Westport: Praeger Security International. {{آئی ایس بی این|978-0275985455}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0275985455|978-0275985455]]</ref> ایران دی وزارت انٹلیجنس دے ایجنٹاں نے وی حزب اللہ نوں تربیت دتی ، تے شمالی کوریا دے استاداں نے ممکنہ طور اُتے 1980 تے 1990 دی دہائی وچ حصہ لیا سی۔ <ref>{{حوالہ ویب|url=http://38north.org/2014/08/aberger080514/|title=North Korea, Hamas, and Hezbollah: Arm in Arm?|publisher=US-Korea Institute at SAIS|first=Andrea|last=Berger|date=August 5, 2014}}</ref> آئی آر جی سی دی تربیت نوں سنجیدہ تے گہرائی توں تعبیر کيتا گیا اے۔ <ref name="ghost">Adam C Seitz, Anthony H. Cordesman. ''Iranian Weapons of Mass Destruction: The Birth of a Regional Nuclear Arms Race?'' (Praeger Security International) {{آئی ایس بی این|978-0313380884}}</ref> شامی حکومت کئی دہائیاں توں حزب اللہ دی تربیت وچ شامل سی ، لیکن شام دی خانہ جنگی دے آغاز دے بعد توں ہی اس دا طرز عمل بدل گیا اے تے حزب اللہ ہن "شام دی حکومت نوں تربیت ، مشورے تے وسیع تر لاجسٹک سپورٹ فراہم کردی اے۔" <ref>{{حوالہ ویب|url=https://www.treasury.gov/press-center/press-releases/Pages/tg1676.aspx|title=Treasury Targets Hizballah for Supporting the Assad Regime|last=|date=August 10, 2012|publisher=U.S. Department of the Treasury}}</ref> شام دی خانہ جنگی دے اعلیٰ افرادی قوت دے مطالبات دے جواب وچ ، اس گروپ نے مبینہ طور اُتے نويں بھرتی ہونے والے افراد دے لئی اپنے پس منظر دی جانچ تے تربیت دے منصوبے مختصر کردتے نيں ، حالانکہ معیار زیادہ اے۔ <ref name="seinfeld"/>
=== بھرتی ===
بھرتی اک سست عمل اے جس وچ مہینےآں سالاں دا عرصہ لگدا اے ، بھرتی کرنے والے متقی ، قدامت پسند تے نظم و ضبط افراد دی تلاش وچ نيں۔ <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> حزب اللہ دا "داخلی سیکیورٹی ونگ" ایران دے انٹیلیجنس خدمات دے نال خاندانی پس منظر دے سخت معائنہ دے نال ، جدید ترین تربیت دے لئی منتخب بھرتیاں اُتے نگاہ رکھنے دے لئی تعاون کردا اے۔ <ref name="Magnus">Magnus Ranstorp (2006) "The Hizballah Training Camps of Lebanon," In James Forest, ed., ''The Making of a Terrorist: Recruitment, Training, and Root Causes'', Vol. 2. Westport: Praeger Security International. {{آئی ایس بی این|978-0275985455}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0275985455|978-0275985455]]</ref> صفاں دے اندر ترقی قابل اعتماد تے ہونہار افراد دی مریض صلاحیتاں دی نشاندہی نال ہُندی اے۔ جنگجو عموما وڈے زیادہ تر تے تعلیم یافتہ ہُندے نيں۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> اک تحقیق وچ دسیا گیا اے کہ حزب اللہ جنگجو جو کارروائی وچ مارے گئے سن انہاں دی عام شہری ساتھیاں توں زیادہ تعلیم اے۔ <ref>{{حوالہ ویب|url=http://unesdoc.unesco.org/images/0024/002474/247430E.pdf|title=Peace: Building Sustainable Peace and Global Citizenship Through Education: Global Education Monitoring Report 2016|last=UNESCO|date=2016|publisher=}}</ref> غیر ریاستی اداکار دے لئی غیر معمولی حد تک ، حزب اللہ دے ممبران نوں IED ، توپ خانہ ، انجینئرنگ تے مواصلات جداں شعبےآں وچ مہارت حاصل اے۔ <ref name="Worall">James Worrall, Simon Mabon, Gordon Clubb. (2011) ''Hezbollah: From Islamic Resistance to Government''. p. 44–46 {{آئی ایس بی این|1440831343}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/1440831343|1440831343]]</ref>
=== تحفظ پسند ===
حزب اللہ دی افرادی قوت وچ کل وقتی جنگجو تے نرمی توں وابستہ تحفظ پسند شامل نيں ، جو کدی کدائيں صرف حزب اللہ دے لئی لڑ سکدے نيں یا دوسری سیاسی جماعتاں توں وابستہ ہوئے سکدے نيں۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> حزب اللہ دی رکنیت دا کوئی باقاعدہ رول نئيں اے۔
اس گروپ دے تحفظ پسنداں دا اندازہ ، جسنوں "پنڈ دے محافظ" یا جز وقتی جنگجو وی کہیا جاندا اے ، وسیع پیمانے اُتے مختلف ہُندا اے۔ انہاں افراد دی حزب اللہ توں باہر ملازمت اے تے اوہ صرف وڈی فوجی مصروفیات دے لئی ہتھیار اٹھاندے نيں <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> یا ہر ہفتے "ڈیوٹی" دے حصے دے طور پر۔ <ref name="seinfeld"/> اسرائیلی ذرائع نے اس گروہ دے حریت پسنداں نوں "نسبتا غیرہنر مند" قرار دتا اے <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> جدوں کہ حزب اللہ نے انھاں بالکل ایداں دے ہی جنگجو قرار دتا اے جداں کل وقتی جنگجوواں دی طرح اے۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> اک امریکی تھنک ٹینک دا کہنا اے کہ انہاں نے 2006 دی جنگ وچ غیر معمولی کارکردگی دا مظاہرہ کيتا ، <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> جدوں کہ دوسرا انہاں نوں کل وقتی جنگجوواں دے مقابلے وچ "کم قابل" قرار دیندا اے۔ حزب اللہ تحفظ پسنداں دی تربیت وی ايسے طرح غیر واضح اے۔ اینڈریو ایکوم دا کہنا اے کہ ایسا نئيں لگدا سی کہ اوہ ایران دی طرف توں تربیت یافتہ سن ، تے کچھ سابق ملیشیا دے سابق ممبر وی ہوسکدے نيں ، جدوں کہ تجزیہ کار نڈاو پولک دا کہنا اے کہ انہاں نوں المہدی اسکاؤٹس تے متعدد توں بھرتی کيتا گیا سی۔ ذرائع دا کہنا اے کہ تقریبا all تمام ملیشیا دے سابق ممبر سن ۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> حزب اللہ دے تحفظ پسنداں دے طور اُتے بیان کیتے جانے والے کچھ لوکاں نے بظاہر صریحا اسلحہ اٹھایا سی یا انہاں نوں باقاعدہ طور اُتے پارٹی توں وابستہ نئيں کيتا گیا سی۔ حزب اللہ دے تحفظ پسنداں نوں پارٹی دے باقاعدہ جنگجوواں تے کمانڈراں دے نال نال ، مختصر مدت دے تعیناتیاں اُتے شام دے ذریعے گھمایا گیا اے۔
== سپلائی ==
[[فائل:Flickr - Israel Defense Forces - Iranian RPG Found in Lebanon (1).jpg|thumb| ایران وچ بنایا گیا حزب اللہ [[آر پی جی - 7|آر پی جی 7]] ۔ ]]
حزب اللہ زیادہ تر ایران تے شام دیاں ریاستاں زمینی ، ہويا تے سمندر دے ذریعے فراہم کردی اے۔ <ref name="ghost">Adam C Seitz, Anthony H. Cordesman. ''Iranian Weapons of Mass Destruction: The Birth of a Regional Nuclear Arms Race?'' (Praeger Security International) {{آئی ایس بی این|978-0313380884}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0313380884|978-0313380884]]</ref> اس دے علاوہ ، حزب اللہ لبنان ، شمالی امریکا تے یورپ جداں ہور بازاراں توں کچھ سامان حاصل کردا اے۔ حزب اللہ دے ہتھیاراں دی اکثریت ایران دے ذریعہ حاصل کيتی گئی اے یا اسنوں بنایا گیا اے تے فیر شام توں لبنان وچ داخل کيتا جاندا اے۔
ایران حزب اللہ دی اکثریت دی مالی اعانت تے اسلحہ فراہم کردا اے تے انہاں نوں عراقی فضائی حدود توں [[شام|شام]] تک پرواز کردا اے۔ شام کچھ جدید ہتھیاراں دی فراہمی کردا اے تے ایران نوں اس گروپ دی فراہمی دے لئی [[دمشق]] نوں راہ راست دے طور اُتے استعمال کرنے دی اجازت دیندا اے۔ <ref>{{حوالہ ویب|url=https://2001-2009.state.gov/s/ct/rls/crt/2005/64337.htm|title=Country Reports on Terrorism: State Sponsors of Terror Overview|accessdate=2006-07-17|last=Office of the Coordinator for Counterterrorism|date=2006-04-28}}</ref> ایران نے دمشق دے ہوائی اڈاں اُتے سب توں زیادہ پرواز دی اے تے اس نے حزب اللہ نوں اراضی توں عبور کيتا اے ، کچھ سامان براہ راست لبنانی ہوائی اڈاں اُتے اڑایا گیا اے۔ <ref name="danger">Frederic Wehrey, David E. Thaler, Nora Bensahel, Kim Cragin, Jerrold D. Green – ''Dangerous But Not Omnipotent: Exploring the Reach and Limitations of Iranian Power in the Middle East'', RAND, {{آئی ایس بی این|9780833045546}} pages 95-96</ref> 2006 تے لبنان جنگ دے بعد ایران تے شام دونے دی حمایت وچ اضافہ ہويا ، ایران دی حمایت وچ تے اضافہ ہويا۔ حزب اللہ دے پاس ایران دی لاجسٹک سپورٹ دی اپنی منفرد فوجی طاقت اے۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> ایران دی نظر وچ حزب اللہ دا مقصد ایران دی جوہری تنصیبات اُتے امریکی یا اسرائیلی حملےآں دی روک سیم کرنا اے۔
1980 دی دہائی وچ ، حزب اللہ نوں محتاط تے "نسبتا تھوڑی مقدار وچ اسلحہ" فراہم کیہ گیا سی۔ <ref>Worldwide Equipment Guide: Volume 1: Ground Systems. United States Army Training and Doctrine Command, Dec. 2015. Fort Leavenworth, KS</ref> لاجسٹک مسائل ، ایران تے عراق وچ جاری جنگ تے حزب اللہ دی شام دی تنبیہ نے تربیت دینے والےآں دی تعداد تے اس وقت حزب اللہ نوں فراہم دی جانے والی سامان دی مقدار نوں محدود کردتا۔ <ref name="archive.org5"/> شام نے 1987 دے موسم بہار وچ حزب اللہ نوں فوجی سامان دی خاطر خواہ مقدار جاری کيتی سی کیونجے اس تنظیم نے خاص طور اُتے جنوبی لبنان وچ آئی ڈی ایف توں لڑنے اُتے توجہ دتی اے۔ <ref name="awo">{{حوالہ رسالہ|url=https://www.cia.gov/library/readingroom/docs/CIA-RDP88T00792R000300010002-4.pdf|title=Lebanon–Israel: Hizballah's Strategy and Capabilities|last=Directorate of Intelligence|date=3 July 1987}} {{Webarchive|url=https://web.archive.org/web/20180115001404/https://www.cia.gov/library/readingroom/docs/CIA-RDP88T00792R000300010002-4.pdf |date=15 January 2018 }}</ref> اپنے عہد صدارت دے دوران ، [[حافظ الاسد|حافظ الاسد نے]] حزب اللہ نوں چھوٹے ہتھیاراں تے اینٹی ٹینک میزائلاں دی محدود اسمگلنگ دی اجازت دتی ، جدوں [[بشار الاسد|کہ بشار الاسد نے]] سن 2000 وچ اقتدار سنبھالنے دے بعد ایرانی تے شامی ہتھیاراں دی مقدار وچ بے حد اضافہ کيتا سی۔ بشار الاسد نے حزب اللہ دے نال شام دے تعلقات نوں اسٹریٹجک شراکت وچ بدل دتا۔ <ref>Ethan Corbin, "Principals and Agents: Syria and the Dilemma of Its Armed Groups Allies," The Fletcher Forum of World Affairs 35, no. 2 (2011)</ref> حزب اللہ نے بدعنوان شامی فوج دے افسران ، لبنانی بلیک مارکیٹ ، ایس ایل اے ، تے لبنانی خانہ جنگی وچ شکست خوردہ دھڑاں توں وی اسلحہ حاصل کيتا۔ <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> 2006 دی جنگ دے بعد اسلحے وچ کافی حد تک اضافہ ہويا ، شام نے اس تنازعہ نوں فتح دے طور اُتے دیکھیا ، حزب اللہ نوں اسرائیلی افواج دا مقابلہ کرنے تے اہم جانی نقصان اٹھانا دیکھنے وچ آیا۔ جنگ دے بعد ، ایران نے SA-7 ، SA-14 ، SA-16 ، تے Muthaq-1 MANPADS ، BM-21 Grad ، Fajr-3 ، Fajr-5 ، Falaq-1 ، تے Falaq-2 راکٹ فراہم کرنے دی اطلاع دتی اے۔ ، تے RAAD-T تے RPG اینٹی ٹینک ہتھیار۔ <ref name="sendnudes"/> شام نے 230 فراہمی دی ملی میٹر تے خیبر 1 راکٹ ، تے [[کورنٹ میزائل|کارنیٹ]] ، کونکرس ، میٹیس-ایم تے [[آر پی جی – 29|آر پی جی -29]] اینٹی ٹینک ہتھیار۔ 2007 وچ اسرائیل نے شامی جوہری ری ایکٹر اُتے مشتبہ بمباری دے بعد اسلحے وچ اک بار فیر اضافہ ہويا ، اس دے جواب وچ اسد نے ہدایت نامہ [[فاتح 110|M-600]] میزائل حزب اللہ نوں منتقل کردتے۔ 2009 تک ، ہتھیاراں دی ترسیل نوں "متواتر تے وڈے" دے طور اُتے بیان کيتا گیا۔ <ref name="ghost">Adam C Seitz, Anthony H. Cordesman. ''Iranian Weapons of Mass Destruction: The Birth of a Regional Nuclear Arms Race?'' (Praeger Security International) {{آئی ایس بی این|978-0313380884}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0313380884|978-0313380884]]</ref> آخر کار ، شام دی [[شامی خانہ جنگی|خانہ جنگی دے]] جواب وچ [[شامی خانہ جنگی|شامی]] حزب اللہ دی سپلائی مئی 2011 وچ اک بار فیر تیز ہوگئی {{Efn|Israel intelligence reportedly says this increase in supply started slightly earlier, in January/February 2011.<ref name="hvoice" />}} ، شام نے لبنان وچ اسلحہ سازی دے "گوداماں" نوں باغیاں دے ہتھوں توں دور رکھنے دے لئی منتقل کردتا۔ شام وچ حزب اللہ نوں اسلحہ دی ترسیل وچ وی اضافہ ہويا اے تاکہ پارٹی نوں حکومت کیتی جانب توں لڑنے اُتے آمادہ کيتا جاسکے۔ <ref name="auto24"/> اس وقت ایران توں اسلحے دی ترسیل وچ وی اضافہ ہويا ، قدس فورس نوں بظاہر خدشہ سی کہ اسد حکومت گر سکدی اے تے حزب اللہ دی فراہمی دے لئی انہاں دی کھڑکی ختم ہوسکدی اے۔ اک مبصر دے مطابق ، "سرحد پار توں بہت زیادہ سامان آرہیا اے۔ . . حزب اللہ نئيں جاندی کہ اسنوں کتھے رکھنا اے۔ " <ref>{{حوالہ ویب|url=https://fas.org/sgp/crs/mideast/R42339.pdf|title=Lebanon and the Uprising in Syria: Issue for Congress.|publisher=Congressional Research Service|first=Rebecca|last=Hopkins|date=February 2, 2012}}</ref> {{Efn|A Hezbollah fighter makes a near-identical claim: "the scale of the arms shipments into Lebanon was so great that 'we don't know where to put it all.'"<ref name="hvoice">Beeston, Richard; Blanford, Nicholas; and Frenkel, Sheera (July 15, 2011) ''Embattled Syrian regime still sending missiles to Lebanese militants''. The Times.</ref>}} مخصوص ہتھیاراں دے دعوے دا احتیاط دے نال سلوک کيتا جانا چاہیدا ، پر: ایہ دعوی کيتا جارہیا اے کہ شام وچ تقریبا ہر ہتھیار حزب اللہ نوں منتقل کردتا گیا اے۔
[[فائل:Flickr - Israel Defense Forces - Hezbollah Weaponry Captured in Bint Jbeil (5).jpg|thumb| 2006 دی جنگ وچ آئی ڈی ایف دے ذریعہ حزب اللہ TOW میزائل خاناں تے فیلڈ ریڈیواں اُتے قبضہ کيتا گیا سی۔]]
حزب اللہ دے لئی ایران دی فوجی امداد دا ، یا تقریبا تمام ، شام دے راستے توں گزردا اے ، <ref name="seinfeld"/> تے جے شام نے حزب اللہ دی ہتھیاراں دے حصول دی صلاحیت وچ ڈرامائی طور اُتے کمی واقع ہوئے گی۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> چونکہ ایران تے شام حزب اللہ دے اہم سرپرست نيں ، حزب اللہ دے بیشتر راکٹ ، چھوٹے اسلحہ ، رقم تے گولہ بارود شام توں گزردے نيں۔ ایران حزب اللہ دی فراہمی دے لئی صرف دوسرے موثر ترین راستہ گزردا [[ترکی]] ، لیکن ترکی تہران دے نال منسلک نئيں کر رہیا اے تے 2006 دے بعد <ref>{{حوالہ ویب|url=https://wikileaks.org/plusd/cables/06ANKARA4912_a.html|title=Turkey Searches Iranian Trucks for Hezbollah Arms Shipments|publisher=}}</ref> اس دے علاقے توں گزرنے توں ایرانی ٹرکاں تے طیارےآں نوں روک دتا اے .<ref name="understandingwar"/> ماضی وچ ایرانی بندرگاہ [[بندر عباس]] توں شام دی بندرگاہ [[لاذقیہ|لٹاکیہ]] تک سمندر دے ذریعہ سامان بھیجنا استعمال ہُندا رہیا اے ، لیکن اس وچ بہت زیادہ وقت لگدا اے تے اس توں رکاوٹ دا خطرہ اے۔
چونکہ شام دے اک قابل قابل ہوائی دفاعی نیٹ ورک نے اس ملک نوں اسرائیلی فضائی حملےآں توں بچایا سی ، حزب اللہ نے کئی عشراں توں مغربی شام نوں رسد تے رسد دے مرکز دے طور اُتے استعمال کيتا اے۔ <ref name="seinfeld"/> اس علاقے وچ حزب اللہ دے تربيتی کیمپ تے اسلحہ دے ڈپو نيں۔ تاریخی طور اُتے ، دمشق دا بین الاقوامی ہوائی اڈہ حزب اللہ دے جنگجوواں دے لئی ایران وچ جدید ترین تربیت دے راستے اُتے جانے دا اک اہم مقام سی۔
حزب اللہ کالی منڈیاں تے ممکنہ طور اُتے لبنانی فوج توں کچھ ہتھیار حاصل کردا اے۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> 2000 دی دہائی دے شروع وچ دوہری استعمال کیتی ٹیکنالوجی ، بشمول [[شب بصری عینک|نائٹ ویژن چشماں]] ، [[لیزر رینج فائنڈر|لیزر رینج فائنڈرز]] ، [[عالمی مقامیابی نظام|جی پی ایس]] ریسیورز ، جدید طیارہ تجزیہ تے ڈیزائن سافٹ ویر ، اسٹن گنز ، نائٹروجن لیزر کٹرز ، بحری سامان ، تے الٹراسونک ڈاگ ڈرینٹینٹ وچ ریاست ہائے متحدہ امریکا تے کینیڈا وچ نجی دکانداراں توں خریداری کيتی گئی۔ <ref name="Magnus">Magnus Ranstorp (2006) "The Hizballah Training Camps of Lebanon," In James Forest, ed., ''The Making of a Terrorist: Recruitment, Training, and Root Causes'', Vol. 2. Westport: Praeger Security International. {{آئی ایس بی این|978-0275985455}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0275985455|978-0275985455]]</ref> حزب اللہ رات نوں لڑنے دے قابل اے تے اس وچ نائٹ ویژن دی جدید ٹیکنالوجی اے۔ <ref name="frank">Hoffman, Frank G. (1st quarter 2009) ''Hybrid Warfare and Challenges''. JPQ Issue 52, National Defense University.</ref> اسرائیل تے کچھ ذرائع دا دعویٰ اے کہ ایران نے لبنان دے پہاڑی بیکا وادی خطے وچ زیر زمین ہتھیاراں دی دو فیکٹریاں قائم کيتیاں نيں ، جنہاں وچ [[فاتح 110|فتح -110]] میزائل تے بوہت سارے دوسرے ہتھیار تیار کیتے گئے نيں۔ <ref name="longwarjournal.org">{{حوالہ ویب|url=https://www.longwarjournal.org/archives/2017/03/has-hezbollah-developed-a-domestic-arms-industry-with-iranian-support.php|title=Has Hezbollah developed a domestic arms industry with Iranian support?|date=14 March 2017|publisher=FDD's Long War Journal}}</ref> مبینہ طور اُتے تعمیرات دا آغاز 2012 دے بعد ہويا سی۔ حزب اللہ تے آئی آر جی سی نے پہلے وی ایہ تجویز پیش کيتی سی کہ پارٹی اپنا کچھ ہتھیار بناسکدی اے۔ فیکٹریاں وچ توقع اے کہ اوہ ہر سال سیکڑاں میزائلاں دی گنجائش رکھدے نيں۔
شام وچ خانہ جنگی دے آغاز دے بعد توں ، اسرائیل نے شام وچ "جدید" یا "گیم بدلنے" والے ہتھیاراں اُتے فضائی حملے کیتے نيں جنہاں دا کہنا اے کہ حزب اللہ دا مقدر اے۔ اطلاعات دے مطابق ، اسرائیل نے فتح - 110 / M600 گائڈڈ میزائل ، ڈرون ، جہاز توں بچنے والے میزائل ، تے فضائی دفاعی نظام وچ مداخلت دی اے۔ <ref name="stratfor.com1">{{حوالہ ویب|url=https://worldview.stratfor.com/article/israel-targets-hezbollah-weaponry-syria|title=Israel Targets Hezbollah Weaponry in Syria|last=|website=worldview.stratfor.com|date=Dec 9, 2014}}</ref> زیادہ تر ذرائع تجویز کردے نيں کہ فضائی حملے موثر رہے نيں لیکن حزب اللہ نوں جدید ترین ہتھیاراں دے بہاو نوں روکنے وچ اوہ کامل نئيں نيں۔
== فوج ==
حزب اللہ نوں وسیع پیمانے اُتے فوجی طاقت وچ لبنانی مسلح افواج دے مقابلے تے مضبوط قرار دتا گیا اے۔ حزب اللہ دی بہتر نظم و ضبط ، <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> بہتر تجربہ ، <ref name="washingtoninstitute.org1">{{حوالہ ویب|url=http://www.washingtoninstitute.org/policy-analysis/view/hezbollahs-russian-military-education-in-syria|title=Hezbollah's Russian Military Education in Syria|publisher=The Washington Institute for Near East Policy|last=Brig. Gen. Muni Katz, IDF and Nadav Pollak|date=December 24, 2015}}</ref> تے بہتر اسلحہ سازی ، <ref name="smallwarsjournal.com">{{حوالہ رسالہ|url=http://smallwarsjournal.com/jrnl/art/the-syrian-conflict-and-its-impact-on-hezbollah%E2%80%99s-authority|title=The Syrian Conflict and its Impact on Hezbollah's Authority|journal=Small Wars Journal|author=Elliott|date=April 5, 2014}}</ref> وجہ پیش دی جانے والی وجوہات ایل اے ایف دے مقابلے وچ حزب اللہ نوں "واضح طور پر" بہتر فوجی تے جنگی صلاحیت فراہم کردی نيں۔ ہور برآں ، کچھ کہندے نيں کہ ایل اے ایف عدم اعتماد تے فرقہ وارانہ کشمکش دا شکار اے ، جدوں کہ حزب اللہ ایسا نئيں کردا اے۔ اس دے علاوہ ، اس گروپ نوں لبنان وچ کِسے وی سنی شدت پسند گروپ <ref>{{حوالہ ویب|url=https://fas.org/sgp/crs/mideast/R42816.pdf|title=Lebanon: Background and U.S. Policy|first=Christopher M|last=Blanchard|publisher=Congressional Research Service|date=February 14, 2014}}</ref> توں زیادہ قابل تے خطرناک تے UNIFIL توں زیادہ قابل قرار دتا گیا اے۔ <ref name="wremb"/> اک تحقیق وچ کہیا گیا اے کہ حزب اللہ نوں عام عرب عسکریت پسنداں توں تشبیہ دیندے ہوئے ، اہم اختلافات حکمت عملی دی تدبیر وچ حزب اللہ دی مہارت ، اسلحہ دی مہارت توں استعمال کرنے دی صلاحیت ، تے حزب اللہ دی چھوٹی چھوٹی یونٹاں نوں دتی جانے والی خودمختاری تے اقدام اے۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> جداں کہ اک سینئر امریکی عہدیدار نے کہیا ، "حزب اللہ بہت چنگا اے۔" <ref name="auto24"/> کئی دہائیاں توں ، ایہ اطلاعات آرہیاں نيں کہ پارٹی لڑائی تے تباہی دے دہانے اُتے تھک چکی اے۔ ایسا نئيں لگدا کہ ایہ اطلاعات درست نيں۔ <ref name="seinfeld"/>
حزب اللہ نے 30 دسمبر 1999 توں کسی فوجی ہدف دے خلاف خودکش حملہ آوراں نوں تعینات نئيں کيتا اے ، لیکن ہوسکدا اے کہ اوہ لبنان جنگ 2006 دے دوران ایسا کرنے دے لئی تیار ہوئے۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> حزب اللہ خودکش بم دھماکےآں دے استعمال وچ اک کارگر سی ، کیوں کہ حزب اللہ دے خودکش بم دھماکےآں وچوں 85 فیصد فوجی اہداف اُتے حملہ کردے نيں۔ <ref>Pedahzur, Ami. ''Root Causes of Suicide Terrorism: The Globalization of Martyrdom'' (Political Violence) 1st Edition. {{آئی ایس بی این|978-0415770309}}</ref> 1990 دے وسط توں حزب اللہ نے امریکی مفادات دے خلاف دہشت گردی دے حملے شروع نئيں کیتے نيں <ref name="tomorrow"/> تے سن 1991 توں لبنان وچ امریکی مفادات اُتے حملہ نئيں کيتا اے۔ <ref name="shu"/>
=== ہلکی انفنٹری ===
حزب اللہ دی بنیاد اک ہلکی انفنٹری فورس دے طور اُتے رکھی گئی سی تے ایہ اج وی بنیادی طور اُتے لائٹ انفنٹری اُتے مشتمل اے۔ <ref name="eve">Adam Johnson, ''A Lesson of Proxies: Case Studies of Hezbollah and Boko Haram''. 24th Annual Illinois State University Conference for Students of Political Science. (2016)</ref>
[[فائل:Hezbollah DShK.jpg|thumb| اک دے نال اک حزب اللہ بنکر DShK بھاری مشین گن.]]
2006 وچ ، جین نے حزب اللہ دی گوریلا قوتاں دا اندازہ لگایا کہ اوہ "دنیا وچ سب توں زیادہ سرشار ، حوصلہ افزائی تے اعلیٰ تربیت یافتہ" نيں۔ <ref name="web.archive.org"/> [[آوازِامریکا|وائس آف امریکا دی]] رپورٹ وچ دسیا گیا اے کہ "حزب اللہ دے جنگجوواں نوں اک چھوٹی عمر توں ہی سخت فوجی نظم و ضبط دی پیروی کرنے دے لئی تعلیم دتی گئی اے تے اوہ شہادت دے کلچر وچ پروان چڑھ رہے نيں ، اس خیال وچ کہ خدا انہاں دی جدوجہد اُتے پابندی عائد کردا اے ،" انہاں نے ہور کہیا کہ ، "ان دی فوجی تے نظریاتی تربیت سخت اے۔ " <ref>{{حوالہ ویب|url=http://www.voanews.com/a/hezbollah-develops-new-skills-in-syria-posing-challenges-for-israel/3304664.html|title=Hezbollah Develops New Skills in Syria, Posing Challenges for Israel|first=Jamie|last=Dettmer|publisher=Voice of America|date=April 27, 2016}}</ref> 2006 وچ حزب اللہ دی افواج نوں "اچھی طرح توں تربیت یافتہ ، اچھی طرح توں تیار کردہ تے مناسب لیس" رکھیا گیا سی تے اس نے گہرائی توں دفاع کيتا سی ۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> تفتیشی کم ، منصوبہ بندی ، تے انٹیلیجنس اکٹھا کرنا "احتیاط سے" حزب اللہ دے جنگی مشناں دی مدد کردا اے۔ <ref name="Magnus">Magnus Ranstorp (2006) "The Hizballah Training Camps of Lebanon," In James Forest, ed., ''The Making of a Terrorist: Recruitment, Training, and Root Causes'', Vol. 2. Westport: Praeger Security International. {{آئی ایس بی این|978-0275985455}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0275985455|978-0275985455]]</ref> حزب اللہ دی کارروائیاں نوں تدبیری چستی ، کور دا استعمال ، جدید ہتھیاراں ، بقا ، پیچیدہ آپریشنز ، جدید ترین تربیت ، تے موثر کمانڈ اینڈ کنٹرول دے ذریعہ نشان زد کيتا گیا سی۔ <ref name="auto25">Martin S. Catino, Week 7 Summary: Hezbollah Capabilities and Advantages in the 2006 Lebanon War. MILS 521: Strategy, Tactics, and the Operational Art. American Military University</ref> وڈی کارروائیاں دے لئی ، حزب اللہ نے بعض اوقات "ٹاسک آرگنائزڈ" فورسز دا مظاہرہ کيتا ، جس وچ اک حملہ ٹیم ، خلاف ورزی کرنے والا عنصر ، تے معاون ٹیم شامل اے۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> اک فوجی نے دسیا کہ اوہ ایسا نئيں لڑ رہے جس طرح اساں سوچیا سی کہ اوہ لڑاں گے۔ "وہ زیادہ سخت لڑ رہے نيں۔ اوہ اپنی زمین اُتے اچھے نيں۔ " حزب اللہ دے خلئی لچکدار تے قابل سن کہ تیزی توں وڈی قوتاں وچ یکجا ہوسکدے نيں یا منقطع ہونے اُتے آزادانہ طور اُتے چل سکدے نيں۔ <ref name="frank">Hoffman, Frank G. (1st quarter 2009) ''Hybrid Warfare and Challenges''. JPQ Issue 52, National Defense University.</ref> اطلاعات دے مطابق ، جنوبی لبنان نوں 75 خود نوں برقرار رکھنے والے حزب اللہ زون وچ تقسیم کيتا گیا سی جو اک نیٹ ورک دے طور اُتے اک دوسرے دے نال جڑے ہوئے سن ۔ <ref>John Arquilla, "It Takes a Network- On Countering Terrorism While Reforming the Military," Testimony before the House Armed Services Subcommittee on Terrorism, Unconventional Threats and Capabilities, presented 18 September 2008.</ref> جدوں آئی ڈی ایف نے فائر پاور نوں ماہر کيتا تے کمبائن اسلحہ دا استعمال کيتا ، اُتے ، اوہ حزب اللہ نوں آرام توں اپنے مضبوط ٹھکانے اُتے وی شکست دینے وچ کامیاب رہیا۔ اسرائیلی فوجی قیادت دا 2018 دا اندازہ ایہ اے کہ اس تنظیم دے پاس 45،000 افراد دی اک کھڑی فوج اے جس وچ کئی جنگجو تجربہ کار جنگجو نيں۔ <ref name="Jerusalem Post website">Friedson, Michael; Bybelezer, Charles; The Media Line. (25 January 2018). "Deputy Defense Minister discusses strategic threats." [http://www.jpost.com/Israel-News/Israels-deputy-defense-minister-discusses-strategic-threats-539799 Jerusalem Post website] Retrieved 25 January 2018.</ref>
2006 وچ ، حزب اللہ دے جنگجو "اکثر [[اسرائیلی دفاعی افواج]](IDF ) دے نال براہ راست فائر فائٹرز وچ حصہ لیا کردے سن ۔" <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> حزب اللہ عام طور اُتے لڑائی شروع کرنے توں پہلے اسرائیل دے کسی پنڈ وچ داخل ہونے دا انتظار کردے ، بجائے کھلے علاقے وچ مشغول ہوجاواں۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> جنگجو زیادہ تر حزب اللہ دی وردی پہنے ہوئے سن ، جدوں کہ بوہت گھٹ تعداد نے لڑادے ميں سویلین کپڑے یا آئی ڈی ایف دی وردی پہن رکھی سی۔ 1990 تے 2000 دی دہائی وچ حزب اللہ دے جنگجو زیادہ تر M81 ووڈلینڈ تے زیتون ڈرائب کیمو پہنے ہوئے سن ، حال ہی وچ جنگجوواں نے ملٹی کیم وی پہنا ہويا سی۔ <ref name="washingtoninstitute.org">{{حوالہ ویب|url=https://www.washingtoninstitute.org/uploads/Documents/pubs/PF138Appendices/PF138_Appendix_6.pdf|title=Weapons and Equipment Tied to Shiite Militias|last=Washington Institute for Near East Policy|date=2015|publisher=|access-date=2020-10-01|archivedate=2019-12-10|archiveurl=https://web.archive.org/web/20191210080247/https://www.washingtoninstitute.org/uploads/Documents/pubs/PF138Appendices/PF138_Appendix_6.pdf}}</ref> حزب اللہ دے جنگجوواں نے آئی ڈی ایف دے نال نیڑےی فاصلے اُتے ، براہ راست فائر فائٹرز دا انعقاد کيتا ، تے مرداں دی اک پلاٹون تک جوابی کارروائی دا آغاز کيتا۔ فوجیاں نے سختی دا مظاہرہ کيتا تے پیچیدہ گھاتاں دی منصوبہ بندی تے انہاں اُتے عمل درآمد کيتا۔ <ref name="auto2"/> انہاں دے آپریشن دے علاقے ، شہریاں دی وسیع پیمانے اُتے حمایت ، تے مضبوط مواصلاتی نیٹ ورک توں جنگجوواں نوں تقویت ملی۔ جنگجو اسرائیل دی تکنیکی ترقی نوں روکنے دے لئی "اعلیٰ تحرک ، لڑائی دے حوصلے تے عوامی حمایت" اُتے انحصار کردے نيں۔ <ref name="danger">Frederic Wehrey, David E. Thaler, Nora Bensahel, Kim Cragin, Jerrold D. Green – ''Dangerous But Not Omnipotent: Exploring the Reach and Limitations of Iranian Power in the Middle East'', RAND, {{آئی ایس بی این|9780833045546}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/9780833045546|9780833045546]] pages 95-96</ref> اسرائیلی بریگیڈیئر جنرل گال ہرش نے حزب اللہ دے نال گھر گھر گھر لڑائی نوں "اک مکمل رابطہ آپریشن" قرار دتا۔ میرا مطلب اے ساڈے فوجیاں دے وچکار براہ راست لڑائی آمنے سامنے۔ " <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> 2006 وچ ، حزب اللہ دے جنگجوواں نوں بھاری بھرکم وردی وچ پہنایا گیا سی ، تے انہاں وچ اکثر ایسا سامان ہُندا سی جس وچ جسمانی کوچ ، کتاں دے ٹیگ تے ہیلمٹ جداں ریاستی عسکریت پسند استعمال کردے سن ۔ حزب اللہ اس وقت سب توں مضبوط اے جدوں جنوبی لبنان دے اپنے آبائی علاقے دا دفاع کردے ہوئے ، تے ایتھے اسنوں "اسٹریٹجک فائدہ" حاصل ہويا۔ <ref>Asymmetric Warfare Group. November 2016. Modern Urban Operations: Lessons Learned from Urban Operations from 1980 to the Present</ref> حزب اللہ دی سب توں مضبوط خوبیاں وچوں اک اس دی کور تے چھلاورن وچ مہارت اے ، جسنوں بعض اوقات اسرائیل دی طرح چنگا سمجھیا جاندا اے۔ <ref name="soar">Creveld, Martin van, "The Second Lebanon War: A Re-assessment", Infinity Journal, Issue No. 3, Summer 2011, pages 4-7.</ref>
2006 وچ حزب اللہ دی کچھ اکائیاں نے اسرائیل وچ گھسنے دی کوشش کيتی لیکن اسرائیل نے انہاں تمام حملےآں نوں پسپا کردتا۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> بہت سارے تبصرہ نگار توقع کردے نيں کہ حزب اللہ آئندہ جنگ وچ اسرائیلی سرزمین اُتے قبضہ کرنے دے لئی خاطر خواہ کوشش کرے گی۔ <ref>{{حوالہ ویب|url=http://www.thetower.org/4480-idf-adapting-fighting-doctrine-in-case-of-attack-by-hezbollah/|title=IDF Adapts Fighting Doctrine in Case of Attack by Hezbollah|publisher=The Tower Magazine|date=January 25, 2017}}</ref>
=== اینٹی آرمور ===
[[فائل:Flickr - Israel Defense Forces - Launcher Captured in Lebanon.jpg|سجے|thumb| 2006 وچ حزب اللہ ٹوفن اے ٹی جی ایم۔]]
حزب اللہ دی اینٹی آرمر قابلیتاں 5 یا 6 جنگجوواں اُتے مشتمل اے ٹی جی ایم ٹیماں اُتے مشتمل نيں۔ <ref name="defense-update.com"/> عام ٹیم دے پاس دو انتہائی تربیت یافتہ آپریٹرز سن ، حزب اللہ دے اندر ہیوی میزائلاں نوں منتقل کرنے دے لئی "ٹینک سنائپرز" یا "میرکاوا دے جنگجو" تے دو یا تن پورٹرز۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref><ref name="auto9">Cordesman, A. H., Sullivan, G., & Sullivan, W. D. (2007). Lessons of the 2006 Israeli-Hezbollah war. Washington (D.C.): CSIS Press. {{آئی ایس بی این|978-0892065059}}</ref> جنگجوواں نوں اینٹی ٹینک ہتھیاراں ، گھاتاں ، تے چھلاورن دی تربیت دتی جاندی اے۔ <ref name="live">Saramifar, Younes. (2015). ''Living with the AK-47''. {{آئی ایس بی این|978-1443875523}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1443875523|978-1443875523]]</ref> حزب اللہ نے فواد شہاب کمانڈ تے اسٹاف کالج توں اک لڑاکا سمیلیٹر بظاہر چوری کيتا تے اسنوں اینٹی ٹینک ٹیماں دی تربیت دینے دے لئی استعمال کيتا۔ اطلاعات دے مطابق ، 2006 دی جنگ وچ ، حزب اللہ دی سب توں ہنر مند اینٹی ٹینک ٹیماں اسرائیل دے کسی وڈے حملے دی توقع وچ واپس رکھی گئياں تے انہاں دا مقابلہ دیکھنے وچ نئيں آیا۔ حزب اللہ دا اک عمومی ہتھکنڈہ ایہ سی کہ کسی اسرائیلی گڈی دے گزرنے دے لئی ڈھکن دے انتظار وچ رہنا ، فیر عقبی حصے توں حملہ کرنا ، جتھے اسلحہ سب توں کمزور اے۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> جنگجو اسرائیلی ٹینکاں نوں درجناں سستے اے ٹی جی ایم دے نال ہتھیاراں توں بھریا کردے نيں تاکہ اوہ ری ایکٹیویوڈ آرمر تے ایکٹو پروٹیکشن سسٹم نوں کھو لاں ، فیر ٹینک نوں تباہ کرنے دے لئی کارنیٹ ، توفن یا [[آر پی جی – 29|آر پی جی-29]] جداں طاقتور میزائل دا استعمال کرن۔ <ref name="rocks">{{حوالہ ویب|url=https://warontherocks.com/2016/03/the-rise-of-the-hybrid-warriors-from-ukraine-to-the-middle-east/|title=The Rise of the Hybrid Warriors: From Ukraine to the Middle East|date=9 March 2016|publisher=War on the Rocks|last=Douglas A. Ollivant}}</ref> اے ٹی جی ایم ٹیماں نے وی انفرادی فوجیاں نوں نشانہ بنایا تے میزائلاں توں عمارتاں اُتے قبضہ کيتا۔ <ref name="nytimes.com"/> مشترکہ ہتھیاراں دے حصے دے طور اُتے اوہ پیدل فوج دے شانہ بشانہ کم کردے نيں۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> فضائی حملےآں تے جوابی فائرنگ توں بچنے دے لئی، ٹیماں نقل و حرکت اُتے بہت زیادہ انحصار کردی نيں۔ 2006 دے بعد توں ، لگدا اے کہ حزب اللہ نے اپنے سواراں دے آمیزے وچ بے ضابطہ رائفلاں تے سستے اے ٹی جی ایم استعمال کرنے دی زیادہ کوشش کيتی اے۔ <ref name="isopod"/>
2006 وچ ، حزب اللہ دی تقریبا 12-15٪ افواج اے ٹی جی ایم ٹیماں دا حصہ سن۔ <ref name="defense-update.com">{{حوالہ ویب|url=http://defense-update.com/analysis/lebanon_war_4.htm|title=Assessing the Assessing Hezbollah anti-armour tactics and weapons|publisher=Defense Update|first=David|last=Eshel|date=2007|accessdate=2016-11-03|archiveurl=https://web.archive.org/web/20141113184135/http://defense-update.com/analysis/lebanon_war_4.htm|archivedate=2014-11-13}}</ref> انہاں نے اے ٹی جی ایم ٹیماں نوں بالواسطہ اگ توں کامیابی دے نال مربوط کيتا ، جس توں اس گروپ نوں اپنی افواج دی تعیناتی کرنے تے زیادہ موثر گھات لگانے دی اہلیت ملی۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> اے ٹی جی ایم دی ٹیماں حزب اللہ نوں کھڑے ہونے دی صلاحیت فراہم کردے ہوئے کئی کلومیٹر دے فاصلے اُتے اسرائیل توں منسلک ہوسکدی نيں۔ <ref>{{حوالہ ویب|url=http://www.defensereview.com/are-anti-tank-guided-missiles-the-new-primary-threat-in-urban-warfaremout/|title=Are Anti-Tank Guided Missiles the New Primary Threat in Urban Warfare/MOUT?|website=defensereview.com|first=David|last=Crane|date=August 19, 2006}}</ref> اینٹی ٹینک ہتھکنڈاں نوں کچھ کامیابی ملی تے اوہ اسرائیلی ہلاکتاں دا سب توں اہم ذریعہ سن ، جس وچ گھٹ توں گھٹ 50 اموات ہوئیاں۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> حزب اللہ نے اپنے ہتھیاراں نوں مہارت دے نال استعمال کرنے دے علاوہ ، وسیع پیمانے اُتے اینٹی ٹینک میزائل وی استعمال کیتے ، جنہاں توں آئی ڈی ایف دے لئی پریشانی پیدا ہوگئی۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref>
نیویارک ٹائمز نے دسیا اے کہ ٹینکاں اُتے 20 فیصد اے ٹی جی ایم حملےآں وچ ہلاکتاں ہوئیاں یا بکتر بند گھسے ہوئے سن ، <ref name="nytimes.com">{{حوالہ ویب|url=https://www.nytimes.com/2006/08/07/world/middleeast/07hezbollah.html|title=A Disciplined Hezbollah Surprises Israel With Its Training, Tactics and Weapons|date=7 August 2006|website=The New York Times|last=Steven Erlanger and Richard A. Oppel Jr.}}</ref> لیکن اسرائیلی فوج دی رپورٹاں دے مطابق ایہ تعداد 45 فیصد زیادہ اے۔ <ref name="danger">Frederic Wehrey, David E. Thaler, Nora Bensahel, Kim Cragin, Jerrold D. Green – ''Dangerous But Not Omnipotent: Exploring the Reach and Limitations of Iranian Power in the Middle East'', RAND, {{آئی ایس بی این|9780833045546}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/9780833045546|9780833045546]] pages 95-96</ref> حزب اللہ نے ہتھیاراں دی لڑائیاں لڑاں تے اسرائیل دے مضبوط ٹھکانےآں اُتے حملہ کيتا۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> حزب اللہ دی اسٹریٹجک تدابیر دی صلاحیت اک بنیادی کمزوری اے ، لیکن پارٹی دی تدبیراں وچ تدبیر کرنے وچ مہارت "مہارت" اے۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> اگرچہ جنگجو اپنے آپریشن دے علاقےآں وچ انتہائی موبائل سن ، لیکن حکمت عملی دے مطابق حزب اللہ دی دفاعی پوزیشن بنیادی طور اُتے مستحکم سی۔ افواج دی بے قابو آگہی تے مواصلاتی مسائل دا مطلب ایہ سی کہ پِچھے ہٹنا یا حملہ کرنا کدی کدائيں ہی ممکن سی۔ حزب اللہ دے ممبراں نے پِچھے ہٹنے دے بجائے اپنی وردی اتار دتی تے شہری آبادی وچ غائب ہوگئے۔ حزب اللہ نے ایداں دے گھات لگائے جنہاں نے اسرائیلی پیادہ فوج نوں کوچےآں دی یونٹاں توں وکھ کيتا تے اسرائیل دے سابقہ مخالفین توں کدرے زیادہ عرب لڑاکا ہلاک کيتا۔ اُتے ، اے ٹی جی ایم ٹیماں وچ رات دی لڑائی دی ناقص صلاحیت موجود سی تے پِچھے ہٹتے وقت دوبارہ گروپ بنانا سست سی۔ <ref name="defense-update.com"/>
=== بکتر بند فوجاں ===
2015 یا 2016 وچ ، شام نے مبینہ طور اُتے حزب اللہ 75 T-55 تے T-72 ٹینکاں نوں ملک وچ استعمال کرنے دے لئی بطور بکتر بند گاڑیاں فراہم کيتیاں ۔ <ref name="alraimedia.com">{{حوالہ ویب|url=http://www.alraimedia.com/ar/article/special-reports/2015/09/26/623237/nr/syria|title=طلائع قوات إيرانية خاصة وصلت دمشق و"حزب الله" يملك لواء مدرّعاً من 75 دبابة|publisher=AlRai Media Group|date=September 26, 2015|access-date=October 1, 2020|archivedate=June 24, 2017|archiveurl=https://web.archive.org/web/20170624205403/http://www.alraimedia.com/ar/article/special-reports/2015/09/26/623237/nr/syria}}</ref><ref name="ynetnews.com">{{حوالہ ویب|url=http://www.ynetnews.com/articles/0,7340,L-4704278,00.html|title=Report: Syria to give Hezbollah Soviet tank division|publisher=Ynetnews|first=Roi|last=Kais|date=September 26, 2015}}</ref> انہاں فورسز دی تصدیق شام دے شہر القصیر وچ منعقدہ 2016 دی پریڈ وچ ہوئی۔ <ref name="auto10"/><ref>{{حوالہ ویب|url=https://www.voanews.com/a/hezbollah-controversy-military-parade-syria/3603047.html|title=Hezbollah Stirs Controversy with Military Parade in Syria|first=Sirwan|last=Kajjo|date=November 18, 2016|publisher=Voice of America}}</ref> حزب اللہ ایس اے اے توں حاصل کردہ ٹی 55 ٹینک تے توپ خانے وی چلاندا اے تے اس وچ نامعلوم رقم بی ایم پی 1 انفنٹری توں لڑنے والی گاڑیاں نيں۔ حزب اللہ لبنان وچ اسرائیل دے خلاف کوچ نئيں بھیجے گی ، کیونجے گاڑیاں تریخ دے مطابق نيں تے پارٹی اسرائیل دی مطلق فضائی برتری دا مقابلہ نئيں کرسکدی اے۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref>
=== خصوصی افواج ===
حزب اللہ نے 1990 دی دہائی توں " اسپیشل فورس " دے جنگجوواں نوں تربیت دتی اے ، جو اج کل "رڈوان یونٹ" دا حصہ نيں۔ انہاں نوں چھاپےآں تے چھوٹی یونٹ دی حکمت عملی دا خاص تجربہ اے <ref name="seinfeld"/> تے حزب اللہ دے مطابق "گھات لگانے ، قتل ، یا آپریشن کرنے دے لئی گہری دراندازی دی ضرورت ہُندی اے۔" <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> اوہ خفیہ نيں لیکن "حیرت انگیز طور اُتے پیشہ ور تے قابل" <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> تے "سخت گوریلا جو خفیہ طور اُتے آپریٹنگ دے فن وچ سبقت لے جاندے نيں۔" <ref name="paris"/> اسرائیلی لیفٹیننٹ کرنل رونی عامر دے مطابق ، "جب اک فائرنگ دے دوران اک موقع اُتے اک اسرائیلی ایس او ایف ٹیم [حزب اللہ ایس او ایف] دا سامنا کرنا پيا تاں ، اسرائیلی ٹیم دے ارکان نے پہلے سوچیا کہ اوہ کسی نہ کسی طرح اسرائیلی مہراں دی علیحدہ علیحدگی دے نال مل گئے نيں۔" تربیت 90 دن تک جاری رہندی اے۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> انہاں نوں "انتہائی نظم و ضبط" دے نال کل وقتی جنگجو قرار دتا جاندا اے ، تے 1990 دی دہائی وچ بیروت وچ مقیم سن ۔ حزب اللہ دے ایس او ایف وچ یونٹ 1800 شامل اے جو [[فلسطینی علاقہ جات|فلسطینی علاقےآں]] وچ دہشت گرداں نوں تربیت فراہم کردی اے ، یونٹ 910 ، جو اسرائیل تے بیرون ملک "بیرونی کارروائی" کردی اے تے یونٹ 3800 ، جو عراقی شیعہ عسکریت پسند گروہاں دی حمایت کردا اے ، خاص طور اُتے آئی ای ڈی دی تعمیر وچ ۔ <ref>{{حوالہ ویب|url=http://www.washingtoninstitute.org/policy-analysis/view/hezbollah-in-iraq-a-little-help-can-go-a-long-way|title=Hezbollah in Iraq: A Little Help Can Go a Long Way|publisher=The Washington Institute for Near East Policy|last=Matthew Levitt and Nadav Pollak|date=June 25, 2014}}</ref><ref name="understandingwar"/> حزب اللہ ایس ایف نے بنت جبیل دی جنگ وچ حصہ لیا <ref>Harel, Amos; Issacharoff, Avi (2008). ''34 Days: Israel, Hezbollah, and the War in Lebanon''. New York: Palgrave Macmillan. {{آئی ایس بی این|978-0230604001}}</ref> تے القصیر دی لڑائی دا حکم دتا۔ <ref>{{حوالہ ویب|url=https://www.brookings.edu/wp-content/uploads/2016/06/Syria-Military-Landscape-English.pdf|title=Dynamic Stalemate: Surveying Syria's Military Landscape. Policy Briefing.|publisher=Brookings Doha Center|first=Charles|last=Lister|date=May 2014}}</ref> حزب اللہ ایس ایف شام تھیٹر وچ بہت زیادہ ملوث رہیا اے۔
== کمانڈ دا ڈھانچہ ==
[[فائل:Flickr - Israel Defense Forces - Hezbollah Aerial Snapshot Used to Document IDF Forces.jpg|thumb| شمالی اسرائیل دا فضائی سنیپ شاٹ حزب اللہ دے اک کمانڈ سنٹر وچ استعمال کيتا گیا سی تاکہ اوہ آئی ڈی ایف دے دستےآں دی نقل و حرکت اُتے نظر رکھے۔]]
حزب اللہ دا انتظام اک عام فوجی تنظیم دی طرح اے۔ اس دی درجہ بندی دا ڈھانچہ تے مرکزی منصوبہ بندی تے وکندریقرت عملدرآمد ہُندا اے ، جداں کہ عام اے ، <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> اگرچہ اس وچ معمولی توں زیادہ حصہ بندی اے۔ <ref name="Worall">James Worrall, Simon Mabon, Gordon Clubb. (2011) ''Hezbollah: From Islamic Resistance to Government''. p. 44–46 {{آئی ایس بی این|1440831343}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/1440831343|1440831343]]</ref> "حزب اللہ دا فوجی ونگ منظم طور اُتے منظم اے ، لیکن اسرائیلی سنسراں تے فضائی حملے توں پتہ لگانے توں بچنے دے لئی بہتر آپریشنل تے مواصلات دی حفاظت دے نال سیلولر انداز وچ کم کردا اے۔ <ref name="nps.edu">{{حوالہ رسالہ|url=https://calhoun.nps.edu/bitstream/handle/10945/11491/SI-v10-FoW_pg124-137_Johnson.pdf|title=Minding the Middle: Insights, from Hezbollah and Hamas|author=Johnson|date=October 2011}}</ref> حزب اللہ دے پاس لچکدار تدبیراں نيں تے انہاں دے پاس مقامی کمانڈراں نوں زیادہ اختیارات تفویض کرنے دے بجائے کمان دا اک لمبا درجہ بندی نئيں اے۔ <ref name="nytimes.com"/> خود مختار پیادہ خلیاں وچ "کافی حد تک آزادی" ، جس وچ حملہ کرنا اے اس دا انتخاب کرنا شامل اے ، جس وچ تنظیم دے بیشتر جنگجو شامل ہُندے نيں۔ حزب اللہ دے رہنما حسن نصراللہ نے 2013 دے اک انٹرویو وچ وضاحت کيتی سی کہ 2006 دی جنگ دے دوران انہاں نے پنڈ دی سطح تک "تشخیص دی آزادی" دتی سی تے متعدد دیہاتاں نے کھڑے ہوکے لڑنے دا فیصلہ کيتا سی۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> دوسری طرف ، حزب اللہ ہائی کمان نے اپنی اسٹریٹجک میزائل فورس اُتے "فرم آپریشنل کنٹرول" اُتے زور دتا اے۔ بیروت وچ حزب اللہ ہیڈکوارٹر طویل فاصلے تک مار کرنے والے میزائلاں اُتے براہ راست کنٹرول برقرار رکھدا اے ، جس وچ علاقائی کمانڈراں نوں منتقل کردہ مختصر تے ممکنہ طور اُتے درمیانے فاصلے تک مار کرنے والے میزائلاں دا کنٹرول اے۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> لبنان دی جنگ وچ ، حزب اللہ ہائی کمان دے پاس راکٹ حملےآں نوں مکمل طور اُتے روکنے یا شروع کرنے دے لئی ٹاپ ڈاون کنٹرول سی۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> حزب اللہ دا اسرائیل دے خلاف مسلسل مختصر فاصلے تک جاری رہنے والے راکٹ حملےآں دے ارد گرد قائم آپریشناں دا تصور ۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> "حزب اللہ اک انتہائی سرشار تے پیشہ ورانہ لڑائی قوت ثابت ہوئی۔ . . حزب اللہ نے کامیابی دے نال اک نواں نظریہ اپنایا ، اس نے خود نوں اک گوریلا قوت توں اک مضبوط ارد روايتی لڑائی قوت وچ تبدیل کردتا۔ " <ref name="auto22">Matt M. Matthews, ''We Were Caught Unprepared: The 2006 Hezbollah-Israeli War'' The Long War Series, Occasional Paper 26. U.S. Army Combined Arms Center, Combat Studies Institute Press. Fort Leavenworth, Kansas. {{آئی ایس بی این|978-0-16-079899-3}}</ref> عام طور اُتے ، حزب اللہ دے فیصلہ سازی دے عمل دے بارے وچ بوہت گھٹ معلومات نيں۔ <ref name="seinfeld"/> پارٹی نے 2006 توں اپنے کمانڈ اینڈ کنٹرول انفراسٹرکچر وچ نمایاں سرمایہ کاری دی اے۔ <ref name="isopod"/>
2009 دے جائزے وچ حزب اللہ نوں خلاصہ طور اُتے بیان کيتا گیا سی "ایداں دے تاکتیکی اقدامات دے قابل جو اک عام غیر ریاستی لڑائی توں کدرے زیادہ پیچیدہ نيں۔ اوہ نفاست تے وڈے وڈے جنگی آپریشن کرنے دی واضح صلاحیت دا مظاہرہ کردے نيں۔ " <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> تجزیہ کار وڈے پیمانے اُتے اس گروپ نوں اک "غیر معمولی قابل تنظیم" تے دنیا دی جدید ترین مسلح غیر ریاستی اداکاراں وچوں اک سمجھدے نيں ۔ <ref name="exploring">DeVore, M. (2012). Exploring the Iran-Hezbollah Relationship: A Case Study of how State Sponsorship affects Terrorist Group Decision-Making. ''Perspectives On Terrorism'', 6(4-5).</ref> حزب اللہ نوں تربیت ، نظم و ضبط ، تے مرکزی کمانڈ دے معاملے وچ فلسطینی گروپاں توں زیادہ قابل سمجھیا جاندا اے۔ 2006 دی جنگ وچ ، حزب اللہ مشن قسم دے احکامات اُتے عمل درآمد کرنے وچ کامیاب رہیا ، جس توں اس دی جنگی تاثیر وچ بہتری آئی ، لیکن فیر وی آئی ڈی ایف دے ذریعہ اک دوسرے توں لڑائی وچ اس دا مقابلہ بہت سخت سی۔ <ref name="thicc">Ralph Peters. ''Endless War: Middle-Eastern Islam Vs. Western Civilization'' (2016). p. 71</ref> 2006 دی جنگ وچ ، جنگجوواں دے منقطع ہونے دی صورت وچ براہ راست احکامات دے بغیر کم کرنے دی خود مختاری حاصل سی۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> اُتے ، ایسا لگدا اے کہ ایہ ضروری نئيں سی ، کیونجے پوری جنگ وچ اک سلسلہ آف کمانڈ برقرار سی۔ اگرچہ حزب اللہ دے مشن کمانڈ نے مقامی رہنماواں نوں پہل کرنے تے لچکدار ہونے دا اہل بنادتا ، اس دا ایہ مطلب وی سی کہ حزب اللہ یونٹ لڑائی وچ اک دوسرے دا نال نئيں دے پا رہیاں نيں۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> حزب اللہ دے دستے عام طور اُتے ، لیکن ہمیشہ نئيں ، ست توں دس آدمی اُتے مشتمل ہُندے نيں۔ انہاں دے پاس خودمختاری تے خود کفالت دا بہت معاملہ سی ، لیکن اس دے نال بیروت تک اک سلسلہ آف کمانڈ وی سی۔ حزب اللہ دا لاجسٹک ٹرین دی بجائے ذخیرہ اندوزی دا استعمال ، تے "جونیئر رہنماواں نوں دتے گئے اعلیٰ خودمختاری" نے اسنوں عام عرب فوج توں ممتاز کيتا۔ حزب اللہ وکندریقرت مشن کمانڈ اُتے عمل پیرا اے جتھے اعلیٰ قیادت طویل مدتی منصوبہ بندی دے لئی ذمہ دار اے لیکن عام طور اُتے حرباں یا کارروائیاں دے لئی ننيں۔ <ref>{{حوالہ ویب|url=http://sill-www.army.mil/firesbulletin/archives/2017/mar-apr/Deep%20fight.pdf|title=How enablers shape the deep fight for the brigade combat team|last=Capt. Colin Marcum|date=March–April 2017}}</ref> 2006 وچ ، حزب اللہ دے مشن کمانڈ دے انداز تے اعلیٰ خودمختاری دے نتیجے وچ ایہ تنظیم آئی ڈی ایف دی طرح میدان جنگ وچ برتاؤ کردی رہی۔ حزب اللہ دا حکم تے کنٹرول کارگر اے لیکن "کم ٹیک" اے۔ ایہ تار ، فائبر آپٹک ، رنرز ، سگنل تے سویلین مواصلاتی نیٹ ورک اُتے مشتمل اے۔ حزب اللہ کدی کدائيں ہی ریڈیو الیکٹرانک اسپیکٹرم خارج کردا اے۔ حزب اللہ ایرانی مفادات دا بہت محتاط اے ، لیکن ایسا لگدا اے کہ ایران دے ذریعہ اس دا براہ راست کنٹرول نئيں ہُندا اے۔ <ref name="echo">Cordesman, Anthony H. (July 15, 2006) ''Iran's Support of the Hezbollah in Lebanon''. Center for Strategic and International Studies.</ref> لبنانی قوم پرست تحریک دی حیثیت توں حزب اللہ دی حیثیت ، تے اعتراف جرم دی حمایت نوں برقرار رکھنے دی ضرورت ، اس دی نشوونما وچ سب توں وڈی رکاوٹ اے۔ <ref name="wikileaks.org"/> حزب اللہ اک طاقتور ، مقامی غیر متناسب قوت توں علاقائی فوجی طاقت وچ توسیع کر رہیا اے۔ <ref name="armenia">{{حوالہ رسالہ|url=http://www.janes.com/images/assets/885/68885/Hizbullahs_expanded_role_in_Syria_threatens_Israel.pdf|title=Hizbullah's expanded role in Syria threatens Israel|first=Nicholas|last=Blanford|date=2017}}</ref>
حزب اللہ دی دہشت گردی دی کاروائیاں "اسلامی جہاد تنظیم" یا "بیرونی آپریشن تنظیم" دے ناں توں اک وکھ ، "بلیک آپس" دے ذیلی گروپ وچ مرتب کيتیاں گئیاں۔ <ref name="Worall">James Worrall, Simon Mabon, Gordon Clubb. (2011) ''Hezbollah: From Islamic Resistance to Government''. p. 44–46 {{آئی ایس بی این|1440831343}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/1440831343|1440831343]]</ref><ref name="Ali">United States of America v. Ali Kourant, https://www.justice.gov/opa/press-release/file/972451/download</ref> اج ، حزب اللہ اک ایسا دہشت گرد تنظیم اے جس وچ روايتی صلاحیتاں دی حامل اک انسانیت پسند گورننگ ایجنٹ دی حیثیت توں نقاب پوشی کيتی جاندی اے۔ <ref name="dvidshub.net"/>
== جغرافیائی کمانڈز ==
[[فائل:The partition of Lebanon.png|thumb| لبنان دے شیعاں دے تن علاقے: جنوبی لبنان ، جنوبی بیروت ، تے وادی بیکا۔]]
لبنان دے شیعہ تن جغرافیائی طور اُتے متضاد علاقےآں وچ رہندے نيں: مشرقی لبنان ، جنوبی لبنان تے جنوبی بیروت وچ وادی بیکا۔ <ref name="imcia">Directorate of Intelligence, (8 November 1985) ''Lebanon: Amal and Hizballah– The Line Between Politics and Terrorism'', in ''Near East and South Asia Review''. Central Intelligence Agency.</ref> حزب اللہ نوں وادی بیدا ميں تشکیل دتا گیا سی تے اس نے 1980 دی دہائی وچ بیروت دے ناقص تے بنیاد پرست جنوبی نواحی علاقےآں اُتے قابو پانے دے لئی عمال نوں چیلینج کرنا شروع کيتا سی ، 1990 تک اوتھے کنٹرول حاصل کرنا سی۔ جداں ہی اسرائیل دے خلاف گوریلا جنگ وچ تیزی آئی ، حزب اللہ امل دا مضبوط گڑھ ، لبنان جنوبی لبنان تک پھیل گیا تے بالآخر اوتھے وی فوجی اہمیت حاصل کرلئی-
سن 2000 وچ اسرائیل دے لبنان توں رخصت ہونے دے بعد ، حزب اللہ نے اپنے آپ نوں علاقائی احکامات وچ ازسر نو تنظیم نو دے بارے وچ جانیا جاندا اے ، لیکن انہاں دے پاس جغرافیائی احکامات دے بارے وچ قطعی طور اُتے اختلاف رائے پایا جاندا اے۔ بہت سارے ذرائع دا کہنا اے کہ حزب اللہ دے تن کمانڈ نيں: جنوبی لبنان ، وادی بیکا ، تے جنوبی بیروت دا علاقہ ، <ref name="bonjour">Guérin, Alexandre. (2009) ''Le Hezbollah Face Aux Forces Armées Conventionnelles Perspective Historique Des Modes D'action''. Centre de Doctrine d'Emploi des Forces – Division Recherge et Retour d'Expérience.</ref> جدوں کہ حزب اللہ دے فوجی ماہر نکولس بلنفورڈ دا کہنا اے کہ اس گروپ وچ بحیرہ روم دی اک کمانڈ وی اے۔ <ref name="p346">Blanford, Nicholas. Warriors of God. (2011) p. 346</ref> آئی ڈی ایف دے کچھ ذرائع پارٹی دی شام دی کارروائیاں نوں وی "ایسٹرن کمانڈ" دے طور اُتے بیان کردے نيں۔ <ref name="seinfeld"/>
اس گروپ دے بیشتر تربيتی کیمپ ، <ref name="defense-update.com1">{{حوالہ ویب|url=http://defense-update.com/newscast/0407/analysis/analysis-190407.htm|title=Hezbollah is Rearming for another round with Israel – by Col. David Eshel|publisher=Defense Update|access-date=2020-10-01|archivedate=2018-03-08|archiveurl=https://web.archive.org/web/20180308093549/http://defense-update.com/newscast/0407/analysis/analysis-190407.htm}}</ref> لاجسٹک انفراسٹرکچر دے نال ، شام دی سرحد دے نیڑے مشرقی لبنان دی [[وادی بقاع|ویران بیکا وادی]] وچ واقع نيں۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> اس کمانڈ نوں ممکنہ طور اُتے "حیدر یونٹ" کہیا جاندا اے۔ <ref name="seinfeld"/> اس علاقے وچ حزب اللہ دی کاروائیاں خاص طور اُتے [[بعلبک|بعلب دے]] قصبے دے آس پاس نيں۔ [[دریائے لیطانی|دریائے لتانی دے]] شمال وچ ، نباتیہ ہائیٹس گروپ دے طویل فاصلے تک راکٹ ذخیرہ کردی اے تے دفاعی گہرائی فراہم کردی اے۔ ایہ بظاہر بیروت کمانڈ دا اک حصہ نيں ، <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> جس دا صدر دفتر بیروت دے دہیہ وچ واقع اے ، تے ایہ کمانڈ اینڈ کنٹرول ، انٹلیجنس تے پروپیگنڈہ دے وی ذمہ دار اے۔ آخر کار ، گروپ دا آپریشنل کور اسرائیلی سرحد دے نیڑے لتانی دے جنوب وچ واقع اے ، جتھے وڈی تعداد وچ مختصر فاصلے والے راکٹ ، جنگجو تے قلعے نيں۔ ایہ گروہ ، جسنوں نصر اکائی دے ناں توں جانیا جاندا اے ، اپنی بیشتر لڑائیاں دیہات توں کرواندا اے ، لڑائی وی پہاڑی پینڈو علاقےآں وچ ہُندی اے۔ بحیرہ روم دی چھوٹی کمانڈ ، جس دا کچھ ذرائع ذکر نئيں کردے نيں ، بیرون ملک مقیم مینڈک مین ، ساحلی نگرانی ، اینٹی شپ میزائل ، تے "بحری اثاثے"۔ <ref name="p346">Blanford, Nicholas. Warriors of God. (2011) p. 346</ref>
1982 توں 1992 تک ، حزب اللہ دا صدر دفتر وادی بیدا ميں واقع بالک شہر وچ واقع شیخ عبد اللہ بیرکس وچ سی۔ <ref name="wolf"/><ref>{{حوالہ ویب|url=https://www.independent.co.uk/news/world/hizbollah-leaves-lebanon-base-1535997.html|title=Hizbollah leaves Lebanon base|date=28 July 1992|publisher=}}</ref>
== انفراسٹرکچر ==
حزب اللہ نے لبنان دے گنجان آباد علاقےآں وچ "وسیع ، جدید ، [اور] جامع فوجی انفراسٹرکچر تعمیر کيتا اے۔" <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> چونکہ حزب اللہ لبنان دے مقابلے وچ اسرائیلی فضائی برتری نوں چیلنج نئيں کرسکدا ، <ref>{{حوالہ ویب|url=https://warisboring.com/this-new-airstrip-could-be-home-to-hezbollah-s-drones-bdec97ff36a8|archiveurl=http://webarchive.loc.gov/all/20160817070028/https://warisboring.com/this-new-airstrip-could-be-home-to-hezbollah-s-drones-bdec97ff36a8|archivedate=17 August 2016|title=New Airstrip Could Be Home to Hezbollah's Drones|first=Adam|last=Rawnsley|date=25 April 2015|publisher=War Is Boring}}</ref> ایہ گروپ انتہائی وسندریقرت اے ، جس وچ کوئی بنیادی ڈھانچہ یا کشش ثقل نئيں اے ۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> پارٹی دے بنیادی ڈھانچے نوں بنیادی طور اُتے دو حصےآں اُتے مشتمل اے: پینڈو علاقےآں وچ خفیہ بنکراں دا اک جال جو اینٹی ٹینک ٹیماں جداں بھاری تربیت یافتہ جنگجوواں دے ذریعہ استعمال ہُندا اے ، تے مقامی باشندےآں تے تحفظ پسنداں دے زیر دفاع مضبوط دیہات نيں۔ <ref name="isopod"/>
حزب اللہ اپنے ہتھیاراں دے دستخطےآں نوں کم کرنے تے اسرائیلی فضائی حملےآں نوں کم کرنے دے لئی سخت دفاعی پوزیشن بنانے دی کوشش کردا اے۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> حزب اللہ دے کچھ بنکر اقوام متحدہ دے مشاہدے دی چوکیوں یا اسرائیلی سرحد دے بالکل نیڑے واقع سن ، تے اس وچ وگدا ہويا پانی ، موٹا کنکریٹ تے ہفتےآں دی رسد موجود سی۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> ایہ انفراسٹرکچر مبینہ طور اُتے 2003–2004 وچ تعمیر کيتا گیا سی تے اس دی نگرانی حزب اللہ دے کمانڈر فواد شاکر نے دی سی۔ <ref name="paris"/>
[[فائل:Hezbollah Bunker in Mleeta, southern Lebanon.jpg|سجے|thumb| زیرزمین حزب اللہ جنگی کمرہ ، جو ہن اک میوزیم دا حصہ اے۔]]
[[فائل:Hezbollah Outpost.jpg|thumb| 2006 وچ حزب اللہ دی سرحدی چوکيتی۔ ایہ گروپ ہن سرحدی چوکیوں نوں برقرار نئيں رکھدا اے کیونجے اوہ فضائی حملےآں دے ذریعے آسانی توں تباہ ہوگئے سن ۔]]
2006 وچ ، [[اسرائیلی فضائیہ|آئی اے ایف]] نے نیلی لائن اُتے گروپ دی تمام 17 سرحدی مشاہداتی پوسٹاں نوں جلدی توں تباہ کردتا۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> ايسے طرح ، اسرائیل نے جنوبی بیروت وچ اس گروپ دا نگہبانہ ہیڈ کوارٹر کمپلیکس ، جس وچ پندرہ منزلہ عمارتاں وی شامل نيں ، نوں فضائی حملےآں دے نال مسمار کردتا۔ اس پیچیدہ نگرانی انتظامیہ ، رسد ، افرادی قوت ، تے انٹیلیجنس کم دی نگرانی۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> اس دے نتیجے وچ ، اس دے بعد توں حزب اللہ زیادہ وینٹریکلائزڈ ہويا اے تے اس توں زیادہ بنیادی ڈھانچہ زیر زمین منتقل ہوگیا اے۔ اس تنظیم دا بیروت وچ ایرانی سفارت خانے دے تھلے اک مرکزی کمانڈ سنٹر ہوسکدا اے۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref><ref name="ReferenceA">{{حوالہ ویب|url=http://defense-update.com/analysis/lebanon_war_1.htm|title=Hezbollah's Intelligence War|first=David|last=Eshel|publisher=Defense Update|date=2007|access-date=2020-10-01|archivedate=2018-04-10|archiveurl=https://web.archive.org/web/20180410014502/http://defense-update.com/analysis/lebanon_war_1.htm}}</ref> 2006 دی جنگ وچ ، حزب اللہ نے "دانشمندی دے نال میدان جنگ تیار کيتا" تے اپنی فوج نوں اسرائیلی خطرہ دے مطابق بنایا۔ <ref name="thicc">Ralph Peters. ''Endless War: Middle-Eastern Islam Vs. Western Civilization'' (2016). p. 71</ref> جنوبی لبنان دا علاقہ محافظ دے لئی بہت سازگار اے ، تے حزب اللہ نے اس پیش گوئی وچ توسیع کردے ہوئے اس گل دا اندازہ لگایا کہ IDF کس طرح لڑے گا تے IDF دی راہ وچ رکاوٹ پیدا کرنے دے لئی درکار بنیادی ڈھانچے دی تعمیر یا حصول کريں گا۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> جس طرح حزب اللہ نے وڈی تعداد وچ بنکر تعمیر کیتے ، ايسے طرح حزب اللہ نے وی اسلحہ ذخیرہ کيتا تے سویلین دیہات تے قصبےآں وچ انفراسٹرکچر بنایا۔ اس توں حزب اللہ نوں جنوبی لبنان دے شہری تے پینڈو دونے علاقےآں توں لڑنے دا اہل بنایا گیا۔
جدوں کہ جنوبی لبنان وچ شیعہ دیہات یکساں طور اُتے ہیڈ کوارٹر تے بنکراں دے نال مضبوط نيں ، حزب اللہ کم شہری حمایت حاصل کرنے دی وجہ توں [[مسیحی|عیسائی]] تے [[دروز|ڈروز]] پنڈ دے مضافات وچ کم کردی اے۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> پارٹی نے "شہری خطےآں دا مہارت توں استحصال کيتا" تے "غیر جنگجوواں دے قربت وچ مضبوط دفاعی قلعے منعقد کیتے۔" <ref name="frank">Hoffman, Frank G. (1st quarter 2009) ''Hybrid Warfare and Challenges''. JPQ Issue 52, National Defense University.</ref> حزب اللہ جنوبی لبنان وچ وڈی تعداد وچ غیر منقولہ جائداد دی ملکیت دا مالک اے تے شہریاں دے گھراں وچ اسلحہ ذخیرہ کرنے دے بدلے وچ چھوٹا کرایہ پیش کردا اے۔ <ref>{{حوالہ ویب|url=http://www.thetower.org/4534-israel-prepares-for-possible-hezbollah-naval-commando-attack/|title=Israel Prepares for Possible Hezbollah Naval Commando Attack|publisher=The Tower Magazine|date=February 7, 2017}}</ref> اوہ شہری مکانات تے عمارتاں نوں وڈے پیمانے اُتے لڑائی دے تھاںواں دے طور اُتے استعمال کردے نيں ، اس وجہ توں کہ "مکان تباہ ہوسکدا اے ، پنڈ نوں تباہ کيتا جاسکدا اے ، لیکن وطن ننيں۔" ایہ گروپ مسیتاں ، اسکولاں ، اسپتالاں تے ہور محفوظ تھاںواں اُتے اسلحہ جمع کردا اے۔
=== قدرت دے ذخائر ===
[[فائل:Flickr - Israel Defense Forces - Entrance to Hezbollah Bunker.jpg|thumb| جنوبی لبنان وچ حزب اللہ دا اک بنکر ، جس وچ دروازے دی حفاظت کرنے والا اک کنکریٹ بلاک اے۔]]
اسرائیل نے حزب اللہ دے زیر زمین بنکراں ، بیرکاں ، کیچاں تے فائرنگ دی پوزیشناں دے وسیع نیٹ ورک نوں ایہ ناں "فطرت دے ذخائر" دا ناں دے دتا اے جو جنوبی لبنان دے بوہت گھٹ آبادی والے پینڈو علاقےآں وچ واقع اے۔ حزب اللہ دے [[مبارزتی ہندسیات|جنگی انجینیئرز]] نے سن 2000 توں جنوبی لبنان وچ دفاعی طور اُتے فائرنگ دی پوزیشناں تے پوشیدہ ٹھکانے بنائے نيں۔ حزب اللہ دے بنکراں دا چنگا دفاع اے ، دھماکے دے دروازے تے حفاظتی کیمرے نيں تے اسرائیلی فضائی حملےآں وچ گہری دفن نيں۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> لانچنگ سائٹاں نوں تلاش کرنا خاص طور اُتے چیلنجنگ دے نال ایہ قلعے وی اچھی طرح توں چھپائے ہوئے نيں۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref><ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref>
کچھ ٹیپیکل معاملات وچ ، بنکراں نوں سیکڑاں فٹ زیر زمین دفن کيتا گیا ، جس وچ کئی فٹ ٹھوس تحفظ سی تے کافی کھانے تے رہائشی جگہ ہفتےآں تک بغیر کسی بدل دے چل پائے گی۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> حزب اللہ دی کچھ سرنگاں ہزاراں میٹر لمبی نيں۔ اسرائیلی ذرائع دا کہنا اے کہ [[شمالی کوریا|شمالی کوریا دے]] استاداں نے 2004 وچ لبنان دا سفر کيتا سی تے حزب اللہ دے زیرزمین بنیادی ڈھانچے دی تعمیر دی نگرانی دی سی۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> 2013 وچ ، ریاستہائے متحدہ دی اک وفاقی عدالت نے ایہ دریافت کيتا کہ شمالی کوریا نے حزب اللہ نوں "جنوبی لبنان وچ زیر زمین فوجی تنصیبات ، سرنگاں ، بنکر ، ڈپو تے اسٹوریج دی سہولیات دا اک وسیع نیٹ ورک" بنانے وچ "جدید اسلحہ ، ماہر دی صلاح تے تعمیراتی مدد" دی۔ <ref>''Kaplan v. Central Bank of the Islamic Republic of Iran'', 961 F. Supp. 2d 185, 193 D.D.C. 2013</ref>
[[فائل:Flickr - Israel Defense Forces - Missiles Found Aboard Francop (1).jpg|thumb| حزب اللہ دا پھڑیا گیا 122 ملی میٹر BM-21 گرڈ راکٹ۔]]
چونکہ حزب اللہ دی قلعہ بند سائٹاں تے زیر زمین سہولیات فضائی حملےآں دے خلاف مزاحم نيں ، لہذا انہاں نوں زمینی ردعمل دے بغیر غیر موثر نئيں کيتا جاسکدا۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> اس دے نتیجے وچ ، حزب اللہ اسرائیلی زمینی فوج نوں چیلنج کرنے دے لئی اپنے ہتھیاراں دے ذخیرے تے مضبوط تھاںواں دا استعمال کرسکدا اے۔ 2006 وچ ، سامان دی تقسیم شدہ کیچاں نے جنگجوواں نوں IAF دی بازیابی دے باوجود روکنے دے لئی لڑنے دے لئی کافی دفعات فراہم کيتیاں ۔ <ref name="fas.org1">{{حوالہ ویب|url=https://fas.org/sgp/crs/mideast/RL33566.pdf|title=Lebanon: The Israel-Hamas-Hezbollah Conflict|publisher=Congressional Research Service|editor-last=Sharp, Jeremy M.|date=September 15, 2006}}</ref> اس گروہ دے پاس 2006 وچ 500–600 ہتھیاراں دے ذخیرے سن ۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref><ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> حزب اللہ دے کچھ یونٹاں نے IDF لائناں دے پِچھے توں وی اسرائیل اُتے راکٹ فائر کرنا جاری رکھیا۔ 2006 دی جنگ دے بعد ، حزب اللہ دریائے لٹانی دے جنوب وچ اپنے بنکرز تے "فطرت دے ذخائر" ترک کرنے اُتے مجبور ہوگئی۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> 2006 دی جنگ حزب اللہ دے فوجی انفراسٹرکچر دے خطے وچ تبدیلی دا سبب بنی۔ جنگ توں پہلے ، حزب اللہ دریائے لٹانی دے جنوب وچ مرتکز سی ، جدوں کہ جنگ دے بعد حزب اللہ دا دفاعی سامان زیادہ تر اس دے شمال وچ اے۔ <ref name="isopod"/> اپنے بیشتر بنکراں نوں ترک کرنے دے باوجود ، اسرائیلی انٹیلیجنس دا کہنا اے کہ انہاں دے پاس "بہت اچھی ذہانت" اے ، لیکن اس دا ثبوت نئيں اے کہ حزب اللہ نے جنوبی لبنان دے یو این آئی ایف آئی ایل زون وچ بنکرز تے "زیر زمین شہر" بنائے نيں۔ <ref name="wikileaks.org"/>
=== دفاعی سرنگاں ===
شمالی اسرائیل نوں لبنانی علاقے توں تجاوز کر کئی سرنگاں دی طرف توں پایا گیا [[اسرائیلی دفاعی افواج|آئڈییف]] دے نتیجے دے طور اُتے دسمبر 2018 وچ آپریشن شمالی شیلڈ تے یونیفل دے بعد انہاں دے وجود دی تصدیق کی.<ref name="jpostUNIFILconfirmation">{{حوالہ ویب|url=https://www.jpost.com/Breaking-News/UN-peacekeeping-mission-in-Lebanon-confirm-Hezbollah-tunnels-crossed-border-with-Israel-574578|title=U.N. mission in Lebanon confirms Hezbollah tunnels crossed Israel border – Arab-Israeli Conflict – Jerusalem Post|website=www.jpost.com}}</ref>
=== لانچ سائٹاں ===
[[فائل:Flickr - Israel Defense Forces - IDF Forces Uncover Missiles in Lebanon.jpg|thumb| جنوبی لبنان وچ زیر زمین کتیوشا راکٹ لانچر ، گھنے برش توں چھلا ہويا۔]]
حزب اللہ دے پاس پورے لبنان وچ اپنے راکٹاں دے لئی سیکڑاں لانچنگ سائٹس موجود نيں ، <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> 2006 وچ 200 توں 300 لانچنگ سائٹاں۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> سویلین مکانات تے بنکراں وچ اسپیئر راکٹ تے سامان اسٹور کيتا جاندا اے۔ <ref name="nytimes.com"/> زیادہ تر راکٹاں نوں اک ٹیم دے ذریعہ اسٹوریج توں فائرنگ دی پوزیشن وچ منتقل کيتا جاندا اے ، تے دوسری ٹیم نے فائر کيتا اے۔ حزب اللہ راکٹ ٹیماں نوں اسرائیل اُتے راکٹ فائر برقرار رکھنے دے لئی مشن قسم دی آسان ہدایات دتیاں گئیاں تے اوہ 2006 دی جنگ دے عرصے تک اکثر آزادانہ طور اُتے کم کردیاں سن۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> {{Efn|But some say Hezbollah rocket teams were organically integrated with light infantry as part of combined arms.<ref name="LEAD" />}} حکمت عملی دے مطابق ، حزب اللہ نے کٹیوشا راکٹاں نوں باقاعدگی دے نال باقاعدگی توں فائر کرنے وچ کامیاب کيتا ، جداں کہ انہاں نے منصوبہ بنایا سی ، تے انہاں دی راکٹ ٹیماں دا عزم کيتا گیا سی تے اس وچ اچھی رسد سی۔ اُتے ، راکٹ اسرائیل اُتے زبردستی اسٹریٹجک اثر مرتب کرنے وچ ناکام رہے ، تے جنگ ختم نئيں ہويا۔
حزب اللہ سیپرس جنگ وچ استعمال کرنے دے راکٹاں دے پیش بینی شدہ تے تیار لانچنگ عہدےآں دی وڈی تعداد تعمیر کيتا اے .<ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> اک ککڈ عملہ جلدی توں راکٹاں نوں پوزیشن وچ منتقل کردا اے تے انہاں نوں تنہا یا کم توں کم لاجسٹک سپورٹ دے ذریعہ فائر کردا اے۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> کچھ راکٹ نیومیٹک لفٹاں دے نال زیر زمین چھپ جاندے نيں تاکہ انہاں نوں اٹھایا جاسکے تے فائر کيتا جاسکے یا ٹرکاں توں لانچ کيتا جائے۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> اگرچہ اسرائیل لانچنگ دے منٹ دے اندر ہی لانچ سائٹ نوں نشانہ بناسکدا اے ، لیکن IDF 2006 وچ عام طور اُتے استعمال توں پہلے لانچ سائٹ نوں تباہ نئيں کرسکدا سی تے ايسے وجہ توں راکٹ حملےآں دی بارش نوں روک نئيں سکدا سی۔ <ref name="fas.org1"/> {{Efn|"Given how numerous the rockets were, as well as the ease with which they could be transported, concealed and fired, stopping them was probably beyond the capabilities of any air force"<ref name="soar" />}}
=== مواصلات ===
[[فائل:Flickr - Israel Defense Forces - Hezbollah Equipment Captured in Lebanon.jpg|سجے|thumb| حزب اللہ دے ممبر عام طور اُتے لو ٹیک ٹیک واکی ٹاکیز استعمال کردے نيں۔]]
حزب اللہ اک "بہترین ، متنوع ، تے سخت نشانہ بننے والا" <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> فوجی مواصلاتی نیٹ ورک چلاندا اے ، جسنوں حزب اللہ دے رہنما [[حسن نصر اللہ|حسن نصراللہ]] نے 2008 وچ "گروپ دا سب توں اہم ہتھیار" قرار دتا سی۔ <ref name="stratfor.com"/> حکومت اس نیٹ ورک نوں بند کرنے دی کوششاں دی وجہ توں 2008 دے لبنان تنازعہ دا سبب بنی ۔ اس نیٹ ورک وچ بنیادی طور اُتے ریشہ آپٹک کیبلز شامل نيں جو زیادہ تر یا تمام لبنان وچ پھیلا ہويا اے ، تانبے دی تاراں تے بیروت وچ ویمکس تنصیب دے ذریعہ تکمیل شدہ اے۔ حزب اللہ دا کہنا اے کہ انہاں دے نیٹ ورک وچ تجارتی استعمال نئيں ہُندا اے ، عیسائی علاقےآں وچ داخل نئيں ہُندا اے تے اوہ انہاں دے اسلحہ خانے دا لازمی جزو اے۔ <ref name="auto26">{{حوالہ ویب|url=https://wikileaks.org/plusd/cables/08BEIRUT523_a.html|title=Hizballah Goes Fiber Optic|date=16 April 2008|publisher=|first=Michele|last=Sison}}</ref> ایہ دعوے متنازعہ نيں۔
[[فائل:Flickr - Israel Defense Forces - Hezbollah Communication Devices.jpg|thumb| حزب اللہ فیلڈ ٹیلیفون ۔]]
حزب اللہ دے وائرڈ مواصلاتی نیٹ ورک دا آغاز اصل وچ [[بیروت]] توں [[وادی بقاع|وادی]] بقاع دے راستے اسرائیل-لبنان سرحد تک ہويا سی ، لیکن 2006 دے بعد توں حزب اللہ دے بیشتر علاقےآں نوں کوریج کرنے دے لئی اس وچ توسیع کيتی گئی اے ، سوائے شمالی لبنان دے کچھ حصےآں کے۔ <ref name="stratfor.com"/><ref>{{حوالہ ویب|url=https://www.intelligenceonline.com/government-intelligence/2012/05/10/hezbollah-on-the-line,101714060-art|title=Hezbollah on the line – Issue 664|last=|date=10 May 2012|publisher=Intelligence Online}}</ref> موجودہ سول لبنانی ٹیلی مواصلات دے بنیادی ڈھانچے دے نال نال زیادہ تر فائبر آپٹک کیبلز تیار کيتی گئیاں نيں ، اس نیٹ ورک وچ کچھ تانبے دی تاراں تے اسٹینڈ لائنز وی شامل نيں۔ حزب اللہ دی زیر ملکیت "تقریبا ہر سہولیات تے عمارت" اس نیٹ ورک توں جڑ جاندی اے۔ اسرائیل دے نال 2006 دی جنگ وچ ، نیٹ ورک نے اسنوں جام کرنے دی اسرائیلی کوششاں کیخلاف مزاحمت دی ، تے حزب اللہ نے تمام تنازعات وچ رابطےآں نوں برقرار رکھیا۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref>
حزب اللہ دے جنگجو زیادہ تر کوڈ ٹیک واکی ٹاکی اُتے کوڈ ورڈز دا استعمال کردے ہوئے رابطے کردے سن ، جدوں کہ کمانڈ پوسٹس تے بنکرس نوں گروپ دے فائبر آپٹک نیٹ ورک دے ذریعہ منسلک کيتا جاندا سی۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> حزب اللہ اپنے لئے بانی کیریئراں نوں استعمال کرنے تے اپنے سیلولر نیٹ ورکس نوں چلانے دے لئی اپنے عمل نوں انجام دینے دے لئی سیل فون اُتے بہت زیادہ انحصار کردا اے۔ بیکار اقدام دے طور اُتے محدود تعداد وچ اعلیٰ درجے دے تے اہم اہلکار دے پاس سیٹلائٹ فون موجود نيں ۔ <ref name="stratfor.com">{{حوالہ ویب|url=https://www.stratfor.com/analysis/lebanon-hezbollahs-communication-network|title=Lebanon: Hezbollah's Communication Network|publisher=Stratfor}}</ref> 2006 دے بعد توں حزب اللہ دے مواصلاتی نیٹ ورک وچ بہت زیادہ اضافہ ہويا اے ، تے فائبر آپٹک کیبلز اعلیٰ کمانڈراں دے گھراں نوں بنکر تے ہیڈ کوارٹر توں جوڑ دیندے نيں۔ عام اہلکاراں نوں صرف غیر محفوظ تانبے دے تار نیٹ ورک تک رسائی حاصل اے ، جس دے بارے وچ سمجھیا جاندا اے کہ ایہ صرف آرام دہ تے پرسکون گفتگو دے لئی استعمال ہُندے نيں۔ حزب اللہ نے 1999 وچ IDF دے نال براہ راست رابطے نئيں کیتے سن ، <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> لیکن بظاہر اوہ 2009 وچ ہويا سی۔ <ref>{{حوالہ ویب|url=https://wikileaks.org/plusd/cables/09BEIRUT161_a.html|title=Lebanon: Hizballah Likely to Remain on the Defensive Absent Regional Imperative|last=|date=|publisher=}}</ref>
=== مائنز تے آئی ای ڈی ===
حزب اللہ دے پاس متعدد مائن فیلڈز نيں ، جو کدی کدی نظامی فائرنگ دے تھاںواں دے نال مل کے گھات لگاندے نيں تے بعض اوقات علاقے توں انکار دے ہتھیار دے طور اُتے استعمال ہُندے نيں ۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> حزب اللہ اسرائیلی چھاپےآں توں پختہ تھاںواں دی حفاظت دے لئی بارودی سرنگاں دا وی استعمال کردا اے۔ <ref>Spencer C. Tucker and Priscilla Roberts, (2008) ''The Encyclopedia of the Arab-Israeli Conflict: A Political, Social, and Military History'', p. 680. {{آئی ایس بی این|978-1851098415}}</ref> اراکین سویلین گھراں تے گوداماں وچ اسپیئر مائنز اسٹور کردے نيں۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> حزب اللہ نے اسرائیلی حملے دی پیش گوئی وچ جنوبی لبنان دی بیشتر وڈی سڑکاں دی کان کنی دی اے ، جدوں کہ اسرائیل پسپائی اختیار کرکے انہاں بارودی سرنگاں توں بچنے دی کوشش کردا اے۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> اگرچہ حزب اللہ دے پاس متعدد مائن فیلڈز سن ، 2006 وچ آئی ڈی ایف آسانی توں انہاں سب نوں نظرانداز کرنے وچ کامیاب سی ، تے پارٹی کدی کدائيں ہی مائن فیلڈز نوں مربوط رکاوٹ دے دفاع وچ جوڑنے وچ کامیاب رہی۔ حزب اللہ دے ذریعہ استعمال ہونے والی بارودی سرنگاں وچ ایم 15 مائن تے ایم 18 کلیمور مائن شامل نيں۔ <ref name="alamy.com">{{حوالہ ویب|url=http://www.alamy.com/stock-photo/weapons-roberto-nistri.html|title=Weapons Roberto Nistri Stock Photos|last=Roberto Nistri|date=26 September 2011|publisher=Alamy}}</ref>
حزب اللہ دے ذخیرے وچ بہتر ساختہ دھماکہ خیز آلات یا IED وی اک عام عنصر نيں۔ ماضی وچ ، حزب اللہ دے ارکان اسرائیلی ٹینکاں نوں نکالنے دے لئی سیکڑاں کلو دھماکہ خیز مواد وڈے گڑھاں وچ دفن کرچکے نيں۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref>
== ہتھیار ==
حزب اللہ نوں طویل عرصے توں خطے یا دنیا وچ اک بہترین مسلح غیر ریاستی اداکار وچوں اک سمجھیا جاندا اے <ref name="wremb">Joint prepared statement of ambassador Jeffrey D. Feltman, Assistant Secretary of State for Near Eastern Affairs, and Ambassador Daniel Benjamin, coordinator for counterterrorism, Department of State, Washington, DC: Comments at a Congressional Hearing. ''Assessing the Strength of Hezbollah: Hearing Before the Subcommittee on Near Eastern and South and Central Asian Affairs of the Committee on Foreign Relations''. United States Senate One Hundred Eleventh Congress, Second Session. June 8, 2010. https://www.gpo.gov/fdsys/pkg/CHRG-111shrg62141/html/CHRG-111shrg62141.htm.</ref> تے اس دے ہتھیاراں دے معیار تے مقدار وچ <ref name="seinfeld"/> تن دہائیاں توں ودھ چکے نيں۔ <ref name="Worall">James Worrall, Simon Mabon, Gordon Clubb. (2011) ''Hezbollah: From Islamic Resistance to Government''. p. 44–46 {{آئی ایس بی این|1440831343}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/1440831343|1440831343]]</ref> اسٹراٹفور نے اسنوں "دنیا دی سب توں بہتر لیس غیر ریاستی لڑائی قوت" دے طور اُتے بیان کيتا اے تے متعدد دوسرے ذرائع وی ايسے طرح دے دعوے کردے نيں۔ <ref>{{حوالہ ویب|url=https://worldview.stratfor.com/article/israels-next-war-hezbollah-will-be-worse-last|title=Israel's Next War With Hezbollah Will Be Worse Than the Last|last=|date=Nov 23, 2016|publisher=Stratfor}}</ref> اگرچہ اچھی طرح توں مسلح ، حزب اللہ ہوائی حملے نوں روکنے وچ ناکام اے ، لہذا اس تنظیم نے تاریخی طور اُتے وڈے یا مہنگے ہتھیاراں دے نظام دے حصول توں باز آ گیا اے۔ عام طور اُتے ، حزب اللہ دے پاس اسرائیل توں لڑنے دی کوشش کرنے دے لئی کافی ہتھیار نيں ، <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> تے اس دے پاس "جدید اعلیٰ شدت پسندی دی جنگ" دا اسلحہ موجود اے۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> 2006 دی لبنان جنگ وچ ، تنظیم نے بوہت سارے مختلف ہتھیاراں دا استعمال کيتا ، تے "حزب اللہ نے اپنے تمام ہتھیاراں دے نظام نوں ہنر مند تے نظم و ضبط توں زیر تربیت ، برقرار ، تے استعمال کيتا۔" <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref>
عام طور اُتے ، ایہ عوامی طور اُتے معلوم نئيں اے کہ حزب اللہ دے پاس کيتا ہتھیار نيں تے کس مقدار وچ ، تے انہاں دے ہتھیاراں دے بارے وچ کیتے جانے والے بوہت سارے دعوے قیاس آرائیاں نيں۔ <ref name="auto9">Cordesman, A. H., Sullivan, G., & Sullivan, W. D. (2007). Lessons of the 2006 Israeli-Hezbollah war. Washington (D.C.): CSIS Press. {{آئی ایس بی این|978-0892065059}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0892065059|978-0892065059]]</ref> خود حزب اللہ کدی وی انہاں دے ہتھیاراں توں متعلق مباحثہ نئيں کردا اے۔ <ref name="mideastshuffle.com">{{حوالہ ویب|url=https://mideastshuffle.com/2011/07/23/rupert-murdoch-and-hezbollahs-scuds/|title=Rupert Murdoch and Hezbollah's "Scuds"|date=23 July 2011|publisher=|last=Sharmine Narwani}}</ref><ref>{{حوالہ ویب|url=http://www.cnas.org/blogs/abumuqawama/2011/11/special-abu-muqawama-qa-nick-blanford.html|archiveurl=https://web.archive.org/web/20130309090703/http://www.cnas.org/blogs/abumuqawama/2011/11/special-abu-muqawama-qa-nick-blanford.html|archivedate=9 March 2013|title=Nick Blanford, Interview.|date=9 March 2013|publisher=Center for a New American Security}}</ref>
ایرانی فوجی نظریہ ساز حزب اللہ دے لئی جدید اسلحہ سازی دے اثرات نوں کم کردے ہوئے تجویز کردے نيں کہ فتح دے تعین دے لئی انسانی وسائل زیادہ اہم نيں۔ <ref>{{حوالہ ویب|url=http://thearkenstone.blogspot.com/2014/03/translation-selected-writings-on-modern.html|title=ارکنستون: Translation – Selected Writings on Modern War Theory|first=Galen|last=Wright|date=17 March 2014|publisher=The Arkenstone (self-published)}}</ref> کچھ آزاد تجزیہ کار متفق نيں ، تجویز کردے نيں کہ اس گروہ دی صلاحیتاں ، تدبیراں تے تنظیم اس دے پاس موجود اسلحہ سازی توں زیادہ اہم نيں۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> حزب اللہ دا ہتھیار انہاں دی مجموعی طاقت دا صرف اک جزو اے تے انھاں فوجی حکمت عملی دے اشارے دے طور اُتے نئيں دیکھیا جانا چاہیدا۔ <ref>Stephen Keith Mulhern, An Analysis Of Hezbollah's Use of Irregular Warfare</ref> 2006 دے بعد توں ، حزب اللہ دی فوجی خریداری وچ اضافہ ہويا حد تے درستگی دے نال ہوائی دفاعی نظام تے سطح توں سطح دے راکٹاں اُتے توجہ دتی گئی اے۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> توقع کيتی جاندی اے کہ حزب اللہ دی جانب توں مستقبل وچ عین مطابق ہڑتال دی صلاحیت حاصل کرنے دی کوشش کيتی جائے گی۔ <ref>{{حوالہ ویب|url=http://www.esd.whs.mil/Portals/54/Documents/FOID/Reading%20Room/Other/Litigation%20Release%20-%20The%20Likely%20Course%20of%20the%20Revolution%20in%20Military%20Affairs%20201012.pdf|title=The Likely Future Course of the Revolution in Military Affairs|last=Center for Strategic and Budgetary Assessments.|date=December 2010|publisher=|access-date=2020-10-01|archivedate=2019-12-22|archiveurl=https://web.archive.org/web/20191222075651/https://www.esd.whs.mil/Portals/54/Documents/FOID/Reading%20Room/Other/Litigation%20Release%20-%20The%20Likely%20Course%20of%20the%20Revolution%20in%20Military%20Affairs%20201012.pdf}}</ref> اگست 2019 وچ ، مبینہ طور اُتے اسرائیلی ڈرونز نے بیروت وچ اک فیکٹری نوں تباہ کردتا جس وچ حزب اللہ دے لئی طویل فاصلے تک صحت توں متعلق میزائل تیار کرنے دا ذمہ دار سی۔ پارٹی "ان علاقےآں وچ جتھے روايتی طور اُتے حرمت پایا اے " ، امریکی افواج اُتے حملہ کرنے دی صلاحیتاں تے آپریشنل تصورات نوں وی فروغ دینے دی کوشش کر رہی اے۔ <ref>Center for Strategic and Budgetary Assessments, ''Thinking About the U.S. Military's Next-Generation UAS Force: Final Report''. Prepared for the Office of Net Assessment Office of the Secretary of Defense.</ref>
=== چھوٹے ہتھیار ===
{| style="width:100%;"
! style="width:13%;" |Model
! style="width:15%;" |Type
! style="width:13%;" |Quantity
! style="width:7%;" |Acquired
! style="width:10%;" |Origin
!Notes
|-
|Browning Hi-Power
|handgun
|small amounts
|various
|Belgium
|<ref name="l">Levitt, Mathew. Hezbollah: The Global Footprint of Lebanon's Party of God (2015) p. 390 {{آئی ایس بی این|978-1626162013}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1626162013|978-1626162013]]</ref>
|- style="background:#efefef; color:black"
|Glock
|handgun
|small amounts
|
|Austria
| Possibly Glock 22 variant.
|-
|H&amp;K MP5
|Submachine gun
|rare
|
|Germany
|used in training and by Nasrallah's bodyguards.
|- style="background:#efefef; color:black"
|[[اے۔کے 47|AK-47]]
|Assault rifle
|common
|various
|USSR
|Standard issue, in use since the 1980s. often equipped with GP-30 grenade launchers from Syria.<ref>{{حوالہ ویب|url=https://now.mmedia.me/lb/en/reportsfeatures/566310-benefiting-from-bourj-barajneh|archiveurl=https://web.archive.org/web/20160107000237/https://now.mmedia.me/lb/en/reportsfeatures/566310-benefiting-from-bourj-barajneh|archivedate=January 7, 2016|title=Benefiting from Bourj Barajneh|first=Nicholas|last=Blanford|date=December 16, 2015|publisher=}}</ref>
|-
|AKM
|Assault rifle
|common
|
|USSR
|esp. AKMS variant.
|- style="background:#efefef; color:black"
|[[ایم 16|M16]]
|Assault rifle
|
|various
|United States
|Standard issue. Hezbollah uses American made rifles, Norinco CQs, and Iranian-made Sayyad 5.56 clones.<ref name="washingtoninstitute.org"/> In use since the 1980s.
|-
|M4
|Assault rifle
|uncommon
|various
|United States
|Used in 2006 war<ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/97224678|title=A masked Hezbollah fighter stands with an M-4 rifle that he says was...|last=Michael Appleton|date=August 14, 2006|publisher=NY Daily News Archive via Getty Images}}</ref><ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/82717389|title=Shia School girls stand in front of an exhibit of captured Israeli...|last=Kaveh Kazemi|date=August 27, 2008|publisher=Getty Images}}</ref>
|- style="background:#efefef; color:black"
|AKS-74U
|Carbine assault rifle
|rare
|
|USSR
|<ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/82368040|title=A supporter of the Lebanese Shiite Muslim Hezbollah movement displays...|last=Mahmoud Zayat/AFP/Getty Images|date=August 15, 2008|publisher=Getty Images}}</ref>
|-
|[[جی تھری|H&K G3]]
|battle rifle
|
|
|West Germany
|used in training.<ref name="live">Saramifar, Younes. (2015). ''Living with the AK-47''. {{آئی ایس بی این|978-1443875523}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1443875523|978-1443875523]]</ref>
|- style="background:#efefef; color:black"
|PK machine gun
|General machine gun
|common
|
|USSR
|Standard issue, often PKS variant
|-
|shotguns
|shotgun
|common
|
|various
|<ref name="gettyimages.com">{{حوالہ ویب|url=http://www.gettyimages.com/license/72863559|title=Israeli soldiers display weapons of Hezbollah guerillas killed in...|last=Shaul Schwarz|date=July 26, 2006|publisher=Getty Images}}</ref>
|- style="background:#efefef; color:black"
|Dragunov sniper rifle
|sniper rifle
|hundreds?<ref>{{حوالہ ویب|url=https://www.haaretz.com/israel-news/.premium-1.765158|title=Eyeing Northern Front, Israeli Army Sets Up 'Hezbollah Units'|first=Gili|last=Cohen|date=26 December 2017|publisher=}}</ref>
|
|USSR
|standard weapon for sniper units<ref>{{حوالہ ویب|url=https://medium.com/war-is-boring/syria-strike-will-be-pretty-useless-against-assads-foreign-legion-bdd950a95998|title=Syria Strike Will Be Pretty Useless Against Assad's Foreign Legion|first=Robert|last=Beckhusen|date=6 September 2013|publisher=War is Boring}}</ref>
|-
|Steyr SSG 69
|sniper rifle
|
|
|Austria
|Supposedly being replaced by S&amp;T Motiv K14.
|- style="background:#efefef; color:black"
|Steyr HS .50
|anti-material rifle
|unclear<ref>{{حوالہ ویب|url=http://jihadology.net/2013/12/24/hizballah-cavalcade-khameneis-cannon-50-caliber-anti-material-rifles-shia-fighters-in-syria/|title=Hizballah Cavalcade: Khamenei's Cannon: .50 Caliber Anti-Material Rifles & Shia Fighters in Syria|first=Phillip|last=Smyth|date=24 December 2013|publisher=Jihadology}}</ref>
|Iran
|Austria
|whether Hezbollah has OEM Austrian-made weapons or Iranian-made Sayyad-2 clones is unclear.<ref>{{حوالہ ویب|url=http://spioenkop.blogspot.com/2013/04/syria-and-her-hs50s.html|archiveurl=https://web.archive.org/web/20131211102237/http://spioenkop.blogspot.com/2013/04/syria-and-her-hs50s.html|archivedate=11 December 2013|title=Oryx Blog: Syria and her HS.50's|last=Oryx|date=27 April 2013|publisher=}}</ref><ref>John L. Plaster, The History of Sniping and Sharpshooting (2008) {{آئی ایس بی این|978-1581606324}}</ref> In use since at least 2012.<ref>{{حوالہ ویب|url=http://yalibnan.com/2012/04/08/mp-geagea-slams-hezbollah-mp-remarks-over-husbands-incident/|title=MP Geagea slams Hezbollah MP remarks over husband's incident|last=|website=yalibnan.com|date=April 8, 2012}}</ref>
|-
|Barrett M82
|anti-materiel rifle
|very limited if any
|
|United States
|unconfirmed
|- style="background:#efefef; color:black"
|DShK
|heavy machine gun
|
|
|USSR
|<ref>{{حوالہ ویب|url=http://www.gettyimages.com/detail/news-photo/hezbollah-fighter-mans-a-dshk-heavy-machine-gun-on-the-news-photo/474113334|title=A Hezbollah fighter mans a DShK heavy machine gun on the Lebanese side of the Qalamun mountains on the border with Syria on May 20, 2015|last=Joseph Eid|date=May 20, 2015|publisher=Getty Images}}</ref> Mostly DShKM variant.
|-
|KPV
|Heavy machine gun
|
|
|USSR
|<ref name="mili"/>
|- style="background:#efefef; color:black"
|M2 Browning
|Heavy machine gun
|common
|
|United States
|standard weapon
|}
[[فائل:Flickr - Israel Defense Forces - Weaponry Captured During Second Lebanon War.jpg|thumb| 2006 دی جنگ وچ حزب اللہ دے ہتھیاراں دا قبضہ ہويا۔ حزب اللہ دی زیادہ تر بندوقاں اے دے 47 رائفل نيں۔]]
حزب اللہ دے جنگجوواں نوں ایم 16 تے اے دے 47 رائفل دے درمیان انتخاب کرنے دی اجازت اے۔ <ref name="p118">Blanford, Nicholas. Warriors of God. (2011) p. 118</ref> زیادہ تر جنگجو اے دے 47 دا انتخاب کردے نيں۔ <ref name="live">Saramifar, Younes. (2015). ''Living with the AK-47''. {{آئی ایس بی این|978-1443875523}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1443875523|978-1443875523]]</ref><ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> کچھ جنگجو ایم 4 رائفل وی رکھدے نيں۔ اک غیر روايتی لڑائی فورس دے طور اُتے اس خطے وچ سرگرم عمل اے جتھے بہت سارے ہتھیار پھیل چکے نيں ، حزب اللہ جنگجوواں دے لئی دوسرے چھوٹے ہتھیاراں ، جداں آر پی دے مشین گنز <ref>Nitsana Darshan-Leitner, Samuel M. Katz, ''Harpoon: Inside the Covert War Against Terrorism's Money Masters'' {{آئی ایس بی این|978-0316399050}}</ref> تے ایف این میگ مشین گناں دا استعمال کرنا کوئی معمولی گل نئيں اے۔ <ref>{{حوالہ ویب|url=https://www.flickr.com/photos/idfonline/4365062581/|title=Hezbollah Weaponry Captured in Lebanon|last=|date=August 7, 2006|publisher=Israel Defense Forces}}</ref> پارٹی دے پاس وڈی تعداد وچ آتشاں اسلحہ دی مالک اے۔ 2006 وچ ، جدوں حزب اللہ دے پاس تقریبا 3000 جنگجو سن ، IDF انٹلیجنس نے اندازہ لگایا سی کہ حزب اللہ دے پاس گھٹ توں گھٹ سیکڑاں ہزار رائفلیاں سن۔ <ref name="auto9">Cordesman, A. H., Sullivan, G., & Sullivan, W. D. (2007). Lessons of the 2006 Israeli-Hezbollah war. Washington (D.C.): CSIS Press. {{آئی ایس بی این|978-0892065059}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0892065059|978-0892065059]]</ref> امریکا وچ بار بار سینکڑاں ، ہزاراں ، <ref name="politico.com">{{حوالہ ویب|url=https://www.politico.com/interactives/2017/obama-hezbollah-drug-trafficking-investigation/|title=The secret backstory of how Obama let Hezbollah off the hook|last=Josh Meyer|date=2017|publisher=Politico}}</ref> یا دسیاں ہزاراں ایم 4 حملہ رائفلز دی خریداری دے منصوبےآں دے لئی حزب اللہ دے ایجنٹاں نوں گرفتار کيتا گیا اے۔ اس دے علاوہ ، حزب اللہ دے ممبراں نوں امریکا وچ ایم200 سنائپر رائفلز تے ہزاراں گلاک ہینڈ گن خریدنے دی کوشش کرنے اُتے گرفتار کيتا گیا اے۔ <ref>{{حوالہ ویب|url=https://www.justice.gov/usao-edny/pr/two-hezbollah-associates-arrested-charges-conspiring-launder-narcotics-proceeds-and|title=Two Hezbollah Associates Arrested On Charges Of Conspiring To Launder Narcotics Proceeds And International Arms Trafficking|website=www.justice.gov|date=October 9, 2015}}</ref> عام طور اُتے ، اس گروپ نوں پیدل چلنے والے سامان دی کسی وی خاص قلت دا سامنا نئيں کرنا پڑدا اے۔ <ref name="seinfeld"/>
1980 دی دہائی وچ ، حزب اللہ دے جنگجو لبنانی خانہ جنگی دے ہتھیاراں توں لیس سن : اے دے 47 ، ایم 16 ، ایچ اینڈ دے جی تھری ، تے ایف این ایف ایل رائفلز۔ <ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/542362942|title=A row of Hezbollah militants armed with rifles|publisher=Getty Images|date=July 24, 1987|first=Maher|last=Attar}}</ref><ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/81162451|title=Hezbollah's automatic weapons rest in front of a mural of the Iranian...|publisher=Getty Images|date=June 17, 1986|last=Kaveh Kazemi}}</ref><ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/81162449|title=Al–Quds Day|publisher=Getty Images|date=June 15, 1986|last=Kaveh Kazemi}}</ref><ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/101874687|title=Hezbollah Building|publisher=Getty Images|last=Kaveh Kazemi}}</ref>
=== اینٹی ٹینک ===
{| style="width:100%;"
! style="width:10%;" |Model
! style="width:10%;" |Type
! style="width:13%;" |Quantity
! style="width:10%;" |Acquired
! style="width:10%;" |Origin
!Notes
|-
|[[آر پی جی - 7|RPG-7]]
|RPG
|very common
|various
|USSR
|standard issue, includes Iranian clones<ref name="ReferenceC">{{حوالہ ویب|url=http://www.jinsa.org/articles/articles.html/function/view/categoryid/158/documentid/3504/history/3%2C2360%2C655%2C158%2C3504|title=Hezbollah, Already a Capable Military Force, Makes Full Use of Civilian Shields and Media Manipulation|date=7 January 2008|publisher=JINSA Online|archiveurl=https://web.archive.org/web/20080107090241/http://www.jinsa.org/articles/articles.html/function/view/categoryid/158/documentid/3504/history/3%2C2360%2C655%2C158%2C3504|archivedate=7 January 2008}}</ref> and Iranian made PG-7-AT "Nader" warheads.
|- style="background:#efefef; color:black"
|M72 LAW
|anti-tank rocket
|
|
|United States
|<ref>{{حوالہ ویب|url=https://www.flickr.com/photos/idfonline/4367576700/|title=Hezbollah Rockets Found in Itron|last=Israel Defense Forces|date=August 4, 2006|publisher=Flickr}}</ref>
|-
|[[آر پی جی – 29|RPG-29]]
|RPG
|
|Syria
|USSR
|<ref name="defense-update.com"/> First used in November 2005.<ref name="divine">William M. Arkin, ''Divining Victory: Airpower in the 2006 Israel-Hezbollah War'' (2007) pp. 36–37 {{آئی ایس بی این|978-1585661688}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1585661688|978-1585661688]]</ref>
|- style="background:#efefef; color:black"
|RPG-30
|RPG
|
|Syria
|Russia
|possession unconfirmed<ref>{{حوالہ ویب|url=http://www.israelhayom.com/site/newsletter_article.php?id=3265|title=Report: Russia gave Hezbollah advanced anti-tank missiles|publisher=Israel Hayom|date=February 26, 2012}}</ref><ref>{{حوالہ ویب|url=https://jssnews.com/2012/02/27/des-missiles-rpg-30-russes-dans-les-mains-du-hezbollah/|archiveurl=https://web.archive.org/web/20170914220250/https://jssnews.com/2012/02/27/des-missiles-rpg-30-russes-dans-les-mains-du-hezbollah/|archivedate=14 September 2017|title=Des missiles RPG-30 russes dans les mains du Hezbollah ?|publisher=JSSNews|date=27 February 2012|first=Amos|last=Lerah|language=French}}</ref>
|-
|Saegre 2
|ATGM
|
|Iran
|Iran
|Iranian M47 Dragon clone, used in 2006 war<ref name="archive.org2">{{حوالہ ویب|url=http://www.ocnus.net/cgi-bin/exec/view.cgi?archive=100&num=25670&printer=1|archiveurl=https://web.archive.org/web/20110726120546/http://www.ocnus.net/cgi-bin/exec/view.cgi?archive=100&num=25670&printer=1|archivedate=26 July 2011|title=Arab States Eye Better Spec Ops, Missiles|last=Riad Kahwaji|date=26 July 2011|publisher=Defense News}}</ref>
|- style="background:#efefef; color:black"
|AT-3 Sagger
|ATGM
|500+
|Iran
|USSR
|<ref name="smallarmssurvey.org1">{{حوالہ ویب|url=http://www.smallarmssurvey.org/fileadmin/docs/H-Research_Notes/SAS-Research-Note-31.pdf|title=Armed Actor Research Notes: ''Armed Groups' Holding of Guided Light Weapons''. Number 31, June 2013.|publisher=Small Arms Survey|access-date=2020-10-01|archivedate=2016-03-13|archiveurl=https://web.archive.org/web/20160313111528/http://www.smallarmssurvey.org/fileadmin/docs/H-Research_Notes/SAS-Research-Note-31.pdf}}</ref> Most common Hezbollah ATGM. First used in 1992.
|-
|Raad
|ATGM
|
|Iran
|USSR
|Iranian Malyutka clone.<ref name="smallarmssurvey.org">{{حوالہ ویب|url=http://www.smallarmssurvey.org/fileadmin/docs/A-Yearbook/2008/en/Small-Arms-Survey-2008-Chapter-01-EN.pdf|title=Small Arms Survey 2008 Chapter 1: Light Weapons|publisher=Small Arms Survey|access-date=2020-10-01|archivedate=2020-10-23|archiveurl=https://web.archive.org/web/20201023121549/http://www.smallarmssurvey.org/fileadmin/docs/A-Yearbook/2008/en/Small-Arms-Survey-2008-Chapter-01-EN.pdf}}</ref> Hezbollah has RAAD, SACLOS I-RAAD and SACLOS tandem-warhead I-RAAD-T variants.<ref name="echo">Cordesman, Anthony H. (July 15, 2006) ''Iran's Support of the Hezbollah in Lebanon''. Center for Strategic and International Studies.</ref>
|- style="background:#efefef; color:black"
|9K111 Fagot
|ATGM
|hundreds (2006 est.)<ref name="monster">SIPRI Yearbook 2007: Armaments, Disarmament and International Security p. 409-411 {{آئی ایس بی این|9780199230211}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/9780199230211|9780199230211]]</ref>
|Iran and Syria
|USSR
| Acquired 1995, first use in 1997.
|-
|9M113 Konkurs
|ATGM
|hundreds (2006 est.)
|Iran and Syria
|USSR
|<ref name="archive.org">Iran Replenishes Hizbullah's Arms Inventory, Jane's Defence Weekly, Jan. 3, 2007. Jane's Information Group.</ref>
|- style="background:#efefef; color:black"
|Towsan-1
|ATGM
|
|Iran
|Iran
|Iranian Konkurs clone<ref name="armstrade.sipri.org"/>
|-
|9K115-2 Metis-M
|ATGM
|hundreds (2006 est.)
|Syria
|USSR
|
|- style="background:#efefef; color:black"
|[[کورنٹ میزائل|9M133 Kornet]]
|ATGM
|hundreds (2006 est.)
|Syria{{Efn|Syria has undoubtedly supplied Kornet missiles to Syria; Hezbollah claims that they have received Kornet missiles from Russia directly<ref name="thedailybeast.com" /> and Iran produces a reverse engineered clone called the "Dehlaviyeh" missile.}}
|Russia
| Hezbollah's most powerful anti-tank weapon.<ref name="isopod">{{حوالہ ویب|url=https://www.brookings.edu/wp-content/uploads/2016/06/08_hizballah_israel.pdf|title=Analysis Paper Number 24, August 2011. The Next War: How Another Conflict Between Hizballah and Israel Could Look and How Both Sides are Preparing For It|first=Bilal Y.|last=Saab|first2=Nicholas|last2=Blanford|date=August 2011|publisher=The Saban Center for Middle East Policy at Brookings}}</ref>
|-
|BGM-71 TOW
|ATGM
|unknown
|unknown
|United States
|from Iran,<ref name="danger">Frederic Wehrey, David E. Thaler, Nora Bensahel, Kim Cragin, Jerrold D. Green – ''Dangerous But Not Omnipotent: Exploring the Reach and Limitations of Iranian Power in the Middle East'', RAND, {{آئی ایس بی این|9780833045546}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/9780833045546|9780833045546]] pages 95-96</ref> perhaps pre-revolution or Iran-Contra.<ref>Hala Jaber, Hezbollah: Born with a Vengeance. (1997) {{آئی ایس بی این|978-0231108348}} p.122</ref> Built in the 1970s, "unstable".<ref name="page">{{حوالہ ویب|url=https://www.strategypage.com/htmw/htarm/20080827.aspx|title=Armor: Hapless Hezbollah ATGMs Revealed|publisher=StrategyPage.com}}</ref> Used with night sights. Acquired 1997.
|- style="background:#efefef; color:black"
|Toophan
|ATGM
|unknown
|Iran
|Iran
|Iranian TOW clone acquired prior to 2002.<ref>Jane's Missiles and Rockets (2002)</ref> Used in 2006 war and Syria.
|-
|MILAN
|ATGM
|few
|Syria and black market
|France
|
|- style="background:#efefef; color:black"
|M40
|Recoilless rifle
|more than in 2006
|
|United States
|about 30,000 rounds of ammunition in 2008<ref name="defenddemocracy.org"/> Includes Iranian made clones.
|-
|Type 56 recoilless rifle
|recoilless rifle
|not in service.
|Lebanese Civil War
|China
|probably no longer in use<ref name="mili"/>
|- style="background:#efefef; color:black"
|SPG-9
|recoilless rifle
|more than in 2006
|
|USSR
|
|-
|B-10 recoilless rifle
|recoilless rifle
|
|Lebanese Civil War
|USSR
|East German BRG82 copy, probably no longer in use<ref name="alamy.com"/>
|- style="background:#efefef; color:black"
|M67 recoilless rifle
|recoilless rifle
|not in service.
|Lebanese Civil War
|United States
|probably no longer in use
|-
|}
[[فائل:Flickr - Israel Defense Forces - Hezbollah Munitions Found in Underground Bunker.jpg|thumb| اک M40 ریکولیس رائفل دے ل 10 106 ملی میٹر دیاں گولیاں۔]]
عام طور اُتے ، حزب اللہ دے پاس کسی وی غیر سرکاری ریاستی طاقت دا سب توں جدید تے متعدد اینٹی ٹینک ہتھیار اے ، جدوں کہ عام ریاست توں کم جدید ہتھیار رکھدے نيں۔ حزب اللہ عام طور اُتے نسبتا جدید ترین اینٹی ٹینک میزائل رکھنے تے مہارت دے نال انہاں دا استعمال کرنے دی حیثیت توں بیان کيتا جاندا اے۔ پارٹی دی اینٹی ٹینک ہتھیاراں دی انہاں دی اک خصوصیت اے۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> حزب اللہ دے اینٹی ٹینک ہتھیاراں وچ انہاں دے ہتھیاراں دی سب توں زیادہ دستاویزی دستاویزات شامل نيں ، لیکن حالے وی اس بارے وچ قطعی طور اُتے اختلاف رائے موجود اے کہ انہاں دے قبضے وچ کیہڑا ہتھیار نيں۔
حزب اللہ نے مبینہ طور اُتے 2006 دی جنگ وچ اک توں زیادہ اے ٹی جی ایم وچ 500 توں زیادہ دا استعمال کيتا <ref name="auto11">Anthony H. Cordesman with George Sullivan and William D. Sullivan. Lessons of the 2006 Israeli-Hezbollah War. (2007) p. 108</ref> تے اس دی مجموعی تعداد ہزاراں وچ اے۔ <ref>{{حوالہ ویب|url=http://www.ynetnews.com/articles/0,7340,L-4343662,00.html|title=Hezbollah's strategy: Rockets on Tel Aviv, raids on Galilee|publisher=Ynetnews|date=February 11, 2013|first=Ron|last=Ben-Yishai}}</ref> اک امریکی تھنک ٹینک دے مطابق ، حزب اللہ نے اپنے اے ٹی جی ایم نوں "تاکتیکی مہارت" تے کچھ تکنیکی غلطیاں دے نال استعمال کيتا۔ حزب اللہ دا اینٹی ٹینک ہتھیاراں دا استعمال اکثر بہت کامیاب سمجھیا جاندا اے ، اس گروپ نے اینٹی ٹینک ہتھیاراں توں اسرائیلی ٹینکاں نوں نشانہ بنانے ، عمارتاں نوں نشانہ بنانے تے عمارتاں نوں نشانہ بنانے دے لئی استعمال کيتا۔ 2006 دی جنگ وچ زیادہ تر اسرائیلی ہلاکتاں اینٹی ٹینک ہتھیاراں دی وجہ توں ہوئی نيں۔ مذکورہ بالا مقدار دے علاوہ ، حزب اللہ نوں ایران تے شام توں غیر اطلاع شدہ اسلحہ دی بہت ساریاں ترسیلاں موصول ہوئی نيں۔ <ref name="defenddemocracy.org"/>
[[فائل:Flickr - Israel Defense Forces - Missiles Found Aboard Francop.jpg|thumb| 106 ہزار ملی میٹر M40 راؤنڈ IDF دے ذریعہ قبضہ کيتا گیا۔]]
اس دے علاوہ ، حزب اللہ نے 2006 دی جنگ وچ اک واحد ورکنگ اسرائیلی اسپائک-ایم آر "گِل" اے ٹی جی ایم تے لانچر نوں وی اپنی گرفت وچ لیا۔ <ref>Isby, David C., ''Hizbullah Captures Gill ATGM,'' Jane's Missiles and Rockets, January 1, 2007.</ref>
=== فضائی دفاعی ===
{| style="width:100%;"
! style="width:10%;" | ماڈل
! style="width:20%;" | قسم
! style="width:13%;" | مقدار
! style="width:7%;" | حاصل کيتا
! style="width:15%;" | اصل
! نوٹ
|- style="background:#efefef; color:black"
| AZP S-60
| اینٹی ایرکرافٹ گن
| چھوٹی تعداد
| لبنان
| یو ایس ایس آر
| 2002 یا اس توں پہلے دا حصول
|-
| زیڈ یو 23-2
| اینٹی ایرکرافٹ گن
|
|
| یو ایس ایس آر
| <ref name="mili"/>
|- style="background:#efefef; color:black"
| 55 35 ٹائپ کرن <nowiki><span typeof="mw:Entity" id="mwCEg">&</nowiki>nbsp;<nowiki></span></nowiki> ملی میٹر بندوق
| اینٹی ایرکرافٹ گن
|
| لبنانی خانہ جنگی
| چین
| شاید ہن استعمال وچ نئيں اے
|-
| ZSU-23-4
| خود توں چلنے والا اینٹی ایرکرافٹ ہتھیار
| غیر واضح
|
| یو ایس ایس آر
| <ref>{{حوالہ ویب|url=http://militaryedge.org/armaments/assorted-anti-aircraft-artillery/|title=Assorted Anti-Aircraft Artillery|date=10 December 2013|website=militaryedge.org|access-date=1 October 2020|archivedate=25 July 2020|archiveurl=https://web.archive.org/web/20200725045051/https://militaryedge.org/armaments/assorted-anti-aircraft-artillery/}}</ref><ref name="washingtoninstitute.org"/>
|- style="background:#efefef; color:black"
| زیڈ پی یو
| اینٹی ایرکرافٹ گن
| غیر واضح
|
| یو ایس ایس آر
| ZPU-1 تے ZPU-2 مختلف حالتاں
|-
| KS-12A
| اینٹی ایرکرافٹ گن
| چھوٹی تعداد
| لبنانی خانہ جنگی
| یو ایس ایس آر
| 85 دتا ملی میٹر WWII دور اینٹی ایرکرافٹ گن <ref name="wordpress.com"/>
|- style="background:#efefef; color:black"
| دے ایس ۔19
| اینٹی ایرکرافٹ گن
| چھوٹی تعداد
| لبنانی خانہ جنگی
| یو ایس ایس آر
| ٹرک اُتے سوار تے توپ خانے دے طور اُتے استعمال ہُندا اے <ref>{{حوالہ ویب|url=https://twitter.com/Objekt432Y/status/904058165402132480|title=Hezbollah self-propelled 100 mm KS-19. The chassis is a peculiar Volvo FH produced under license by SETCAR in Tunisia. Syria-Lebanon border.|last=zooper|publisher=twitter|date=2 September 2017}}</ref>
|-
| ZSU-57-2
| خود توں چلنے والی اینٹی ایرکرافٹ گن
| چھوٹی تعداد
|
| یو ایس ایس آر
|
|- style="background:#efefef; color:black"
| SA-7
| مین پیڈس
| غیر واضح {{Efn|estimates for Hezbollah's quantity of SA-7 missiles range from "few"<ref name="monster" /> to at least 100<ref name="armstrade.sipri.org" /> to an "enormous supply."<ref name="auto13">Dr. Robbie Sabel, Hezbollah. Israel. Lebanon and the Law of Armed Conflict, University of Pittsburgh School of Law: Jurist Legal News and Research, July 25, 2006, http://www.jurist.org/forum/2006/07/hezbollah-israel-lebanon-and-law-of.php</ref>}}
| ایران
| یو ایس ایس آر
| <ref name="smallarmssurvey.org"/><ref name="armstrade.sipri.org"/><ref name="sams">{{حوالہ ویب|url=http://militaryedge.org/armaments/assorted-samsmissile-defense/|title=Assorted SAMs|date=13 December 2013|publisher=Foundation for Defense of Democracies|access-date=1 October 2020|archivedate=25 July 2020|archiveurl=https://web.archive.org/web/20200725050644/https://militaryedge.org/armaments/assorted-samsmissile-defense/}}</ref><ref name="archive.org">Iran Replenishes Hizbullah's Arms Inventory, Jane's Defence Weekly, Jan. 3, 2007. Jane's Information Group.</ref><ref name="smallarmssurvey.org1"/> 1991 وچ حاصل ہويا۔ <ref>Hala Jaber, Hezbollah: Born with a Vengeance. (1997) {{آئی ایس بی این|978-0231108348}} p. 80</ref><ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> حزب اللہ دی SA-7 تے SA-7b قسماں نيں۔ <ref name="ghost">Adam C Seitz, Anthony H. Cordesman. ''Iranian Weapons of Mass Destruction: The Birth of a Regional Nuclear Arms Race?'' (Praeger Security International) {{آئی ایس بی این|978-0313380884}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0313380884|978-0313380884]]</ref> SA-7 دی حد 3200 اے ایم ، تے SA-7B دی حد 4200 اے م
|-
| SA-14
| مین پیڈس
| کچھ (2006 ایسٹ ) <ref name="monster">SIPRI Yearbook 2007: Armaments, Disarmament and International Security p. 409-411 {{آئی ایس بی این|9780199230211}}</ref>
| ایران
| یو ایس ایس آر
| مبینہ طور اُتے لڑائی وچ فائر کيتا گیا۔ SA-14 دی حد 4100 اے م
|- style="background:#efefef; color:black"
| [[9K38 ایگلا میزائل|SA-16]]
| مین پیڈس
| کچھ (2006 ایسٹ )
| ایران
| یو ایس ایس آر
| <ref>{{حوالہ ویب|url=http://defense-watch.com/2017/04/20/hezbolla-fighter-spotted-sa-16-manpad-lebanon/|archiveurl=https://web.archive.org/web/20170421194455/http://defense-watch.com/2017/04/20/hezbolla-fighter-spotted-sa-16-manpad-lebanon/|archivedate=2017-04-21|title=Hezbolla fighter spotted with SA-16 MANPAD in Lebanon|website=defense-watch.com}}</ref> SA-16 دی حد 5200 اے م
|-
| کیو ڈبلیو 1 وینگارڈ
| مین پیڈس
| درجن
| شام
| چین
| کیو ڈبلیو -1 وانگوارڈ دی حد 5000 اے م
|- style="background:#efefef; color:black"
| میسھاگ ۔1
| مین پیڈس
|
| ایران
| ایران
| ایرانی QW-1 مختلف قسم ، <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref> 2006 دی جنگ دے دوران یا اس دے بعد فراہم کيتی گئی <ref name="auto9">Cordesman, A. H., Sullivan, G., & Sullivan, W. D. (2007). Lessons of the 2006 Israeli-Hezbollah war. Washington (D.C.): CSIS Press. {{آئی ایس بی این|978-0892065059}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0892065059|978-0892065059]]</ref> میساگ 1 دی حد 5000 اے م
|-
|}
[[فائل:Hezbollah ZU-23-2 anti-aircraft gun.jpg|thumb| حزب اللہ ZU-23-2 اینٹی ایرکرافٹ گن۔]]
عام طور اُتے ، حزب اللہ دی فضائی دفاع دے لئی صلاحیت کم اے۔ حزب اللہ عام طور اُتے انہاں دے جدید اسلحہ سازی دا انکشاف نئيں کردا اے تے نہ ہی اس اُتے تبادلہ خیال کردا اے ، تے اس گروہ دے پاس صرف وڈی ، متروک اینٹی ایرکرافٹ گن تے چھوٹی ، سستی مینپڈس میزائل رکھنے دی تصدیق اے۔ حزب اللہ دا اصل دشمن اسرائیل اے ، تے اسرائیل دی فضائیہ پورے خطے وچ سب توں زیادہ قابل اے ، جو حزب اللہ دی محدود صلاحیت توں کدرے زیادہ مماثلت رکھدی اے۔ اسرائیل پورے اسرائیل تے لبنان اُتے فضائی بالادستی نوں برقرار رکھدا اے تے سن 1982 وچ تنازعہ دے آغاز توں ہی ایسا کر رہیا اے۔ حزب اللہ لبنان وچ جاری اسرائیلی اوور لائٹ نوں آئی ایس آر مقاصد دے لئی روکنے وچ ناکام رہیا اے یا فوجی مہماں دے دوران اسرائیل دے فضائی حملےآں دی اعلیٰ شرحاں وچ رکاوٹ نئيں اے۔
پر ، حزب اللہ دی فراہمی شام تے ایران دے ذریعہ کيتی جاندی اے ، انہاں دونے وچ بہت زیادہ قابل ہتھیار ہُندے نيں ، جنہاں وچ وڈے ٹرک اُتے سوار ہويا دفاعی نظام شامل نيں۔ کئی دہائیاں توں ، حزب اللہ دی بہت ساریاں افوانيں آرہیاں نيں کہ مختلف جدید نظاماں دی فراہمی دی جارہی اے ، جنہاں وچوں کسی دی وی تصدیق نئيں ہوئی اے۔ اس دے نتیجے وچ ، حزب اللہ دے فضائی دفاع نوں عام طور اُتے ناقص سمجھیا جاندا اے ، لیکن انہاں دے پاس موجود اسلحہ دے بارے وچ وی بے حد بے یقینی تے اختلاف رائے پایا جاندا اے۔ 2008 وچ ، اسرائیلی دفاعی انٹلیجنس نے اس گل دا اندازہ کيتا کہ "حزب اللہ دے طیارہ شکن اسلحہ اسرائیلی ہیلی کاپٹراں یا بغیر پائلٹ دی فضائی گاڑیاں (یو اے وی کے) نوں مار سکدا اے ، لیکن حالے تک طیارہ بردار ننيں۔" <ref name="wikileaks.org">{{حوالہ ویب|url=https://wikileaks.org/plusd/cables/08TELAVIV2247_a.html|title=U.s./Is Dialogue on Lebanon: Support Moderates, but Disagreement Over How|last=|date=|publisher=}}</ref>
اس گروپ دی اینٹی ایرکرافٹ گناں کئی دہائیاں دے بعد متروک نيں تے اوہ اسرائیلی جدید ہیلی کاپٹراں دے خلاف مکمل طور اُتے غیر موثر نيں ، لہذا انہاں نوں اسرائیل <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> تے شام وچ باغیاں دے خلاف زمینی حملہ آرٹلری دے طور اُتے تعینات کيتا گیا اے۔ <ref name="auto10"/><ref name="wordpress.com"/> مہارت دے معاملے وچ ، حزب اللہ دا 2006 وچ مین پیڈس دا استعمال عراقی باغیاں دے مقابلے وچ اک ہی وقت وچ ايسے طرح دے آلات دے نال کم کرنے وچ کم کامیاب رہیا سی۔
18 سالاں دی شورش دے دوران ، حزب اللہ نے صرف اک اسرائیلی ہیلی کاپٹر نوں گولی مار دی۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> 2006 دی جنگ دے دوران اسرائیل حزب اللہ دے فضائی دفاع توں آسانی توں گریز کردا رہیا۔ حزب اللہ دے میزائلاں دی حدود توں دور رکھنے دے لئی ڈرون تے ہڑتال دے جنگجو 9000 فٹ یا اس توں زیادہ دی بلندی اُتے اڑ گئے جدوں کہ ریسکیو ہیلی کاپٹر تے نیڑےی فضائی مدد توں زمین اُتے جھپکیوں توں اگ توں بچ گیا۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> حزب اللہ نے صرف اک CH-53 ٹرانسپورٹ ہیلی کاپٹر نوں گرایا ، <ref>{{حوالہ ویب|url=https://www.flightglobal.com/news/articles/israel-studies-ch-53-shoot-down-208558/|title=Israel studies CH-53 shoot-down|date=22 August 2006|publisher=Flightglobal|first=Arie|last=Egozi}}</ref> بظاہر اک اینٹی ٹینک میزائل ، جس نوں IDF دے لئی بہت ہی ہلکا نقصان سمجھیا جاندا سی۔
=== غیر مصدقہ ہوائی دفاعی نظام ===
{| style="width:100%;"
! style="width:10%;" | ماڈل
! style="width:20%;" |قسم
! style="width:7%;" | مقدار
! style="width:13%;" | حاصل کيتا
! style="width:15%;" | اصل
! نوٹ
|- style="background:#efefef; color:black"
| [[9K38 ایگلا میزائل|SA-18]]
| مین پیڈس
|
|
| یو ایس ایس آر
| <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref><ref name="smallarmssurvey.org"/><ref name="sams"/><ref name="smallarmssurvey.org1"/><ref name="defenddemocracy.org">{{حوالہ ویب|url=http://www.defenddemocracy.org/content/uploads/documents/LebWar_Report_Design_091416.pdf|title=The Third Lebanon War: The Coming Clash Between Hezbollah and Israel in the Shadow of the Iran Nuclear Deal|publisher=Foundation for Defense of Democracies|date=July 2016|last=Jonathan Schanzer|last2=Tony Badran|last3=David Daoud}}</ref> افواج 2002 دے بعد توں حزب اللہ دے اسلحہ خانے وچ نيں۔ <ref name="isopod"/> آئی اے ایف دا خیال سی کہ 2006 وچ حزب اللہ دے پاس SA-18s سی لیکن کسی نوں وی برطرف نئيں کيتا گیا سی۔ <ref name="auto9">Cordesman, A. H., Sullivan, G., & Sullivan, W. D. (2007). Lessons of the 2006 Israeli-Hezbollah war. Washington (D.C.): CSIS Press. {{آئی ایس بی این|978-0892065059}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0892065059|978-0892065059]]</ref><ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> اک دہائی دے بعد وی قبضے دی تصدیق نئيں ہوئی۔ SA-18 دی حد 5200 اے م
|-
| میسھاگ ۔2
| مین پیڈس
|
| ایران
| ایران
| <ref name="defense-update.com1"/><ref>{{حوالہ ویب|url=http://www.janes.com/defence/news/jdw/jdw060807_1_n.shtml|archiveurl=https://web.archive.org/web/20060821213944/http://www.janes.com/defence/news/jdw/jdw060807_1_n.shtml|archivedate=21 August 2006|title=Iran answers Hizbullah call for SAM systems|date=21 August 2006|publisher=}}</ref> ایرانی QW-18 متغیر۔ میساگ 2 دی حد 5000 اے م
|- style="background:#efefef; color:black"
| [[9K38 ایگلا میزائل|SA-24 گرینچ اسٹریلیٹس]]
| گڈی توں لگے ہوئے لانچر
|
| لیبیا (بذریعہ ایران) یا شام
| روس
| قبضے دی تصدیق نئيں ہوئی <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref> نئيں انسان پورٹیبل۔
|-
| [[اسٹنگر میزائل|FIM-92 اسٹنگر]]
| مین پیڈس
|
| افغانستان (ایران دے راستے)
| ریاستہائے متحدہ
| افغانستان توں میزائل 1990 دی دہائی دے آخر وچ پہنچے لیکن موجودہ قبضہ غیر واضح اے <ref>{{حوالہ ویب|url=http://www.smallarmssurvey.org/fileadmin/docs/M-files/Armed%20groups%27%20guided%20missiles%20-%20March%20update.pdf|title=Small Arms Survey, Guided light weapons reportedly held by non-state armed groups 1998–2013|date=March 2013|publisher=Small Arms Survey|access-date=2020-10-01|archivedate=2014-08-18|archiveurl=https://web.archive.org/web/20140818055508/http://www.smallarmssurvey.org/fileadmin/docs/M-files/Armed%20groups%27%20guided%20missiles%20-%20March%20update.pdf}}</ref> ایف آئی ایم -92 دی حد 8000 اے م نشانہ بنانے دا کم اورکت دے ذریعے کيتا جاندا اے۔
|- style="background:#efefef; color:black"
| SA-2
| سطح توں ہويا دا میزائل نظام
|
| شام
| یو ایس ایس آر
| حزب اللہ دے کارکناں نے اس نظام نوں استعمال کرنے دی تربیت دتی اے۔ <ref name="wremb"/><ref>{{حوالہ ویب|url=https://www.upi.com/Top_News/International/2010/01/17/Report-Hezbollah-trains-on-missiles/UPI-51221263741141/|title=Report: Hezbollah trains on missiles|last=|date=January 17, 2010|publisher=UPI}}</ref> تقریبا یقینی طور اُتے حزب اللہ دے قبضے وچ نئيں اے۔ <ref>Jeffrey White. Policy Focus #106 | September 2010. If War Comes: Israel vs. Hizballah and Its Allies</ref>
|-
| SA-8
| سطح توں ہويا دا میزائل نظام
| کچھ جے کوئی
| شام
| یو ایس ایس آر
| قبضہ متنازعہ <ref name="ReferenceC"/> 2006 توں حزب اللہ دے قبضہ کرنے دی افوانيں۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> سن 2009 وچ حزب اللہ دے کارکناں نے مبینہ طور اُتے شام وچ نظام دی تربیت حاصل کيتی سی۔
|- style="background:#efefef; color:black"
| SA-17
| سطح توں ہويا دا میزائل نظام
|
| شام
| یو ایس ایس آر
| مبینہ طور اُتے اسرائیلی فضائی حملےآں دے ذریعہ SA-17 نظام دی ترسیل بند کردتی گئياں ، <ref name="auto24">{{حوالہ ویب|url=https://www.wsj.com/articles/hezbollah-upgrades-missile-threat-to-israel-1388707270|title=Hezbollah Upgrades Missile Threat to Israel|first=Adam Entous, Charles Levinson and Julian E.|last=Barnes|date=|publisher=}}</ref> نامعلوم / متنازعہ قبضہ
|-
| SA-22
| سطح توں ہويا دا میزائل نظام
|
| ایران
| روس
| قبضہ متنازعہ <ref>{{حوالہ ویب|url=https://medium.com/war-is-boring/israel-plans-to-counter-hezbollah-with-hundreds-of-surface-to-surface-missiles-59462fedc552|title=Israel Plans to Counter Hezbollah With Hundreds of Surface-to-Surface Missiles|first=Robert|last=Beckhusen|date=31 December 2016|publisher=War Is Boring}}</ref>
|- style="background:#efefef; color:black"
| "سید"
| سطح توں ہويا دا میزائل نظام
|
| ایران
| ایران
| ایرانی ایم آئی ایم 23 ہاک کلون ، قبضہ متنازعہ اے
|-
| "شہاب ثاقب"
| سطح توں ہويا دا میزائل نظام
|
| ایران
| ایران
| فرانسیسی کروٹیل یا چینی ہیڈکوارٹر 7 نظام اُتے مبنی ایرانی ایس اے ایم نظام ، جنہاں دا قبضہ متنازعہ اے
|}
جے حزب اللہ نے SA-16 ، یا خاص طور اُتے SA-18 تے SA-24 MANPAD حاصل کيتا اے ، تاں یہ[[اسرائیلی دفاعی افواج]](IDF )دے لئی اک وڈا خطرہ ہوئے گا۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> خیال کيتا جاندا اے کہ حزب اللہ نے 2006 دے بعد توں روسی ایس اے ایم دے جدید نظاماں دے لئی ایران اُتے دباؤ ڈالیا اے۔ <ref name="sendnudes"/> اک تحقیق وچ کہیا گیا اے کہ جے حزب اللہ نے SA-8 سسٹم حاصل کرلیا اے ، تاں اس توں اسرائیلی ہیلی کاپٹراں تے UAVs نوں زیادہ خطرہ لاحق ہوئے گا ، لیکن اسرائیل دے جدید F-16 تے F-15 جنگجوواں دے لئی ننيں۔
حزب اللہ لڑائی فورس دے لئی غیر معمولی رازداری دے نال کم کردا اے ، لہذا انہاں دے ہتھیاراں دے نظام دے بارے وچ بہت سارے دعوےآں دی تصدیق نئيں ہوسکدی اے۔ 1994 وچ ، ایران دے [[سپاہ پاسداران انقلاب اسلامی|آئی آر جی سی]] نے افغان مجاہدین توں [[اسٹنگر میزائل|اسٹنجر]] میزائل خریدے۔ ایران نے انھاں لبنان وچ حزب اللہ دے اک ذیلی ادارہ وچ منتقل کيتا ، لیکن اوہ عیب دار سن ، لہذا اوہ شاید بیچنے والے نوں واپس کردتے گئے سن ۔ ایران نے [[شمالی اتحاد (افغانستان)|شمالی اتحاد]] سمیت ہور افغان تنظیماں توں 6-10 ہور اسٹینگرز خریدنے دی کوشش کيتی ، لیکن ایہ معلوم نئيں اے کہ اوہ کامیاب ہوئے یا ننيں۔ <ref>{{حوالہ ویب|url=https://www.nytimes.com/2002/01/12/world/a-nation-challenged-intelligence-report-says-iran-gave-terrorists-us-arms.html|title=Report Says Iran Gave Terrorists U.S. Arms|date=12 January 2002|website=The New York Times}}</ref>
=== راکٹ ===
{| style="width:100%;"
! style="width:10%;" |Model
! style="width:7%;" |Diameter (mm)
! style="width:20%;" |Quantity
! style="width:10%;" |Range (km)
! style="width:7%;" |Warhead (kg)
!Notes
|-
|Type 63
|107
|at least dozens of Chinese launchers<ref name="armstrade.sipri.org">{{حوالہ ویب|url=http://armstrade.sipri.org/armstrade/page/trade_register.php|title=Trade Register|publisher=Stockholm International Peace Research Institute|access-date=2020-10-01|archivedate=2019-04-22|archiveurl=https://web.archive.org/web/20190422051706/http://armstrade.sipri.org/armstrade/page/trade_register.php}}</ref> and 144 Iranian launchers,<ref name="auto14">{{حوالہ رسالہ|url=http://www.meforum.org/806/hezbollahs-strategic-threat-to-israel|title=Hezbollah's Strategic Threat to Israel|last=Devenny|date=1 January 2006}}</ref> and "scores"<ref name="auto15">Divining Victory: Airpower in the 2006 Israel-Hezbollah War p. 32 {{آئی ایس بی این|978-1585661688}}</ref> to thousands of rockets
|8.5-9
|6-8
|Hezbollah also uses cloned Iranian Haseb launchers, Iranian Fadjr-1 rockets<ref name="norway">{{حوالہ کتاب|url=https://www.ffi.no/no/Rapporter/09-00179.pdf|title=The Rocket Artillery Reference Book|last=Dullum|first=Ove|date=30 June 2010|publisher=Norwegian Defence Research Establishment (FFI)|isbn=978-82-464-1829-2|access-date=1 October 2020|archive-date=19 February 2018|archive-url=https://web.archive.org/web/20180219125143/http://www.ffi.no/no/Rapporter/09-00179.pdf}}</ref> and North Korean rockets. Acquired via Iran and Syria.<ref name="auto16">Anthony H. Cordesman with George Sullivan and William D. Sullivan. Lessons of the 2006 Israeli-Hezbollah War. (2007) p. 106 {{آئی ایس بی این|978-0-89206-505-9}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-89206-505-9|978-0-89206-505-9]]</ref> Probably used in 2006 war.
|- style="background:#efefef; color:black"
|BM-21 Grad
|122
|probably in the tens of thousands of rockets
|range depends on variant, about 20-40
|6<ref name="hrw.org">{{حوالہ ویب|url=https://www.hrw.org/reports/2007/iopt0807/5.htm|title=Civilians under Assault: Hezbollah'ss Rocket Attacks on Israel in the 2006 War: Hezbollah's Arsenal|last=|date=|publisher=Human Rights Watch}}</ref> or 21
|Hezbollah's first and most numerous rocket. Part of the Katyusha rocket launcher family. Rockets are built in Iran under the name Arash, Russia, China, Eastern Europe,<ref>{{حوالہ ویب|url=https://www.flickr.com/photos/israel-mfa/4114959738/|title=Iranian Arms Seized on MV Francop – 122 mm Rockets|last=IDF|date=November 6, 2009|publisher=flickr}}</ref> North Korea and perhaps former Soviet states.<ref>{{حوالہ رسالہ|url=http://www.smallarmssurvey.org/fileadmin/docs/G-Issue-briefs/Lebanon-Armed-Violence-IB1-Security-Provision-in-Souther.pdf|last=Small Arms Survey|date=May 2010|title=Security provision in Southern Lebanon: Surveying public opinion}} {{Webarchive|url=https://web.archive.org/web/20130601154227/http://www.smallarmssurvey.org/fileadmin/docs/G-Issue-briefs/Lebanon-Armed-Violence-IB1-Security-Provision-in-Souther.pdf |date=2013-06-01 }}</ref> Hezbollah mostly uses 9M22 HE rockets and Chinese Type-81 extended range rockets with Type-90 cluster munitions. Hezbollah also uses BM-21-P variant launcher and an unclear amount of Iranian-made 40 tube "Hadid" truck launchers. Acquired 1992 and first used in 1993. 4000 fired in 2006.
|- style="background:#efefef; color:black"
|-
|BM-27 Uragan
|220
|"dozens" to hundreds in 2006
|40{{Efn|Hezbollah's 220 mm rockets are Syrian-made and may have shorter range than original Soviet rockets.<ref name="meforum.org">{{cite web|url=https://www.meforum.org/meib/articles/0211_l2.htm|title="Hezbollah's Strategic Rocket Arsenal" (November-December 2002)|website=www.meforum.org}}</ref>}}
|100
|Dozens fired in 2006 war, widely agreed to have been built and supplied by Syria<ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref><ref name="auto17">{{حوالہ ویب|url=https://www.technologyreview.com/s/406282/the-missiles-of-august/|title=The Missiles of August|first=Mark Williams|last=Pontin|date=August 16, 2006|publisher=MIT Technology Review – Business Impact}}</ref> starting around 2002. Also known as "Raad,"<ref name="monster">SIPRI Yearbook 2007: Armaments, Disarmament and International Security p. 409-411 {{آئی ایس بی این|9780199230211}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/9780199230211|9780199230211]]</ref> "Raad-2" and "Raad-3". Anti-personnel warhead. Acquired 2000s.
|- style="background:#efefef; color:black"
|Oghab
|230
|few{{Efn|in 2016 Iran was estimated to have just 30 Oghab, Shahin-1, Shahin-2, Nazeat-6, and Nazeat-10 rockets in total.<ref>{{cite web|url=http://www.ceptm.iue.edu.ar/pdf/futureAMarketReport.pdf|title=Future Artillery Systems 2016 Market Report|date=2016|publisher=Future Artillery|author=Defense IQ|access-date=2020-10-01|archive-date=2018-01-22|archive-url=https://web.archive.org/web/20180122000524/http://www.ceptm.iue.edu.ar/pdf/futureAMarketReport.pdf|dead-url=yes}}</ref>}}
|34 to ~45
|65 or 70
|Iranian clone of Chinese Type 83 MLRS with >500m CEP. Not used in 2006.<ref name="divine">William M. Arkin, ''Divining Victory: Airpower in the 2006 Israel-Hezbollah War'' (2007) pp. 36–37 {{آئی ایس بی این|978-1585661688}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1585661688|978-1585661688]]</ref>
|-
|Fajr-3
|240
|"scores" to hundreds of rockets<ref name="Lamb">Benjamin S. Lambeth, Air Operations in Israel's War Against Hezbollah: Learning from Lebanon and Getting It Right in Gaza (Project Air Force). RAND Corp. (2011). p. 92 {{آئی ایس بی این|978-0-8330-5146-2}}</ref> and 24-30 launchers in 2006<ref>{{حوالہ ویب|url=https://www.criticalthreats.org/analysis/estimates-for-hezbollahs-arsenal|title=Estimates for Hezbollah's Arsenal|last=|date=|website=Critical Threats}}</ref>
|~43
|45
|Sometimes called a Katyusha rocket, acquired from Iran<ref>{{حوالہ ویب|url=http://militaryedge.org/armaments/fajr-3/|title=240mm Fajr 3|date=28 October 2013|publisher=Foundation for Defense of Democracies|access-date=1 October 2020|archivedate=25 July 2020|archiveurl=https://web.archive.org/web/20200725054043/https://militaryedge.org/armaments/fajr-3/}}</ref> in early 2000<ref name="lamb2">Benjamin S. Lambeth, Air Operations in Israel's War Against Hezbollah: Learning from Lebanon and Getting It Right in Gaza (Project Air Force). RAND Corp. (2011). p. 94 {{آئی ایس بی این|978-0-8330-5146-2}}</ref> or late 1990s. Small amount used in 2006 war. Also known as "Ra'ad-1"
|- style="background:#efefef; color:black"
|Falaq-1
|240
|hundreds-thousands?<ref name="nps.edu"/>
|9–10<ref name="arts">N.R. Jenzen-Jones, Yuri Lyamin, and Galen Wright. (May 2014) ''Iranian Falaq-1 and Falaq-2 Rockets in Syria''. Armament Research Services. {{آئی ایس بی این|978-0-9924624-1-3}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9924624-1-3|978-0-9924624-1-3]]</ref>
|50
|from Iran,<ref name="archive.org1">{{حوالہ ویب|url=http://www.theisraelproject.org/site/c.hsJPK0PIJpH/b.4613979/k.D44E/The_Threat_of_Iranian_Missile_Development_and_Export.htm|title=The Threat of Iranian Missile Development and Export|date=11 March 2009|publisher=The Israel Project|archiveurl=https://web.archive.org/web/20090311023552/http://www.theisraelproject.org/site/c.hsJPK0PIJpH/b.4613979/k.D44E/The_Threat_of_Iranian_Missile_Development_and_Export.htm|archivedate=11 March 2009}}</ref><ref name="militaryedge.org">{{حوالہ ویب|url=http://militaryedge.org/armaments/assorted-rockets-mortars/|title=Assorted Rockets & Mortars|date=9 December 2013|publisher=Foundation for Defense of Democracies|access-date=1 October 2020|archivedate=15 September 2017|archiveurl=https://web.archive.org/web/20170915204717/http://militaryedge.org/armaments/assorted-rockets-mortars/}}</ref> acquired early 2000s. Small amount used in 2006 war. Truck mounted.
|-
|Khaibar-1
|302
|perhaps dozens–hundreds in 2006
|100
|50 or 175
|acquired 2000s and used in 2006 war possibly by the Syrian Army's 158th Missile Regiment.<ref name="auto27">{{حوالہ ویب|url=http://spioenkop.blogspot.com/2014/12/why-israel-is-bombing-syria-and-is.html|title=Why Israel is bombing Syria and getting away with it|last=Stijn Mitzer and Joost Oliemans|date=11 December 2014|publisher=self-published}}</ref>
|- style="background:#efefef; color:black"
|Falaq-2
|333
|dozens in 2006
|10.8 – 11
|117
|from Iran, acquired after 2000. truck-mounted.<ref name="sendnudes"/>
|-
|Shahin-1
|333
|few
|13 or 75
|190
|Iranian liquid fueled rocket also known as "Ra'ad 1"{{Efn|Iran has produced many separate missiles named Raad (Persian for 'thunder'). They are generally unrelated.}} and "Fajr-4."<ref name="an">Anthony H. Cordesman, Martin Kleiber. Iran's Military Forces and Warfighting Capabilities (2007) {{آئی ایس بی این|978-0-89206-501-1}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-89206-501-1|978-0-89206-501-1]] pp. 60–61</ref> Sources disagree on whether it was used in the 2006 war.<ref>{{حوالہ ویب|url=https://www.ynetnews.com/articles/0,7340,L-3276411,00.html|title=Hizbullah: one of the rockets is a Ra'ad 1|last=|date=16 July 2006|publisher=Ynet News}}</ref> Chemical weapons capable.
|- style="background:#efefef; color:black"
|Shahin-2
|333
|few
|20-29
|190
| Not used in 2006. Chemical weapons capable.
|-
|[[فجر - 5|Fajr-5]]
|333
|hundreds in 2006
|75
|75–90
| Large scale deliveries began 2002 Normally fired from truck-based launchers but can be launched individually.
|- style="background:#efefef; color:black"
|Naze'at 6
|355.6 or 356
|few
|100–130?
|90
| not used in 2006 Uses a transporter erector launcher. Solid-fueled Iranian-made rocket. Possibly WMD capable.
|-
|Naze'at 10
|450
|few
|125-130 or 130-150
|230-240 or 250
| not used in 2006
|- style="background:#efefef; color:black"
|Zelzal-1
|610
|few
|100<ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref>–125
|600
|acquired 2002 or 2003–2004, not used in 2006. Made in Iran.
|-
|Zelzal-2
|610
|dozens in 2006, perhaps hundreds in 2016
|200–250 to 400?
|600
|acquired 2002<ref name="archive.org4">{{حوالہ رسالہ|url=http://jamestown.org/terrorism/news/article.php?issue_id=3830|title=Hezbollah's Rocket Strategy|last=Andrew McGregor|date=10 August 2006|publisher=The Jamestown Foundation}}</ref> or 2003–2004 but not used in 2006 due to airstrike damage.<ref>{{حوالہ ویب|url=http://militaryedge.org/armaments/zelzal-2/|title=610mm Zelzal-2|date=28 October 2013|publisher=Military Edge/Foundation for Defense of Democracies|access-date=1 October 2020|archivedate=25 July 2020|archiveurl=https://web.archive.org/web/20200725054742/https://militaryedge.org/armaments/zelzal-2/}}</ref>{{Efn|In the 2006 war one Zelzal-2 rocket was apparently ignited by accident; it did not reach Israel.}} Also known as Mushak-200.
|}
ایران تے شام دے راکٹ توپ خانے دے نظام دی متعدد مختلف حالتاں تے ناواں دے نال نال حزب اللہ نوں کیہڑا سسٹم منتقل کردتے گئے نيں اس دے بارے وچ وڈی بے یقینی اے۔ <ref name="auto16">Anthony H. Cordesman with George Sullivan and William D. Sullivan. Lessons of the 2006 Israeli-Hezbollah War. (2007) p. 106 {{آئی ایس بی این|978-0-89206-505-9}}</ref> حزب اللہ راکٹاں دی اک وڈی تعداد وچ کلسٹر اسلحہ موجود اے ، <ref name="longboi">IDF, Intelligence and Terrorism Information Center (ITIC) at the Center for Special Studies (CSS), Hezbollah's use of Lebanese civilians as human shields: the extensive military infrastructure positioned and hidden in populated areas. Part Three: Israel Population Centers as Targets for Hezbollah Rocket Fire. November 2006</ref> اگرچہ حزب اللہ اس دی تردید کردا اے۔ چونکہ راکٹاں وچ تبادلہ ہونے والا وار ہیڈ ہوسکدا اے ، لہذا عین مطابق وزن تے حد قدرے مختلف ہوسکدی اے۔
[[فائل:Flickr - Israel Defense Forces - Rocket Shell Found in Hezbollah Bunker.jpg|سجے|thumb| 2006 وچ IDF دے ذریعہ حزب اللہ فالق 1 یا فجر 3 راکٹ قبضہ کيتا گیا سی۔]]
[[فائل:Flickr - Israel Defense Forces - IAF Bombs Katyusha Rocket Launchers.jpg|thumb| حزب اللہ BM-21 Grad "Katyusha" راکٹ لانچر۔]]
حزب اللہ دے بیشتر راکٹ مختصر فاصلے والی کٹیوشا راکٹ نيں ، <ref>{{حوالہ ویب|last=McGregor|first=Andrew|url=http://www.jamestown.org/programs/gta/single/?tx_ttnews%5Btt_news%5D=869&tx_ttnews%5BbackPid%5D=181&no_cache=1|title=The Jamestown Foundation: Hezbollah's Rocket Strategy|publisher=Jamestown.org|date=|accessdate=2011-01-27}}</ref> جس توں مراد کسی خاص ماڈل دا نئيں اے بلکہ ایہ اک عام اصطلاح اے جس وچ ٹرکاں توں وڈی مقدار وچ فائر کیتے جانے والے مختصر فاصلے والے راکٹاں نوں نشانہ بنایا جاندا اے۔ <ref name="hrw.org"/> اصطلاح "کٹیوشا" عام طور اُتے 122 دے لئی استعمال ہُندا اے ملی میٹر BM-21 راکٹ ، تے کدی کدی BM-27 Uragan تے Fajr-3 راکٹ وی شامل کردے نيں۔ تے انہاں دے کٹیوشاس دے علاوہ ، حزب اللہ دے پاس فاجر 3 تے فجر 5 تے درمیانی فاصلے والے راکٹاں دے "ہزاراں" تے طویل فاصلے والے راکٹ موجود نيں۔ <ref name="haaretz.com">{{حوالہ ویب|url=http://www.haaretz.com/st/c/prod/eng/2016/07/lebanon2/|title=Hezbollah: Not a terror group but a midsized army|website=Haaretz|date=August 2016}}</ref> اگرچہ حزب اللہ دے طویل فاصلے تک چلنے والے راکٹ سرحد توں دور دی بنیاد اُتے ہوسکدے نيں تے زیادہ اسرائیل نوں خطرہ بن سکدے نيں ، لیکن انھاں ٹرک اُتے مبنی وڈے ٹرانسپورٹر ایریکٹر لانچراں دی وی ضرورت ہُندی اے جو فضائی حملےآں دا بہت خطرہ نيں۔ <ref name="auto9">Cordesman, A. H., Sullivan, G., & Sullivan, W. D. (2007). Lessons of the 2006 Israeli-Hezbollah war. Washington (D.C.): CSIS Press. {{آئی ایس بی این|978-0892065059}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0892065059|978-0892065059]]</ref> 2006 دی جنگ وچ حزب اللہ دے طویل فاصلے تک راکٹ اولین ترجیحی اہداف سن تے آئی اے ایف نے حزب اللہ دے زلزال لانچراں وچوں 19 وچ 19 توں 21 نوں تباہ کردتا سی ، تے حزب اللہ نے کدی وی راکٹ نوں جنگ دے دوران استعمال نئيں کيتا سی۔ ايسے طرح ، جنگ دے پہلے ہی گھینٹے وچ اس گروپ نے اپنے درمیانے فاصلے والے فجر 3 تے فجر 5 راکٹاں وچوں نصف توں زیادہ نوں گنوا دتا۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> اس گل اُتے غور کردے ہوئے کہ حزب اللہ نے انہاں راکٹاں دے حصول وچ بے حد کوشش کيتی اے ، جنگ وچ انہاں دی تقریبا مکمل تباہی اک وڈی ناکامی دی نمائندگی کردی اے۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> حزب اللہ دے چھوٹے کٹیوشاس راکٹ کسی حد تک انسان دے قابل نقل تے قابل زندہ نيں۔ <ref name="auto14"/> حزب اللہ نے اس دے بعد مبینہ طور اُتے اسرائیلی سرحد توں دور لبنان دے کسی نہ کسی پہاڑی علاقےآں وچ انہاں دے راکٹ دفن کردتے نيں ، جس دی وجہ توں انہاں نوں تلاش کرنے تے تباہ کرنے دے لئی آئی اے ایف دیاں کوششاں پیچیدہ ہوسکدی نيں۔ حزب اللہ زیادہ تر BM-21 راکٹاں نوں انفرادی طور اُتے فائر کردا اے ، لیکن بعض اوقات انہاں نوں گروپاں وچ فائر کردا اے۔ <ref name="archive.org4"/> اس گل دے کچھ شواہد موجود نيں کہ حزب اللہ مقامی طور اُتے آئرام راکٹ تیار کردا اے ، جس وچ 107 دے راکٹ نوں ملایا جاندا اے فولک 1 راکٹ دے وار ہیڈ دے نال ملی میٹر ہتھیار ، جسنوں غیر رسمی طور اُتے "آتش فشاں" راکٹ کہیا جاندا اے۔ <ref name="arts">N.R. Jenzen-Jones, Yuri Lyamin, and Galen Wright. (May 2014) ''Iranian Falaq-1 and Falaq-2 Rockets in Syria''. Armament Research Services. {{آئی ایس بی این|978-0-9924624-1-3}}</ref> ایہ خاص طور اُتے شام وچ مستعمل نيں۔ <ref name="seinfeld"/> حزب اللہ دے بوہت سارے راکٹ اک "ریڈی ٹو فائر" موڈ وچ زیر زمین محفوظ نيں۔ <ref name="closer">{{حوالہ ویب|url=http://www.janes.com/images/assets/560/76560/Israel_raises_alarm_over_advances_by_Hizbullah_and_Iran.pdf|title=Israel raises alarm over advances by Hizbullah and Iran|publisher=Jane's Intelligence Review|first=Nicholas|last=Blanford|first2=Jonathan|last2=Spyer|date=2017}}</ref> حزب اللہ دی مجموعی طور اُتے کِنے راکٹ نيں اس اُتے کوئی اتفاق رائے نئيں اے ، تے جدوں ڈیڑھ لکھ دے لگ بھگ تخمینے عام طور اُتے دہرائے جاندے نيں ، تاں جین اس پروپیگنڈے نوں قرار دیندا اے۔ اس معاہدے اُتے اتفاق اے کہ حزب اللہ دی راکٹ فورس بہت وڈی اے تے پچھلی دہائی وچ اس وچ کافی حد تک وسعت آئی اے۔
[[فائل:Flickr - Israel Defense Forces - Confiscated Ammunition in Warehouse.jpg|thumb| 2009 وچ IDF نے 2،124 نوں روک لیا حزب اللہ جانے والے کارگو جہاز اُتے 107ملی میٹر فجر 1 آرٹلری راکٹ۔ <ref>Matt Schroeder. Rogue Rocketeers: Artillery Rockets and Armed Groups</ref>]]
<nowiki></br></nowiki> حزب اللہ دی راکٹ فورس اک اسٹریٹجک ، تدبیر والا ہتھیار اے جس دا مقصد میدان جنگ دے اثرات نوں حاصل کرنا نئيں اے بلکہ اسرائیل دے تحفظ تے معیار زندگی دے احساسنوں نقصان پہچانیا اے۔ <ref name="meme"/> اس دا بنیادی اثر جسمانی تباہی نئيں بلکہ راکٹ فائر توں اسرائیل دی آبادی دی زندگیاں اُتے اثر پڑدا اے تے لوک شمالی اسرائیل توں فرار ہونے دا سبب بندے نيں۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> جداں کہ اک مبصر نے 1990 دی دہائی وچ خشک انداز وچ نوٹ کيتا سی ، "جب کٹیوشا کسی دے گھر اُتے ڈگدی اے تاں ، انہاں نوں دسنیا مشکل ہُندا اے کہ ایہ ٹھیک چل رہیا اے۔" <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref> اس معنی وچ ، ایہ اک رکاوٹ دے طور اُتے کم کردا اے ، <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref><ref name="longboi">IDF, Intelligence and Terrorism Information Center (ITIC) at the Center for Special Studies (CSS), Hezbollah's use of Lebanese civilians as human shields: the extensive military infrastructure positioned and hidden in populated areas. Part Three: Israel Population Centers as Targets for Hezbollah Rocket Fire. November 2006</ref> تے اسرائیل دے خلاف جنگ وچ سازگار نتیجہ اخذ کرنے دا حزب اللہ دا بنیادی ذریعہ اے۔ <ref name="auto10">{{حوالہ ویب|url=http://www.atlanticcouncil.org/blogs/new-atlanticist/lebanese-hezbollah-offers-a-glimpse-of-its-firepower|title=Lebanese Hezbollah Offers a Glimpse of its Firepower|first=Nicholas|last=Blanford|publisher=Atlantic Council|date=November 21, 2016}}</ref> 2009 وچ ، حزب اللہ گھٹ توں گھٹ دو ماہ تک اسرائیل اُتے بھاری راکٹ فائر نوں برقرار رکھ سکدی اے۔ <ref>{{حوالہ ویب|url=http://www.cablegatesearch.net/cable.php?id=09TELAVIV2501|title=40th Jpmg: Countersmuggling Technical Discussion (part 2 Of 4)|publisher=Wikileaks|archiveurl=https://web.archive.org/web/20130625033629/http://www.cablegatesearch.net/cable.php?id=09TELAVIV2501|archivedate=25 June 2013|date=18 Nov 2009}}</ref> حزب اللہ دی اسرائیل دے خلاف راکٹاں دے استعمال کیتی راکٹ حکمت عملی وسیع پیمانے اُتے حماس دی حکمت عملی توں مشابہت اے۔ حزب اللہ دا راکٹ اسلحہ حماس توں اعلیٰ معیار تے مقدار دا اے ، تے حزب اللہ دی روزانہ اگ لگنے دی شرح چار گنیازیادہ اے۔ 2006 توں 2015 دے درمیان حزب اللہ دے راکٹ اسٹاک وچ دس گنیااضافہ ہويا۔ آئندہ اسرائیل دے نال جنگ وچ ، روزانہ فائر کیتے جانے والے راکٹاں دی تعداد دا تخمینہ 500 توں لے کے 1000 توں وی زیادہ اے ، تنازعہ دے ابتدائی مراحل وچ ایہ اک ابتدائی جھٹکا اے۔ حزب اللہ دے مجموعی طور اُتے راکٹاں دی تعداد دا اندازہ مختلف اے ، لیکن اعلٰی اندازے دے مطابق تقریبا 150 ڈیڑھ لکھ ہزار راکٹ نيں۔ 2002 وچ ، پارٹی دے پاس نیڑے 8،000 توں 9000 راکٹ سن ، <ref name="auto28">Gordon, Michael (September 27, 2002) "Militants Are Said to Amass Missiles in South Lebanon," The New York Times.</ref> تے 2006 وچ ، مغربی انٹلیجنس ذرائع دا خیال سی کہ حزب اللہ دے پاس تقریبا 12،000 راکٹ سن ، <ref name="sendnudes">{{حوالہ رسالہ|url=https://www.gpo.gov/fdsys/pkg/CREC-2007-01-23/pdf/CREC-2007-01-23-pt1-PgH863.pdf|title=A TERRORIST GROUP REARMS|author=GENE GREEN|date=January 23, 2007|journal=Congressional Record – House|volume=153|issue=Pt 2|pages=H862-H863}}</ref> حزب اللہ دے رہنما حسن نصراللہ نے وی دعوی کيتا سی۔ حزب اللہ دے پاس 2006 دی جنگ دے موقع اُتے نیڑے 12 تا 13،000 راکٹ سن ، جنہاں وچوں 11،000 ایران دے ذریعے فراہم کیتے جاندے سن <ref>{{حوالہ ویب|url=http://www.iiss.org/index.asp?pgid=14309|archiveurl=https://web.archive.org/web/20080113172729/http://www.iiss.org/index.asp?pgid=14309|archivedate=13 January 2008|title=International Institute for Strategic Studies – July 19th - - The Globe and Mail -- What rules govern the conflict?|date=13 January 2008|publisher=}}</ref> تے تقریبا 100 100 درمیانی فاصلے والی فجر سیریز توں سن ۔ <ref name="echo">Cordesman, Anthony H. (July 15, 2006) ''Iran's Support of the Hezbollah in Lebanon''. Center for Strategic and International Studies.</ref> 2008 وچ ، اسرائیلی دفاعی انٹلیجنس نے دسیا کہ نیڑے 20،000 راکٹ دریائے لٹانی دے جنوب وچ واقع سن ۔ <ref name="wikileaks.org"/> 2018 وچ ، نائب وزیر دفاع ، ایلیاہو بین دہھن نے اندازہ لگایا کہ اس تنظیم دے پاس 120،000 توں زیادہ میزائل سن ۔ <ref name="Jerusalem Post website"/>
اس گل دا کوئی ثبوت نئيں اے کہ زلزال 3 ، صفر 2 دے زیر انتظام آرٹلری راکٹ دا معمولی اپ گریڈ ، حزب اللہ نے حاصل کيتا اے۔ <ref>Anthony H. Cordesman with George Sullivan and William D. Sullivan. Lessons of the 2006 Israeli-Hezbollah War. (2007) p. 11 {{آئی ایس بی این|978-0-89206-505-9}}</ref> {{Efn|A number of sources confuse the Zelzal-3 artillery rocket with the much larger [[Shahab-3]] ballistic missile.}} ايسے طرح ، اس دے برعکس قیاس آرائیاں دے باوجود ، اس گل دا کوئی ثبوت نئيں اے کہ فتح 313 میزائل حزب اللہ نوں منتقل کيتا گیا اے۔ اس گل دا کوئی ثبوت نئيں اے کہ 2006 دی جنگ دے بعد حزب اللہ نوں ہور زلزال میزائل فراہم کیتے گئے۔ <ref name="sendnudes"/> کچھ ذرائع دا کہنا اے کہ حزب اللہ نے 300 حاصل کیتے نيں ملی میٹر BM-30 "سمرچ" راکٹ۔ <ref name="auto23">Piotrowski, Marcin Andrzej. (2 March 2015) ''Hezbollah: The Model of a Hybrid Threat'' The Polish Institute of International Affairs Bulletin, No. 24 (756).</ref>
=== میزائل ===
{| style="width:100%;"
! style="width:10%;" | ماڈل
! style="width:7%;" | قطر (ملی میٹر)
! style="width:7%;" | مقدار
! style="width:7%;" | حد (کلومیٹر)
! style="width:15%;" | وار ہیڈ (کلوگرام)
! نوٹ
|- style="background:#efefef; color:black"
| [[فاتح 110|فتح -110]]
| 610 <ref name="an">Anthony H. Cordesman, Martin Kleiber. Iran's Military Forces and Warfighting Capabilities (2007) {{آئی ایس بی این|978-0-89206-501-1}} pp. 60–61</ref> یا 616 <ref name="mindexcenter.ir">{{حوالہ ویب|url=http://www.mindexcenter.ir/product/fateh-110-surface-surface-rocket|title=Fateh 110 Surface To Surface Rocket – IRAN Defence Products|last=|date=|website=www.mindexcenter.ir|access-date=2020-10-01|archivedate=2019-07-14|archiveurl=https://web.archive.org/web/20190714043958/http://www.mindexcenter.ir/product/fateh-110-surface-surface-rocket}}</ref>
| درجن سیکڑاں؟
| دے بارے وچ 200 <ref>{{حوالہ ویب|url=https://fas.org/sgp/crs/nuke/R42849.pdf|title=Iran's Ballistic Missile and Space Launch Programs|publisher=Congressional Research Service|last=Hildreth|first=Steven A|date=December 6, 2012}}</ref>
| 450
| ٹھوس ایندھن والا ہدایت والا میزائل۔ بظاہر شامی ساختہ M600 مختلف قسم <ref>{{حوالہ ویب|url=http://militaryedge.org/armaments/fateh-110m600/|title=Fateh-110/M-600|date=11 October 2013|publisher=Military Edge/Foundation for Defense of Democracies|access-date=1 October 2020|archivedate=15 September 2017|archiveurl=https://web.archive.org/web/20170915204451/http://militaryedge.org/armaments/fateh-110m600/}}</ref> تے OEM ایر ساختہ فتح -110 میزائل شامل نيں۔ <ref name="auto24"/> 2006 وچ اس دی ملکیت نئيں اے۔ <ref name="divine">William M. Arkin, ''Divining Victory: Airpower in the 2006 Israel-Hezbollah War'' (2007) pp. 36–37 {{آئی ایس بی این|978-1585661688}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1585661688|978-1585661688]]</ref> فتح -110 اے ، M600 ، تے فتح -110 چوتھی نسل دی مختلف حالتاں دی اطلاع دتی گئی اے۔
|-
| اسکاؤڈ
| 880
| 0-10
| 700
| 500
| فراہمی توں متنازعہ <ref name="haaretz">{{حوالہ ویب|last=Harel|first=Amos|url=http://www.haaretz.com/hasen/spages/1162658.html|title=Syria is shipping Scud missiles to Hezbollah|website=Haaretz|date=2010-04-13|accessdate=2011-01-27}}</ref> شمالی کوریائی ہووسونگ 7s <ref>{{حوالہ ویب|url=http://militaryedge.org/armaments/scud-d/|title=Scud D (Hwasong 7)|date=11 October 2013|publisher=Foundation for Defense of Democracies|access-date=1 October 2020|archivedate=25 July 2020|archiveurl=https://web.archive.org/web/20200725044304/https://militaryedge.org/armaments/scud-d/}}</ref> سکڈ- Cs ، یا سکڈ- Ds دے نال اکثر ماڈل دے حوالے توں وی ماڈل متنازعہ سی۔ <ref>{{حوالہ ویب|url=http://www.janes.com/article/49668/idf-corroborates-hizbullah-scud-d-claims|archiveurl=https://web.archive.org/web/20150304091940/http://www.janes.com/article/49668/idf-corroborates-hizbullah-scud-d-claims|archivedate=4 March 2015|title=IDF corroborates Hizbullah 'Scud-D' claims|first=Jeremy|last=Binnie|date=4 March 2015|publisher=IHS Jane's 360}}</ref> 2010 وچ شام دے ذریعہ فراہم کردہ۔ <ref name="defenddemocracy.org"/><ref name="honk">The Military Balance 2017: The Annual Assessment of Global Military Capabilities and Defence Economics, p. 562 {{آئی ایس بی این|978-1857439007}}</ref>
|- style="background:#efefef; color:black"
|}
چونکہ میزائل ، راکٹاں دے برعکس ، رہنمائی کر رہے نيں ، لہذا اوہ جنگ لڑنے دی صلاحیت وچ وڈے اضافہ دی نمائندگی کردے نيں۔ اگرچہ غیر منظم راکٹ دہشت گردی دے ہتھیار نيں جس دا مقصد وڈے شہری علاقےآں وچ خوف و ہراس پھیلیانا اے ، لیکن میزائلاں نوں مخصوص بنیادی ڈھانچے یا تھاںواں دی طرف نشانہ بنایا جاسکدا اے۔ تجزیہ کاراں دا کہنا اے کہ کسی جنگ وچ حزب اللہ اپنے میزائلاں دا استعمال اسرائیلی فوجی اہداف ، اہم انفراسٹرکچر تے ہوائی بندرگاہاں نوں نشانہ بنانے دے لئی کريں گا۔ 2006 دی جنگ دے دوران حزب اللہ دے پاس کوئی گائڈڈ میزائل نئيں سی۔ <ref name="hrw.org"/> حزب اللہ نے مبینہ طور اُتے یمن وچ سعودی عرب دے خلاف لڑائی وچ بیلسٹک میزائل استعمال کیتے نيں ، جس دی وجہ توں انھاں نے میزائلاں دے پے لوڈ تے رہنمائی نظام نوں بہتر تے جانچنے دی اجازت دتی اے۔ <ref name="closer"/>
2010 دے بعد توں ایہ افوانيں چل رہیاں نيں کہ حزب اللہ نوں شام توں وڈے ، طاقتور سوویت ساختہ اسکود میزائل فراہم کیتے جارہے نيں۔ <ref>{{حوالہ ویب|url=https://wikileaks.org/gifiles/docs/84/843688_syr-syria-middle-east-.html|title=The Global Intelligence Files – SYR/SYRIA/MIDDLE EAST|website=wikileaks.org}}</ref> حزب اللہ نے سکڈ میزائل حاصل کیتے نيں یا نئيں ، ایہ تنازعہ دا موضوع اے ، جداں کہ اسکاؤڈز دی طرح فراہم کيتی گئی اے ، میزائلاں نوں مطلوبہ تریخ وچ دسی گئی سی ، تے اس دی مقدار وی ، تے اس اُتے وی اتفاق رائے نئيں اے کہ میزائلاں دی فراہمی کيتی گئی سی یا ننيں۔ لندن ''ٹائمز'' نے 2011 وچ رپورٹ کيتا سی کہ حزب اللہ نے شام توں دو بیچاں وچ 10 سکڈ میزائل حاصل کیتے۔ حزب اللہ دے فوجی ماہر نکولس بلنفورڈ دا خیال اے کہ حزب اللہ نے شامی اسکود میزائل استعمال کرنے دی تربیت حاصل کيتی اے ، لیکن ایہ یقینی طور اُتے معلوم نئيں اے کہ انھاں لبنان منتقل کيتا گیا اے یا ننيں۔ سکڈ میزائل بہت وڈے تے پیچیدہ نيں ، وڈے ٹرانسپورٹر ایکٹر راکٹاں دے نال ، اک وڈی لاجسٹک ٹرین اے ، تے ایندھن تے لانچ کرنے دے لئی پیچیدہ تربیت دی ضرورت ہُندی اے۔ <ref name="mili"/> اسکاڈ میزائل چھپانا مشکل ہوئے گا ، <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> تے اس دے لئی شاید کسی وڈے زیرزمین احاطے دی ضرورت ہوئے گی۔ چونکہ سکڈ میزائل M600 میزائلاں توں کدرے زیادہ وڈے تے پیچیدہ نيں ، لہذا انہاں دا اصل استعمال نفسیاتی ہتھیاراں دے طور اُتے ہوئے گا جو تمام اسرائیل نوں خطرہ بنائے گا یا ڈیمونا وچ اسرائیل دے جوہری تنصیبات اُتے حملہ کريں گا۔ فیر وی ، کچھ ذرائع دے مطابق حزب اللہ نے اسکود میزائلاں دی اک بہت ہی کم مقدار حاصل کرلئی اے۔ <ref name="wremb"/> شام نے عوامی طور اُتے <ref>{{حوالہ ویب|url=https://wikileaks.org/plusd/cables/10STATE17307_a.html|title=Demarche on Transfer of Ballistic Missiles to Hizballah|publisher=|date=February 25, 2010}}</ref> تے نجی طور اُتے <ref>{{حوالہ ویب|url=https://wikileaks.org/plusd/cables/10DAMASCUS168_a.html|title=Miqdad Denies Supplying Ballistic Missiles to Hizballah, Directs U.S. Demarche to Israel|publisher=|date=February 25, 2010}}</ref> حزب اللہ نوں اسکھوڈ فراہم کرنے توں انکار کيتا۔ صحافی [[رابرٹ فسک]] تے UNIFIL دا کہنا اے کہ حزب اللہ نوں اسکاڈس نئيں ملیا اے۔ <ref name="mideastshuffle.com"/>
نصراللہ نے انہاں بیانات وچ مشورہ دتا اے کہ حزب اللہ دے پاس ایرانی ساختہ M600 میزائل نيں ، <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> تے زیادہ تر تجزیہ کاراں تے آئی ڈی ایف دا خیال اے کہ حزب اللہ نے گھٹ توں گھٹ کچھ M600 میزائل حاصل کیتے نيں۔ حزب اللہ باقاعدہ طور اُتے اسلحہ رکھنے دا دعوی کردا اے جو اس دے دشمناں نوں "حیرت" وچ ڈال دے گا ، جو ممکنہ طور اُتے جنوبی اسرائیل دے ڈیمونا دے نیڑے اسرائیل دی ایٹمی تنصیبات اُتے حملے دا حوالہ دے رہیا اے۔ <ref name="wikileaks.org"/>
=== مارٹر تے توپ خانہ ===
{| style="width:100%;"
! style="width:10%;" | ماڈل
! style="width:20%;" |قسم
! style="width:15%;" | مقدار
! style="width:13%;" | حاصل کيتا
! style="width:7%;" | اصل
! نوٹ
|- style="background:#efefef; color:black"
| 60 ملی میٹر مارٹر
| مارٹر
|
|
|
| شاید HM 12
|-
| 81 ملی میٹر مارٹر
| مارٹر
|
| شاید لبنانی خانہ جنگی
|
| <ref name="militaryedge.org1">{{حوالہ ویب|url=https://militaryedge.org/armaments/assorted-rockets-mortars/|title=Assorted Rockets & Mortars|last=|date=9 December 2013|publisher=Military Edge/Foundation for the Defense of Democracies|access-date=1 October 2020|archivedate=25 July 2020|archiveurl=https://web.archive.org/web/20200725045556/https://militaryedge.org/armaments/assorted-rockets-mortars/}}</ref> M29 مارٹر سمیت <ref name="mili">{{حوالہ ویب|url=https://milinme.wordpress.com/2011/09/04/mleeta-memorial-2-the-weaponry/|title=Mleeta Memorial (2): The Weaponry|last=|date=4 September 2011|publisher=}}</ref>
|- style="background:#efefef; color:black"
| 106 ملی میٹر مارٹر
| مارٹر
|
|
|
| <ref>{{حوالہ ویب|url=https://www.ynetnews.com/articles/0,7340,L-3800306,00.html|title=Navy: 10 times more arms on ship than on Karin-A|last=Hanan Greenberg|date=4 November 2009|publisher=Ynet News}}</ref>
|-
| 120 ملی میٹر مارٹر
| مارٹر
|
|
|
| <ref>Blanford, Nicholas. Warriors of God (2011). p. 169 and 313.</ref> جس وچ رازم مارٹر <ref name="eve">Adam Johnson, ''A Lesson of Proxies: Case Studies of Hezbollah and Boko Haram''. 24th Annual Illinois State University Conference for Students of Political Science. (2016)</ref> تے HM 16 "حدید" مارٹر شامل نيں <ref>{{حوالہ ویب|url=http://www.understandingwar.org/sites/default/files/Backgrounder_IsraeliMissileDefense_email.pdf|title=THREAT AND RESPONSE: ISRAELI MISSILE DEFENSE|last=Christopher Harmer|date=August 16, 2012|publisher=Institute for the Study of War}}</ref>
|- style="background:#efefef; color:black"
| 56 مارٹر ٹائپ کرن
| 160 ملی میٹر مارٹر
| 10 <ref name="armstrade.sipri.org"/>
| نامعلوم ، ممکنہ طور اُتے ایران
| چین
|
|-
| 2S1 Gvozdika
| خود توں چلنے والا ہیوٹزر
| 3 یا اس توں زیادہ
| شام
| یو ایس ایس آر
| شام وچ آپریشن کيتا
|- style="background:#efefef; color:black"
| M-30
| توپ خانے دا ٹکڑا
|
| SLA توں پھڑیا گیا
| یو ایس ایس آر
| شاید ہن استعمال وچ نئيں <ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/81233296|title=Lebanese children wave Hezbollah flags as they climb on an old...|last=Mahmoud Zayat|date=May 25, 2008|publisher=AFP/Getty Images}}</ref>
|-
| ڈی -30
| توپ خانے دا ٹکڑا
|
| SLA توں پھڑیا گیا
| یو ایس ایس آر
| ٹرک سوار <ref>{{حوالہ ویب|url=https://twitter.com/Objekt432Y/status/900039597484146688|title=Hezbollah mobile artillery. 122 mm D-30 mounted on a late-1990s Renault Midliner 4x4.|last=zooper|date=22 Aug 2017|publisher=Twitter (self-published)}}</ref>
|- style="background:#efefef; color:black"
| M-46
| توپ خانے دا ٹکڑا
| <ref>{{حوالہ ویب|url=http://www.washingtoninstitute.org/policy-analysis/view/deterioration-along-the-israel-lebanon-border|title=Deterioration along the Israel-Lebanon Border|website=www.washingtoninstitute.org}}</ref> 1990 دی دہائی دے آخر وچ 2 <ref>{{حوالہ ویب|url=http://www.dailystar.com.lb/News/Lebanon-News/2015/May-29/299699-hezbollah-acquiring-new-tactics-in-syria.ashx|title=Hezbollah acquiring new tactics in Syria|date=29 May 2015|publisher=}}</ref>
|
| یو ایس ایس آر
| 2017 وچ استعمال وچ دیکھیا گیا <ref>{{حوالہ ویب|url=https://twitter.com/MathieuMorant/status/888334884544053248|title=Lebanese Hezbollah 130 mm M-46 SPG, Western Qalamoun.|first=Morant|last=Mathieu|date=21 Jul 2017|publisher=twitter}}</ref><ref>{{حوالہ ویب|url=http://www.gettyimages.com/license/825561212|title=A picture taken on August 2, 2017 during a tour guided by the...|last=Louai Beshara|date=August 2, 2017|publisher=AFP/Getty Images}}</ref>
|}
حزب اللہ دے پاس نسبتا محدود مقدار وچ مارٹر تے توپ خانے والے اسلحہ موجود اے۔ اس پارٹی نے شورش دے دور وچ آئی ڈی ایف تے ایس ایل اے چوکیوں اُتے گولہ باری دے لئی مارٹر دا استعمال کيتا ، تے لبنانی خانہ جنگی تے ایس ایل اے ملیشیا دے خاتمے دے دوران توپاں دے کچھ ٹکڑے ٹکڑے کر لئے۔ اس پارٹی نے شام دی جاری خانہ جنگی وچ ہور توپ خانے دے ٹکڑےآں نوں وی حاصل تے استعمال کيتا اے۔ اس گروپ دے مارٹرس ، انہاں دے بقیہ سامان دی طرح ایران تے شام وی فراہم کردے نيں۔ <ref name="echo">Cordesman, Anthony H. (July 15, 2006) ''Iran's Support of the Hezbollah in Lebanon''. Center for Strategic and International Studies.</ref> 2009 وچ IDF نے حزب اللہ دے لئی 9000 60 ملی میٹر ، 81 ملی میٹر ، تے 120 ملی میٹر دے مارٹر بم لے جانے والا سامان بردار جہاز پھڑیا، جس نوں IDF نے دسیا کہ حزب اللہ دے کل ہتھیاراں دا 10٪ اے۔ <ref>{{حوالہ ویب|url=https://www.flickr.com/photos/idfonline/4429318768/|title=Fuses Directly Tie Shipment to Iran|last=|date=November 4, 2009|publisher=Israell Defense Forces}}</ref>
1995 توں 2002 دے درمیان ، ایرانی پاسداران انقلاب نے دعوی کيتا اے کہ حزب اللہ نوں 400 مختصر تے درمیانے درجے دی توپ خانے توں آراستہ کيتا گیا اے۔ اسرائیلی تھنک ٹینک ایم ایم آر آئی نے اک وکھ تخمینہ لگایا اے ، ایہ کہندے ہوئے کہ حزب اللہ نے 1992 توں 2005 دے درمیان چار سو مختصر تے درمیانے فاصلے اُتے توپ خانے حاصل کیتے۔ <ref name="ghost">Adam C Seitz, Anthony H. Cordesman. ''Iranian Weapons of Mass Destruction: The Birth of a Regional Nuclear Arms Race?'' (Praeger Security International) {{آئی ایس بی این|978-0313380884}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0313380884|978-0313380884]]</ref>
=== بکتر بند گاڑیاں ===
{| style="width:100%;"
! style="width:10%;" | ماڈل
! style="width:20%;" |قسم
! style="width:15%;" | مقدار
! style="width:13%;" | حاصل کيتا
! style="width:7%;" | اصل
! نوٹ
|-
| T-54
| مین جنگ دا ٹینک
| چھوٹی مقدار وچ
| شام
| یو ایس ایس آر
| زیادہ تر T-54A مختلف حالت <ref name="wordpress.com">{{حوالہ ویب|url=https://misterxanlisis.wordpress.com/2016/11/13/hezbollah-getting-armored-in-syria/|title=Hezbollah getting armored in Syria|first=Yago|last=Rodríguez|date=13 November 2016|publisher=self-published}}</ref>
|- style="background:#efefef; color:black"
| ٹی 55
| مین جنگ دا ٹینک
| درجن؟
| شام تے جنوبی لبنان دی فوج
| یو ایس ایس آر
|
|-
| ٹی 62
| مین جنگ دا ٹینک
| چھوٹی مقدار وچ
| شام
| یو ایس ایس آر
| زیادہ تر T-62 اوبر۔ 1972 وچ تبدیلی ، شام وچ چلدی تھی
|- style="background:#efefef; color:black"
| [[ٹی - 72|T-72]]
| مین جنگ دا ٹینک
| تقریبا 60 60 <ref>{{حوالہ ویب|url=https://www.stratfor.com/analysis/hezbollahs-shot-permanency-syria|title=Hezbollah's Shot at Permanency in Syria|publisher=Stratfor Worldview|date=Apr 6, 2016}}</ref>
| شام
| یو ایس ایس آر
| شام وچ کم کيتا گیا ، بشمول کچھ T-72AV تے T-72M1 مختلف حالتاں اہم جنگ دے اہم ٹینک۔ <ref name="honk">The Military Balance 2017: The Annual Assessment of Global Military Capabilities and Defence Economics, p. 562 {{آئی ایس بی این|978-1857439007}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1857439007|978-1857439007]]</ref>
|-
| بی ایم پی ۔1
| پیادہ لڑنے والی گڈی
| 5 یا زیادہ
| شام
| یو ایس ایس آر
| زیادہ تر شام وچ آپریشن کيتا
|- style="background:#efefef; color:black"
| بی ایم پی ۔2
| پیادہ لڑنے والی گڈی
|
| شام
| یو ایس ایس آر
| شام وچ آپریشن کيتا <ref name="medium.com">{{حوالہ ویب|url=https://medium.com/@x_TomCooper_x/understanding-the-syrian-civil-war-part-2-irgc-irgc-controlled-and-hezbollah-units-in-syria-f17907e44ee5|title=Understanding the Syrian Civil War, Part 2: IRGC-, IRGC-Controlled and Hezbollah Units in Syria|first=Tom|last=Cooper|date=11 November 2016|publisher=}}</ref>
|-
| ایم 113
| بکتر بند اہلکار کیریئر
| اک چھوٹی سی تعداد ، 4 یا اس توں زیادہ <ref name="auto10"/>
| اسرائیل دی حمایت یافتہ ساؤتھ لبنان آرمی توں پھڑیا گیا
| ریاستہائے متحدہ
| اسرائیل دا کہنا اے کہ ایہ گاڑیاں لبنان دی مسلح افواج دی طرف توں چلائی گئياں ، اک ایسا دعوی جسنوں وڈے پیمانے اُتے مسترد کردتا گیا اے۔
|- style="background:#efefef; color:black"
| بی ٹی آر 152
| بکتر بند اہلکار کیریئر
|
| جنوبی لبنان دی فوج
| یو ایس ایس آر
| قبضہ کر ليا
|-
| بی ٹی آر -50
| بکتر بند اہلکار کیریئر
|
| جنوبی لبنان دی فوج
| یو ایس ایس آر
| قبضہ کر ليا
|- style="background:#efefef; color:black"
| بی آر ڈی ایم -2
| بکتر بند اہلکار کیریئر
| کچھ
| لبنانی خانہ جنگی تے / یا شام
| یو ایس ایس آر
| شام وچ استعمال کيتا جاندا اے۔
|-
| R-330P 'پیرامیڈا I'
| الیکٹرانک وارفیئر گڈی
| کم تعداد ، گھٹ توں گھٹ 2
| شام
| یو ایس ایس آر
| شام وچ ایم ٹی - ایل بی او پلیٹ فارم اُتے مبنی ای ڈبلیو گڈی اُتے مبنی گڈی چلائی
|- style="background:#efefef; color:black"
| تمام خطےآں دی گڈی
|
| درجن؟
| مختلف
| مختلف
|
|-
| صفیر
| جیپ
| درجناں - سیکڑاں
| ایران
| ایران
| شام وچ آپریشن کيتا
|- style="background:#efefef; color:black"
| M825
| جیپ
|
| لبنانی خانہ جنگی
| ریاستہائے متحدہ
| امل دے نال 1989 دے تنازعہ وچ استعمال ہويا۔ ہن خدمت وچ نئيں نيں۔ <ref name="mili"/>
|-
|}
اگرچہ 1980 دی دہائی تے 1990 دی دہائی وچ حزب اللہ نے ٹانکاں تے بکتر بند اہلکاراں کیریئراں اُتے غیر متوقع طور اُتے قبضہ کرنے دی اطلاعات موصول ہوئیاں نيں ، <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref><ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref><ref>{{حوالہ ویب|url=https://www.upi.com/Archives/1992/07/27/Hezbollah-to-hand-over-main-base-to-Lebanese-army/5437712209600/|title=Hezbollah to hand over main base to Lebanese army|last=|date=July 27, 1992|publisher=UPI}}</ref> حزب اللہ نے شام دی خانہ جنگی وچ شامل ہونے تک سنجیدگی توں بکتر بند گڈیاں دا کم شروع نئيں کيتا سی۔ چونکہ حزب اللہ غیر ریاستی اداکاراں دے خلاف کارروائی کر رہیا سی تے انہاں نوں فضائی برتری حاصل سی ، لہذا بھاری ہتھیاراں تے گڈیاں دے استعمال توں تدبیر معنی رکھدی اے۔ اُتے ، حزب اللہ دی بکتر بند گاڑیاں آئی ڈی ایف دے مقابلے وچ عالمی سطح اُتے کمتر قرار دتیاں گئیاں نيں ، تے ایہ اسرائیل دے خلاف جنگ وچ کارآمد ثابت نئيں ہاں گی۔
[[فائل:Flickr - Israel Defense Forces - Car with Missiles Captured in Lebanon (1).jpg|thumb| حزب اللہ اے ٹی 3 سیگر میزائل سویلین کار وچ لے جا رہے سن ۔]]
[[فائل:Mleeta museum (1).jpg|سجے|thumb| اک کاواساکی دے ڈی ایکس 250 موٹر سائیکل جو حزب اللہ دے زیر استعمال اے۔]]
ہر روز آوا جائی تے لڑائی دے لئی حزب اللہ دے جنگجو تے سرگرم کارکن شہری گڈیاں دا نظامی استعمال کردے نيں۔ حزب اللہ دی لاجسٹک ٹیماں پک ٹرکاں وچ اسلحہ تے گولہ بارود دی آمدورفت کردے نيں ، جدوں کہ افراد عام طور اُتے سڑک دے سفر دے لئی گندگی دی بائک دا استعمال کردے نيں۔ <ref name="shield">Erlich R, (2006). ''Hezbollah's use of Lebanese Civilians as Human Shields: The Extensive Military Infrastructure Positioned and Hidden in Populated Areas from within the Lebanese Towns and Villages''. Tel-Aviv: Intelligence and Terrorism Information Center at the Center for Special Studies.</ref> اک بار کسی میدان جنگ وچ پہنچنے دے بعد ، حزب اللہ دے جنگجو عام طور اُتے اپنی گاڑیاں ترک کردیندے نيں تے پیدل لڑدے نيں۔ اسرائیل نے حزب اللہ اُتے الزام لگایا اے کہ اوہ اسلحہ سازی دے لئی ایمبولینساں تے ریڈ کراس دی گاڑیاں استعمال کردی اے ، جو اک [[جنگی جرائم|جنگی جرم اے ]] ۔
=== بحری اثاثے ===
{| style="width:100%;"
! style="width:10%;" | ماڈل
! style="width:20%;" |قسم
! style="width:7%;" | مقدار
! style="width:13%;" | حاصل کيتا
! style="width:15%;" | اصل
! نوٹ
|- style="background:#efefef; color:black"
| [[نور میزائل|نور]]
| اینٹی شپ میزائل
| 8+ یا "نامعلوم" <ref name="sendnudes"/>
| ایران
| چین
| ایرانی C-802 سلک کیڑا دا کلون ، <ref name="auto17"/> کدی کدی چینی ساختہ دے طور اُتے بیان ہُندا اے۔ <ref name="danger">Frederic Wehrey, David E. Thaler, Nora Bensahel, Kim Cragin, Jerrold D. Green – ''Dangerous But Not Omnipotent: Exploring the Reach and Limitations of Iranian Power in the Middle East'', RAND, {{آئی ایس بی این|9780833045546}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/9780833045546|9780833045546]] pages 95-96</ref><ref name="archive.org1"/> 2000 دی دہائی دے اوائل وچ حاصل کيتا۔ <ref name="iver">Gabrielsen, Iver (2014) "The evolution of Hezbollah's strategy and military performance, 1982–2006," Small Wars & Insurgencies, 25:2, 257–283, DOI: 10.1080/09592318.2014.903636M</ref>
|-
| یخونٹ
| اینٹی شپ میزائل
| 12 تک
| شام
| روس
| 2013 نوں فراہم کیہ <ref name="haaretz.com"/><ref>{{حوالہ ویب|url=http://militaryedge.org/armaments/p-800ss-n-26-yakhont/|title=P-800 Yakhont (SS-N-26 Strobile)|date=22 December 2013|publisher=Military Edge/Foundation for Defense of Democracies|access-date=1 October 2020|archivedate=15 September 2017|archiveurl=https://web.archive.org/web/20170915023704/http://militaryedge.org/armaments/p-800ss-n-26-yakhont/}}</ref> قبضہ متنازعہ <ref name="auto27"/>
|- style="background:#efefef; color:black"
| رقم
| پھسلنے والی کشتی
|
|
|
| <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref>
|}
14 جولائی 2006 نوں ، [[حزب اللہ|حزب اللہ دی]] افواج نے اسرائیلی <nowiki><i id="mwDcM">کاریوٹیٹ</i></nowiki> آئی این ایس <nowiki><i id="mwDcM">حنیت</i></nowiki> اُتے اک سی 802 اینٹی شپ میزائل داغے ، جس وچ چار ملاح ہلاک تے کافی نقصان پہنچیا۔ دوسرا میزائل اپنے ہدف نوں کھو گیا تے سویلین تاجر دے جہاز نوں تباہ کردتا۔ {{Efn|Due to fog of war this was also reported as a C-701 missile or an anti-ship UAV.}} ذرائع اس توں متفق نئيں نيں کہ استعمال شدہ میزائل OEM چینی ساختہ میزائل سی یا ایرانی ساختہ [[نور میزائل|کلون]] ۔ ذرائع اس گل توں متفق نئيں نيں کہ میزائل فائر کرنے دا ذمہ دار کون سی ، حزب اللہ ، شامی فوج ، یا [[سپاہ پاسداران انقلاب اسلامی|اسلامی انقلابی گارڈ کارپ]] نوں ملوث ہونے دے نال۔ <ref name="auto27"/> ایران نے اس واقعے وچ ملوث ہونے توں انکار کيتا <ref name="afp_4august06">{{حوالہ ویب|date=2006-08-04|url=https://news.yahoo.com/s/afp/20060804/wl_mideast_afp/mideastconflictiranhezbollahweapons|archiveurl=https://web.archive.org/web/20060815200009/https://news.yahoo.com/s/afp/20060804/wl_mideast_afp/mideastconflictiranhezbollahweapons|archivedate=2006-08-15|title=Iran to supply Hezbollah with surface-to-air missiles|publisher=Agence France-Presse}}</ref> {{Efn|A few contemporary sources say that the attack was likely conducted by Hezbollah alone.<ref>{{cite news|url=https://www.nytimes.com/2006/07/19/world/middleeast/arming-of-hezbollah-reveals-us-and-israeli-blind-spots.html|title=Arming of Hezbollah Reveals U.S. and Israeli Blind Spots|first1=Mark|last1=Mazzetti|first2=Thom|last2=Shanker|date=19 July 2006|newspaper=New York Times}}</ref>}} جدوں کہ ہور متفق نئيں نيں۔ <ref name="echo">Cordesman, Anthony H. (July 15, 2006) ''Iran's Support of the Hezbollah in Lebanon''. Center for Strategic and International Studies.</ref> ايسے سال ، اسرائیل نے ساحل دے نال نال لبنانی مسلح افواج دے دس راڈار اسٹیشناں نوں تباہ کر دتا ، ممکنہ طور اُتے اس وجہ توں کہ حزب اللہ نے اینٹی شپ میزائل لانچ کرنے دے لئی انہاں تک رسائی حاصل کرلئی- <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> 25 مئی ، 2010 نوں اک تقریر وچ ، حسن نصراللہ نے اسرائیلی بحری جہازاں تے اسرائیل جانے والی تجارتی جہاز اُتے حملہ کرنے دا وعدہ کيتا سی۔ <ref name="wremb"/> کچھ لوکاں نے قیاس کيتا اے کہ حزب اللہ دے پاس نیم آبدوزاں ، تیراکی دی ترسیل دی گاڑیاں ، <ref name="closer"/> یا حتی کہ آبدوزاں نيں ، اگرچہ انہاں دی تصدیق نئيں ہوئی اے۔ <ref>{{حوالہ ویب|url=https://www.wired.com/2008/08/wtf-hez-sails-s/|title=WTF? Hez Submarines in South America?|publisher=}}</ref><ref>{{حوالہ ویب|url=https://www.defensenews.com/naval/2016/08/04/israeli-navy-eyes-next-threat-narco-subs/|title=Israeli Navy Eyes Next Threat: Narco-Subs|first=Barbara|last=Opall-Rome|date=8 August 2017|publisher=}}</ref><ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref>
متنازعہ اطلاعات نيں کہ حزب اللہ نے شام توں وڈے ، جدید یخونٹ اینٹی شپ میزائلاں نوں حصےآں وچ لبنان اسمگل کرکے حاصل کيتا اے۔
حزب اللہ نے سن 1990 دی دہائی وچ اک عمیق جنگی جنگی یونٹ قائم کيتا سی ، جو لبنان تے ایران وچ ٹریننگ کردا اے۔ <ref>Blanford, Nicholas. ''Warriors of God''. (2011) p. 350</ref> اس دے بارے وچ بوہت گھٹ معلوم اے۔
=== بغیر پائلٹ ہوائی گاڑیاں ===
{| style="width:100%;"
! style="width:10%;" | ماڈل
! style="width:17%;" |قسم
! style="width:10%;" | مقدار
! style="width:13%;" | حاصل کيتا
! style="width:15%;" | اصل
! نوٹ
|- style="background:#efefef; color:black"
| مہاجر ۔4
| بغیر پائلٹ ہوائی گڈی
| 8
| ایران
| ایران
| <ref name="armstrade.sipri.org"/>
|-
| مہاجر ۔2
| بغیر پائلٹ ہوائی گڈی
|
| ایران
| ایران
|
|- style="background:#efefef; color:black"
| ابابیل ۔2
| یو اے وی
| 2006 وچ تخمینے 12 توں 24-30 تک ہُندے نيں <ref name="auto20">{{حوالہ ویب|url=http://thearkenstone.blogspot.com/2011/02/ababil-uav.html|title=The Arkenstone - ارکنستون: Ababil UAV|first=Galen|last=Wright|date=5 February 2011|publisher=self-published}}</ref>
| ایران
| ایران
| 2006 وچ اسرائیل دے ذریعہ دو افراد نوں گولی مار دتی گئی۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> ایببل- T لاٹرینگ منیشن دی مختلف قسم اُتے مشتمل اے۔ <ref>{{حوالہ ویب|url=https://www.flightglobal.com/news/articles/iranian-made-ababil-t-hezbollah-uav-shot-down-by-israeli-fighter-in-lebanon-208400/|title=Iranian-made Ababil-T Hezbollah UAV shot down by Israeli fighter in Lebanon crisis|last=Peter La Franchi|date=15 August 2006|publisher=Flight Global}}</ref>
|-
| یاسر
| یو اے وی
| نامعلوم
| ایران
| ریاستہائے متحدہ
| ایرانی [[سکین ایگل|اسکین ایگل]] کلون ، غیر مصدقہ ملکیت <ref>{{حوالہ ویب|url=https://www.debka.com/article/25558/Drone-over-N-Israel-Iranian-with-stolen-US-apps-|archiveurl=https://web.archive.org/web/20160805082040/https://www.debka.com/article/25558/Drone-over-N-Israel-Iranian-with-stolen-US-apps-|archivedate=August 5, 2016|title=Drone over N. Israel: Iranian with stolen US apps|publisher=Debkafile|date=July 19, 2016}}</ref>
|- style="background:#efefef; color:black"
| DJI پریت
| یو اے وی
|
| اک تجارتی کم گاہ
| چین
| سویلین ڈرون یا تاں غیر مسلح تے نگرانی دے لئی استعمال کيتا جاندا اے یا چینی ایم زیڈ ڈی 2 ذیلی اسلحے دے نال اسلحہ بردار سی۔ <ref>{{حوالہ ویب|url=http://www.middleeasteye.net/news/analysis-hezbollah-enters-new-war-use-armed-drones-syria-11412100|title=Analysis: Hezbollah enters drone age with bombing raids in Syria|publisher=Middle East Eye|first=Mona|last=Alami|date=21 March 2017}}</ref>
|-
| کرار
| یو اے وی
| گھٹ توں گھٹ چار
| ایران
| ایران
| مبینہ طور اُتے شام وچ ایرانی ایم کیو ایم -107 اخذ کيتا گیا سی۔ <ref name="stratfor.com1"/><ref name="middleeasteye.net"/> حاصل شدہ c 2010.<ref>"Is Lebanon's Hezbollah Equipped with New Iranian Drones?" ''Terrorism Monitor: In-Depth Analysis of the War on Terror'', no. VIII (24 November 2010), 2.</ref>
|- style="background:#efefef; color:black"
| DJI میٹرس 600
| یو اے وی
|
| کوٹس
| چین
| شہری ڈرون نوں اسلحہ توں نشانہ بنایا
|}
[[فائل:Flickr - Israel Defense Forces - Hezbollah UAV (2).jpg|thumb| حزب اللہ دے گرائے گئے یو اے وی دی باقیات]]
اس دے بوہت سارے دوسرے ہتھیاراں دے نظاماں دی طرح ، حزب اللہ دی UAV دی صلاحیت کسی دوسرے غیر ریاستی قوت دے مقابلے وچ زیادہ ترقی یافتہ اے ، جدوں کہ اک عام ملک دی ریاست توں بوہت گھٹ صلاحیت رکھدی اے۔ خاص طور اُتے ، حزب اللہ دا یو اے وی نظام اسرائیل دی مقدار تے صلاحیت دونے وچ بوہت گھٹ اے۔ حزب اللہ دونے فوجی ڈرون چلاندا اے ، جنہاں دے بارے وچ خیال کيتا جاندا اے کہ اوہ ایران توں حاصل کيتا گیا سی ، تے تجارتی تجارتی سامان دے تحت جدید تجارتی سامان تیار کيتا گیا سی ۔ <ref name="emerge">Larry Friese, N.R. Jenzen-Jones and Michael Smallwood. Emerging Unmanned Threats: The use of commercially-available UAVs by armed non-state actors. (2016). Armament Research Services.</ref> حزب اللہ دے پاس کیہڑا ماڈل تے مقدار وچ ڈرون نيں اس اُتے کافی اختلاف رائے موجود اے۔ <ref>{{حوالہ ویب|url=http://www.aberfoylesecurity.com/?p=2035|title=Is Lebanon's Hezbollah Equipped with New Iranian Drones?|website=www.aberfoylesecurity.com|first=Andrew|last=Andrew|date=November 24, 2010}}</ref> حزب اللہ دے پاس کوئی طیارہ نئيں اے۔ <ref>John G. Bunnell, Lt Col, USAF, FROM THE UNDERGROUND TO THE HIGH GROUND: THE INSURGENT USE OF AIRPOWER. 16 February 2011</ref>
حزب اللہ نے پہلی بار 2002 وچ یو اے وی حاصل کيتی <ref>{{حوالہ ویب|url=https://www.al-monitor.com/pulse/security/01/05/the-drone-threat.html|title=Hezbollah Stockpiling Drones In Anticipation of Israeli Strike|first=Ronen|last=Bergman|date=15 February 2013|publisher=al-Monitor}}</ref><ref>{{حوالہ ویب|url=https://www.ynetnews.com/articles/0,7340,L-4221414,00.html|title=Hezbollah boosting drone unit|date=27 April 2012|publisher=}}</ref> تے ڈرون دا انہاں دا پہلا معروف استعمال 7 نومبر 2004 نوں سامنے آیا۔ پارٹی نے یو اے وی ٹکنالوجی دا استعمال جاری رکھے ہوئے اے۔ 2005 وچ ، اس تنظیم دے پاس ممکنہ طور اُتے صرف تن "میرساد -1" یو اے وی سن ، <ref>{{حوالہ ویب|url=https://search.wikileaks.org/plusd/cables/05BEIRUT1322_a.html|title=Syrian Intelligence May Have Worked with Hizballah on UAC Launchings|last=|date=25 April 2005|publisher=}}</ref> تے اس تنظیم نے 2006 دی لبنان جنگ وچ ڈرون دا استعمال کيتا سی تے اس وچوں کئی ہار گئے سن ۔ 2014 دے بعد توں ، حزب اللہ ڈرون وی غیر محفوظ لبنان تے شام دی سرحد اُتے تکرار وچ ملوث رہے نيں۔ <ref name="archive.org3">{{حوالہ ویب|url=https://www.ynetnews.com/Articles/0,7340,L-4482951,00.html|archiveurl=https://web.archive.org/web/20140618105320/https://www.ynetnews.com/Articles/0,7340,L-4482951,00.html|archivedate=18 June 2014|title=Hezbollah expanding drone use to Syria and Lebanon|last=Roi Kais|date=18 June 2014|publisher=Ynetnews}}</ref> حزب اللہ نے شہری ڈروناں نوں نشانہ بنانے دا مظاہرہ کيتا اے ، تے اس دا دعویٰ کيتا اے کہ انہاں دا استعمال ستمبر 2014 وچ پہلی بار کيتا گیا سی۔ <ref>{{حوالہ ویب|url=https://www.bellingcat.com/uncategorized/2017/02/10/death-drone-bombs-caliphate/|title=Death From Above: The Drone Bombs of the Caliphate|date=10 February 2017|publisher=Bellingcat|first=Nick|last=Waters}}</ref><ref>{{حوالہ ویب|url=http://en.farsnews.com/newstext.aspx?nn=13930630001247|title=Hezbollah Drones Target Al-Nusra Front's Positions at Syrian Border|last=|date=September 21, 2014|website=en.farsnews.com|access-date=October 1, 2020|archivedate=December 26, 2019|archiveurl=https://web.archive.org/web/20191226214518/https://en.farsnews.com/newstext.aspx?nn=13930630001247}}</ref> 2015 وچ حزب اللہ COTS کواڈراکاپٹر UAV دے استعمال کر رہیا سی بتا شام وچ آرٹلری فائر <ref name="emerge">Larry Friese, N.R. Jenzen-Jones and Michael Smallwood. Emerging Unmanned Threats: The use of commercially-available UAVs by armed non-state actors. (2016). Armament Research Services.</ref> شام وچ پارٹی ڈرون دے استعمال دا پہلا گہری استعمال اے۔ <ref name="seinfeld"/>
[[فائل:Hezbollah Ababil UAV.jpg|thumb| اک حزب اللہ ابابیل یو اے وی]]
حزب اللہ دے ڈرون دی کل تعداد دا تخمینہ 10 توں لے کے "درجن" توں تقریبا 200 تک اے ، <ref name="archive.org3"/><ref>{{حوالہ ویب|url=https://www.ynetnews.com/articles/0,7340,L-4457653,00.html|title=Hezbollah has fleet of 200 Iranian-made UAVs|date=25 November 2013|publisher=}}</ref> تجارتی شہری ڈرون دی گنتی ننيں۔ 2006 وچ ، اس گروپ نے 50 تربیت یافتہ ڈرون پائلٹ رکھنے دا دعوی کيتا سی۔ <ref>{{حوالہ ویب|url=http://www.asharqalawsat.com/english/news.asp?section=1&id=5651|archiveurl=https://web.archive.org/web/20070302170158/http://www.asharqalawsat.com/english/news.asp?section=1&id=5651|archivedate=2 March 2007|title=Asharq Alawsat Newspaper (English)|date=2 March 2007|publisher=}}</ref> حزب اللہ نے متنازعہ ماڈل دے ڈرون ، جسنوں میرساد 1 دے ناں توں جانیا جاندا اے تے یا تاں اک آبادیل 2 یا مہاجر 4 ماڈل نے نومبر 2004 تے اپریل 2005 وچ اسرائیلی فضائی حدود دی خلاف ورزی دی سی۔ حزب اللہ مواصلات سمیت کئی ماڈل وچ Abidil-2 UAVs دے چلدی Qasef-1 Loitering دی قلعہ ، تے اسٹریٹجک انٹیلی جنس.<ref name="auto20"/> اس گروپ دے پاس حکمت عملی دی نگرانی دے لئی ابادیل 2 ڈرون نئيں نيں۔ سن 2014 وچ یا 2015 وچ حزب اللہ نے شمالی بیدا ميں 2200 فٹ بغیر چلنے والا رن وے بنایا سی ، شاید شام وچ UAVs دے لئی استعمال کيتا جائے۔ <ref>{{حوالہ ویب|url=http://www.janes.com/article/50922/hizbullah-airstrip-revealed|title=Hizbullah airstrip revealed|date=27 April 2015|publisher=Jane's Information Group|archiveurl=https://web.archive.org/web/20150427003440/http://www.janes.com/article/50922/hizbullah-airstrip-revealed|archivedate=27 April 2015}}</ref> قیاس آرائیاں دی جارہیاں نيں کہ حزب اللہ نے شاہد 129 یو اے وی حاصل کرلیا اے۔ <ref>{{حوالہ ویب|url=https://jamestown.org/program/hezbollahs-drone-program-sets-precedents-non-state-actors/|title=Hezbollah's Drone Program Sets Precedents for Non-State Actors|publisher=Jamestown Foundation|last=Avery Plaw|last2=Elizabeth Santoro|date=November 10, 2017}}</ref><ref>{{حوالہ ویب|url=https://www.thedailybeast.com/us-guns-down-mystery-drone-over-syria|title=U.S. Guns Down Mystery Drone Over Syria|last=Kimberly Dozier|last2=David Axe|date=20 June 2017|publisher=}}</ref>
حزب اللہ نے پیراگلیڈرس توں چلنے والے پیرا گلائڈرس یا پیراشوٹ توں چلنے والے وی استعمال کیتے نيں۔ <ref>Worldwide Equipment Guide: Volume 2: Air and Air Defense Systems. United States Army Training and Doctrine Command, Dec. 2015. Fort Leavenworth, KS</ref><ref>{{حوالہ ویب|url=https://www.haaretz.com/israel-news/1.579017|title=Israeli Arrested for Selling Paragliding Equipment to Iranian|last=Haaretz|date=11 March 2014|publisher=}}</ref><ref name="closer"/> اس دے بارے وچ بوہت گھٹ معلوم اے۔
=== حزب اللہ تے وڈے پیمانے اُتے تباہی پھیلانے والے ہتھیار ===
اس گل دا کوئی ثبوت نئيں اے کہ حزب اللہ نے کیمیائی ، حیاتیاندی یا جوہری ہتھیار حاصل کیتے نيں۔ حسن نصراللہ نے WMD دے خلاف گل کيتی اے تے IDF ذرائع دا کہنا اے کہ حزب اللہ نے کیمیائی ہتھیار حاصل نئيں کیتے نيں۔ اُتے ، حزب اللہ دے کیمیائی ہتھیاراں دے ممکنہ حصول دے بارے وچ بہت ساریاں قیاس آرائیاں تے تشویش پائی جاندی رہیاں نيں ، خاص طور اُتے نیڑےی شام وچ ریاست دے خاتمے دی وجہ تاں۔ 2013 دے اک مضمون وچ کہیا گیا اے کہ جے حزب اللہ شام توں حیاتیاندی ہتھیار حاصل کرلیندا اے تاں ، اس دی موجودہ یو اے وی ممکنہ طور اُتے فراہمی دا اک قابل عمل طریقہ کار فراہم کرے گی۔ دوسری طرف ، جارج بش انتظامیہ نے 2008 وچ اندازہ کيتا کہ حزب اللہ ممکنہ طور اُتے کیمیائی ، حیاتیاندی یا کم درجے دے جوہری ہتھیاراں توں دہشت گردی دا حملہ کرنے دی صلاحیت رکھدی اے۔ <ref name="politico.com"/>
== انٹیلیجنس ==
[[فائل:Flickr - Israel Defense Forces - Hezbollah Analysis Station Found in Lebanon.jpg|thumb| نگرانی دی فوٹیج دیکھنے دے لئی اک اسٹیشن۔]]
حزب اللہ انٹیلیجنس ، انسداد انٹیلی جنس ، تے داخلی نگرانی دے لئی ذمہ دار اک قابل تے وڈے انٹیلیجنس آلات نوں برقرار رکھدی اے۔ <ref name="auto23">Piotrowski, Marcin Andrzej. (2 March 2015) ''Hezbollah: The Model of a Hybrid Threat'' The Polish Institute of International Affairs Bulletin, No. 24 (756).</ref> حزب اللہ دی انٹیلیجنس تنظیم 1982 دے موسم گرما وچ وادی بیدا ميں قائم ہوئی سی تے اصل وچ اسنوں فاتحہ سیکیورٹی آلات ، تے امل دے سیکیورٹی اپریٹس دے ذریعہ جہاز الرضاد دی تشکیل دتی گئی سی۔ اصل وچ قبیلہ اُتے مبنی ، انٹلیجنس سروس اک وڈی ، زیادہ ریاستی تنظیم دی حیثیت توں تیار ہوئی تے حزب اللہ دی نشوونما دے نال ہی دائرہ کار وچ توسیع ہوئی۔ وقت دے نال نال حزب اللہ دی معاندانہ دخولاں وچ اضافہ ہويا اے۔ <ref name="quiet">Carl Anthony Wege (2012) Hizballah's Counterintelligence Apparatus, International Journal of Intelligence and CounterIntelligence, 25:4, 771-785, DOI: 10.1080/08850607.2012.705185</ref> حزب اللہ دی خفیہ ایجنسی نے دعوی کيتا اے کہ اس نے سلفی تے اسلام پسند گروہاں ، فلسطینی گروہاں ، شامی حکومت تے شام تے عراقی شیعہ ملیشیا وچ گھس جانے یا گھسنے دی کوشش کيتی اے۔ مبینہ طور اُتے اس تنظیم دے پاس ایل اے ایف دی فوجی انٹیلیجنس تک رسائی حاصل اے۔
حزب اللہ وچ سگنل ، ہیومنٹ ، تے آئی ایم آئی این ٹی دی صلاحیتاں نيں۔ <ref name="bonjour">Guérin, Alexandre. (2009) ''Le Hezbollah Face Aux Forces Armées Conventionnelles Perspective Historique Des Modes D'action''. Centre de Doctrine d'Emploi des Forces – Division Recherge et Retour d'Expérience.</ref>
حزب اللہ نے سگنل دے عملے نوں سرشار کيتا اے۔ <ref>{{حوالہ ویب|url=http://www.israeldefense.co.il/en/content/peek-inside-idf-8200s-combat-intelligence-unit|title=A Peek inside the IDF 8200's Combat Intelligence Unit|publisher=|access-date=2020-10-01|archivedate=2020-09-25|archiveurl=https://web.archive.org/web/20200925095050/https://www.israeldefense.co.il/en/content/peek-inside-idf-8200s-combat-intelligence-unit}}</ref> 2006 وچ ، حزب اللہ دے اشارے دے عملے نے مبینہ طور اُتے IDF دے ذریعہ استعمال کیتے جانے والے کچھ سیل فونز دے تھاںواں نوں تکمیل کرنے وچ کامیاب کيتا سی۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> حزب اللہ دا اشارہ سیکشن مبینہ طور اُتے تنظیم دا سب توں خفیہ تے تربیت یافتہ حصہ اے ، تے اس دے بارے وچ بوہت گھٹ معلوم اے۔ <ref name="isopod"/> 2006 توں اس دی صلاحیتاں وچ بہتری آئی اے تے اسنوں ایران توں سامان تے الیکٹرانکس وچ ریاست دا وسیع حمایت حاصل اے۔ <ref name="auto5">Nicolas Blanford (2011) ''Warriors of God: Inside Hezbollah's Thirty-Year Struggle Against Israel''. New York: Random House.</ref>
2006 وچ ، حزب اللہ دی ذہانت دی صلاحیت تے ایرانی مدد نے انہاں نوں "اسرائیل دی فوجی حکمت عملی دے بارے وچ غیر معمولی تفہیم" عطا کيتی ، جو جنگ کامیابی توں لڑنے دے لئی اہم سی۔ <ref name="auto25">Martin S. Catino, Week 7 Summary: Hezbollah Capabilities and Advantages in the 2006 Lebanon War. MILS 521: Strategy, Tactics, and the Operational Art. American Military University</ref> پارٹی دے پاس "اچھی تدبیراں ذہانت" سی تے اوہ IDF دے کمانڈراں ، لبنان دے راستے پیشگی راستے تے حرباں نوں جاندی سی۔ <ref name="jj">Exum, Andrew (December 2006) ''Hizballah at War: A Military Assessment''. Policy Focus #63, The Washington Institute for Near East Policy.</ref> 2006 وچ حزب اللہ دی خارجی انٹلیجنس سروس نے اپنے راکٹ ذخیرے دے لئی "اہداف تے ٹریژوجی الگورتھم دے انتخاب پر" شناخت کرنے اُتے توجہ دتی۔ <ref name="auto14"/> اسرائیل وچ حزب اللہ دا انٹیلیجنس نیٹ ورک راکٹاں دے اہداف دی نشاندہی کرنے اُتے بہت زیادہ توجہ مرکوز اے۔ <ref name="midi">Blanford, Nicholas. (May 24, 2010) ''Hezbollah and the Next War with Israel''. Speech, Middle East Institute.</ref> حزب اللہ دی داخلی سلامتی دے سازوسامان دا صدر مقام بیروت دے دہیہ وچ اے۔ <ref>{{حوالہ ویب|url=http://debka.com/article/22459/|archiveurl=https://web.archive.org/web/20121103181603/http://debka.com/article/22459/|archivedate=3 November 2012|title=Iran's global cyber war-room is secretly hosted by Hizballah in Beirut|last=|date=3 November 2012|publisher=Debkafile}}</ref> حزب اللہ دا لبنان دی سیکیورٹی خدمات دی حکومت دے اندر اثر و رسوخ اے۔ <ref>{{حوالہ ویب|url=https://www.ft.com/content/888c2e22-21cd-11e6-9d4d-c11776a5124d|title=American sanctions are hitting the wrong target in Lebanon|last=David Gardner|date=May 25, 2016|website=Financial Times}}</ref> 2000 دے بعد توں ، حزب اللہ نے عوامی رپورٹنگ تے جاسوساں دے ذریعے اسرائیلی سویلین تے فوجی انفراسٹرکچر دا ڈیٹا ویہہ حاصل کرنے اُتے توجہ مرکوز دی اے تاکہ جنگ کيتی صورت وچ راکٹ آرٹلری نوں نشانہ بنایا جاسکے۔ <ref name="isopod"/>
نصراللہ دی سیکیورٹی دی تفصیلات حزب اللہ دے انٹیلیجنس آلات توں وکھ سنبھال لی گئی نيں۔ <ref name="loud">Carl Anthony Wege (April 2008) The Hizballah Security Apparatus. Perspectives on Terrorism, Volume II, Issue 7</ref> گذشتہ چند سالاں وچ نصراللہ دے محافظاں دی پیشہ ورانہ مہارت وچ اضافہ ہويا اے لیکن اوہ تاحال متاثر کن تے مایوس کن اے۔
=== کاؤنٹر انٹیلیجنس ===
حزب اللہ دا کاؤنٹر انٹیلیجنس اے جو دو اعضاء اُتے مشتمل اے۔ <ref name="quiet">Carl Anthony Wege (2012) Hizballah's Counterintelligence Apparatus, International Journal of Intelligence and CounterIntelligence, 25:4, 771-785, DOI: 10.1080/08850607.2012.705185</ref> وقت دے نال نال اس گروپ دی انسداد جنگ کيتی صلاحیت وچ بہتری آئی اے۔ <ref name="cbsnews.com">{{حوالہ ویب|url=https://www.cbsnews.com/news/major-cia-network-unraveled-by-hezbollah-iran/|title=Major CIA network unraveled by Hezbollah, Iran|publisher=CBS News|date=November 21, 2011}}</ref> انسداد جنگ تنظیم وچ اک "جنگی یونٹ" شامل اے ، جو 2004 دے ارد گرد سرگرم عمل ہويا۔
2000 تے 2006 دے درمیان ، اس گروپ نے خاص طور اُتے انسداد سگنل انٹلیجنس ، یا اسرائیلی الیکٹرانک جاسوسی دے آلات نوں ہٹانے ، تے اسرائیلی ایجنٹاں نوں "موڑ" دینے وچ بہتری لائی۔ <ref name="LEAD">Farquhar, S. C. (Ed.). (2009). ''Back to Basics: A Study of the Second Lebanon War and Operation CAST LEAD''. Combat Studies Institute Press, U.S. Army. {{آئی ایس بی این|978-0-9823283-3-0}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-9823283-3-0|978-0-9823283-3-0]]</ref>
== الیکٹرانک جنگ ==
حزب اللہ نے فائبر آپٹک کیبلز نوں ٹیپ کرنے ، انٹرسیپٹ ڈیٹا تے انٹرنیٹ تے مواصلاتی رابطےآں نوں ہائی جیک کرنے دی اک محدود صلاحیت دا مظاہرہ کيتا اے۔ 2006 وچ ، اس گروپ دے پاس "اسرائیل دے راڈار تے مواصلاتی نظام دے کچھ حصےآں نوں جام کرنے دے لئی موجود اثاثے سن ۔" <ref name="stratfor.com"/>
2006 وچ جنوبی لبنان دے انتہائی تباہ کن گڑھاں وچ وی حزب اللہ دا مواصلاتی نیٹ ورک کم کردا رہیا۔ چار ہفتےآں دی جنگ دے بعد ، ہن وی اس نیٹ ورک نے اسرائیلی سرحد توں صرف 500 میٹر دی دوری اُتے کم کيتا۔ <ref name="ReferenceA"/> ایرانی الیکٹرانک جنگی جنگی ماہرین نے نیٹ ورک دی ترقی وچ مدد کيتی تے جدید ایرانی سامان دی فراہمی کيتی۔ اس وچ "چھپے ہوئے آلات ، کمپیوٹر تے جدید مواصلاتی آلات شامل سن ۔" حزب اللہ دے پاس اسرائیلی الیکٹرانک جنگ دا مقابلہ کرنے دے لئی اک محکمہ اے ، خاص طور اُتے غیر محفوظ آلات دے استعمال کیتی حوصلہ شکنی کردے ہوئے۔ اک اسرائیلی ماخذ دا کہنا اے کہ 2006 وچ ، "حزب اللہ دے کمانڈر اسرائیلی اشاراں دی صلاحیتاں دے بارے وچ پوری طرح ذہن رکھدے سن تے اپنی اعلیٰ سطح اُتے مواصلات دی حفاظت تے خفیہ کاری نوں برقرار رکھنے دے لئی سخت محتاط سن ،" جس نے IDF انٹلیجنس نوں نمایاں طور اُتے چیلنج کيتا سی۔ <ref name="air">Lambeth, B. S. (2011). Air operations in Israel's war against Hezbollah: Learning from Lebanon and getting it right in Gaza. Santa Monica, CA, United States: RAND. {{آئی ایس بی این|978-0-8330-5146-2}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-0-8330-5146-2|978-0-8330-5146-2]]</ref> حزب اللہ نے ایہ وی دعوی کيتا اے کہ انہاں نے اسرائیل دے خفیہ کردہ ریڈیو نیٹ ورکس اُتے تبادلہ خیال کيتا ، لیکن ایہ "یقینا" غلط "اے۔ <ref>{{حوالہ ویب|url=https://www.schneier.com/blog/archives/2006/09/did_hezbollah_c.html|title=Did Hezbollah Crack Israeli Secure Radio? - Schneier on Security|website=www.schneier.com}}</ref>
== میڈیا تے پروپیگنڈا ==
کئی دہائیاں توں میڈیا حزب اللہ دی فوجی حکمت عملی وچ اک اہم کردار ادا کردا رہیا اے۔ حزب اللہ میڈیا دے کردار نوں بہت سنجیدگی توں لیندی اے تے اس دی لڑائی دی سرگرمیاں دی خبر اپنے اجزاء تے وڈے پیمانے اُتے پوری دنیا تک پہنچانے دے لئی بہت کوشش کردی اے۔ حزب اللہ دی میڈیا سرگرمیاں بنیادی طور اُتے حزب اللہ دے اخبارات ، حزب اللہ دے المنار ٹیلی ویژن اسٹیشن ، تے حزب اللہ دے ریڈیو نور دے ذریعے ہُندی نيں۔
== شام دی خانہ جنگی ==
2012 توں ، حزب اللہ جاری خانہ جنگی وچ اسد حکومت دے لئی لڑنے دے لئی شام وچ فوجی تعیناتی اُتے مصروف اے۔ ہلاکتاں تے کل افرادی قوت دونے دے لحاظ توں ، ایہ حزب اللہ دا ہن تک دا سب توں وڈا فوجی آپریشن اے۔ <ref name="armenia"/> حزب اللہ دی شام وچ شمولیت مختصر مدت وچ اس گروپ نوں کچھ حد تک کمزور کرسکدی اے ، لیکن طویل مدتی وچ اس گروپ نوں مضبوط بنائے گی۔ <ref name="pando.com"/> حزب اللہ اسلحے دے لئی [[بشار الاسد|اسد]] اُتے انحصار کردا اے تے اسلحے دی مدد کردا اے ، تے اسنوں لبنان دی سرحد اُتے سنی عسکریت پسند گروپاں دی موجودگی توں خطرہ ہوئے گا۔
2011 دے اوائل وچ پہلے مظاہرےآں دے ہفتےآں بعد ، حزب اللہ نے شام وچ اسد دی حکومت دے لئی اپنی حمایت دا اعلان کيتا۔ <ref name="understandingwar">{{حوالہ ویب|url=http://www.understandingwar.org/sites/default/files/Hezbollah_Sullivan_FINAL.pdf|title=Middle East Security Report 19 – Hezbollah in Syria|date=2014|publisher=Institute for the Study of War|first=Marisa|last=Sullivan}}</ref> چونکہ حزب اللہ اپنی لاجسٹک ٹرین نوں بچانے دے لئی ملک دے قابل ایئر ڈیفنس نیٹ ورکس دا استعمال کردی اے ، لہذا حزب اللہ دے کارکنان پرتشدد مظاہرہ کرنے توں پہلے ہی موجود سن ۔ ایہ گروپ 2012 وچ فوجی طور اُتے شامل ہوگیا سی جدوں حکومت کیتی پوزیشن پھسل گئی تے 2013 وچ اپنی موجودگی دا انکشاف کيتا۔ جنگ دے پہلے دو سال تک ، حزب اللہ دی موجودگی اک اہم خفیہ مشاورتی کردار ، تربیت تے اہم تنصیگل کيتی حفاظت تک محدود سی۔ <ref name="seinfeld"/> ایہ گروپ وڈے پیمانے اُتے کم کردا اے ، لیکن مکمل طور اُتے نئيں ، اک مشاورتی صلاحیت ، تربیت تے IEDs ، گوریلا جنگ ، تے اسنیپنگ ورگی کچھ صلاحیتاں دی فراہمی۔ اس گروہ دا فوجی کردار آہستہ آہستہ پھیلدا گیا جدوں حکومت کیتی پوزیشن خراب ہُندتی گئی۔ 2006 دی جنگ دے بعد ، حزب اللہ افرادی قوت دی سب توں وڈی تعمیر وچ مصروف رہیا۔
حزب اللہ نے شاید کسی وی وقت وچ 4000 جنگجوواں نوں شام وچ تعینات کردتا اے۔ <ref>{{حوالہ رسالہ|last=White|first=Jeffery|title=Hizb Allah at War in Syria: Forces, Operations, Effects and Implications|date=15 January 2014|url=https://ctc.usma.edu/hizb-allah-at-war-in-syria-forces-operations-effects-and-implications/|publisher=Combating Terrorism Center at West Point}} {{Webarchive|url=https://web.archive.org/web/20200930221141/https://www.ctc.usma.edu/hizb-allah-at-war-in-syria-forces-operations-effects-and-implications/ |date=30 September 2020 }}</ref> تخمینے تقریبا 1500--8000،کے درمیان وڈے پیمانے اُتے مختلف ہُندے نيں ، <ref name="Worall">James Worrall, Simon Mabon, Gordon Clubb. (2011) ''Hezbollah: From Islamic Resistance to Government''. p. 44–46 {{آئی ایس بی این|1440831343}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/1440831343|1440831343]]</ref><ref name="monitor2">{{حوالہ ویب|url=http://www.csmonitor.com/World/Middle-East/2013/1203/Battlefield-lessons-in-Syria-strengthen-Hezbollah-s-fighting-force|title=Battlefield lessons in Syria strengthen Hezbollah's fighting force|first=Nicholas|last=Blanford|date=3 December 2013|publisher=}}</ref> لیکن ذرائع اتفاق کردے نيں کہ اس توں حزب اللہ دی کل افرادی قوت دے اک معنی خیز دی نمائندگی ہُندی اے۔ حزب اللہ شام وچ کچھ ہفتےآں توں لے کے اک مہینے تک مختصر تعیناتیاں استعمال کردا اے۔ اگرچہ حزب اللہ نے متعدد مواقع اُتے لائن انفنٹری دی حیثیت توں تعینات کيتا اے ، لیکن انہاں دا زیادہ تر حصہ فرنٹ لائن مشیراں دی حیثیت توں اے جو مواصلات وچ معاونت ، سنائپر فائر تے اسپیشل فورس جداں خصوصی فوجی مدد فراہم کردے نيں۔ <ref name="understandingwar"/> شام وچ حزب اللہ دی شمولیت دا دائرہ ، انہاں دی ہن تک دی سب توں وڈی عسکری مصروفیت دے طور اُتے ، اوہ ایہ اے کہ اوہ نہ صرف جنگجوواں نوں ملک گھلدے نيں بلکہ اہلکاراں تے تربیت کاراں دی مدد کردے نيں۔ <ref name="seinfeld"/>
[[فائل:Breaking siege of Nubl and Al-Zahraa (1).jpg|thumb| نوبل تے الزہرہ شہراں دے نیڑے شام وچ اک چوکی اُتے اڑدا ہويا حزب اللہ دا جھنڈا۔]]
شام وچ ، حزب اللہ جارحانہ تے انسداد شورش آپریشن کردی اے تے اسپاٹ ناز سمیت روسی فوجیاں دے نال شانہ بشانہ لڑدی اے۔ <ref>{{حوالہ ویب|url=https://warontherocks.com/2015/10/why-israel-should-be-worried-about-russias-role-in-syria/|title=Why Israel Should Be Worried About Russia's Role in Syria|publisher=War on the Rocks|first=Nadav|last=Pollak|date=October 8, 2015}}</ref><ref name="washingtoninstitute.org1"/> اگرچہ کچھ ذرائع ایہ دسدے نيں کہ روس تے حزب اللہ نیڑے توں تعاون کر رہے نيں ، لیکن دوسرے ذرائع دا کہنا اے کہ نیڑے توں تعاون نہ کرنے وچ انہاں دے اسٹریٹجک اختلافات نيں۔ <ref>{{حوالہ ویب|url=https://www.intelligenceonline.com/government-intelligence/2017/10/04/kremlin-reevaluates-alliances-in-syria,108274419-GRA|title=Kremlin reevaluates alliances in Syria|last=|date=4 October 2017|publisher=Intelligence Online}}</ref> روسی پارٹی دے نفیس نظریات ، ای ڈبلیو دی اہلیت ، ہوائی طاقت ، تے مشترکہ ہتھیاراں توں پارٹی دی نمائش پارٹی دی صلاحیتاں نوں بہتر بنا سکدی اے ، لیکن اسرائیل دی طاقت دا مظاہرہ کرکے اس دی روک سیم وی کر سکدی اے۔ <ref name="seinfeld"/> حزب اللہ نے کمانڈ اینڈ کنٹرول وچ خاص طور اُتے بہتری لیائی اے ، ہور فوجی تنظیماں دے نال مل کے کم کيتا اے ، تے گھنے شہری ماحول وچ لڑائی لڑی اے۔ تنظیم نے ایرانی اتحاد توں منسلک ہور قوتاں دے نال کم کرنے دی اپنی صلاحیت نوں بہتر بنایا اے تے لبنان دے باہر مختلف خطےآں وچ مستقل آپریشن کرنے دی اپنی صلاحیت نوں بہتر بنایا اے۔ <ref name="understandingwar"/> حزب اللہ ، جس نے عشراں توں جنوبی لبنان وچ اسرائیل توں لڑنے دے لئی تیار کيتا ، اس دے بجائے نامعلوم علاقے تے کھیتاں تے شہری علاقےآں وچ ملیشیا فورسز نوں اک وڈی روايتی قوت دے طور اُتے لڑنا پيا۔ <ref name="auto10"/> بہت سارے ذرائع نوٹ کردے نيں کہ حزب اللہ دے جنہاں دشمناں نوں جنگ وچ سامنا کرنا پڑدا اے اوہ IDF توں بالکل مختلف نيں ، تے ایہ کہ حزب اللہ دے کچھ سازوسامان تے علم اسرائیل دے خلاف قابل استعمال نئيں ہون گے۔ کہیا جاندا اے کہ جنگ وچ حصہ لینے توں حزب اللہ نوں روايتی مسلح افواج ، ہوائی طاقت ، تے انٹیلیجنس اجتماع دی بہتر تفہیم ملی اے۔ جنگ حزب اللہ دا میدان جنگ دا پہلا جارحانہ تجربہ اے تے پہلی بار حزب اللہ نے اپنے سینکڑاں جنگجوواں نوں مربوط کيتا۔
2013 وچ ، حزب اللہ نے القصیر دی جنگ کيتی منصوبہ بندی دی تے اس دی رہنمائی دی ، <ref name="understandingwar"/> جو حکومت دے لئی اک اہم فتح سمجھیا جاندا سی۔ اس مرحلے تک اس گروپ دا شام وچ اک نمایاں کردار سی <ref>''Analysis: Syria's insurgent landscape''. (October 2013) IHS Aerospace, Defence & Security.</ref> تے انہاں دی کارکردگی ایہ اے کہ ایہ جنگ اچھی سمجھی جاندی اے۔ بعد وچ ، ایہ گروپ حلب دی جنگ دے نتیجے وچ ہونے والے توقع توں کدرے زیادہ بھاری نقصان اٹھائے گا تے ایران نے مبینہ طور اُتے اس دی جگہ بدر آرگنائزیشن وچ لے لئی۔ <ref name="thetower">{{حوالہ ویب|url=http://www.thetower.org/article/the-iranian-empire-is-almost-complete-hezbollah-syria-lebanon-iraq/|title=The Iranian Empire Is Almost Complete|publisher=The Tower Magazine|first=Hanin|last=Ghaddar|date=December 2016}}</ref> اس دے باوجود ، حزب اللہ شام وچ سب توں زیادہ قابل تے قابل اعتماد ایرانی اتحاد توں جڑا گروہ اے ، تے عام طور اُتے شام وچ بیشتر شیعہ ملیشیا تے افغان تے پاکستانی غیر ملکی جنگجوواں دا کنٹرول برقرار رکھدا اے۔ ايسے وقت ، حزب اللہ دے کچھ ارکان جنگ کيتی کوشش نوں اجیرن کم دے طور اُتے دیکھدے نيں۔ جدوں ایہ گروہ شام وچ لڑدا اے تاں ، اوہ اکثر کمانڈ دا کردار ادا کردے نيں ، جس وچ شامی فوج رسد تے مقامی انٹیلیجنس نوں سنبھالدی اے۔ <ref name="seinfeld"/> 2017 وچ ، حزب اللہ دے پیراٹروپرس بظاہر فوح تے کفریہ دے محاصرہ شدہ چودی ميں کود پئے۔ <ref name="auto10"/>
اس جنگ نے حزب اللہ نوں شام توں وی زیادہ آزاد بنا دتا اے: جدوں کہ حزب اللہ اک زمانے وچ شام دا پراکسی سی ، ہن شام دے اندر اس دے اپنے اثر و رسوخ نيں۔ جنگ دے دوران ایرانی اتحادی افواج وچ گروپ دی پوزیشن مستحکم ہوگئی اے۔ <ref name="seinfeld"/> چونکہ حزب اللہ نے شام وچ مداخلت کيتی سی ، اس نے روايتی جنگ کيتی اے تے اسد حکومت کیتی طرف توں بھاری ہتھیاراں توں فائدہ اٹھایا گیا اے۔ <ref name="honk">The Military Balance 2017: The Annual Assessment of Global Military Capabilities and Defence Economics, p. 562 {{آئی ایس بی این|978-1857439007}}[[بین الاقوامی معیاری کتابی عدد|ISBN]] [[Special:BookSources/978-1857439007|978-1857439007]]</ref> حزب اللہ نے شام وچ 4،000 توں 8،000 جنگجوواں نوں تعینات کيتا اے۔
اگرچہ اس گروہ نوں دو ہزار توں زیادہ اموات دے نال ، جنگ توں بھاری نقصان اٹھانا پيا اے ، <ref>{{حوالہ ویب|url=http://studies.aljazeera.net/en/reports/2016/06/hezbollah-syria-gains-losses-160601093443171.html|title=Hezbollah in Syria: Gains, Losses and Changes|publisher=Al Jazeera|date=1 June 2016|first=Chafic|last=Choucair}}</ref> اس نے شیعہ نوجواناں وچ بھرتی کرنے دی اک طاقتور مہم دے طور اُتے وی کم کيتا اے تے اس دا نتیجہ اسد حکومت کیتی تریخ تک محفوظ رہیا اے۔ شن بیٹ دے سابق چیف ایوی ڈِکٹر دے مطابق ، شام وچ حزب اللہ دے جنگی تجربے نے "[انہاں نوں] اک بہتر لڑاکا قوت تے روايتی فوجی جنگ وچ زیادہ ماہر بنایا اے۔" <ref>{{حوالہ ویب|url=http://www.thetower.org/4284-iranian-television-calls-hezbollah-instrumental-in-protecting-assad/|title=Iranian State TV: Hezbollah "Instrumental" in Protecting Assad|publisher=The Tower Magazine}}</ref> اگرچہ شام وچ حزب اللہ دی مداخلت نے اس گروپ نوں "مضبوط تے جنگ توں سخت کردتا اے " ، <ref name="rocks"/><ref name="monitor2"/> اس نے اسرائیل توں دور وسائل نوں وی دوبارہ منتقل کردتا اے تے لبنانی [[اہل سنت|سنیاں دے]] درمیان اس گروپ دا موقف کم کيتا اے۔ شام وچ پارٹی دی شمولیت توں اس دی جنگی تیاریاں نوں خطرہ لاحق ہوسکدا اے ، حالانکہ ایہ پارٹی لبنانی شیعاں دے وچکار مضبوط حمایت برقرار رکھے ہوئے اے۔ <ref name="seinfeld"/> شام وچ قائم اصولاں دا فقدان اسرائیل دے نال اوتھے دی پارٹی دے تعلقات نوں ہور غیر مستحکم کردا اے۔ <ref name="closer"/>
حزب اللہ دے جنگجو شامی عرب فوج دے فوجیاں توں کافی حد تک بہتر نيں ، <ref name="theweek.com"/><ref name="thedailybeast.com"/> اک باغی کمانڈر جس وچ حزب اللہ نوں "شام وچ نمبر اک [حکومت] دے جنگجو" قرار دتا گیا اے۔ نیوز ویک لکھدے نيں کہ مجموعی طور اُتے حزب اللہ شامی حکومت توں زیادہ مضبوط اے۔ <ref name="newsweek.com"/> جنگ دے مطالعے دے انسٹی ٹیوٹ دی اک رپورٹ وچ پتا چلیا اے کہ حزب اللہ دے فوجی "اپنے شامی یا عراقی اسيں منصباں توں اکثر بہتر تربیت یافتہ ، نظم و ضبط تے تجربہ کار" ہُندے نيں تے انہاں وچ کافی حد تک بہتر حوصلے پائے جاندے نيں ۔ <ref name="understandingwar"/>
حزب اللہ شامی عرب فوج دے مقابلے وچ زیادہ قابل سمجھیا جاندا اے ، جو عیب تے خراب نظم و ضبط توں دوچار اے۔ انہاں دے جنگجوواں نوں ایس اے اے دے فوجیاں نوں پرت مار تے پتھراؤ توں روکنے دے لئی جانیا جاندا اے۔ حزب اللہ شام وچ طویل مدتی اثر و رسوخ دے لئی کھیل رہیا اے۔ جنگجو بعض اوقات شامی فوج دے سپاہیاں دی کھلم کھلا بے عزتی کردے نيں تے کدی کدائيں ہی شام دے جھنڈے یا بشار الاسد دی تصاویر اڑاندے نيں۔
== نوٹ ==
{{حواشی}}
== حوالے ==
{{حوالا جات|2}}
[[گٹھ:حزب اللہ]]
[[گٹھ:غیر نظر ثانی شدہ تراجم اُتے مشتمل صفحات]]
tun24gv13ok0r98xv4kmgnlbxk3423p
ماڈیول:Complex date
828
92503
690972
564061
2025-07-10T15:57:16Z
Abbas dhothar
361
690972
Scribunto
text/plain
--[[
__ __ _ _ ____ _ _
| \/ | ___ __| |_ _| | ___ _ / ___|___ _ __ ___ _ __ | | _____ __ __| | __ _| |_ ___
| |\/| |/ _ \ / _` | | | | |/ _ (_) | / _ \| '_ ` _ \| '_ \| |/ _ \ \/ / / _` |/ _` | __/ _ \
| | | | (_) | (_| | |_| | | __/_| |__| (_) | | | | | | |_) | | __/> < | (_| | (_| | || __/
|_| |_|\___/ \__,_|\__,_|_|\___(_)\____\___/|_| |_| |_| .__/|_|\___/_/\_\ \__,_|\__,_|\__\___|
|_|
This module is intended for creation of complex date phrases in variety of languages.
Once deployed, please do not modify this code without applying the changes first at Module:Complex date/sandbox and testing
at Module:Complex date/sandbox/testcases.
Authors and maintainers:
* User:Sn1per - first draft of the original version
* User:Jarekt - corrections and expansion of the original version
]]
-- List of external modules and functions
local p = {Error = nil}
local i18n = require('Module:i18n/complex date') -- used for translations of date related phrases
local ISOdate = require('Module:ISOdate')._ISOdate -- used for parsing dates in YYYY-MM-DD and related formats
local Calendar -- loaded lazily
-- ==================================================
-- === Internal functions ===========================
-- ==================================================
local function langSwitch(list,lang)
local langList = mw.language.getFallbacksFor(lang)
table.insert(langList,1,lang)
table.insert(langList,math.max(#langList,2),'default')
for i,language in ipairs(langList) do
if list[language] then
return list[language]
end
end
end
-- ==================================================
local function formatnum1(numStr, lang)
-- mostly require('Module:Formatnum').formatNum function used to translate a number to use different numeral characters,
-- except that it it does not call that function unless the language is on the list "LList"
local LList = {bn=1,bpy=1,kn=1,hi=1,mr=1,new=1,pa=1,gu=1,fa=1,glk=1,mzn=1,ur=1,ar=1,ckb=1,ks=1,lo=1,['or']=1,bo=1,['ml-old']=1,mn=1,te=1,th=1}
if LList[lang] then -- call only when the language is on the list
numStr = require('Module:Formatnum').formatNum(numStr, lang, 1)
end
return numStr
end
-- ==================================================
local function getISODate(datestr, datetype, lang, num, case)
-- translate dates in the format YYYY, YYYY-MM, and YYYY-MM-DD
if not case and i18n.Translations[datetype] then
-- look up the grammatical case needed and call ISOdate module
local rec = langSwitch(i18n.Translations[datetype], lang)
if type(rec)=='table' then
case = rec.case[num]
end
end
return ISOdate(datestr, lang, case, '', 1)
end
-- =======================================================================
local function translatePhrase(date1, date2, operation, lang, state)
-- use tables in Module:i18n/complex date to translate a phrase
if not i18n.Translations[operation] then
p.Error = string.format('<span style="background-color:red;">Error in [[Module:Complex date]]: input parameter "%s" is not recognized.</span>', operation or 'nil')
return ''
end
local dateStr = langSwitch(i18n.Translations[operation], lang)
if type(dateStr)=='table' then
dateStr = dateStr[1]
end
if type(dateStr)=='function' then
local dateFunc = dateStr
local nDates = i18n.Translations[operation]['nDates']
if nDates==2 then -- 2 date phrase
dateStr = dateFunc(date1, date2, state)
else -- 1 date phrase
dateStr = dateFunc(date1, state)
end
end
if type(dateStr)=='string' then
-- replace parts of the string '$date1' and '$date2' with date1 and date2 strings
dateStr = mw.ustring.gsub(dateStr, '$date1', date1)
dateStr = mw.ustring.gsub(dateStr, '$date2', date2)
else
-- Special case of more complex phrases that can be build out of simple phrases
-- If complex case is not translated to "lang" than build it out of simpler ones
local x = dateStr
dateStr = p._complex_date(x.conj, x.adj1, date1, x.units1, x.era1, x.adj2, date2, x.units2, x.era2, lang, 2)
end
return dateStr
end
-- =======================================================================
local function oneDatePhrase(dateStr, adj, era, units, lang, num, case, state)
-- translate a single date phrase
if num==2 then
state.adj, state.era, state.units, state.precision = state.adj2, state.era2, state.units2, state.precision2
end
-- dateStr can have many forms: ISO date, year or a number for
-- decade, century or millennium
if units == '' then -- unit is "year", "month", "day"
dateStr = getISODate(dateStr, adj, lang, num, case)
else -- units is "decade", "century", "millennium''
dateStr = translatePhrase(dateStr, '', units, lang, state)
end
-- add adjective ("early", "mid", etc.) or preposition ("before", "after",
-- "circa", etc.) to the date
if adj ~= '' then
dateStr = translatePhrase(dateStr, '', adj, lang, state)
else -- only era?
dateStr = formatnum1(dateStr, lang)
end
-- add era
if era ~= '' then
dateStr = translatePhrase(dateStr, '', era, lang, state)
end
return dateStr
end
-- =======================================================================
local function twoDatePhrase(date1, date2, state, lang)
-- translate a double date phrase
local dateStr, case
local era=''
if state.era1 == state.era2 then
-- if both eras are the same than add it only once
era = state.era1
state.era1 = ''
state.era2 = ''
end
case = {nil, nil}
if i18n.Translations[state.conj] then
local rec = langSwitch(i18n.Translations[state.conj], lang)
if type(rec)=='table' then
case = rec.case
end
end
date1 = oneDatePhrase(date1, state.adj1, state.era1, state.units1, lang, 1, case[1], state)
date2 = oneDatePhrase(date2, state.adj2, state.era2, state.units2, lang, 2, case[2], state)
dateStr = translatePhrase(date1, date2, state.conj, lang, state)
if era ~= '' then
dateStr = translatePhrase(dateStr, '', era, lang, state)
end
return dateStr
end
-- =======================================================================
local function otherPhrases(date1, date2, operation, era, lang, state)
-- translate specialized phrases
local dateStr = ''
if operation == 'islamic' then
if date2=='' then date2 = mw.getCurrentFrame():callParserFunction('#time', 'xmY', date1) end
date1 = getISODate(date1, operation, lang, 1, nil)
date2 = getISODate(date2, operation, lang, 2, nil)
if era == '' then era = 'ad' end
dateStr = translatePhrase(date1, '', era, lang, state) .. ' (' .. translatePhrase(date2, '', 'ah', lang, state) .. ')'
era = ''
elseif operation == 'julian' then
if not date2 and date1 then -- Convert from Julian to Gregorian calendar date
if Calendar == nil then
Calendar = require("Module:Calendar") -- lazy loding (only if needed)
end
local JDN = Calendar._date2jdn(date1, 0)
if JDN then
date2 = date1 -- first date is assumed to be Julian
date1 = Calendar._jdn2date(JDN, 1)
end
end
date1 = getISODate(date1, operation, lang, 1, nil)
date2 = getISODate(date2, operation, lang, 2, nil)
dateStr = translatePhrase(date1, date2, operation, lang, state)
dateStr = mw.ustring.gsub(mw.ustring.gsub(dateStr, '%( ', '('), ' %)', ')') -- in case date2 is empty
elseif operation == 'turn of the year' or operation == 'turn of the decade' or operation == 'turn of the century' then
local dt = 1
if operation == 'turn of the decade' then dt=10 end
if not date2 or date2=='' then date2=tostring(tonumber(date1)-dt) end
if era~='bp' and era~='bc' then date1, date2 = date2, date1 end
if operation == 'turn of the year' then
date1 = ISOdate(date1, lang, '', '', 1)
date2 = ISOdate(date2, lang, '', '', 1)
else
date1 = formatnum1(date1, lang)
date2 = formatnum1(date2, lang)
end
dateStr = translatePhrase(date1, date2, operation, lang, state)
elseif operation == 'year unknown' then
dateStr = translatePhrase('', '', operation, lang, state) .. '<div style="display: none;">Unknown date</div>'
elseif operation == 'unknown' then
dateStr = tostring(mw.message.new( "exif-unknowndate" ):inLanguage( lang )) .. '<div style="display: none;">Unknown date</div>'
end
-- add era
if era ~= '' then
dateStr = translatePhrase(dateStr, '', era, lang, state)
end
return dateStr
end
-- =======================================================================
local function checkAliases(str1, str2, sType)
-- some inputs have many aliases - reconcile them and ensure string is playing a proper role
local out = ''
if str1 and str1~='' then
local a = i18n.Synonyms[str1] -- look up synonyms of "str1"
if a then
out = a[1]
else
p.Error = string.format('<span style="background-color:red;">Error in [[Module:Complex date]]: %s is not recognized.</span>', str1)
end
elseif str2 and str2~='' then -- if "str1" of type "sType" is empty than maybe ...
local a = i18n.Synonyms[str2] -- ..."str2" is of the same type and is not empty
if a and a[2]==sType then
out = a[1]
str2 = ''
end
end
return out, str2
end
-- =======================================================================
local function datePrecision(dateStr, units)
-- "in this module "Units" is a string like millennium, century, or decade
-- "precision" is wikibase compatible date precision number: 6=millennium, 7=century, 8=decade, 9=year, 10=month, 11=day
-- based on string or numeric input calculate "Units" and "precision"
local precision
if type(units)=='number' then
precision = units
if precision>11 then precision=11 end -- clip the range of precision values
if precision==6 then units='millennium'
elseif precision==7 then units='century'
elseif precision==8 then units='decade'
else units = ''
end
elseif type(units)=='string' then
units = string.lower(units)
if units=='millennium' then precision=6
elseif units=='century' then precision=7
elseif units=='decade' then precision=8
else precision=9
end
end
if units=='' or precision==9 then
local sLen = mw.ustring.len(dateStr)
if sLen<= 4 then precision=9
elseif sLen== 7 then precision=10
elseif sLen>=10 then precision=11
end
units=''
end
if precision==6 and dateStr.match( dateStr, '%d000' )~=nil then
dateStr = tostring(math.floor(tonumber(dateStr)/1000) +1)
elseif precision==7 and mw.ustring.match( dateStr, '%d%d00' )~=nil then
dateStr = tostring(math.floor(tonumber(dateStr)/100) +1)
end
return dateStr, units, precision
end
-- =======================================================================
local function isodate2timestamp(dateStr, precision, era)
-- convert date string to timestamps used by Quick Statements
local tStamp = nil
if era == 'ah' or precision<6 then
return nil
elseif era ~= '' then
local eraLUT = {ad='+', bc='-', bp='-' }
era = eraLUT[era]
else
era='+'
end
-- convert isodate to timestamp used by quick statements
if precision>=9 then
if string.match(dateStr,"^%d%d%d%d$") then -- if YYYY format
tStamp = era .. dateStr .. '-00-00T00:00:00Z/9'
elseif string.match(dateStr,"^%d%d%d%d%-%d%d$") then -- if YYYY-MM format
tStamp = era .. dateStr .. '-00T00:00:00Z/10'
elseif string.match(dateStr,"^%d%d%d%d%-%d%d%-%d%d$") then -- if YYYY-MM-DD format
tStamp = era .. dateStr .. 'T00:00:00Z/11'
end
elseif precision==8 then -- decade
tStamp = era .. dateStr .. '-00-00T00:00:00Z/8'
elseif precision==7 then -- century
local d = tostring(tonumber(dateStr)-1)
tStamp = era .. d .. '50-00-00T00:00:00Z/7'
elseif precision==6 then
local d = tostring(tonumber(dateStr)-1)
tStamp = era .. d .. '500-00-00T00:00:00Z/6'
end
return tStamp
end
-- =======================================================================
local function oneDateQScode(dateStr, adj, era, precision)
-- create QuickStatements string for "one date" dates
local outputStr = ''
local d = isodate2timestamp(dateStr, precision, era)
if not d then
return ''
end
local rLUT = { early='Q40719727' , mid='Q40719748', late='Q40719766',
['1quarter']='Q40690303' , ['2quarter']='Q40719649' , ['3quarter']='Q40719662', ['4quarter']='Q40719674',
spring='Q40720559' , summer='Q40720564' , autumn='Q40720568' , winter='Q40720553',
firsthalf='Q40719687', secondhalf='Q40719707' }
local qLUT = {['from']='P580', ['until']='P582', ['after']='P1319', ['before']='P1326', ['by']='P1326'}
local refine = rLUT[adj]
local qualitier = qLUT[adj]
if adj=='' then
outputStr = d
elseif adj=='circa' then
outputStr = d..",P1480,Q5727902"
elseif refine then
outputStr = d..",P4241,"..refine
elseif precision>7 and qualitier then
local century = string.gsub(d, 'Z%/%d+', 'Z/7')
outputStr = century ..",".. qualitier ..","..d
end
return outputStr
end
-- =======================================================================
local function twoDateQScode(date1, date2, state)
-- create QuickStatements string for "two date" dates
if state.adj1~='' or state.adj2~='' or state.era1~=state.era2 then
return '' -- QuickStatements string are not generated for two date phrases with adjectives
end
local outputStr = ''
local d1 = isodate2timestamp(date1, state.precision1, state.era1)
local d2 = isodate2timestamp(date2, state.precision2, state.era2)
if (not d1) or (not d2) then
return ''
end
-- find date with lower precision in common to both dates
local cd
local year1 = tonumber(string.sub(d1,2,5))
local year2 = tonumber(string.sub(d2,2,5))
local k = 0
for i = 1,10,1 do
if string.sub(d1,1,i)==string.sub(d2,1,i) then
k = i -- find last matching letter
end
end
if k>=9 then -- same month, since "+YYYY-MM-" is in common
cd = isodate2timestamp(string.sub(d1,2,8), 10, state.era1)
elseif k>=6 and k<9 then -- same year, since "+YYYY-" is in common
cd = isodate2timestamp(tostring(year1), 9, state.era1)
elseif k==4 then -- same decade(k=4, precision=8), since "+YYY" is in common
cd = isodate2timestamp(tostring(year1), 8, state.era1)
elseif k==3 then -- same century(k=3, precision=7) since "+YY" is in common
local d = tostring(math.floor(year1/100) +1) -- convert 1999 -> 20
cd = isodate2timestamp( d, 7, state.era1)
elseif k==2 then -- same millennium (k=2, precision=6), since "+Y" is in common
local d = tostring(math.floor(year1/1000) +1) -- convert 1999 -> 2
cd = isodate2timestamp( d, 6, state.era1)
end
if not cd then
return ''
end
--if not cd then
-- return ' <br/>error: ' .. d1.." / " .. d2.." / ".. (cd or '') .." / ".. string.sub(d1,2,5).." / " .. string.sub(d2,2,5).." / " .. tostring(k)
--end
--
if (state.conj=='from-until') or (state.conj=='and' and year1==year2-1) then
outputStr = cd ..",P580,".. d1 ..",P582,".. d2
elseif (state.conj=='between') or (state.conj=='or' and year1==year2-1) then
outputStr = cd ..",P1319,".. d1 ..",P1326,".. d2
elseif state.conj=='circa2' then
outputStr = cd ..",P1319,".. d1 ..",P1326,".. d2 ..",P1480,Q5727902"
end
return outputStr
end
-- =======================================================================
local function processInputParams(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, passNr)
-- process inputs and save date in state array
local state = {}
state.conj = string.lower(conj or '')
state.adj1 = string.lower(adj1 or '')
state.adj2 = string.lower(adj2 or '')
state.era1 = string.lower(era1 or '')
state.era2 = string.lower(era2 or '')
state.units1 = string.lower(units1 or '')
state.units2 = string.lower(units2 or '')
-- if date 1 is missing but date 2 is provided than swap them
if date1 == '' and date2 ~= '' then
date1 = date2
date2 = ''
state = {adj1 = state.adj2, era1 = state.era2, units1 = state.units2,
adj2 = '', era2 = '', units2 = '', conj=state.conj, num=1}
end
if date2 ~= '' then state.nDates = 2
elseif date1 ~= '' then state.nDates = 1
else state.nDates = 0
end
-- reconcile alternative names for text inputs
local conj = checkAliases(state.conj ,'' ,'j')
state.adj1 ,conj = checkAliases(state.adj1 ,conj,'a')
state.units1,conj = checkAliases(state.units1,conj,'p')
state.era1 ,conj = checkAliases(state.era1 ,conj,'e')
state.special,conj = checkAliases('',conj,'c')
state.adj2 = checkAliases(state.adj2 ,'','a')
state.units2 = checkAliases(state.units2,'','p')
state.era2 = checkAliases(state.era2 ,'','e')
state.conj = conj
state.lang = lang
if p.Error~=nil then
return nil
end
-- calculate date precision value
date1, state.units1, state.precision1 = datePrecision(date1, state.units1)
date2, state.units2, state.precision2 = datePrecision(date2, state.units2)
-- Handle special cases
-- Some complex phrases can be created out of simpler ones. Therefore on pass # 1 we try to create
-- the phrase using complex phrase and if that is not found than on the second pass we try to build
-- the phrase out of the simpler ones
if passNr==1 then
if state.adj1=='circa' and state.nDates == 2 then
state.conj = 'circa2'
state.adj1 = ''
state.adj2 = ''
end
if state.nDates == 2 and state.adj1=='late' and state.adj2=='early' and state.conj=='and'
and state.units1==state.units2 and state.era1==state.era2 then
if state.units1=='century' then
state.conj='turn of the century'
elseif state.units1=='decade' then
state.conj='turn of the decade'
elseif state.units1=='' then
state.conj='turn of the year'
end
state.adj1 = ''
state.adj2 = ''
state.units1 = ''
state.units2 = ''
end
end
state.adj, state.era, state.units, state.precision = state.adj1, state.era1, state.units1, state.precision1
return date1, date2, state
end
-- ==================================================
-- === External functions ===========================
-- ==================================================
function p.Era(frame)
-- process inputs
local dateStr
local args = frame.args
if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then
args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
local lang = args['lang']
local dateStr = args['date'] or ''
local eraType = string.lower(args['era'] or '')
dateStr = ISOdate(dateStr, lang, '', '', 1)
if eraType then
eraType = checkAliases(eraType ,'','e')
dateStr = translatePhrase(dateStr, '', eraType, lang, {})
end
return dateStr
end
-- =======================================================================
function p._complex_date(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, passNr)
local Output=''
local state
-- process inputs and save date in state array
date1, date2, state = processInputParams(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, passNr)
if p.Error~=nil then
return nil
end
local errorStr = string.format(
'\n*conj=%s, adj1=%s, era1=%s, unit1=%s, prec1=%i, adj2=%s, era2=%s, unit2=%s, prec2=%i, special=%s',
state.conj, state.adj1, state.era1, state.units1, state.precision1,
state.adj2, state.era2, state.units2, state.precision2, state.special)
-- call specialized functions
local QScode = ''
if state.special~='' then
Output = otherPhrases(date1, date2, state.special, state.era1, lang, state)
elseif state.conj~='' then
QScode = twoDateQScode(date1, date2, state)
Output = twoDatePhrase(date1, date2, state, lang)
elseif state.adj1~='' or state.era1~='' or state.units1~='' then
Output = oneDatePhrase(date1, state.adj1, state.era1, state.units1, lang, 1, nil, state)
QScode = oneDateQScode(date1, state.adj1, state.era1, state.precision1)
elseif date1~='' then
Output = ISOdate(date1, lang, '', 'dtstart', '100-999')
end
if p.Error~=nil then
return errorStr
end
-- if there is any wikicode in the string than execute it
if mw.ustring.find(Output, '{') then
Output = mw.getCurrentFrame():preprocess(Output)
end
if QScode and #QScode>0 then
QScode = ' <div style="display: none;">date QS:P,' .. QScode .. '</div>'
end
return Output .. QScode
end
-- =======================================================================
function p._complex_date_cer(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, certainty, lang)
-- same as p._complex_date but with extra parameter for certainty: probably, possibly, presumably, etc.
local dateStr = p._complex_date(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, 1)
certainty = checkAliases(certainty, conj, 'r')
local LUT = {probably='Q56644435', presumably='Q18122778', possibly='Q30230067', circa='Q5727902' }
if certainty and LUT[certainty] then
local state = {}
date1, date2, state = processInputParams(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, lang, 1)
dateStr = translatePhrase(dateStr, '', certainty, lang, state)
dateStr = string.gsub(dateStr, '(%<div style="display: none;"%>date QS:P,[^%<]+)(%</div%>)', '%1,P1480,' .. LUT[certainty] .. '%2' )
end
return dateStr
end
-- =======================================================================
function p.complex_date(frame)
-- process inputs
local dateStr
local args = frame.args
if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then
args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
local date1 = args['date1'] or args['2'] or args['date'] or ''
local date2 = args['date2'] or args['3'] or ''
local conj = args['conj'] or args['1'] or ''
local adj1 = args['adj1'] or args['adj'] or ''
local adj2 = args['adj2'] or ''
local units1 = args['precision1'] or args['precision'] or ''
local units2 = args['precision2'] or args['precision'] or ''
local era1 = args['era1'] or args['era'] or ''
local era2 = args['era2'] or args['era'] or ''
local certainty = args['certainty']
local lang = args['lang']
dateStr = p._complex_date_cer(conj, adj1, date1, units1, era1, adj2, date2, units2, era2, certainty, lang)
if p.Error~=nil then
dateStr = p.Error .. '[[Category:Pages using Complex date template with incorrect parameter]]'
end
return dateStr
end
return p
ppv1t08ydt8a9x36u2iltdsomq7mcr5
اترپردیش مجلس قانون ساز دے انتخابات، 2022ء
0
113044
691023
690699
2025-07-11T04:47:17Z
CommonsDelinker
60
Removing [[:c:File:Rashtriya_Lok_Dal_Flag_new.jpg|Rashtriya_Lok_Dal_Flag_new.jpg]], it has been deleted from Commons by [[:c:User:Krd|Krd]] because: No license since 3 July 2025.
691023
wikitext
text/x-wiki
{{اُردو}}{{Infobox election
| election_name = اترپردیش مجلس قانون ساز دے انتخابات، 2022ء
| country = بھارت
| type = قانون ساز
| ongoing = نئيں
| previous_election = اترپردیش مجلس قانون ساز دے انتخابات، 2017ء
| previous_year = 2017
| election_date = 10 فروری – 7 مارچ 2022
| next_election = اترپردیش مجلس قانون ساز دے انتخابات، 2027ء
| next_year = 2027
| seats_for_election = [[اتر پردیش مجلس قانون ساز]] دی تمام 403 نشستاں
| majority_seats = 202
| image1 = [[File:The Uttar Pradesh Chief Minister, Shri Yogi Adityanath in New Delhi on February 10, 2018 (cropped).jpg|120x120px]]
| leader1 = [[یوگی آدتیہ ناتھ]]
| party1 = بھارتیہ جنتا پارٹی
| alliance1 = [[قومی جمہوری اتحاد (بھارت)|این ڈی اے]]
| leader_since1 = 2017
| leaders_seat1 = گورکھپور
| last_election1 = 325 نشستاں<br />41.35% ووٹ
| title = [[اتر پردیش دے وزرائے اعلیٰ دی لسٹ|وزیر اعلیٰ]]
| before_election = یوگی آدتیہ ناتھ
| before_party = بھارتیہ جنتا پارٹی
| after_election = یوگی آدتیہ ناتھ
| after_party = بھارتیہ جنتا پارٹی
| image2 = [[File:Akhilesh Yadav (14335961811).jpg|120x120px]]
| leader2 = [[اکھلیش یادو]]
| leader_since2 = 2012
| party2 = سماج وادی پارٹی
| alliance2 = [[سماج وادی پارٹی|ایس پی+]]
| leaders_seat2 = کرہل
| last_election2 = 54 نشستاں<br />28.07% ووٹ
| image3 =
| leader3 = [[پرینکا گاندھی]]
| party3 = انڈین نیشنل کانگریس
| alliance3 = -
| leader_since3 = 2019
| leaders_seat3 = ''کوئی مقابل نئيں''
| last_election3 = 7 نشستاں <br /> 6.25% ووٹ
| image4 = [[File:Mayawati.jpg|120x120px]]
| leader4 = [[مایاوندی]]
| party4 = بہوجن سماج پارٹی
| alliance4 = -
| leader_since4 = 1995
| leaders_seat4 = ''کوئی مقابل نئيں''
| last_election4 = 19 نشستاں<br />22.23% ووٹ
| image5 =
| leader5 = [[رگھوراج پرتاپ سنگھ]]
| party5 = [[جن ستا دل (لوک تانترک)]]
| alliance5 = -
| leader_since5 = 2018
| leaders_seat5 = کنڈا
| last_election5 = نیا
| map_image = [[File:2022 Uttar Pradesh Election.svg|400px]]
| map_alt = Map of constituencies of the Uttar Pradesh Legislative Assembly
| map_caption = اتر پردیش مجلس قانون ساز دے حلقے
| seats1 = '''273'''<ref>{{cite web |date=2022-03-10|title=UP Election Result by ECI |url= https://results.eci.gov.in/ResultAcGenMar2022/partywiseresult-S24.htm?st=S24| access-date=2022-03-10 |website=ECI |language=en}}</ref>
| seat_change1 = {{decrease}} 52
| seats2 = 125
| seat_change2 = {{increase}} 71
| seats3 = 2
| seat_change3 = {{decrease}} 5
| seats4 = 1
| seat_change4 = {{decrease}} 18
| seats5 = 2
| seat_change5 = {{increase}} 2
| percentage1 = '''43.82%'''
| swing1 = {{increase}} 2.47%
| percentage2 = 36.32%
| swing2 = {{increase}} 8.25%
| percentage3 = 2.33%
| swing3 = {{decrease}} 3.92%
| percentage4 = 12.88%
| swing4 = {{decrease}} 9.35%
| percentage5 = 0.21%<ref>{{cite web |date=2022-03-10|title=UP Election Result by ECI |url= https://results.eci.gov.in/ResultAcGenMar2022/partywiseresult-S24.htm?st=S24| access-date=2022-03-10 |website=ECI |language=en}}</ref>
| swing5 = {{increase}} 0.21%
| popular_vote1 = '''40,385,487'''
| popular_vote2 = 33,471,407
| popular_vote3 = 2,151,234
| popular_vote4 = 11,873,137
| popular_vote5 = 191,874
| turnout = 60.8% ({{decrease}} 0.31%) <ref>{{cite web |date=2022-03-10|title= Assembly polls: Turnout of women exceeds male voters’ in UP this year |url=https://timesofindia.indiatimes.com/india/assembly-polls-turnout-of-women-exceeds-male-voters-in-up-this-year/articleshow/90111868.cms | access-date=2022-03-10 |website=Times of India |language=en}}</ref>
}}
'''اترپردیش مجلس قانون ساز دے انتخابات، 2022ء''' 10 فروری توں 7 مارچ 2022 تک [[اتر پردیش]] وچ [[اتر پردیش مجلس قانون ساز]] دے تمام 403 اراکین نوں منتخب کرنے دے لئی ست مرحلےآں وچ منعقد ہوئے۔ 10 مارچ 2022 نوں ووٹاں دی گنتی ہوئی تے نتائج دا اعلان کيتا گیا۔
== پس منظر ==
[[اتر پردیش مجلس قانون ساز]] دی میعاد 14 مئی 2022ء نوں ختم ہونے والی اے۔<ref name=":1">c</ref> [[اتر پردیش مجلس قانون ساز دے انتخابات، 2017ء|پچھلے اسمبلی انتخابات]] فروری توں مارچ 2017 وچ منعقد ہوئے سن ۔ انتخابات دے بعد، [[بھارتیہ جنتا پارٹی]] نے [[حکومت اتر پردیش|ریاستی حکومت]] قائم کيتی، [[یوگی آدتیہ ناتھ]] [[اتر پردیش دے وزرائے اعلیٰ دی لسٹ|وزیر اعلیٰ]] بنے۔<ref>{{cite web |date=2017-03-19 |editor-last=Chakraborty |editor-first=Ananya |others=PTI |title=Yogi Adityanath Takes Oath as Uttar Pradesh Chief Minister |url=https://www.news18.com/news/politics/yogi-adityanath-takes-oath-as-uttar-pradesh-chief-minister-1361750.html |access-date=2022-01-08 |website=News18 |language=en}}</ref>
=== پنچايتی انتخابات ===
2021 دے اتر پردیش پنچایت انتخابات وچ ، [[سماج وادی پارٹی|ایس پی]] نے 760 وارڈ جِت لئی، اس دے بعد [[بی جے پی]] نے 719 وارڈاں دے نال کامیابی حاصل کيتی۔ [[بہوجن سماج پارٹی]] نے 381 تے [[انڈین نیشنل کانگریس]] نے 76 وارڈ جتے۔ آزاد تے چھوٹی جماعتاں نے 1,114 وارڈاں وچ کامیابی حاصل کيتی۔<ref name="UP panchayat elections HT">{{cite news |last=Singh |first=Rajesh Kumar |date=5 مئی 2021 |title=Setback for BJP in key areas in UP panchayat elections |language=en |work=Hindustan Times |url=https://www.hindustantimes.com/india-news/spmakes-gains-bjp-jolted-in-up-panchayat-polls-101620154099505.html |access-date=12 فروری 2022}}</ref> پنچايتی انتخابات وچ [[عام آدمی پارٹی|اے اے پی]] نے 64 تے [[کل ہند مجلس اتحاد المسلمین|اے آئی ایم آئی ایم]] نے 22 وارڈ جتے۔<ref>{{cite news |title=UP Panchayat Elections: AAP Wins One Seat Each in Varanasi, Gorakhpur; AIMIM Raises its Graph |url=https://www.news18.com/news/politics/up-panchayat-elections-aap-wins-one-seat-each-in-varanasi-gorakhpur-while-aimim-raises-its-graph-3712574.html |access-date=10 فروری 2022 |work=News18 |date=6 مئی 2021 |language=en}}</ref>
=== سیاسی پیش رفت ===
جنوری 2022 وچ ، دس [[بھارتیہ جنتا پارٹی|بی جے پی]] ریاستی قانون ساز بشمول تن وزراء، پارٹی چھڈ کے [[سماج وادی پارٹی]] وچ شامل ہوئے۔<ref>{{Cite news |last=Biswas |first=Soutik |date=2022-01-14 |title=Uttar Pradesh elections: Is a rebellion brewing in Modi's BJP? |language=en-GB |work=BBC News |url=https://www.bbc.com/news/world-asia-india-59979808 |access-date=2022-01-15}}</ref> 19 جنوری ناں، [[ملائم سنگھ یادو]] دی بہو اپارنا بشت یادو نے بی جے پی وچ شمولیت اختیار کيتی۔<ref>{{Cite news |last=Mathew |first=Liz |date=2022-01-19 |title=Uttar Pradesh elections: Aparna Yadav joins BJP. |language=en-GB |work=The Indian Express |url=https://indianexpress.com/elections/aparna-yadav-sp-bjp-mulayam-singh-daughter-in-law-up-7731161/lite/ |access-date=2022-02-02}}</ref> انہاں دے بعد ملائم سنگھ دے بہنوئی پرمود گپتا نے 20 جنوری نوں بی جے پی وچ شمولیت اختیار کيتی۔<ref>{{Cite news|date=2022-01-20|title=Uttar Pradesh elections: Pramod Gupta joins BJP.|language=en-GB|work=The Times of India|url=https://m.timesofindia.com/city/lucknow/up-elections-2022-samajwadi-party-patriarch-mulayam-singh-yadavs-brother-in-law-pramod-gupta-joins-bjp/amp_articleshow/89012860.cms|access-date=2022-02-02}}</ref> 25 جنوری نوں سابق مرکزی وزیر تے کانگریس لیڈر [[رتن جِت پرتاپ نارائن سنگھ]] نے بی جے پی وچ شمولیت اختیار کيتی۔<ref>{{Cite news |last=Hebbar |first=Nistula |date=2022-01-25 |title=R.P.N. Singh joins BJP, party says boost to prospects in eastern U.P. |language=en-IN |work=The Hindu |url=https://www.thehindu.com/elections/uttar-pradesh-assembly/rpn-singh-resigns-from-congress-all-set-to-join-bjp/article38323169.ece |access-date=2022-03-03 |issn=0971-751X}}</ref>
== نظام الاوقات ==
انتخابی نظام الاوقات دا اعلان [[بھارتی الیکشن کمیشن]] نے 8 جنوری 2022ء نوں کيتا سی۔<ref>{{cite web |last=Gupta |first=Shubhangi |date=2022-01-08 |title=Assembly elections 2022: Check complete schedule for Uttar Pradesh, Uttarakhand, Goa, Manipur & Punjab |url=https://www.hindustantimes.com/elections/assembly-election-2022-date-check-complete-polling-schedule-for-uttar-pradesh-uttarakhand-goa-manipur-punjab-101641639532618.html |access-date=2022-01-08 |website=Hindustan Times |language=en}}</ref>
[[File:UP phase wise election schedule 2022.svg|انتخابی حلفےآں دا نقشہ تے انہاں دے مراحل|300px|thumb|مرکز]]
{| class="wikitable"
|-
! rowspan="3" | پول ایونٹ
! colspan="7" | مرحلہ
|-
!I
!II
!III
!IV
!V
!VI
!VII
|-
| style="background:#810081;"|
| style="background:#0000fe;"|
| style="background:#0ff;"|
| style="background:#00ff01;"|
| style="background:#ff0;"|
| style="background:#f60;"|
| style="background:#fe0000;"|
|-
! اطلاع دی تریخ
|14 جنوری 2022
|21 جنوری 2022
|25 جنوری 2022
|27 جنوری 2022
|1 فروری 2022
|4 فروری 2022
|10 فروری 2022
|-
! کاغذات نامزدگی داخل کرنے دی آخری تریخ
|21 جنوری 2022
|28 جنوری 2022
|1 فروری 2022
|3 فروری 2022
|8 فروری 2022
|11 فروری 2022
|17 فروری 2022
|-
! نامزدگی دی جانچ پڑتال
|24 جنوری 2022
|29 جنوری 2022
|2 فروری 2022
|4 فروری 2022
|9 فروری 2022
|14 فروری 2022
|18 فروری 2022
|-
! کاغذات نامزدگی واپس لینے دی آخری تریخ
|27 جنوری 2022
|31 جنوری 2022
|4 فروری 2022
|7 فروری 2022
|11 فروری 2022
|16 فروری 2022
|22 فروری 2022
|-
! رائے شماری دی تریخ
|10 فروری 2022
|14 فروری 2022
|20 فروری 2022
|23 فروری 2022
|27 فروری 2022
|3 مارچ 2022
|7 مارچ 2022
|-
!ووٹاں دی گنتی دی تریخ
| colspan="7" style="text-align:center" | '''10 مارچ 2022ء'''
|}
{| class="wikitable"
|-
! colspan="7" | مرحلہ
|-
!I
(58 اسمبلیاں، 11 ضلعے)
!II
(55 اسمبلیاں، 9 ضلعے)
!III
(59 اسمبلیاں، 16 ضلعے)
!IV
(59 اسمبلیاں، 9 ضلعے)
!V
(61 ااںسمبلیاں، 11 ضلعے)
!VI
(57 اسمبلیاں، 10 ضلعے)
!VII
(54 اسمبلیاں، 9 ضلعے)
|-
| style="background:#810081;"|
| style="background:#0000fe;"|
| style="background:#0ff;"|
| style="background:#00ff01;"|
| style="background:#ff0;"|
| style="background:#f60;"|
| style="background:#fe0000;"|
|- style="vertical-align: top;"
||
* [[ضلع شاملی|شاملی]]
* [[ضلع مظفرنگر|مظفر نگر]]
* [[ضلع میرٹھ|میرٹھ]]
* [[ضلع باغپت|باغپت]]
* [[غازی آباد، بھارت|غازی آباد]]
* [[ضلع ہاپڑ|ہاپوڑ]]
* [[ضلع گوتم بدھ نگر|گوتم بدھ نگر]]
* [[ضلع بلندشہر|بلند شہر]]
* [[ضلع علی گڑھ|علی گڑھ]]
* [[ضلع متھرا|متھرا]]
* [[ضلع آگرہ|آگرہ]]
||
* [[ضلع سہارنپور|سہارنپور]]
* [[ضلع بجنور|بجنور]]
* [[ضلع مرادآباد|مرادآباد]]
* [[ضلع سنبھل|سنبھل]]
* [[رام پور ضلع|رامپور]]
* [[ضلع امروہہ|امروہہ]]
* [[ضلع بدایاں|بدایاں]]
* [[ضلع بریلی|بریلی]]
* [[ضلع شاہجہان پور|شاہجہان پور]]
||
* [[ضلع ہتھ رس|ہاتھرس]]
* [[ضلع فیروز آباد|فیروز آباد]]
* [[ضلع کانسی رام نگر|کاسگنج]]
* [[ضلع ایٹہ|ایٹہ]]
* [[ضلع مین پوری|مین پوری]]
* [[ضلع فرخ آباد|فرخ آباد]]
* [[قنوج ضلع|قنوج]]
* [[ضلع اٹاوہ|اٹاوہ]]
* [[ضلع اوریا|اوریا]]
* [[ضلع کانپور دیہات|کانپور دیہات]]
* [[ضلع کانپور نگر|کانپور نگر]]
* [[ضلع جالون|جالون]]
* [[جھانسی ضلع|جھانسی]]
* [[للت پور ضلع، بھارت|للت پور]]
* [[ضلع حمیرپور، اترپردیش|حمیرپور]]
* [[مہوبا ضلع|مہوبا]]
||
* [[ضلع پیلی بھیت|پیلی بھیت]]
* [[لکھیم پور کھیری ضلع|لکھیم پور کھیری]]
* [[ضلع سیتاپور|سیتاپور]]
* [[ہردوئی ضلع|ہردوئی]]
* [[اناؤ ضلع|اناؤ]]
* [[ضلع لکھنؤ|لکھنؤ]]
* [[رائے بریلی ضلع|رائے بریلی]]
* [[ضلع باندہ|باندہ]]
* [[ضلع فتح پور|فتح پور]]
||
* [[ضلع امیتھی|امیٹھی]]
* [[ضلع سلطان پور|سلطان پور]]
* [[ضلع چترکوٹ|چترکوٹ]]
* [[ضلع پرتاپ گڑھ، اتر پردیش|پرتاپ گڑھ]]
* [[ضلع کوشامبی|کوشمبی]]
* [[ضلع الہ آباد|پریاگ راج]]
* [[ضلع بارہ بنکی|بارہ بنکی]]
* [[ضلع فیض آباد|ایودھیا]]
* [[ضلع بہرائچ|بہرائچ]]
* [[شراوستی ضلع|شراوستی]]
* [[ضلع گونڈہ|گونڈہ]]
||
* [[ضلع امبیڈکر نگر|امبیڈکر نگر]]
* [[ضلع بلرام پور|بلرامپور]]
* [[ضلع سدھارتھ نگر|سدھارتھ نگر]]
* [[ضلع بستی|بستی]]
* [[ضلع سنت کبیر نگر|سنت کبیر نگر]]
* [[مہاراج گنج ضلع|مہاراج گنج]]
* [[ضلع گورکھپور|گورکھپور]]
* [[کشی نگر ضلع|کشی نگر]]
* [[ضلع دیوریا|دیوریا]]
* [[ضلع بلیا|بلیا]]
||
* [[ضلع اعظم گڑھ|اعظم گڑھ]]
* [[ضلع مئو|مئو]]
* [[ضلع غازی پور|غازی پور]]
* [[ضلع جونپور|جونپور]]
* [[ضلع چندولی|چنڈولی]]
* [[ضلع وارانسی|ورانسی]]
* [[ضلع سنت رویداس نگر|بھداوہی]]
* [[ضلع مرزاپور|مرزا پور]]
* [[سون بھدرا ضلع|سون بھدرا]]
|}
== پارٹیاں تے اتحاد ==
=== {{legend2|{{party color|National Democratic Alliance}}|[[قومی جمہوری اتحاد (بھارت)|قومی جمہوری اتحاد]]}} ===
ستمبر دے مہینے دے دوران؛ این ڈی اے نے بی جے پی، اے ڈی (ایس) تے [[نشاد پارٹی]] دے درمیان وچ اتحاد دی تصدیق کيتی۔<ref>{{cite web|title=Our aim is to ensure NDA's victory in UP election, says Sanjay Nishad|url=https://www.aninews.in/news/national/general-news/our-aim-is-to-ensure-ndas-victory-in-up-election-says-sanjay-nishad20210928095903/|access-date=2021-12-05|website=ANI News|language=en}}</ref><ref>{{cite web|title=NDA alliance takes shape in Uttar Pradesh; BJP, Nishad party and Apna Dal to contest upcoming Assembly polls|url=https://www.tribuneindia.com/news/nation/uttar-pradesh-nda-alliance-takes-shape-bjp-nishad-party-and-apna-dal-to-contest-the-upcoming-assembly-elections-315639|access-date=2021-12-05|website=Tribuneindia News Service|language=en}}</ref> اگست دے مہینے دے دوران، این ڈی اے نے [[جنتا دل (متحدہ)|جے ڈی (یو)]]، [[ہندوستانی عوام مورچا|ایچ اے ایم]]<ref>{{cite web|date=نومبر 16, 2021|first=Himanshu|last=Mishra|title=JD(U) likely to contest Uttar Pradesh election in alliance with BJP in 2022|url=https://www.indiatoday.in/india/story/jdu-likely-contest-uttar-pradesh-election-alliance-bjp-2022-1877097-2021-11-16|access-date=2021-12-05|website=India Today|language=en}}</ref> تے ہور انہاں ورگی جماعتاں دے نال گل گل کیتی، اُتے سیٹاں دی تقسیم دی گل گل بعد وچ ٹُٹ گئی۔ اکتوبر وچ ، نويں چہراں دے نال اتحاد دی طرف توں وڈی تنظیم نو دیاں کوششاں ہوئیاں تے اقتدار مخالف توں لڑنے دی کوششاں وچ پارٹیاں دی اصلاح کيتی گئی۔ دسمبر دے پہلے 2 ہفتےآں وچ ، اتحاد نے انتخابی مہم دا آغاز کيتا۔ <ref>{{Cite news|title=UP Assembly election 2022 : Top BJP leaders to hold 6 rallies next week|work=The Economic Times|url=https://economictimes.indiatimes.com/news/elections/assembly-elections/uttar-pradesh/up-assembly-election-2022-top-bjp-leaders-to-hold-6-rallies-next-week/articleshow/88094554.cms|access-date=2021-12-05}}</ref> 13 جنوری نوں قومی جمہوری اتحاد نے اپنے سیٹاں دی تقسیم دے معاہدے اُتے مہر ثبت دی جس وچ نشاد پارٹی نوں 16 تے اپنا دل نوں 17 تے بی جے پی نوں باقی 370 سیٹاں اُتے مقابلہ کرنا پيا۔ نشاد پارٹی دے 6 امیدوار بی جے پی دے نشان اُتے لڑاں گے۔<ref>{{Cite web |title=Known for Its Meteoric Rise, Is UP's Nishad Party Set for Success This Time? |url=https://thewire.in/politics/known-for-its-meteoric-rise-can-ups-nishad-party-repeat-the-feat-this-time |access-date=2022-03-07 |website=The Wire}}</ref>
{| class="wikitable" style="width:50%;"
!نمبر.
! پارٹی<ref>{{cite web|last=|first=|date=2021-09-24|title=UP Election 2022: BJP announces alliance with Nishad Party, Apna Dal|url=https://www.indiatvnews.com/elections/news-up-election-2022-bjp-announces-alliance-with-nishad-party-apna-dal-736206|url-status=live|access-date=2021-09-24|website=www.indiatvnews.com|language=en}}</ref>
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
!سوانیاں امیدوار
|-
| style="text-align:center; background:{{party color|Bharatiya Janata Party}};color:white" ! |'''1.'''
| [[بھارتیہ جنتا پارٹی]]
| [[File:BJP flag.svg|50px]]
| rowspan="2" | [[File:Lotus flower symbol.svg|50px]]
| [[یوگی آدتیہ ناتھ]]
| [[File:The Uttar Pradesh Chief Minister, Shri Yogi Adityanath meeting the President, Shri Ram Nath Kovind, at Rashtrapati Bhavan, in New Delhi on February 10, 2018 (cropped).jpg|50px]]
|''370''
|''328''
|''42''
|-
| rowspan="2" style="text-align:center; background:{{party color|NISHAD Party}};color:white" |'''2.'''
| rowspan="2" |[[نشاد پارٹی]]
| rowspan="2" |[[File:No image available.svg|50x50px]]
|شراون نشاد
|[[File:Circle-icons-profile.svg|50x50px]]
|6
|5
|1
|-
| [[File:No image available.svg|50x50px]]
|سنجے نشاد
|[[File:Circle-icons-profile.svg|50x50px]]
|''10''
|''10''
|''0''
|-
| style="text-align:center; background:{{party color|Apna Dal (Sonelal)}};color:white" ! |'''3.'''
| [[اپنا دل (سونے لال)]]
| [[File:Apna dal Flag.svg|50x50px]]
|
| [[انو پریا پٹیل]]
|
|''17''
|''14''
|''3''
|-
! colspan="6" |کل
!403
!357
!46
|}
=== {{legend2|{{party color|Samajwadi Party}}|[[سماجوادی پارٹی|سماجوادی پارٹی+]]}} ===
آر ایل ڈی سب توں پہلے اتحاد وچ شامل ہويا سی۔ بعد وچ اکھلیش یادو نے اعلان کيتا کہ اوہ صرف علاقائی پارٹیاں دے نال شراکت داری دے لئی تیار نيں قومی پارٹیاں توں نئيں۔ این سی پی تے آر جے ڈی وی بعد وچ اتحاد وچ شامل ہوئے۔<ref>{{cite web|date=2021-07-27|title=NCP to tie up with SP for UP assembly polls|url=https://www.hindustantimes.com/cities/lucknow-news/ncp-to-tie-up-with-sp-for-up-assembly-polls-101627408459880.html|access-date=2021-12-04|website=Hindustan Times|language=en}}</ref> مختلف کئی چھوٹی پارٹیاں وی شامل ہوئیاں، جدوں کہ ایس بی ایس پی نے ایس پی اتحاد وچ شامل ہونے دے لئی اپنے اتحاد توں وکھ ہو گئے۔<ref>{{Cite news|title=SP-SBSP join hands, give slogan 'Khadeda Hobe' on lines of Mamata's 'Khela Hobe' battle cry|work=The Economic Times|url=https://economictimes.indiatimes.com/news/elections/assembly-elections/uttar-pradesh/sp-sbsp-join-hands-give-slogan-khadeda-hobe-on-lines-of-mamatas-khela-hobe-battle-cry/articleshow/87314480.cms?from=mdr|access-date=2021-12-04}}</ref> پہلی نشستاں دی تقسیم دی گل گل دے دوران، ایس پی نے آر ایل ڈی نوں 36 سیٹاں دینے اُتے اتفاق کيتا۔ ابتدائی طور پر، آر ایل ڈی نے 60 سیٹاں دا مطالبہ کيتا جدوں کہ ایس پی 30 تک دینے دے لئی تیار سی، بعد وچ دونے پارٹیاں نے 33 اُتے فائنل کيتا تے آر ایل ڈی زیادہ تر [[مغربی اتر پردیش|مغربی یوپی]] وچ مقابلہ کر رہی سی۔ آر ایل ڈی نے ایس پی امیدواراں نوں 8 نشان دیے۔<ref>{{Cite news|last=Anshuman|first=Kumar|title=SP, RLD strike poll alliance|work=The Economic Times|url=https://economictimes.indiatimes.com/news/politics-and-nation/sp-rld-strike-poll-alliance/articleshow/87839894.cms|access-date=2021-12-04}}</ref> عام آدمی پارٹی تے سماج وادی پارٹی دے درمیان اتحاد دے لئی گل گل شروع ہوئی،<ref>{{cite web|date=نومبر 24, 2021|first=Kumar|last=Abhishek|title=AAP heading for alliance with SP, Sanjay Singh says after meeting Akhilesh Yadav|url=https://www.indiatoday.in/elections/uttar-pradesh-assembly-polls-2022/story/aap-samajwadi-party-alliance-sanjay-singh-arvind-kejriwal-akhilesh-yadav-1880244-2021-11-24|access-date=2021-12-05|website=India Today|language=en}}</ref><ref>{{cite web|date=2021-11-25|title=AAP, SP discuss seat-sharing for UP polls|url=https://indianexpress.com/article/cities/lucknow/aap-samajwadi-party-alliance-up-elections-7639022/|access-date=2021-12-07|website=The Indian Express|language=en}}</ref> اُتے اوہ نشستاں دی تقسیم اُتے متفق نئيں ہو سکے۔<ref>{{Cite news|title=AAP-SP deadlock over seat sharing, AAP to go it alone in UP|work=The Economic Times|url=https://economictimes.indiatimes.com/news/elections/assembly-elections/uttar-pradesh/aap-sp-deadlock-over-seat-sharing-aap-to-go-it-alone-in-up/articleshow/88274708.cms?from=mdr|access-date=2021-12-17}}</ref> پرگتیشیل سماج وادی پارٹی (لوہیا) بعد وچ اس اتحاد وچ شامل ہوئی۔ 13 جنوری 2022 ناں، اتحاد نے انتخابات دے پہلے چند مراحل دے لئی اپنے ابتدائی امیدواراں دا اعلان کيتا۔ ایس پی تے ایس بی ایس پی وچ 1 سیٹ اُتے دوستانہ مقابلہ ہوئے گا جدوں کہ ایس پی تے اے ڈی (کے) دے درمیان 2 سیٹاں اُتے دوستانہ مقابلہ ہوئے گا۔{{Citation needed|date=مارچ 2022}}
{| class="wikitable" style="width:50%;"
!نمبر.
!پارٹی<ref>{{cite web|date=2021-12-23|title=From RLD to Mahan Dal, SP's new allies: the smaller parties|url=https://indianexpress.com/article/india/political-pulse/samajwadi-party-coalition-partners-election-7685431/|access-date=2022-01-21|website=The Indian Express|language=en}}</ref><ref>{{cite web|last=|first=|date=2022-01-13|title=SP & Allies Parade Strength & Unity, Chalk Out Consensus On Seat-sharing {{!}} Lucknow News – Times of India|url=https://timesofindia.indiatimes.com/city/lucknow/sp-allies-parade-strength-unitychalk-out-consensus-on-seat-sharing/articleshow/88865020.cms|url-status=live|access-date=2022-01-21|website=The Times of India|language=en}}</ref>
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
! سوانیاں امیدوار
|-
| style="text-align:center; background:{{party color|Samajwadi Party}};color:white" ! |'''1.'''
| [[سماجوادی پارٹی]]
|
| rowspan="5" | [[File:Indian Election Symbol Cycle.png|50px]]
| [[اکھلیش یادو]]
| [[File:Akhilesh Yadav (14335961811).jpg|50px]]
|343
|''301''
|''42''
|-
| style="text-align:center; background:{{party color|Pragatisheel Samajwadi Party (Lohiya)}};color:black" ! |'''2.'''
| [[پرگتیشیل سماجوادی پارٹی (لوہیا)]]
| [[File:प्रसपा लोहिया ध्वज.jpg|50x50px]]
| [[شیوپال سنگھ یادو]]
|[[File:Shivpal Singh Yadav, 2016.jpg|50x50px]]
|1
|1
|0
|-
| style="text-align:center; background:{{party color|Mahan Dal}};color:white" |'''3.'''
|[[مہان دل]]
|[[File:No image available.svg|50x50px]]
|کیشو دیو موریا
|[[File:Circle-icons-profile.svg|50x50px]]
|2
|1
|1
|-
| style="text-align:center; background:{{Party color|Janvadi Party (Socialist)}};color:white" |'''4.'''
|[[جن وادی پارٹی (سوشلسٹ)]]
|[[File:No image available.svg|50x50px]]
|[[سنجے چوہان (سیاست داں)|سنجے چوہان]]
|[[File:Circle-icons-profile.svg|50x50px]]
|1
|1
|0
|-
| rowspan="2" style="text-align:center; background:{{party color|Apna Dal (Kamerawadi)}};color:white"|'''5.'''
| rowspan="2" |[[اپنا دل (کمیراوادی)]]
| rowspan="2" |[[File:Apna dal Flag.svg|50x50px]]
|ڈاکٹر. پلوی پٹیل
|[[File:Circle-icons-profile.svg|50x50px]]
|1
|0
|1
|-
|[[File:No image available.svg|50x50px]]
|کرشنا پٹیل
|[[File:Circle-icons-profile.svg|50x50px]]
|4
|3
|1
|-
| style="text-align:center; background:{{party color|Rashtriya Lok Dal}};color:white" ! |'''6.'''
| [[راشٹریہ لوک دل]]
|
|[[File:Indian Election Symbol Hand Pump.png|50px]]
|[[جینت چودھری]]
|
|33
|31
|2
|-
| style="text-align:center; background:{{party color|Suheldev Bharatiya Samaj Party}};color:black" ! |'''7.'''
|[[سہیل دیو بھارتیہ سماج پارٹی]]
|[[File:No image available.svg|50x50px]]
|
|[[اوم پرکاش راج بھر]]
|[[File:Circle-icons-profile.svg|50x50px]]
|''17''
|''16''
|''1''
|-
| style="text-align:center; background:{{party color|Nationalist Congress Party}};color:white" ! |'''8.'''
| [[راشٹروادی کانگریس پارٹی]]
| [[File:NCP-flag.svg|50px]]
| [[File:Nationalist Congress Party Election Symbol.png|50px]]
| دے کے شرما
|[[File:Circle-icons-profile.svg|50x50px]]
| 1<ref>{{cite web|last=|first=|date=2022-01-13|title=SP declares alliance with NCP, gives lone Anupshahr seat to ally {{!}} Meerut News – Times of India|url=https://timesofindia.indiatimes.com/city/meerut/sp-declares-alliance-with-ncp-gives-lone-anupshahr-seat-to-ally/articleshow/88862336.cms|url-status=live|access-date=2022-01-21|website=The Times of India|language=en}}</ref>
| 1
| 0
|-
! colspan="6" |کل
!402
! اعلان ہونا باقی
!اعلان ہونا باقی
|}
=== {{legend2|{{party color|Bahujan Samaj Party}}|[[بہوجن سماج پارٹی]]}} ===
پچھلے سالاں دے برعکس، [[بہوجن سماج پارٹی]] نے اعلان کيتا سی کہ اوہ خود الیکشن لڑے گی۔<ref name=":0" /> بی ایس پی نے اپنی توسیع و حمایت دے لئی دس چھوٹی سیاسی جماعتاں یعنی انڈیا جنہاں شکتی پارٹی، پچاسی پریورتن سماج پارٹی، وشو شانتی پارٹی، سنیکت جنہاں دیش پارٹی، آدرش سنگرام پارٹی، اکھنڈ وکاس بھارت پارٹی، سروجن آواز پارٹی، جاگروک جنتا پارٹی تے سروجن سیوا پارٹی دے نال اتحاد کيتا اے۔<ref>{{cite web | last=Tiwari | first=Umesh | title=यूपी चुनाव 2022: विकास के लिए बसपा प्रमुख मायावती के साथ आए 10 राजनीतिक दल, समर्थन का किया ऐलान | website=Dainik Jagran | date=2022-01-18 | url=https://www.jagran.com/uttar-pradesh/lucknow-city-up-vidhan-sabha-election-10-political-parties-came-with-bsp-chief-mayawati-for-development-announced-support-22393621.html | language=hi | access-date=2022-01-22}}</ref><ref>{{cite web |date=2022-01-19 |title=Nine Parties Extend Support To Mayawati |url=https://timesofindia.indiatimes.com/city/lucknow/nine-parties-extend-support-to-mayawati/articleshow/88984110.cms |access-date=2022-01-22 |website=The Times of India}}</ref>
{| class="wikitable" style="width:50%;"
|-
!نمبر.
!پارٹی
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
! سوانیاں امیدوار
|-
|! style="text-align:center; background:{{party color|Bahujan Samaj Party}};color:white"|'''1.'''
| [[بہوجن سماج پارٹی]]
| [[File:Elephant Bahujan Samaj Party.svg|50px]]
| [[File:Indian Election Symbol Elephant.png|60px]]
| [[مایاوندی]]
| [[File:Mayawati.jpg|50px]]
| 403<ref name=":0">{{Cite news|last=Singh|first=Sanjay|title=Mayawati says no alliance for UP polls, BSP will contest all 403 seats|work=The Economic Times|url=https://economictimes.indiatimes.com/news/politics-and-nation/mayawati-says-no-alliance-for-up-polls-bsp-will-contest-all-403-seats/articleshow/81517527.cms?from=mdr|access-date=2021-05-23}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|}
=== {{legend2|{{party color|United Progressive Alliance}}|[[متحدہ ترقی پسند اتحاد]]}} ===
بی ایس پی دی طرح، [[متحدہ ترقی پسند اتحاد]] توں مقابلہ کرنے والی واحد جماعت آئی این سی رہی اے۔ 19 اکتوبر 2021 ناں، اتر پردیش کانگریس دی رہنما پرینکا گاندھی نے آنے والے اتر پردیش اسمبلی انتخابات وچ سوانیاں نوں %40 ٹکٹ دینے دا اعلان کيتا۔ <ref>{{Cite news |last=Rashid |first=Omar |date=2021-10-19 |title=Congress to give 40% of tickets to women in Uttar Pradesh assembly polls, says Priyanka Gandhi |language=en-IN |work=The Hindu |url=https://www.thehindu.com/news/national/other-states/congress-to-give-40-of-tickets-to-women-in-uttar-pradesh-assembly-polls-says-priyanka-gandhi/article37072048.ece |access-date=2022-03-03 |issn=0971-751X}}</ref>
{| class="wikitable" style="width:50%;"
|-
!نمبر.
!پارٹی
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
! سوانیاں امیدوار
|-
|! style="text-align:center; background:{{party color|Indian National Congress}};color:white"|'''1.'''
| [[انڈین نیشنل کانگریس]]
| [[File:Indian National Congress Flag.svg|50px]]
| [[File:Hand INC.svg|60px]]
| [[پرینکا گاندھی]]
|
|401<ref>{{Cite news|url= https://www.thehindu.com/news/national/other-states/congress-to-go-solo-in-2022-up-polls-contest-all-403-seats-says-priyanka-gandhi/article37491747.ece|title=Congress to go it alone in 2022 U.P. polls: Priyanka Gandhi|website=The Hindu|date=14 نومبر 2021|access-date=26 نومبر 2021}}</ref>
|241
|160
|}
=== {{legend2|{{party color|All India Majlis-e-Ittehadul Muslimeen}}|[[بھاگیداری پریورتن مورچہ]]}} ===
[[کل ہند مجلس اتحاد المسلمین]]، [[جن ادھیکار پارٹی]]، بھارت مکتی مورچہ، جنتا کرانتی پارٹی تے بھارتیہ ونچیت سماج پارٹی نے تمام 403 سیٹاں اُتے مقابلہ کرنے دے لئی اک محاذ بنایا۔<ref name=":2">{{cite web|date=2022-01-23|title=AIMIM announces launch of new front for UP assembly polls|url=https://www.hindustantimes.com/cities/lucknow-news/aimim-announces-launch-of-new-front-for-up-assembly-polls-101642878223887.html|access-date=2022-01-23|website=Hindustan Times|language=en}}</ref>
{| class="wikitable" style="width:50%;"
|+
!نمبر.
!پارٹی<ref name=":2" />
!پرچم
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
!سوانیاں امیدوار
|-
| style="text-align:center; background:{{party color|All India Majlis-e-Ittehadul Muslimeen}};color:white" ! |'''1.'''
| [[کل ہند مجلس اتحاد المسلمین]]
|[[File:All India Majlis-e-Ittehadul Muslimeen logo.svg|50x50px]]
|[[File:Indian Election Symbol Kite.svg|50x50px]]
|شوکت علی
|[[File:Circle-icons-profile.svg|50x50px]]
|100<ref>{{cite web|last=|first=|title=AIMIM To Contest On 100 Seats In UP Assembly Polls, Babu Kushwaha To Be CM Candidate of Alliance: Owaisi|url=https://www.india.com/news/india/aimim-to-contest-on-100-seats-in-up-assembly-polls-babu-kushwaha-to-be-cm-candidate-of-alliance-owaisi-5212161/|access-date=2022-02-03|website=www.india.com|language=en}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:#b0251e;color:white" ! |'''2.'''
|[[جن ادھیکار پارٹی]]
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|[[بابو سنگھ کشواہا]]
|[[File:Kushwaha2.jpg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:#08ccfc;color:white" ! |'''3.'''
| بھارت مکتی مورچہ
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|[[وامن میشرام]]
|[[File:Waman Meshram on Facebook.jpg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:white;color:black" ! |'''4.'''
|جنتا کرانتی پارٹی
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|انیل سنگھ چوہان
|[[File:Circle-icons-profile.svg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:white;color:black ! |'''5.'''
|بھارتیہ ونچیت سماج پارٹی
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|رام پرساد کشیپ
|[[File:Circle-icons-profile.svg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Peace Party of India}};color:white" !|'''6.'''
|[[پیس پارٹی آف انڈیا]]
|[[File:Peace Party Of India Flag.jpg|50x50px]]
|[[File:Indian election symbol glass tumbler.svg|50px]]
|[[محمد ایوب]]
|[[File:Circle-icons-profile.svg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Rashtriya Ulama Council}};color:white" !|'''7.'''
|[[راشٹریہ علماء کونسل]]
|[[File:Rashtriya Ulama Council (RUC) Flag.jpg|50x50px]]
|[[File:No image available.svg|50x50px]]
|[[عامر رشادی مدنی]]
|[[File:Maulana Aamir Rashadi Madni.jpg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|}
=== {{legend2|{{party color|Left Front}}|بایاں محاذ}} ===
{| class="wikitable" style="width:50%;"
|+
!نمبر.
!پارٹی<ref>{{cite web|date=2022-01-18|title=UP polls: Left parties to field candidates on a limited number of seats|url=https://www.hindustantimes.com/cities/lucknow-news/up-polls-left-parties-to-field-candidates-on-a-limited-number-of-seats-101642446882966.html|access-date=2022-01-17|website=Hindustan Times|language=en}}</ref>
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
! سوانیاں امیدوار
|-
| style="text-align:center; background:{{party color|Communist Party of India}};color:white" |'''1.'''
|[[بھارتیہ کمیونسٹ پارٹی]]
|[[File:CPI-banner.svg|50x50px]]
|[[File:CPI symbol.svg|50x50px]]
|گریش شرما
|[[File:Circle-icons-profile.svg|50x50px]]
|38{{citation needed|date=فروری 2022}}
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Communist Party of India (Marxist)}};color:white" |'''2.'''
|[[بھارتیہ مارکسوادی کمیونسٹ پارٹی]]
|[[File:CPI-M-flag.svg|50x50px]]
| [[File:CPI(M) election symbol - Hammer Sickle and Star.svg|50x50px]]
|سیتارام یچوری
| [[File:Circle-icons-profile.svg|50x50px]]
|4{{cn|date=مارچ 2022}}
|4
|0
|-
| style="text-align:center; background:{{party color|Communist Party of India (Marxist–Leninist) Liberation}};color:white" |'''3.'''
|[[کمیونسٹ پارٹی آف انڈیا (مارکسسٹ-لینسٹ) لبریشن|کمیونسٹ پارٹی آف انڈیا (مارکسسٹ-لینسٹ)]]
| [[File:CPIML LIBERATION FLAG.jpg|50x50px]]
|[[File:Flag Logo of CPIML.png|50x50px]]
|سدھاکر یادو
|[[File:Circle-icons-profile.svg|50x50px]]
|13{{citation needed|date=فروری 2022}}
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|All India Forward Bloc}};color:white" |'''4.'''
|[[آل انڈیا فارورڈ بلاک]]
|[[File:No image available.svg|50x50px]]
|[[File:Indian Election Symbol Lion.svg|50x50px]]
| جگدیش سنگھ ٹھکرال
|[[File:Circle-icons-profile.svg|50x50px]]
|''''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|}
=== ہور ===
انتخابات توں پہلے اک ماہ دے دوران وڈی سیاسی جماعتاں نے جو کسی وی اتحاد دا حصہ نئيں نيں الیکشن وچ حصہ لینے دے اپنے ارادےآں دا اعلان کيتا۔ {{Citation needed|date=مارچ 2022}}
* [[عام آدمی پارٹی|عآپ]] نے اعلان کيتا کہ اوہ تمام 403 سیٹاں اُتے مقابلہ کرے گی۔ عآپ نے [[سماج وادی پارٹی|سپا]] دے نال اتحاد دی گل گل شروع دی لیکن اتحاد دے لئی گل گل کامیاب نئيں ہوئی۔
* [[شیو سینا]] نے اعلان کيتا کہ اوہ انتخابات وچ تمام 403 سیٹاں اُتے مقابلہ کرن گے جو بعد وچ گھٹ کر 50-100 سیٹاں تک رہ گئی۔
* [[کل ہند مجلس اتحاد المسلمین|اے آئی ایم آئی ایم]] اصل وچ اتحاد دا حصہ سی تے اسنوں 100 نشستاں دا حصہ دتا گیا سی، اُتے جدوں [[سہیل دیو بھارتیہ سماج پارٹی|ایس ڈی بی ایس پی]] نے [[سماجوادی پارٹی|سپا]] توں ہتھ ملانے دے لئی اتحاد توڑ دتا سی۔ [[کل ہند مجلس اتحاد المسلمین|اے آئی ایم آئی ایم]] نے تصدیق دی کہ اوہ 100 سیٹاں اُتے اکیلے الیکشن لڑاں گے۔
بعد وچ پارٹیاں جداں [[وکاس شیل انسان پارٹی|وی آئی پی]]، [[لوک جنہاں شکتی پارٹی (رام ولاس)|ایل جے پی۔ (رام ولاس دا دھڑا)]]، آر آر پی، [[اکھل بھارتیہ ہندو مہاسبھا|اے بی ایچ ایم]] تے اے ایس پی نے وی الیکشن وچ اپنی شرکت کيتی تصدیق کيتی۔{{Citation needed|date=فروری 2022}}
{| class="wikitable" " style="width:50%;"
!نمبر.
!پارٹی
!پرچم
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
!سوانیاں امیدوار
|-
|! style="text-align:center; background:{{party color|Aam Aadmi Party}};color:white"|'''1.'''
| [[عام آدمی پارٹی]]
| [[File:Aam Aadmi Party logo (English).svg|50px]]
| [[File:AAP Symbol.png|50px]]
| [[سنجے سنگھ (بھارتی سیاست دان)|سنجے سنگھ]]
| [[File:Sanjay Singh (cropped).jpg|50px]]
|403<ref>{{Cite news|last=|first=|date=2021-09-01|title=AAP will contest on all 403 seats in UP assembly polls: Sanjay Singh|work=Business Standard India|url=https://www.business-standard.com/article/politics/aap-will-contest-on-all-403-seats-in-up-assembly-polls-sanjay-singh-121090100043_1.html|access-date=2022-01-24}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
|style="text-align:center;background:{{party color|Janata Dal (United)}};color:white"|'''2.'''
| [[جنتا دل (متحدہ)]]
| [[File:Janata Dal (United) Flag.svg|border|50x50px]]
| [[File:Indian Election Symbol Arrow.svg|50x50px]]
|
| [[File:Circle-icons-profile.svg|50x50px]]
|51<ref>{{cite web|title=Uttar Pradesh Polls: JDU to contest at 51 seats against BJP in UP|url=https://www.freepressjournal.in/india/uttar-pradesh-polls-jdu-to-contest-51-seats-against-bjp-in-up|access-date=2022-01-24|website=Free Press Journal|language=en}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
|! style="text-align:center; background:{{party color|Shiv Sena}};color:white"|'''3.'''
| [[شو سینا]]<ref>{{cite web|last=|first=|title=Uttar Pradesh Assembly Election 2022: Shiv Sena to Contest on 50-100 Seats, Says Sanjay Raut {{!}} India.com|url=https://www.india.com/uttar-pradesh/uttar-pradesh-assembly-elections-2022-shiv-sena-to-contest-on-50-100-seats-says-sanjay-raut-5182605/|access-date=2022-01-24|website=www.india.com|language=en}}</ref>
| [[File:Logo of Shiv Sena.svg|50x50px]]
| [[File:Indian Election Symbol Bow And Arrow.svg|50x50px]]
| ٹھاکر سنگھ
| [[File:Circle-icons-profile.svg|50x50px]]
| 45
| 40
| 5
|-
|! style="text-align:center; background:{{party color|Jansatta Dal (Loktantrik)}};color:black"|'''4.'''
|[[جن ستہ دل (لوک تانترک)]]
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|[[رگھوراج پرتاپ سنگھ]]
|
|100<ref>{{cite web|title=राजा भैया का एलान: उनकी पार्टी UP की 100 सीटों पर लड़ेगी चुनाव, किसी से गठबंधन का नहीं बनाया मन|url=https://zeenews.india.com/hindi/india/up-uttarakhand/uttar-pradesh/raja-bhaiya-party-jansatta-dal-loktantrik-will-contest-on-100-seats-in-up-election-alliance-with-no-one/1015413|access-date=2022-01-24|website=Zee News|language=hi}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Vikassheel Insaan Party}};color:white" ! |'''5.'''
| [[وکاس شیل انسان پارٹی]]<ref>{{cite web|title=Bihar minister Mukesh Sahani miffed, says his party VIP will contest 165 seats in 2022 UP polls|url=https://www.indiatoday.in/india/story/bihar-minister-mukesh-sahani-vikassheel-insaan-party-2022-uttar-pradesh-polls-1832822-2021-07-26|access-date=2021-09-14|website=India Today|language=en}}</ref>
|
|
| [[مکیش سہانی]]
|
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Lok Janshakti Party (Ram Vilas)}};color:white" ! |'''6.'''
|[[لوک جنہاں شکتی پارٹی (رام ولاس)]]<ref>{{cite web|title=लोजपा यूपी में बन रही है मजबूत, प्रदेश अध्यक्ष की अगुवाई में लड़ेंगे चुनाव- चिराग पासवान|url=https://smart.livehindustan.com/varanasi/news/ljp-leader-chirag-paswan-said-his-party-becoming-stronger-will-fight-up-election-2022-under-the-leadership-of-manishankar-pandey-81631257896072.html|access-date=2021-10-06|website=Hindustan Smart|language=hindi|archive-date=2021-09-10|archive-url=https://web.archive.org/web/20210910074710/https://smart.livehindustan.com/varanasi/news/ljp-leader-chirag-paswan-said-his-party-becoming-stronger-will-fight-up-election-2022-under-the-leadership-of-manishankar-pandey-81631257896072.html|dead-url=yes}}</ref>
|[[File:No image available.svg|50x50px]]
|
|[[چراغ پاسوان]]
| [[File:Chirag Paswan.jpg|70x70px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:Blue;color:white" |'''7.'''
|آزاد سماج پارٹی<ref>{{cite web|title=Chandrashekhar Azad will soon join Bhagidari Sankalp Morcha, claims Om Prakash Rajbhar|url=https://www.newindianexpress.com/nation/2021/sep/22/chandrashekhar-azad-will-soon-join-bhagidari-sankalp-morcha-claims-om-prakash-rajbhar-2362282.html|access-date=2021-09-24|website=The New Indian Express}}</ref>
| [[File:Azad samaj party.png|50x50px]]
|[[File:Azad samaj party symbol.png|50x50px]]
|[[چندر شیکھر آزاد راون]]
|[[File:Chandrashekhar Azad Ravan (cropped).jpg|51x51px]]
|403
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|}
== امیدوار ==
{{Main|اترپردیش مجلس قانون ساز دے انتخابات، 2022ء دے امیدواراں دی فہرست}}
{| class="wikitable" width ="50%" style="text-align:center;"
! colspan="2" | حلقہ
| colspan="3" bgcolor="{{party color|National Democratic Alliance}}" |[[قومی جمہوری اتحاد (بھارت)|<span style="color:white;">'''NDA'''</span>]]
| colspan="3" bgcolor="{{party color|Samajwadi Party}}" |[[سماجوادی پارٹی|<span style="color:white;">'''SP +'''</span>]]
|colspan="3" bgcolor="{{party color|Bahujan Samaj Party}}" |[[بہوجن سماج پارٹی|<span style="color:white;">'''BSP'''</span>]]
| colspan="3" bgcolor="{{party color|United Progressive Alliance}}" |[[متحدہ ترقی پسند اتحاد|<span style="color:white;">'''UPA'''</span>]]
| colspan="3" bgcolor="{{party color|Aam Aadmi Party}}" |[[عام آدمی پارٹی|<span style="color:white;">'''AAP'''</span>]]
|-
! #
! نام
! colspan="2" |پارٹی
! امیدوار
! colspan="2" |پارٹی
!امیدوار
! colspan="2" |پارٹی
!امیدوار
! colspan="2" |پارٹی
!امیدوار
! colspan="2" |پارٹی
!امیدوار
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سہارنپور|<span style="color:white;">'''Saharanpur District'''</span>]]
|-
! 1
| [[Behat (Assembly constituency)|Behat]]
| bgcolor=#FF9933|
| [[بھارتیہ جنتا پارٹی|BJP]]
|
| bgcolor=#FF2222|
| [[سماجوادی پارٹی|SP]]
|
| bgcolor=#22409A|
| [[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 2
| [[Nakur (Assembly constituency)|Nakur]]
| bgcolor=#FF9933|
| [[بھارتیہ جنتا پارٹی|BJP]]
|
| bgcolor=#FF2222|
| [[سماجوادی پارٹی|SP]]
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 3
| [[Saharanpur Nagar (Assembly constituency)|Saharanpur Nagar]]
| bgcolor=#FF9933|
| [[بھارتیہ جنتا پارٹی|BJP]]
|
| bgcolor=#FF2222|
| [[سماجوادی پارٹی|SP]]
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 4
| [[Saharanpur (Assembly constituency)|Saharanpur]]
| bgcolor=#FF9933|
| [[بھارتیہ جنتا پارٹی|BJP]]
|
| bgcolor=#FF2222|
| [[سماجوادی پارٹی|SP]]
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 5
| [[Deoband (Assembly constituency)|Deoband]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 6
| [[Rampur Maniharan (Assembly constituency)|Rampur Maniharan]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 7
| [[Gangoh (Assembly constituency)|Gangoh]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع شاملی|<span style="color:white;">'''Shamli District'''</span>]]
|-
! 8
| [[Kairana (Assembly constituency)|Kairana]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 9
| [[Thana Bhawan (Assembly constituency)|Thana Bhawan]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 10
| [[Shamli (Assembly constituency)|Shamli]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مظفرنگر|<span style="color:white;">'''Muzaffarnagar District'''</span>]]
|-
! 11
| [[Budhana (Assembly constituency)|Budhana]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 12
| [[Charthawal (Assembly constituency)|Charthawal]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 13
| [[Purqazi (Assembly constituency)|Purqazi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 14
| [[Muzaffarnagar (Assembly constituency)|Muzaffarnagar]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 15
| [[Khatauli (Assembly constituency)|Khatauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 16
| [[Meerapur (Assembly constituency)|Meerapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بجنور|<span style="color:white;">'''Bijnor District'''</span>]]
|-
!17
|[[Najibabad (Assembly constituency)|Najibabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 18
| [[Nagina (Assembly constituency)|Nagina]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 19
| [[Barhapur (Assembly constituency)|Barhapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 20
| [[Dhampur (Assembly constituency)|Dhampur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 21
| [[Nehtaur (Assembly constituency)|Nehtaur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 22
| [[Bijnor (Assembly constituency)|Bijnor]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 23
| [[Chandpur (Assembly constituency)|Chandpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 24
| [[Noorpur (Assembly constituency)|Noorpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مرادآباد|<span style="color:white;">'''Moradabad District'''</span>]]
|-
! 25
| [[Kanth (Assembly constituency)|Kanth]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 26
| [[Thakurdwara (Assembly constituency)|Thakurdwara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 27
| [[Moradabad Rural (Assembly constituency)|Moradabad Rural]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 28
| [[Moradabad Nagar (Assembly constituency)|Moradabad Nagar]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 29
| [[Kundarki (Assembly constituency)|Kundarki]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 30
| [[Bilari (Assembly constituency)|Bilari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سنبھل|<span style="color:white;">'''Sambhal District'''</span>]]
|-
! 31
| [[Chandausi (Assembly constituency)|Chandausi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 32
| [[Asmoli (Assembly constituency)|Asmoli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 33
| [[Sambhal (Assembly constituency)|Sambhal]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[رام پور ضلع|<span style="color:white;">'''Rampur District'''</span>]]
|-
! 34
| [[Suar (Assembly constituency)|Suar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 35
| [[Chamraua (Assembly constituency)|Chamraua]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 36
| [[Bilaspur (Assembly constituency)|Bilaspur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 37
| [[Rampur (Assembly constituency)|Rampur]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 38
| [[Milak (Assembly constituency)|Milak]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع امروہہ|<span style="color:white;">'''Amroha District'''</span>]]
|-
! 39
| [[Dhanaura (Assembly constituency)|Dhanaura]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 40
| [[Naugawan Sadat (Assembly constituency)|Naugawan Sadat]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 41
| [[Amroha (Assembly constituency)|Amroha]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 42
| [[Hasanpur (Assembly constituency)|Hasanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع میرٹھ|<span style="color:white;">'''Meerut District'''</span>]]
|-
! 43
| [[Siwalkhas (Assembly constituency)|Siwalkhas]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 44
| [[Sardhana (Assembly constituency)|Sardhana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 45
| [[Hastinapur (Assembly constituency)|Hastinapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 46
| [[Kithore (Assembly constituency)|Kithore]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 47
| [[Meerut Cantt. (Assembly constituency)|Meerut Cantt]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 48
| [[Meerut (Assembly constituency)|Meerut]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 49
| [[Meerut South (Assembly constituency)|Meerut South]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع باغپت|<span style="color:white;">'''Baghpat District'''</span>]]
|-
! 50
| [[Chhaprauli (Assembly constituency)|Chhaprauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 51
| [[Baraut (Assembly constituency)|Baraut]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 52
| [[Bagpat (Assembly constituency)|Bagpat]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع غازی آباد، بھارت|<span style="color:white;">'''Ghaziabad District'''</span>]]
|-
! 53
| [[Loni (Assembly constituency)|Loni]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 54
| [[Muradnagar (Assembly constituency)|Muradnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 55
| [[Sahibabad (Assembly constituency)|Sahibabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 56
| [[Ghaziabad (Assembly constituency)|Ghaziabad]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 57
| [[Modinagar (Assembly constituency)|Modinagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع ہاپڑ|<span style="color:white;">'''Hapur District'''</span>]]
|-
! 58
| [[Dhaulana (Assembly constituency)|Dhaulana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 59
| [[Hapur (Assembly constituency)|Hapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 60
| [[Garhmukteshwar (Assembly constituency)|Garhmukteshwar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع گوتم بدھ نگر|<span style="color:white;">'''Gautam Buddha Nagar District'''</span>]]
|-
!61
| [[Noida (Assembly constituency)|Noida]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 62
| [[Dadri, Uttar Pradesh (Assembly constituency)|Dadri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 63
| [[Jewar (Assembly constituency)|Jewar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بلندشہر|<span style="color:white;">'''Bulandshahr District'''</span>]]
|-
! 64
| [[Sikandrabad (Assembly constituency)|Sikandrabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 65
| [[Bulandshahr (Assembly constituency)|Bulandshahr]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 66
| [[Syana (Assembly constituency)|Syana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 67
| [[Anupshahr (Assembly constituency)|Anupshahr]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 68
| [[Debai (Assembly constituency)|Debai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 69
| [[Shikarpur (Assembly constituency)|Shikarpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 70
| [[Khurja (Assembly constituency)|Khurja]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع علی گڑھ|<span style="color:white;">'''Aligarh District'''</span>]]
|-
! 71
| [[Khair (Assembly constituency)|Khair]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 72
| [[Barauli (Assembly constituency)|Barauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 73
| [[Atrauli (Assembly constituency)|Atrauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 74
| [[Chharra (Assembly constituency)|Chharra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 75
| [[Koil (Assembly constituency)|Koil]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 76
| [[Aligarh (Assembly constituency)|Aligarh]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
| Monika Thapar
|-
! 77
| [[Iglas (Assembly constituency)|Iglas]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع ہتھ رس|<span style="color:white;">'''Hathras District'''</span>]]
|-
! 78
| [[Hathras (Assembly constituency)|Hathras]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 79
| [[Sadabad (Assembly constituency)|Sadabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 80
| [[Sikandra Rao (Assembly constituency)|Sikandra Rao]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع متھرا|<span style="color:white;">'''Mathura District'''</span>]]
|-
! 81
| [[Chhata (Assembly constituency)|Chhata]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 82
| [[Mant (Assembly constituency)|Mant]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 83
| [[Goverdhan (Assembly constituency)|Goverdhan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 84
| [[Mathura (Assembly constituency)|Mathura]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 85
| [[Baldev (Assembly constituency)|Baldev]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع آگرہ|<span style="color:white;">'''Agra District'''</span>]]
|-
! 86
| [[Etmadpur (Assembly constituency)|Etmadpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
| Gautam Singh
|-
! 87
| [[Agra Cantonment (Assembly constituency)|Agra Cantonment]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
| Prem Singh Jataw
|-
! 88
| [[Agra South (Assembly constituency)|Agra South]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 89
| [[Agra North (Assembly constituency)|Agra North]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 90
| [[Agra Rural (Assembly constituency)|Agra Rural]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 91
| [[Fatehpur Sikri (Assembly constituency)|Fatehpur Sikri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
| Banne Singh Pahalwan
|-
! 92
| [[Kheragarh (Assembly constituency)|Kheragarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 93
| [[Fatehabad (Assembly constituency)|Fatehabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 94
| [[Bah (Assembly constituency)|Bah]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فیروز آباد|<span style="color:white;">'''Firozabad District'''</span>]]
|-
! 95
| [[Tundla (Assembly constituency)|Tundla]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 96
| [[Jasrana (Assembly constituency)|Jasrana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 97
| [[Firozabad (Assembly constituency)|Firozabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 98
| [[Shikohabad (Assembly constituency)|Shikohabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 99
| [[Sirsaganj (Assembly constituency)|Sirsaganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع کانسی رام نگر|<span style="color:white;">'''Kasganj District'''</span>]]
|-
! 100
| [[Kasganj (Assembly constituency)|Kasganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 101
| [[Amanpur (Assembly constituency)|Amanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 102
| [[Patiyali (Assembly constituency)|Patiyali]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع ایٹہ|<span style="color:white;">'''Etah District'''</span>]]
|-
!103
|[[Aliganj (Assembly constituency)|Aliganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 104
| [[Etah (Assembly constituency)|Etah]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 105
| [[Marhara (Assembly constituency)|Marhara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 106
| [[Jalesar (Assembly constituency)|Jalesar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مین پوری|<span style="color:white;">'''Mainpuri District'''</span>]]
|-
! 107
| [[Mainpuri (Assembly constituency)|Mainpuri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 108
| [[Bhongaon (Assembly constituency)|Bhongaon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 109
| [[Kishni (Assembly constituency)|Kishni]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 110
| [[Karhal (Assembly constituency)|Karhal]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سنبھل|<span style="color:white;">'''Sambhal District'''</span>]]
|-
! 111
| [[Gunnaur (Assembly constituency)|Gunnaur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بدایاں|<span style="color:white;">'''Budaun District'''</span>]]
|-
! 112
| [[Bisauli (Assembly constituency)|Bisauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 113
| [[Sahaswan (Assembly constituency)|Sahaswan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 114
| [[Bilsi (Assembly constituency)|Bilsi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 115
| [[Badaun (Assembly constituency)|Badaun]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 116
| [[Shekhupur (Assembly constituency)|Shekhupur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 117
| [[Dataganj (Assembly constituency)|Dataganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بریلی|<span style="color:white;">'''Bareilly District'''</span>]]
|-
! 118
| [[Baheri (Assembly constituency)|Baheri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 119
| [[Meerganj (Assembly constituency)|Meerganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 120
| [[Bhojipura (Assembly constituency)|Bhojipura]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 121
| [[Nawabganj (Assembly constituency)|Nawabganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 122
| [[Faridpur (Assembly constituency)|Faridpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 123
| [[Bithari Chainpur (Assembly constituency)|Bithari Chainpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 124
| [[بریلی (انتخابی حلقہ)]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 125
| [[Bareilly Cantt. (Assembly constituency)|Bareilly Cantt]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 126
| [[Aonla (Assembly constituency)|Aonla]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع پیلی بھیت|<span style="color:white;">'''Pilibhit District'''</span>]]
|-
! 127
| [[Pilibhit (Assembly constituency)|Pilibhit]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 128
| [[Barkhera (Assembly constituency)|Barkhera]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 129
| [[Puranpur (Assembly constituency)|Puranpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 130
| [[Bisalpur (Assembly constituency)|Bisalpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع شاہجہان پور|<span style="color:white;">'''Shahjahanpur District'''</span>]]
|-
! 131
|[[Katra (Assembly constituency)|Katra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 132
| [[Jalalabad (UP Assembly constituency)|Jalalabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 133
| [[Tilhar (Assembly constituency)|Tilhar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 134
| [[Powayan (Assembly constituency)|Powayan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 135
| [[Shahjahanpur (Assembly constituency)|Shahjahanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 136
| [[Dadraul (Assembly constituency)|Dadraul]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[لکھیم پور کھیری ضلع|<span style="color:white;">'''Lakhimpur Kheri District'''</span>]]
|-
! 137
| [[Palia (Assembly constituency)|Palia]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 138
| [[Nighasan (Assembly constituency)|Nighasan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 139
| [[Gola Gokrannath (Assembly constituency)|Gola Gokrannath]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 140
| [[Sri Nagar (Assembly constituency)|Sri Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 141
| [[Dhaurahra (Assembly constituency)|Dhaurahra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 142
|[[Lakhimpur (Assembly constituency)|Lakhimpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 143
| [[Kasta (Assembly constituency)|Kasta]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 144
| [[Mohammdi (Assembly constituency)|Mohammdi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سیتاپور|<span style="color:white;">'''Sitapur District'''</span>]]
|-
! 145
| [[Maholi (Assembly constituency)|Maholi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 146
| [[Sitapur (Assembly constituency)|Sitapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 147
| [[Hargaon (Assembly constituency)|Hargaon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 148
| [[Laharpur (Assembly constituency)|Laharpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 149
| [[Biswan (Assembly constituency)|Biswan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 150
| [[Sevata (Assembly constituency)|Sevata]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 151
| [[Mahmoodabad (Assembly constituency)|Mahmoodabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 152
| [[Sidhauli (Assembly constituency)|Sidhauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 153
| [[Misrikh (Assembly constituency)|Misrikh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ہردوئی ضلع|<span style="color:white;">'''Hardoi District'''</span>]]
|-
! 154
| [[Sawayazpur (Assembly constituency)|Sawayazpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 155
| [[Shahabad (Assembly constituency)|Shahabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 156
| [[Hardoi (Assembly constituency)|Hardoi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 157
| [[Gopamau (Assembly constituency)|Gopamau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 158
| [[Sandi (Assembly constituency)|Sandi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 159
| [[Bilgram-Mallanwan (Assembly constituency)|Bilgram-Mallanwan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 160
| [[Balamau (Assembly constituency)|Balamau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 161
| [[Sandila (Assembly constituency)|Sandila]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[اناؤ ضلع|<span style="color:white;">'''Unnao District'''</span>]]
|-
! 162
| [[Bangarmau (Assembly constituency)|Bangarmau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 163
| [[Safipur (Assembly constituency)|Safipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 164
| [[Mohan (Assembly constituency)|Mohan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 165
| [[Unnao (Assembly constituency)|Unnao]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 166
| [[Bhagwantnagar (Assembly constituency)|Bhagwantnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 167
| [[Purwa (Assembly constituency)|Purwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع لکھنؤ|<span style="color:white;">'''Lucknow District'''</span>]]
|-
! 168
| [[Malihabad (Assembly constituency)|Malihabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 169
| [[Bakshi Kaa Talab (Assembly constituency)|Bakshi Kaa Talab]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 170
| [[Sarojini Nagar (Assembly constituency)|Sarojini Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 171
| [[Lucknow West (Assembly constituency)|Lucknow West]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 172
| [[Lucknow North (Assembly constituency)|Lucknow North]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 173
| [[Lucknow East (Assembly constituency)|Lucknow East]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 174
| [[Lucknow Central (Assembly constituency)|Lucknow Central]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 175
| [[Lucknow Cantonment (Assembly constituency)|Lucknow Cantonment]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 176
| [[Mohanlalganj (Assembly constituency)|Mohanlalganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[رائے بریلی ضلع|<span style="color:white;">'''Raebareli District'''</span>]]
|-
! 177
| [[Bachhrawan (Assembly constituency)|Bachhrawan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع امیتھی|<span style="color:white;">'''Amethi District'''</span>]]
|-
! 178
| [[Tiloi (Assembly constituency)|Tiloi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[رائے بریلی ضلع|<span style="color:white;">'''Raebareli District'''</span>]]
|-
! 179
| [[Harchandpur (Assembly constituency)|Harchandpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 180
| [[Rae Bareli (Assembly constituency)|Rae Bareli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 181
| [[Salon (Assembly constituency)|Salon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 182
| [[Sareni (Assembly constituency)|Sareni]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 183
| [[Unchahar (Assembly constituency)|Unchahar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع امیتھی|<span style="color:white;">'''Amethi District'''</span>]]
|-
! 184
| [[Jagdishpur (Assembly constituency)|Jagdishpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 185
| [[Gauriganj (Assembly constituency)|Gauriganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 186
| [[Amethi (Assembly constituency)|Amethi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سلطان پور|<span style="color:white;">'''Sultanpur District'''</span>]]
|-
! 187
| [[Isauli (Assembly constituency)|Isauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 188
| [[Sultanpur (Assembly constituency)|Sultanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 189
| [[Sultanpur Sadar (Assembly constituency)|Sultanpur Sadar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 190
| [[Lambhua (Assembly constituency)|Lambhua]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 191
| [[Kadipur (Assembly constituency)|Kadipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فرخ آباد|<span style="color:white;">'''Farrukhabad District'''</span>]]
|-
! 192
| [[Kaimganj (Assembly constituency)|Kaimganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 193
| [[Amritpur (Assembly constituency)|Amritpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 194
| [[Farrukhabad (Assembly constituency)|Farrukhabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 195
| [[Bhojpur (Assembly constituency)|Bhojpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[قنوج ضلع|<span style="color:white;">'''Kannauj District'''</span>]]
|-
! 196
| [[Chhibramau (Assembly constituency)|Chhibramau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 197
| [[Tirwa (Assembly constituency)|Tirwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 198
| [[Kannauj (Assembly constituency)|Kannauj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع اٹاوہ|<span style="color:white;">'''Etawah District'''</span>]]
|-
! 199
| [[Jaswantnagar (Assembly constituency)|Jaswantnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 200
| [[Etawah (Assembly constituency)|Etawah]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 201
| [[Bharthana (Assembly constituency)|Bharthana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع اوریا|<span style="color:white;">'''Auraiya District'''</span>]]
|-
! 202
| [[Bidhuna (Assembly constituency)|Bidhuna]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 203
| [[Dibiyapur (Assembly constituency)|Dibiyapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 204
| [[Auraiya (Assembly constituency)|Auraiya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع کانپور دیہات|<span style="color:white;">'''Kanpur Dehat District'''</span>]]
|-
! 205
| [[Rasulabad (Assembly constituency)|Rasulabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 206
| [[Akbarpur-Raniya (Assembly constituency)|Akbarpur-Raniya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 207
| [[Sikandra (Assembly constituency)|Sikandra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 208
| [[Bhognipur (Assembly constituency)|Bhognipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع کانپور نگر|<span style="color:white;">'''Kanpur Nagar District'''</span>]]
|-
! 209
| [[Bilhaur (Assembly constituency)|Bilhaur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 210
| [[Bithoor (Assembly constituency)|Bithoor]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 211
| [[Kalyanpur, Kanpur (Assembly constituency)|Kalyanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 212
| [[Govind Nagar (Assembly constituency)|Govindnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 213
| [[Sishamau (Assembly constituency)|Sishamau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 214
| [[Arya Nagar (Assembly constituency)|Arya Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 215
| [[Kidwai Nagar (Assembly constituency)|Kidwai Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 216
| [[Kanpur Cantonment (Assembly constituency)|Kanpur Cantonment]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 217
| [[Maharajpur, Kanpur (Assembly constituency)|Maharajpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 218
| [[Ghatampur (Assembly constituency)|Ghatampur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|Prashant Ahirwar
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع جالون|<span style="color:white;">'''Jalaun District'''</span>]]
|-
! 219
| [[Madhogarh (Assembly constituency)|Madhogarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 220
| [[Kalpi (Assembly constituency)|Kalpi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 221
| [[Orai (Assembly constituency)|Orai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[جھانسی ضلع|<span style="color:white;">'''Jhansi District'''</span>]]
|-
! 222
| [[Babina (Assembly constituency)|Babina]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 223
| [[Jhansi Nagar (Assembly constituency)|Jhansi Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 224
| [[Mauranipur (Assembly constituency)|Mauranipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 225
| [[Garautha (Assembly constituency)|Garautha]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[للت پور ضلع، بھارت|<span style="color:white;">'''Lalitpur District'''</span>]]
|-
! 226
| [[Lalitpur (Assembly constituency)|Lalitpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 227
| [[Mehroni (Assembly constituency)|Mehroni]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع حمیرپور، اترپردیش|<span style="color:white;">'''Hamirpur District'''</span>]]
|-
! 228
| [[Hamirpur (Uttar Pradesh Assembly constituency)|Hamirpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 229
| [[Rath (Assembly constituency)|Rath]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[مہوبا ضلع|<span style="color:white;">'''Mahoba District'''</span>]]
|-
! 230
| [[Mahoba (Assembly constituency)|Mahoba]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 231
| [[Charkhari (Assembly constituency)|Charkhari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع باندہ|<span style="color:white;">'''Banda District'''</span>]]
|-
! 232
| [[Tindwari (Assembly constituency)|Tindwari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 233
| [[Baberu (Assembly constituency)|Baberu]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 234
| [[Naraini (Assembly constituency)|Naraini]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 235
| [[Banda (Assembly constituency)|Banda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع چترکوٹ|<span style="color:white;">'''Chitrakoot District'''</span>]]
|-
! 236
| [[Chitrakoot (Assembly constituency)|Chitrakoot]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 237
| [[Manikpur (Assembly constituency)|Manikpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فتح پور|<span style="color:white;">'''Fatehpur District'''</span>]]
|-
! 238
| [[Jahanabad (Vidhan Sabha constituency)|Jahanabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 239
| [[Bindki (Assembly constituency)|Bindki]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 240
| [[Fatehpur (Assembly constituency)|Fatehpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 241
| [[Ayah Shah (Assembly constituency)|Ayah Shah]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 242
| [[Husainganj (Assembly constituency)|Husainganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 243
| [[Khaga (Assembly constituency)|Khaga]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع پرتاپ گڑھ، اتر پردیش|<span style="color:white;">'''Pratapgarh District'''</span>]]
|-
! 244
| [[Rampur Khas (Assembly constituency)|Rampur Khas]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 245
| [[Babaganj (Assembly constituency)|Babaganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 246
| [[Kunda (Assembly constituency)|Kunda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 247
| [[Vishwanathganj (Assembly constituency)|Vishwanathganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 248
| [[Pratapgarh (Assembly constituency)|Pratapgarh]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 249
| [[Patti (Assembly constituency)|Patti]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 250
| [[Raniganj (Uttar Pradesh Assembly constituency)|Raniganj]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع کوشامبی|<span style="color:white;">'''Kaushambi District'''</span>]]
|-
! 251
| [[Sirathu (Assembly constituency)|Sirathu]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 252
| [[Manjhanpur (Assembly constituency)|Manjhanpur]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 253
| [[Chail (Assembly constituency)|Chail]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع الہ آباد|<span style="color:white;">'''Prayagraj District'''</span>]]
|-
! 254
| [[Phaphamau (Assembly constituency)|Phaphamau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 255
| [[Soraon (Assembly constituency)|Soraon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 256
| [[Phulpur (Assembly constituency)|Phulpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 257
| [[Pratappur (Assembly constituency)|Pratappur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 258
| [[Handia (Assembly constituency)|Handia]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 259
| [[Meja (Assembly constituency)|Meja]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 260
| [[Karachhana (Assembly constituency)|Karachhana]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 261
| [[Allahabad West (Assembly constituency)|Allahabad West]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 262
| [[Allahabad North (Assembly constituency)|Allahabad North]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 263
| [[Allahabad South (Assembly constituency)|Allahabad South]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 264
| [[Bara (Assembly constituency)|Bara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 265
| [[Koraon (Assembly constituency)|Koraon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بارہ بنکی|<span style="color:white;">'''Barabanki District'''</span>]]
|-
! 266
| [[Kursi (Assembly constituency)|Kursi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 267
| [[Ram Nagar (Assembly constituency)|Ramnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 268
| [[Barabanki (Assembly constituency)|Barabanki]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 269
| [[Zaidpur (Assembly constituency)|Zaidpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 270
| [[Dariyabad (Assembly constituency)|Dariyabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فیض آباد|<span style="color:white;">'''Ayodhya District'''</span>]]
|-
! 271
| [[Rudauli (Assembly constituency)|Rudauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بارہ بنکی|<span style="color:white;">'''Barabanki District'''</span>]]
|-
! 272
| [[Haidergarh (Assembly constituency)|Haidergarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فیض آباد|<span style="color:white;">'''Ayodhya District'''</span>]]
|-
! 273
| [[Milkipur (Assembly constituency)|Milkipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 274
| [[Bikapur (Assembly constituency)|Bikapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 275
| [[Ayodhya (Assembly constituency)|Ayodhya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 276
| [[Goshainganj (Assembly constituency)|Goshainganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع امبیڈکر نگر|<span style="color:white;">'''Ambedkar Nagar District'''</span>]]
|-
! 277
| [[Katehari (Assembly constituency)|Katehari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 278
| [[Tanda (Assembly constituency)|Tanda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 279
| [[Alapur (Assembly constituency)|Alapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 280
| [[Jalalpur (Assembly constituency)|Jalalpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 281
| [[Akbarpur (Assembly constituency)|Akbarpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بہرائچ|<span style="color:white;">'''Bahraich District'''</span>]]
|-
! 282
| [[Balha (Assembly constituency)|Balha]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 283
| [[Nanpara (Assembly constituency)|Nanpara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 284
| [[Matera (Assembly constituency)|Matera]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 285
| [[Mahasi (Assembly constituency)|Mahasi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 286
| [[بہرائچ اسمبلی حلقہ]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 287
| [[Payagpur (Assembly constituency)|Payagpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 288
| [[Kaiserganj (Assembly constituency)|Kaiserganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[شراوستی ضلع|<span style="color:white;">'''Shrawasti District'''</span>]]
|-
! 289
| [[Bhinga (Assembly constituency)|Bhinga]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 290
|[[Shrawasti (Assembly constituency)|Shrawasti]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بلرام پور|<span style="color:white;">'''Balrampur District'''</span>]]
|-
! 291
| [[Tulsipur (Assembly constituency)|Tulsipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!292
|[[Gainsari (Assembly constituency)|Gainsari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!293
|[[Utraula (Assembly constituency)|Utraula]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!294
|[[Balrampur (Assembly constituency)|Balrampur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع گونڈہ|<span style="color:white;">'''Gonda District'''</span>]]
|-
!295
|[[Mehnaun (Assembly constituency)|Mehnaun]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!296
|[[Gonda (Assembly constituency)|Gonda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!297
|[[Katra Bazar (Assembly constituency)|Katra Bazar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!298
|[[Colonelganj (Assembly constituency)|Colonelganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!299
|[[Tarabganj (Assembly constituency)|Tarabganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!300
|[[Mankapur (Assembly constituency)|Mankapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!301
|[[Gaura (Assembly constituency)|Gaura]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[نوگڑھ|<span style="color:white;">'''Siddharthnagar District'''</span>]]
|-
!302
|[[Shohratgarh (Assembly constituency)|Shohratgarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!303
|[[Kapilvastu (Assembly constituency)|Kapilvastu]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!304
|[[Bansi (Assembly constituency)|Bansi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!305
|[[Itwa (Assembly constituency)|Itwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!306
|[[Domariyaganj (Assembly constituency)|Domariyaganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بستی|<span style="color:white;">'''Basti District'''</span>]]
|-
!307
|[[Harraiya (Assembly constituency)|Harraiya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!308
|[[Kaptanganj (Assembly constituency)|Kaptanganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!309
|[[Rudhauli (Assembly constituency)|Rudhauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!310
|[[Basti Sadar (Assembly constituency)|Basti Sadar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!311
|[[Mahadewa (Assembly constituency)|Mahadewa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سنت کبیر نگر|<span style="color:white;">'''Sant Kabir Nagar District'''</span>]]
|-
!312
|[[Menhdawal (Assembly constituency)|Menhdawal]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!313
|[[Khalilabad (Assembly constituency)|Khalilabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!314
|[[Dhanghata (Assembly constituency)|Dhanghata]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[مہاراج گنج ضلع|<span style="color:white;">'''Maharajganj District'''</span>]]
|-
!315
|[[Pharenda (Assembly constituency)|Pharenda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!316
|[[Nautanwa (Assembly constituency)|Nautanwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!317
|[[Siswa (Assembly constituency)|Siswa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!318
|[[Maharajganj (Assembly constituency)|Maharajganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!319
|[[Paniyara (Assembly constituency)|Paniyara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع گورکھپور|<span style="color:white;">'''Gorakhpur District'''</span>]]
|-
!320
|[[Caimpiyarganj (Assembly constituency)|Caimpiyarganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!321
|[[Pipraich (Assembly constituency)|Pipraich]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!322
|[[Gorakhpur Urban (Assembly constituency)|Gorakhpur Urban]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!323
|[[Gorakhpur Rural (Assembly constituency)|Gorakhpur Rural]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!324
|[[Sahajanwa (Assembly constituency)|Sahajanwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!325
|[[Khajani (Assembly constituency)|Khajani]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!326
|[[Chauri-Chaura (Assembly constituency)|Chauri-Chaura]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!327
|[[Bansgaon (Assembly constituency)|Bansgaon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!328
|[[Chillupar (Assembly constituency)|Chillupar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[کشی نگر ضلع|<span style="color:white;">'''Kushinagar District'''</span>]]
|-
!329
|[[Khadda (Assembly constituency)|Khadda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!330
|[[Padrauna (Assembly constituency)|Padrauna]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!331
|[[Tamkuhi Raj (Assembly constituency)|Tamkuhi Raj]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!332
|[[Fazilnagar (Assembly constituency)|Fazilnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!333
|[[Kushinagar (Assembly constituency)|Kushinagar]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!334
|[[Hata (Assembly constituency)|Hata]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!335
|[[Ramkola (Assembly constituency)|Ramkola]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع دیوریا|<span style="color:white;">'''Deoria District'''</span>]]
|-
!336
|[[Rudrapur (Assembly constituency)|Rudrapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!337
|[[Deoria (Assembly constituency)|Deoria]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!338
|[[Pathardeva (Assembly constituency)|Pathardeva]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!339
|[[Rampur Karkhana (Assembly constituency)|Rampur Karkhana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!340
|[[Bhatpar Rani (Assembly constituency)|Bhatpar Rani]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!341
|[[Salempur (Assembly constituency)|Salempur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!342
|[[Barhaj (Assembly constituency)|Barhaj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع اعظم گڑھ|<span style="color:white;">'''Azamgarh District'''</span>]]
|-
!343
|[[Atrauliya (Assembly constituency)|Atrauliya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!344
|[[Gopalpur (Assembly constituency)|Gopalpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!345
|[[Sagri (Assembly constituency)|Sagri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!346
|[[Mubarakpur (Assembly constituency)|Mubarakpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 347
| [[Azamgarh (Assembly constituency)|Azamgarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 348
| [[Nizamabad (Assembly constituency)|Nizamabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 349
| [[Phoolpur Pawai (Assembly constituency)|Phoolpur Pawai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 350
| [[Didarganj (Assembly constituency)|Didarganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 351
| [[Lalganj (Assembly constituency)|Lalganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 352
| [[Mehnagar (Assembly constituency)|Mehnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مئو|<span style="color:white;">'''Mau District'''</span>]]
|-
! 353
| [[Madhuban (Assembly constituency)|Madhuban]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 354
| [[Ghosi (Assembly constituency)|Ghosi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 355
| [[Muhammadabad-Gohna (Assembly constituency)|Muhammadabad-Gohna]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 356
| [[Mau (Assembly constituency)|Mau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|Bhim Rajbhar
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بلیا|<span style="color:white;">'''Ballia District'''</span>]]
|-
! 357
| [[Belthara Road (Assembly constituency)|Belthara Road]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 358
| [[Rasara (Assembly constituency)|Rasara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 359
| [[Sikanderpur (Assembly constituency)|Sikanderpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 360
| [[Phephana (Assembly constituency)|Phephana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 361
| [[Ballia Nagar (Assembly constituency)|Ballia Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 362
| [[Bansdih (Assembly constituency)|Bansdih]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 363
| [[Bairia (Assembly constituency)|Bairia]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع جونپور|<span style="color:white;">'''Jaunpur District'''</span>]]
|-
! 364
| [[Badlapur (Assembly constituency)|Badlapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 365
| [[Shahganj (Assembly constituency)|Shahganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 366
| [[Jaunpur (Assembly constituency)|Jaunpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 367
| [[Malhani (Assembly constituency)|Malhani]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 368
| [[Mungra Badshahpur (Assembly constituency)|Mungra Badshahpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 369
| [[Machhlishahr (Assembly constituency)|Machhlishahr]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 370
| [[Mariyahu (Assembly constituency)|Mariyahu]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 371
| [[Zafrabad (Assembly constituency)|Zafrabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 372
| [[Kerakat (Vidhan Sabha constituency)|Kerakat]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع غازی پور|<span style="color:white;">'''Ghazipur District'''</span>]]
|-
! 373
| [[Jakhanian (Assembly constituency)|Jakhanian]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 374
| [[Saidpur (Assembly constituency)|Saidpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 375
| [[Ghazipur Sadar (Assembly constituency)|Ghazipur Sadar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 376
| [[Jangipur (Assembly constituency)|Jangipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 377
| [[Zahoorabad (Assembly constituency)|Zahoorabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 378
| [[Mohammadabad (Assembly constituency)|Mohammadabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 379
| [[Zamania (Assembly constituency)|Zamania]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع چندولی|<span style="color:white;">'''Chandauli District'''</span>]]
|-
! 380
| [[Mughalsarai (Assembly constituency)|Mughalsarai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 381
| [[Sakaldiha (Assembly constituency)|Sakaldiha]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 382
| [[Saiyadraja (Assembly constituency)|Saiyadraja]]
|
|
|Sushil Singh
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 383
| [[Chakia (Assembly constituency)|Chakia]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع وارانسی|<span style="color:white;">'''Varanasi District'''</span>]]
|-
! 384
| [[Pindra (Assembly constituency)|Pindra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|[[Ajai Rai]]
|
|
|
|-
! 385
| [[Ajagara (Assembly constituency)|Ajagara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 386
| [[Shivpur (Assembly constituency)|Shivpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 387
| [[Rohaniya (Assembly constituency)|Rohaniya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|Sunil Kumar Rai
|
|
|
|-
! 388
| [[Varanasi North (Assembly constituency)|Varanasi North]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|Dr Rajesh Mishra
|
|
|
|-
! 389
| [[Varanasi South (Assembly constituency)|Varanasi South]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 390
| [[Varanasi Cantt. (Vidhan Sabha constituency)|Varanasi Cantt.]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|Om Prakash Ojha
|
|
|
|-
! 391
| [[Sevapuri (Assembly constituency)|Sevapuri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سنت رویداس نگر|<span style="color:white;">'''Bhadohi District'''</span>]]
|-
! 392
| [[Bhadohi (Assembly constituency)|Bhadohi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 393
| [[Gyanpur (Assembly constituency)|Gyanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 394
| [[Aurai (Assembly constituency)|Aurai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مرزاپور|<span style="color:white;">'''Mirzapur District'''</span>]]
|-
! 395
| [[Chhanbey (Assembly constituency)|Chhanbey]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 396
| [[Mirzapur (Assembly constituency)|Mirzapur]]
|
|
|
|
|
|Kailash churasiya
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 397
| [[Majhawan (Assembly constituency)|Majhawan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 398
| [[Chunar (Assembly constituency)|Chunar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 399
| [[Marihan (Assembly constituency)|Marihan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[سون بھدرا ضلع|<span style="color:white;">'''Sonbhadra District'''</span>]]
|-
! 400
| [[Ghorawal (Assembly constituency)|Ghorawal]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 401
| [[Robertsganj (Assembly constituency)|Robertsganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 402
| [[Obra (Assembly constituency)|Obra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 403
| [[Duddhi (Assembly constituency)|Duddhi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|}
== رائے شماری ==
{|class="wikitable sortable" style="text-align:center;font-size:95%;line-height:16px}"|
!rowspan="2" width="100px"|تریخ اشاعت
!rowspan="2" width="175px"|پولنگ ایجنسی
!style="background:{{party color|Bharatiya Janata Party}}"|
!style="background:{{party color|Samajwadi Party}}"|
!style="text-align:center; background:{{party color|Bahujan Samaj Party}}"|
!style="text-align:center; background:{{party color|Indian National Congress}}"|
!style="background:gray;{{party color|others}}"|
!rowspan="2"|قیادت
|-
!style="width:75px;"|[[قومی جمہوری اتحاد (بھارت)|این ڈی اے]]
!style="width:75px;"|[[سماجوادی پارٹی]]
!style="width:75px;"|[[بہوجن سماج پارٹی|بی ایس پی]]
!style="width:75px;"|[[متحدہ ترقی پسند اتحاد|یو پی اے]]
!style="width:60px;"|ہور
|-
|rowspan="2"|18 مارچ 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|date=2021-03-18|title=ABP-CVoter UP Vote Share Prediction: Yogi Govt Holds Fort, SP-BSP-Congress Still Distant Second|url=https://news.abplive.com/news/india/abp-news-cvoter-up-survey-2021-election-vote-share-uttar-pradesh-seat-projection-bjp-vs-inc-vs-sp-vs-bsp-1449071|website=news.abplive.com}}</ref><ref>{{Cite web|date=2021-03-18|title=ABP-CVoter UP 2021 Seat Predictions: BJP Heads For Second Consecutive Mandate; SP-BSP Fail To Impress Voters|url=https://news.abplive.com/news/india/abp-news-cvoter-up-survey-election-seat-projection-uttar-pradesh-seat-projection-bjp-vs-inc-vs-sp-vs-bsp-1449077|access-date=2021-08-19|website=news.abplive.com}}</ref>
|{{Party shading/BJP}}|'''284-294'''
|54-64
|33-43
|1-7
|10-16
|{{Party shading/BJP}}|'''220-240'''
|-
|{{Party shading/BJP}}|'''41.0%'''
|24.4%
|20.8%
|5.9%
|7.9%
|{{Party shading/BJP}}|'''16.6%'''
|-
|rowspan="2"|3 ستمبر 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|date=2021-09-03|title=UP Election 2022 Predictions: ABP-CVoter Survey Says BJP Will Win But With Fewer Seats|url=https://news.abplive.com/news/india/abp-news-cvoter-survey-up-assembly-election-2022-predictions-vote-share-seat-sharing-kaun-banega-mukhyamantri-bjp-sp-bsp-congress-1480050|access-date=2021-09-03|website=news.abplive.com}}</ref>
|{{Party shading/BJP}}|'''259-267'''
|109-117
|12-16
|3-7
|6-10
|{{Party shading/BJP}}|'''142-158'''
|-
|{{Party shading/BJP}}|'''41.8%'''
|30.2%
|15.7%
|5.1%
|7.2%
|{{Party shading/BJP}}|'''11.6%'''
|-
|rowspan="2"|8 اکتوبر 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|date=2021-10-08|title=ABP-CVoter Survey: BJP To Retain Power In UP With Massive Mandate In 2022 Assembly Polls|url=https://news.abplive.com/news/india/abp-news-cvoter-survey-snap-poll-uttar-pradesh-election-2022-kaun-banerga-mukhyamantri-final-vote-share-seat-share-1486657|access-date=2021-10-14|website=news.abplive.com}}</ref>
|{{Party shading/BJP}}|'''241-249'''
|130-138
|15-19
|3-7
|0-4
|{{Party shading/BJP}}|'''103-119'''
|-
|{{Party shading/BJP}}|'''41.3%'''
|32.4%
|14.7%
|5.6%
|6.0%
|{{Party shading/BJP}}|'''8.9%'''
|-
|rowspan="2"|13 نومبر 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|date=2021-11-13|title=AUP polls: BJP favourite, SP gains momentum, shows ABP-CVoter survey|url=https://www.hindustantimes.com/india-news/up-polls-bjp-favourite-sp-gains-momentum-shows-abp-cvoter-survey-101636778232753.html|access-date=2021-12-09|website=www.hindustantimes.com}}</ref>
|{{Party shading/BJP}}|'''213-221'''
|152-160
|16-20
| 6-10
| NA
|{{Party shading/BJP}}|'''53-69'''
|-
|{{Party shading/BJP}}|'''40.7%'''
|31.1%
|15.1%
|9.0%
|4.1%
|{{Party shading/BJP}}|'''9.6%'''
|-
|rowspan="2"|11 دسمبر 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|last=|first=|date=2021-12-11|title=ABP News-CVoter Survey: BJP In Driver's Seat In UP, Projected To Win 212 To 224 Seats|url=https://news.abplive.com/news/india/abp-news-cvoter-survey-bjp-in-driver-s-seat-in-up-projected-to-win-212-to-224-seats-1499127|url-status=live|access-date=2021-12-11|website=news.abplive.com|language=en}}</ref>
|{{Party shading/BJP}}|'''212-224'''
|151-163
|12-24
| 2-10
| 2-6
|{{Party shading/BJP}}|'''49-73'''
|-
|{{Party shading/BJP}}|'''40.4%'''
|33.6%
|13.2%
|7.3%
|5.5%
|{{Party shading/BJP}}|'''6.8%'''
|}
== حوالے ==
=== نوٹ ===
{{Notelist}}
=== حوالے ===
{{حوالے}}
{{Portal|بھارت}}
[[گٹھ:بھارت وچ انتخابات]]
[[گٹھ:بھارت وچ ریاستی اسمبلی دے انتخابات، 2022ء]]
[[گٹھ:اتر پردیش مجلس قانون ساز دے انتخابات، 2022ء]]
[[گٹھ:صفحات مع گراف]]
[[گٹھ:چھوٹے پیغام خانیاں دا استعمال کرنے والے مضامین]]
nzt0wt0i448j2gsfq9y1flfgxxxb72i
691024
691023
2025-07-11T04:54:42Z
KiranBOT
41346
removed AMP tracking from URLs ([[:m:User:KiranBOT/AMP|details]]) ([[User talk:Usernamekiran|report error]]) v2.2.7r
691024
wikitext
text/x-wiki
{{اُردو}}{{Infobox election
| election_name = اترپردیش مجلس قانون ساز دے انتخابات، 2022ء
| country = بھارت
| type = قانون ساز
| ongoing = نئيں
| previous_election = اترپردیش مجلس قانون ساز دے انتخابات، 2017ء
| previous_year = 2017
| election_date = 10 فروری – 7 مارچ 2022
| next_election = اترپردیش مجلس قانون ساز دے انتخابات، 2027ء
| next_year = 2027
| seats_for_election = [[اتر پردیش مجلس قانون ساز]] دی تمام 403 نشستاں
| majority_seats = 202
| image1 = [[File:The Uttar Pradesh Chief Minister, Shri Yogi Adityanath in New Delhi on February 10, 2018 (cropped).jpg|120x120px]]
| leader1 = [[یوگی آدتیہ ناتھ]]
| party1 = بھارتیہ جنتا پارٹی
| alliance1 = [[قومی جمہوری اتحاد (بھارت)|این ڈی اے]]
| leader_since1 = 2017
| leaders_seat1 = گورکھپور
| last_election1 = 325 نشستاں<br />41.35% ووٹ
| title = [[اتر پردیش دے وزرائے اعلیٰ دی لسٹ|وزیر اعلیٰ]]
| before_election = یوگی آدتیہ ناتھ
| before_party = بھارتیہ جنتا پارٹی
| after_election = یوگی آدتیہ ناتھ
| after_party = بھارتیہ جنتا پارٹی
| image2 = [[File:Akhilesh Yadav (14335961811).jpg|120x120px]]
| leader2 = [[اکھلیش یادو]]
| leader_since2 = 2012
| party2 = سماج وادی پارٹی
| alliance2 = [[سماج وادی پارٹی|ایس پی+]]
| leaders_seat2 = کرہل
| last_election2 = 54 نشستاں<br />28.07% ووٹ
| image3 =
| leader3 = [[پرینکا گاندھی]]
| party3 = انڈین نیشنل کانگریس
| alliance3 = -
| leader_since3 = 2019
| leaders_seat3 = ''کوئی مقابل نئيں''
| last_election3 = 7 نشستاں <br /> 6.25% ووٹ
| image4 = [[File:Mayawati.jpg|120x120px]]
| leader4 = [[مایاوندی]]
| party4 = بہوجن سماج پارٹی
| alliance4 = -
| leader_since4 = 1995
| leaders_seat4 = ''کوئی مقابل نئيں''
| last_election4 = 19 نشستاں<br />22.23% ووٹ
| image5 =
| leader5 = [[رگھوراج پرتاپ سنگھ]]
| party5 = [[جن ستا دل (لوک تانترک)]]
| alliance5 = -
| leader_since5 = 2018
| leaders_seat5 = کنڈا
| last_election5 = نیا
| map_image = [[File:2022 Uttar Pradesh Election.svg|400px]]
| map_alt = Map of constituencies of the Uttar Pradesh Legislative Assembly
| map_caption = اتر پردیش مجلس قانون ساز دے حلقے
| seats1 = '''273'''<ref>{{cite web |date=2022-03-10|title=UP Election Result by ECI |url= https://results.eci.gov.in/ResultAcGenMar2022/partywiseresult-S24.htm?st=S24| access-date=2022-03-10 |website=ECI |language=en}}</ref>
| seat_change1 = {{decrease}} 52
| seats2 = 125
| seat_change2 = {{increase}} 71
| seats3 = 2
| seat_change3 = {{decrease}} 5
| seats4 = 1
| seat_change4 = {{decrease}} 18
| seats5 = 2
| seat_change5 = {{increase}} 2
| percentage1 = '''43.82%'''
| swing1 = {{increase}} 2.47%
| percentage2 = 36.32%
| swing2 = {{increase}} 8.25%
| percentage3 = 2.33%
| swing3 = {{decrease}} 3.92%
| percentage4 = 12.88%
| swing4 = {{decrease}} 9.35%
| percentage5 = 0.21%<ref>{{cite web |date=2022-03-10|title=UP Election Result by ECI |url= https://results.eci.gov.in/ResultAcGenMar2022/partywiseresult-S24.htm?st=S24| access-date=2022-03-10 |website=ECI |language=en}}</ref>
| swing5 = {{increase}} 0.21%
| popular_vote1 = '''40,385,487'''
| popular_vote2 = 33,471,407
| popular_vote3 = 2,151,234
| popular_vote4 = 11,873,137
| popular_vote5 = 191,874
| turnout = 60.8% ({{decrease}} 0.31%) <ref>{{cite web |date=2022-03-10|title= Assembly polls: Turnout of women exceeds male voters’ in UP this year |url=https://timesofindia.indiatimes.com/india/assembly-polls-turnout-of-women-exceeds-male-voters-in-up-this-year/articleshow/90111868.cms | access-date=2022-03-10 |website=Times of India |language=en}}</ref>
}}
'''اترپردیش مجلس قانون ساز دے انتخابات، 2022ء''' 10 فروری توں 7 مارچ 2022 تک [[اتر پردیش]] وچ [[اتر پردیش مجلس قانون ساز]] دے تمام 403 اراکین نوں منتخب کرنے دے لئی ست مرحلےآں وچ منعقد ہوئے۔ 10 مارچ 2022 نوں ووٹاں دی گنتی ہوئی تے نتائج دا اعلان کيتا گیا۔
== پس منظر ==
[[اتر پردیش مجلس قانون ساز]] دی میعاد 14 مئی 2022ء نوں ختم ہونے والی اے۔<ref name=":1">c</ref> [[اتر پردیش مجلس قانون ساز دے انتخابات، 2017ء|پچھلے اسمبلی انتخابات]] فروری توں مارچ 2017 وچ منعقد ہوئے سن ۔ انتخابات دے بعد، [[بھارتیہ جنتا پارٹی]] نے [[حکومت اتر پردیش|ریاستی حکومت]] قائم کيتی، [[یوگی آدتیہ ناتھ]] [[اتر پردیش دے وزرائے اعلیٰ دی لسٹ|وزیر اعلیٰ]] بنے۔<ref>{{cite web |date=2017-03-19 |editor-last=Chakraborty |editor-first=Ananya |others=PTI |title=Yogi Adityanath Takes Oath as Uttar Pradesh Chief Minister |url=https://www.news18.com/news/politics/yogi-adityanath-takes-oath-as-uttar-pradesh-chief-minister-1361750.html |access-date=2022-01-08 |website=News18 |language=en}}</ref>
=== پنچايتی انتخابات ===
2021 دے اتر پردیش پنچایت انتخابات وچ ، [[سماج وادی پارٹی|ایس پی]] نے 760 وارڈ جِت لئی، اس دے بعد [[بی جے پی]] نے 719 وارڈاں دے نال کامیابی حاصل کيتی۔ [[بہوجن سماج پارٹی]] نے 381 تے [[انڈین نیشنل کانگریس]] نے 76 وارڈ جتے۔ آزاد تے چھوٹی جماعتاں نے 1,114 وارڈاں وچ کامیابی حاصل کيتی۔<ref name="UP panchayat elections HT">{{cite news |last=Singh |first=Rajesh Kumar |date=5 مئی 2021 |title=Setback for BJP in key areas in UP panchayat elections |language=en |work=Hindustan Times |url=https://www.hindustantimes.com/india-news/spmakes-gains-bjp-jolted-in-up-panchayat-polls-101620154099505.html |access-date=12 فروری 2022}}</ref> پنچايتی انتخابات وچ [[عام آدمی پارٹی|اے اے پی]] نے 64 تے [[کل ہند مجلس اتحاد المسلمین|اے آئی ایم آئی ایم]] نے 22 وارڈ جتے۔<ref>{{cite news |title=UP Panchayat Elections: AAP Wins One Seat Each in Varanasi, Gorakhpur; AIMIM Raises its Graph |url=https://www.news18.com/news/politics/up-panchayat-elections-aap-wins-one-seat-each-in-varanasi-gorakhpur-while-aimim-raises-its-graph-3712574.html |access-date=10 فروری 2022 |work=News18 |date=6 مئی 2021 |language=en}}</ref>
=== سیاسی پیش رفت ===
جنوری 2022 وچ ، دس [[بھارتیہ جنتا پارٹی|بی جے پی]] ریاستی قانون ساز بشمول تن وزراء، پارٹی چھڈ کے [[سماج وادی پارٹی]] وچ شامل ہوئے۔<ref>{{Cite news |last=Biswas |first=Soutik |date=2022-01-14 |title=Uttar Pradesh elections: Is a rebellion brewing in Modi's BJP? |language=en-GB |work=BBC News |url=https://www.bbc.com/news/world-asia-india-59979808 |access-date=2022-01-15}}</ref> 19 جنوری ناں، [[ملائم سنگھ یادو]] دی بہو اپارنا بشت یادو نے بی جے پی وچ شمولیت اختیار کيتی۔<ref>{{Cite news |last=Mathew |first=Liz |date=2022-01-19 |title=Uttar Pradesh elections: Aparna Yadav joins BJP. |language=en-GB |work=The Indian Express |url=https://indianexpress.com/elections/aparna-yadav-sp-bjp-mulayam-singh-daughter-in-law-up-7731161/lite/ |access-date=2022-02-02}}</ref> انہاں دے بعد ملائم سنگھ دے بہنوئی پرمود گپتا نے 20 جنوری نوں بی جے پی وچ شمولیت اختیار کيتی۔<ref>{{Cite news|date=2022-01-20|title=Uttar Pradesh elections: Pramod Gupta joins BJP.|language=en-GB|work=The Times of India|url=https://timesofindia.indiatimes.com/city/lucknow/up-elections-2022-samajwadi-party-patriarch-mulayam-singh-yadavs-brother-in-law-pramod-gupta-joins-bjp/articleshow/89012860.cms|access-date=2022-02-02}}</ref> 25 جنوری نوں سابق مرکزی وزیر تے کانگریس لیڈر [[رتن جِت پرتاپ نارائن سنگھ]] نے بی جے پی وچ شمولیت اختیار کيتی۔<ref>{{Cite news |last=Hebbar |first=Nistula |date=2022-01-25 |title=R.P.N. Singh joins BJP, party says boost to prospects in eastern U.P. |language=en-IN |work=The Hindu |url=https://www.thehindu.com/elections/uttar-pradesh-assembly/rpn-singh-resigns-from-congress-all-set-to-join-bjp/article38323169.ece |access-date=2022-03-03 |issn=0971-751X}}</ref>
== نظام الاوقات ==
انتخابی نظام الاوقات دا اعلان [[بھارتی الیکشن کمیشن]] نے 8 جنوری 2022ء نوں کيتا سی۔<ref>{{cite web |last=Gupta |first=Shubhangi |date=2022-01-08 |title=Assembly elections 2022: Check complete schedule for Uttar Pradesh, Uttarakhand, Goa, Manipur & Punjab |url=https://www.hindustantimes.com/elections/assembly-election-2022-date-check-complete-polling-schedule-for-uttar-pradesh-uttarakhand-goa-manipur-punjab-101641639532618.html |access-date=2022-01-08 |website=Hindustan Times |language=en}}</ref>
[[File:UP phase wise election schedule 2022.svg|انتخابی حلفےآں دا نقشہ تے انہاں دے مراحل|300px|thumb|مرکز]]
{| class="wikitable"
|-
! rowspan="3" | پول ایونٹ
! colspan="7" | مرحلہ
|-
!I
!II
!III
!IV
!V
!VI
!VII
|-
| style="background:#810081;"|
| style="background:#0000fe;"|
| style="background:#0ff;"|
| style="background:#00ff01;"|
| style="background:#ff0;"|
| style="background:#f60;"|
| style="background:#fe0000;"|
|-
! اطلاع دی تریخ
|14 جنوری 2022
|21 جنوری 2022
|25 جنوری 2022
|27 جنوری 2022
|1 فروری 2022
|4 فروری 2022
|10 فروری 2022
|-
! کاغذات نامزدگی داخل کرنے دی آخری تریخ
|21 جنوری 2022
|28 جنوری 2022
|1 فروری 2022
|3 فروری 2022
|8 فروری 2022
|11 فروری 2022
|17 فروری 2022
|-
! نامزدگی دی جانچ پڑتال
|24 جنوری 2022
|29 جنوری 2022
|2 فروری 2022
|4 فروری 2022
|9 فروری 2022
|14 فروری 2022
|18 فروری 2022
|-
! کاغذات نامزدگی واپس لینے دی آخری تریخ
|27 جنوری 2022
|31 جنوری 2022
|4 فروری 2022
|7 فروری 2022
|11 فروری 2022
|16 فروری 2022
|22 فروری 2022
|-
! رائے شماری دی تریخ
|10 فروری 2022
|14 فروری 2022
|20 فروری 2022
|23 فروری 2022
|27 فروری 2022
|3 مارچ 2022
|7 مارچ 2022
|-
!ووٹاں دی گنتی دی تریخ
| colspan="7" style="text-align:center" | '''10 مارچ 2022ء'''
|}
{| class="wikitable"
|-
! colspan="7" | مرحلہ
|-
!I
(58 اسمبلیاں، 11 ضلعے)
!II
(55 اسمبلیاں، 9 ضلعے)
!III
(59 اسمبلیاں، 16 ضلعے)
!IV
(59 اسمبلیاں، 9 ضلعے)
!V
(61 ااںسمبلیاں، 11 ضلعے)
!VI
(57 اسمبلیاں، 10 ضلعے)
!VII
(54 اسمبلیاں، 9 ضلعے)
|-
| style="background:#810081;"|
| style="background:#0000fe;"|
| style="background:#0ff;"|
| style="background:#00ff01;"|
| style="background:#ff0;"|
| style="background:#f60;"|
| style="background:#fe0000;"|
|- style="vertical-align: top;"
||
* [[ضلع شاملی|شاملی]]
* [[ضلع مظفرنگر|مظفر نگر]]
* [[ضلع میرٹھ|میرٹھ]]
* [[ضلع باغپت|باغپت]]
* [[غازی آباد، بھارت|غازی آباد]]
* [[ضلع ہاپڑ|ہاپوڑ]]
* [[ضلع گوتم بدھ نگر|گوتم بدھ نگر]]
* [[ضلع بلندشہر|بلند شہر]]
* [[ضلع علی گڑھ|علی گڑھ]]
* [[ضلع متھرا|متھرا]]
* [[ضلع آگرہ|آگرہ]]
||
* [[ضلع سہارنپور|سہارنپور]]
* [[ضلع بجنور|بجنور]]
* [[ضلع مرادآباد|مرادآباد]]
* [[ضلع سنبھل|سنبھل]]
* [[رام پور ضلع|رامپور]]
* [[ضلع امروہہ|امروہہ]]
* [[ضلع بدایاں|بدایاں]]
* [[ضلع بریلی|بریلی]]
* [[ضلع شاہجہان پور|شاہجہان پور]]
||
* [[ضلع ہتھ رس|ہاتھرس]]
* [[ضلع فیروز آباد|فیروز آباد]]
* [[ضلع کانسی رام نگر|کاسگنج]]
* [[ضلع ایٹہ|ایٹہ]]
* [[ضلع مین پوری|مین پوری]]
* [[ضلع فرخ آباد|فرخ آباد]]
* [[قنوج ضلع|قنوج]]
* [[ضلع اٹاوہ|اٹاوہ]]
* [[ضلع اوریا|اوریا]]
* [[ضلع کانپور دیہات|کانپور دیہات]]
* [[ضلع کانپور نگر|کانپور نگر]]
* [[ضلع جالون|جالون]]
* [[جھانسی ضلع|جھانسی]]
* [[للت پور ضلع، بھارت|للت پور]]
* [[ضلع حمیرپور، اترپردیش|حمیرپور]]
* [[مہوبا ضلع|مہوبا]]
||
* [[ضلع پیلی بھیت|پیلی بھیت]]
* [[لکھیم پور کھیری ضلع|لکھیم پور کھیری]]
* [[ضلع سیتاپور|سیتاپور]]
* [[ہردوئی ضلع|ہردوئی]]
* [[اناؤ ضلع|اناؤ]]
* [[ضلع لکھنؤ|لکھنؤ]]
* [[رائے بریلی ضلع|رائے بریلی]]
* [[ضلع باندہ|باندہ]]
* [[ضلع فتح پور|فتح پور]]
||
* [[ضلع امیتھی|امیٹھی]]
* [[ضلع سلطان پور|سلطان پور]]
* [[ضلع چترکوٹ|چترکوٹ]]
* [[ضلع پرتاپ گڑھ، اتر پردیش|پرتاپ گڑھ]]
* [[ضلع کوشامبی|کوشمبی]]
* [[ضلع الہ آباد|پریاگ راج]]
* [[ضلع بارہ بنکی|بارہ بنکی]]
* [[ضلع فیض آباد|ایودھیا]]
* [[ضلع بہرائچ|بہرائچ]]
* [[شراوستی ضلع|شراوستی]]
* [[ضلع گونڈہ|گونڈہ]]
||
* [[ضلع امبیڈکر نگر|امبیڈکر نگر]]
* [[ضلع بلرام پور|بلرامپور]]
* [[ضلع سدھارتھ نگر|سدھارتھ نگر]]
* [[ضلع بستی|بستی]]
* [[ضلع سنت کبیر نگر|سنت کبیر نگر]]
* [[مہاراج گنج ضلع|مہاراج گنج]]
* [[ضلع گورکھپور|گورکھپور]]
* [[کشی نگر ضلع|کشی نگر]]
* [[ضلع دیوریا|دیوریا]]
* [[ضلع بلیا|بلیا]]
||
* [[ضلع اعظم گڑھ|اعظم گڑھ]]
* [[ضلع مئو|مئو]]
* [[ضلع غازی پور|غازی پور]]
* [[ضلع جونپور|جونپور]]
* [[ضلع چندولی|چنڈولی]]
* [[ضلع وارانسی|ورانسی]]
* [[ضلع سنت رویداس نگر|بھداوہی]]
* [[ضلع مرزاپور|مرزا پور]]
* [[سون بھدرا ضلع|سون بھدرا]]
|}
== پارٹیاں تے اتحاد ==
=== {{legend2|{{party color|National Democratic Alliance}}|[[قومی جمہوری اتحاد (بھارت)|قومی جمہوری اتحاد]]}} ===
ستمبر دے مہینے دے دوران؛ این ڈی اے نے بی جے پی، اے ڈی (ایس) تے [[نشاد پارٹی]] دے درمیان وچ اتحاد دی تصدیق کيتی۔<ref>{{cite web|title=Our aim is to ensure NDA's victory in UP election, says Sanjay Nishad|url=https://www.aninews.in/news/national/general-news/our-aim-is-to-ensure-ndas-victory-in-up-election-says-sanjay-nishad20210928095903/|access-date=2021-12-05|website=ANI News|language=en}}</ref><ref>{{cite web|title=NDA alliance takes shape in Uttar Pradesh; BJP, Nishad party and Apna Dal to contest upcoming Assembly polls|url=https://www.tribuneindia.com/news/nation/uttar-pradesh-nda-alliance-takes-shape-bjp-nishad-party-and-apna-dal-to-contest-the-upcoming-assembly-elections-315639|access-date=2021-12-05|website=Tribuneindia News Service|language=en}}</ref> اگست دے مہینے دے دوران، این ڈی اے نے [[جنتا دل (متحدہ)|جے ڈی (یو)]]، [[ہندوستانی عوام مورچا|ایچ اے ایم]]<ref>{{cite web|date=نومبر 16, 2021|first=Himanshu|last=Mishra|title=JD(U) likely to contest Uttar Pradesh election in alliance with BJP in 2022|url=https://www.indiatoday.in/india/story/jdu-likely-contest-uttar-pradesh-election-alliance-bjp-2022-1877097-2021-11-16|access-date=2021-12-05|website=India Today|language=en}}</ref> تے ہور انہاں ورگی جماعتاں دے نال گل گل کیتی، اُتے سیٹاں دی تقسیم دی گل گل بعد وچ ٹُٹ گئی۔ اکتوبر وچ ، نويں چہراں دے نال اتحاد دی طرف توں وڈی تنظیم نو دیاں کوششاں ہوئیاں تے اقتدار مخالف توں لڑنے دی کوششاں وچ پارٹیاں دی اصلاح کيتی گئی۔ دسمبر دے پہلے 2 ہفتےآں وچ ، اتحاد نے انتخابی مہم دا آغاز کيتا۔ <ref>{{Cite news|title=UP Assembly election 2022 : Top BJP leaders to hold 6 rallies next week|work=The Economic Times|url=https://economictimes.indiatimes.com/news/elections/assembly-elections/uttar-pradesh/up-assembly-election-2022-top-bjp-leaders-to-hold-6-rallies-next-week/articleshow/88094554.cms|access-date=2021-12-05}}</ref> 13 جنوری نوں قومی جمہوری اتحاد نے اپنے سیٹاں دی تقسیم دے معاہدے اُتے مہر ثبت دی جس وچ نشاد پارٹی نوں 16 تے اپنا دل نوں 17 تے بی جے پی نوں باقی 370 سیٹاں اُتے مقابلہ کرنا پيا۔ نشاد پارٹی دے 6 امیدوار بی جے پی دے نشان اُتے لڑاں گے۔<ref>{{Cite web |title=Known for Its Meteoric Rise, Is UP's Nishad Party Set for Success This Time? |url=https://thewire.in/politics/known-for-its-meteoric-rise-can-ups-nishad-party-repeat-the-feat-this-time |access-date=2022-03-07 |website=The Wire}}</ref>
{| class="wikitable" style="width:50%;"
!نمبر.
! پارٹی<ref>{{cite web|last=|first=|date=2021-09-24|title=UP Election 2022: BJP announces alliance with Nishad Party, Apna Dal|url=https://www.indiatvnews.com/elections/news-up-election-2022-bjp-announces-alliance-with-nishad-party-apna-dal-736206|url-status=live|access-date=2021-09-24|website=www.indiatvnews.com|language=en}}</ref>
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
!سوانیاں امیدوار
|-
| style="text-align:center; background:{{party color|Bharatiya Janata Party}};color:white" ! |'''1.'''
| [[بھارتیہ جنتا پارٹی]]
| [[File:BJP flag.svg|50px]]
| rowspan="2" | [[File:Lotus flower symbol.svg|50px]]
| [[یوگی آدتیہ ناتھ]]
| [[File:The Uttar Pradesh Chief Minister, Shri Yogi Adityanath meeting the President, Shri Ram Nath Kovind, at Rashtrapati Bhavan, in New Delhi on February 10, 2018 (cropped).jpg|50px]]
|''370''
|''328''
|''42''
|-
| rowspan="2" style="text-align:center; background:{{party color|NISHAD Party}};color:white" |'''2.'''
| rowspan="2" |[[نشاد پارٹی]]
| rowspan="2" |[[File:No image available.svg|50x50px]]
|شراون نشاد
|[[File:Circle-icons-profile.svg|50x50px]]
|6
|5
|1
|-
| [[File:No image available.svg|50x50px]]
|سنجے نشاد
|[[File:Circle-icons-profile.svg|50x50px]]
|''10''
|''10''
|''0''
|-
| style="text-align:center; background:{{party color|Apna Dal (Sonelal)}};color:white" ! |'''3.'''
| [[اپنا دل (سونے لال)]]
| [[File:Apna dal Flag.svg|50x50px]]
|
| [[انو پریا پٹیل]]
|
|''17''
|''14''
|''3''
|-
! colspan="6" |کل
!403
!357
!46
|}
=== {{legend2|{{party color|Samajwadi Party}}|[[سماجوادی پارٹی|سماجوادی پارٹی+]]}} ===
آر ایل ڈی سب توں پہلے اتحاد وچ شامل ہويا سی۔ بعد وچ اکھلیش یادو نے اعلان کيتا کہ اوہ صرف علاقائی پارٹیاں دے نال شراکت داری دے لئی تیار نيں قومی پارٹیاں توں نئيں۔ این سی پی تے آر جے ڈی وی بعد وچ اتحاد وچ شامل ہوئے۔<ref>{{cite web|date=2021-07-27|title=NCP to tie up with SP for UP assembly polls|url=https://www.hindustantimes.com/cities/lucknow-news/ncp-to-tie-up-with-sp-for-up-assembly-polls-101627408459880.html|access-date=2021-12-04|website=Hindustan Times|language=en}}</ref> مختلف کئی چھوٹی پارٹیاں وی شامل ہوئیاں، جدوں کہ ایس بی ایس پی نے ایس پی اتحاد وچ شامل ہونے دے لئی اپنے اتحاد توں وکھ ہو گئے۔<ref>{{Cite news|title=SP-SBSP join hands, give slogan 'Khadeda Hobe' on lines of Mamata's 'Khela Hobe' battle cry|work=The Economic Times|url=https://economictimes.indiatimes.com/news/elections/assembly-elections/uttar-pradesh/sp-sbsp-join-hands-give-slogan-khadeda-hobe-on-lines-of-mamatas-khela-hobe-battle-cry/articleshow/87314480.cms?from=mdr|access-date=2021-12-04}}</ref> پہلی نشستاں دی تقسیم دی گل گل دے دوران، ایس پی نے آر ایل ڈی نوں 36 سیٹاں دینے اُتے اتفاق کيتا۔ ابتدائی طور پر، آر ایل ڈی نے 60 سیٹاں دا مطالبہ کيتا جدوں کہ ایس پی 30 تک دینے دے لئی تیار سی، بعد وچ دونے پارٹیاں نے 33 اُتے فائنل کيتا تے آر ایل ڈی زیادہ تر [[مغربی اتر پردیش|مغربی یوپی]] وچ مقابلہ کر رہی سی۔ آر ایل ڈی نے ایس پی امیدواراں نوں 8 نشان دیے۔<ref>{{Cite news|last=Anshuman|first=Kumar|title=SP, RLD strike poll alliance|work=The Economic Times|url=https://economictimes.indiatimes.com/news/politics-and-nation/sp-rld-strike-poll-alliance/articleshow/87839894.cms|access-date=2021-12-04}}</ref> عام آدمی پارٹی تے سماج وادی پارٹی دے درمیان اتحاد دے لئی گل گل شروع ہوئی،<ref>{{cite web|date=نومبر 24, 2021|first=Kumar|last=Abhishek|title=AAP heading for alliance with SP, Sanjay Singh says after meeting Akhilesh Yadav|url=https://www.indiatoday.in/elections/uttar-pradesh-assembly-polls-2022/story/aap-samajwadi-party-alliance-sanjay-singh-arvind-kejriwal-akhilesh-yadav-1880244-2021-11-24|access-date=2021-12-05|website=India Today|language=en}}</ref><ref>{{cite web|date=2021-11-25|title=AAP, SP discuss seat-sharing for UP polls|url=https://indianexpress.com/article/cities/lucknow/aap-samajwadi-party-alliance-up-elections-7639022/|access-date=2021-12-07|website=The Indian Express|language=en}}</ref> اُتے اوہ نشستاں دی تقسیم اُتے متفق نئيں ہو سکے۔<ref>{{Cite news|title=AAP-SP deadlock over seat sharing, AAP to go it alone in UP|work=The Economic Times|url=https://economictimes.indiatimes.com/news/elections/assembly-elections/uttar-pradesh/aap-sp-deadlock-over-seat-sharing-aap-to-go-it-alone-in-up/articleshow/88274708.cms?from=mdr|access-date=2021-12-17}}</ref> پرگتیشیل سماج وادی پارٹی (لوہیا) بعد وچ اس اتحاد وچ شامل ہوئی۔ 13 جنوری 2022 ناں، اتحاد نے انتخابات دے پہلے چند مراحل دے لئی اپنے ابتدائی امیدواراں دا اعلان کيتا۔ ایس پی تے ایس بی ایس پی وچ 1 سیٹ اُتے دوستانہ مقابلہ ہوئے گا جدوں کہ ایس پی تے اے ڈی (کے) دے درمیان 2 سیٹاں اُتے دوستانہ مقابلہ ہوئے گا۔{{Citation needed|date=مارچ 2022}}
{| class="wikitable" style="width:50%;"
!نمبر.
!پارٹی<ref>{{cite web|date=2021-12-23|title=From RLD to Mahan Dal, SP's new allies: the smaller parties|url=https://indianexpress.com/article/india/political-pulse/samajwadi-party-coalition-partners-election-7685431/|access-date=2022-01-21|website=The Indian Express|language=en}}</ref><ref>{{cite web|last=|first=|date=2022-01-13|title=SP & Allies Parade Strength & Unity, Chalk Out Consensus On Seat-sharing {{!}} Lucknow News – Times of India|url=https://timesofindia.indiatimes.com/city/lucknow/sp-allies-parade-strength-unitychalk-out-consensus-on-seat-sharing/articleshow/88865020.cms|url-status=live|access-date=2022-01-21|website=The Times of India|language=en}}</ref>
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
! سوانیاں امیدوار
|-
| style="text-align:center; background:{{party color|Samajwadi Party}};color:white" ! |'''1.'''
| [[سماجوادی پارٹی]]
|
| rowspan="5" | [[File:Indian Election Symbol Cycle.png|50px]]
| [[اکھلیش یادو]]
| [[File:Akhilesh Yadav (14335961811).jpg|50px]]
|343
|''301''
|''42''
|-
| style="text-align:center; background:{{party color|Pragatisheel Samajwadi Party (Lohiya)}};color:black" ! |'''2.'''
| [[پرگتیشیل سماجوادی پارٹی (لوہیا)]]
| [[File:प्रसपा लोहिया ध्वज.jpg|50x50px]]
| [[شیوپال سنگھ یادو]]
|[[File:Shivpal Singh Yadav, 2016.jpg|50x50px]]
|1
|1
|0
|-
| style="text-align:center; background:{{party color|Mahan Dal}};color:white" |'''3.'''
|[[مہان دل]]
|[[File:No image available.svg|50x50px]]
|کیشو دیو موریا
|[[File:Circle-icons-profile.svg|50x50px]]
|2
|1
|1
|-
| style="text-align:center; background:{{Party color|Janvadi Party (Socialist)}};color:white" |'''4.'''
|[[جن وادی پارٹی (سوشلسٹ)]]
|[[File:No image available.svg|50x50px]]
|[[سنجے چوہان (سیاست داں)|سنجے چوہان]]
|[[File:Circle-icons-profile.svg|50x50px]]
|1
|1
|0
|-
| rowspan="2" style="text-align:center; background:{{party color|Apna Dal (Kamerawadi)}};color:white"|'''5.'''
| rowspan="2" |[[اپنا دل (کمیراوادی)]]
| rowspan="2" |[[File:Apna dal Flag.svg|50x50px]]
|ڈاکٹر. پلوی پٹیل
|[[File:Circle-icons-profile.svg|50x50px]]
|1
|0
|1
|-
|[[File:No image available.svg|50x50px]]
|کرشنا پٹیل
|[[File:Circle-icons-profile.svg|50x50px]]
|4
|3
|1
|-
| style="text-align:center; background:{{party color|Rashtriya Lok Dal}};color:white" ! |'''6.'''
| [[راشٹریہ لوک دل]]
|
|[[File:Indian Election Symbol Hand Pump.png|50px]]
|[[جینت چودھری]]
|
|33
|31
|2
|-
| style="text-align:center; background:{{party color|Suheldev Bharatiya Samaj Party}};color:black" ! |'''7.'''
|[[سہیل دیو بھارتیہ سماج پارٹی]]
|[[File:No image available.svg|50x50px]]
|
|[[اوم پرکاش راج بھر]]
|[[File:Circle-icons-profile.svg|50x50px]]
|''17''
|''16''
|''1''
|-
| style="text-align:center; background:{{party color|Nationalist Congress Party}};color:white" ! |'''8.'''
| [[راشٹروادی کانگریس پارٹی]]
| [[File:NCP-flag.svg|50px]]
| [[File:Nationalist Congress Party Election Symbol.png|50px]]
| دے کے شرما
|[[File:Circle-icons-profile.svg|50x50px]]
| 1<ref>{{cite web|last=|first=|date=2022-01-13|title=SP declares alliance with NCP, gives lone Anupshahr seat to ally {{!}} Meerut News – Times of India|url=https://timesofindia.indiatimes.com/city/meerut/sp-declares-alliance-with-ncp-gives-lone-anupshahr-seat-to-ally/articleshow/88862336.cms|url-status=live|access-date=2022-01-21|website=The Times of India|language=en}}</ref>
| 1
| 0
|-
! colspan="6" |کل
!402
! اعلان ہونا باقی
!اعلان ہونا باقی
|}
=== {{legend2|{{party color|Bahujan Samaj Party}}|[[بہوجن سماج پارٹی]]}} ===
پچھلے سالاں دے برعکس، [[بہوجن سماج پارٹی]] نے اعلان کيتا سی کہ اوہ خود الیکشن لڑے گی۔<ref name=":0" /> بی ایس پی نے اپنی توسیع و حمایت دے لئی دس چھوٹی سیاسی جماعتاں یعنی انڈیا جنہاں شکتی پارٹی، پچاسی پریورتن سماج پارٹی، وشو شانتی پارٹی، سنیکت جنہاں دیش پارٹی، آدرش سنگرام پارٹی، اکھنڈ وکاس بھارت پارٹی، سروجن آواز پارٹی، جاگروک جنتا پارٹی تے سروجن سیوا پارٹی دے نال اتحاد کيتا اے۔<ref>{{cite web | last=Tiwari | first=Umesh | title=यूपी चुनाव 2022: विकास के लिए बसपा प्रमुख मायावती के साथ आए 10 राजनीतिक दल, समर्थन का किया ऐलान | website=Dainik Jagran | date=2022-01-18 | url=https://www.jagran.com/uttar-pradesh/lucknow-city-up-vidhan-sabha-election-10-political-parties-came-with-bsp-chief-mayawati-for-development-announced-support-22393621.html | language=hi | access-date=2022-01-22}}</ref><ref>{{cite web |date=2022-01-19 |title=Nine Parties Extend Support To Mayawati |url=https://timesofindia.indiatimes.com/city/lucknow/nine-parties-extend-support-to-mayawati/articleshow/88984110.cms |access-date=2022-01-22 |website=The Times of India}}</ref>
{| class="wikitable" style="width:50%;"
|-
!نمبر.
!پارٹی
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
! سوانیاں امیدوار
|-
|! style="text-align:center; background:{{party color|Bahujan Samaj Party}};color:white"|'''1.'''
| [[بہوجن سماج پارٹی]]
| [[File:Elephant Bahujan Samaj Party.svg|50px]]
| [[File:Indian Election Symbol Elephant.png|60px]]
| [[مایاوندی]]
| [[File:Mayawati.jpg|50px]]
| 403<ref name=":0">{{Cite news|last=Singh|first=Sanjay|title=Mayawati says no alliance for UP polls, BSP will contest all 403 seats|work=The Economic Times|url=https://economictimes.indiatimes.com/news/politics-and-nation/mayawati-says-no-alliance-for-up-polls-bsp-will-contest-all-403-seats/articleshow/81517527.cms?from=mdr|access-date=2021-05-23}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|}
=== {{legend2|{{party color|United Progressive Alliance}}|[[متحدہ ترقی پسند اتحاد]]}} ===
بی ایس پی دی طرح، [[متحدہ ترقی پسند اتحاد]] توں مقابلہ کرنے والی واحد جماعت آئی این سی رہی اے۔ 19 اکتوبر 2021 ناں، اتر پردیش کانگریس دی رہنما پرینکا گاندھی نے آنے والے اتر پردیش اسمبلی انتخابات وچ سوانیاں نوں %40 ٹکٹ دینے دا اعلان کيتا۔ <ref>{{Cite news |last=Rashid |first=Omar |date=2021-10-19 |title=Congress to give 40% of tickets to women in Uttar Pradesh assembly polls, says Priyanka Gandhi |language=en-IN |work=The Hindu |url=https://www.thehindu.com/news/national/other-states/congress-to-give-40-of-tickets-to-women-in-uttar-pradesh-assembly-polls-says-priyanka-gandhi/article37072048.ece |access-date=2022-03-03 |issn=0971-751X}}</ref>
{| class="wikitable" style="width:50%;"
|-
!نمبر.
!پارٹی
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
! سوانیاں امیدوار
|-
|! style="text-align:center; background:{{party color|Indian National Congress}};color:white"|'''1.'''
| [[انڈین نیشنل کانگریس]]
| [[File:Indian National Congress Flag.svg|50px]]
| [[File:Hand INC.svg|60px]]
| [[پرینکا گاندھی]]
|
|401<ref>{{Cite news|url= https://www.thehindu.com/news/national/other-states/congress-to-go-solo-in-2022-up-polls-contest-all-403-seats-says-priyanka-gandhi/article37491747.ece|title=Congress to go it alone in 2022 U.P. polls: Priyanka Gandhi|website=The Hindu|date=14 نومبر 2021|access-date=26 نومبر 2021}}</ref>
|241
|160
|}
=== {{legend2|{{party color|All India Majlis-e-Ittehadul Muslimeen}}|[[بھاگیداری پریورتن مورچہ]]}} ===
[[کل ہند مجلس اتحاد المسلمین]]، [[جن ادھیکار پارٹی]]، بھارت مکتی مورچہ، جنتا کرانتی پارٹی تے بھارتیہ ونچیت سماج پارٹی نے تمام 403 سیٹاں اُتے مقابلہ کرنے دے لئی اک محاذ بنایا۔<ref name=":2">{{cite web|date=2022-01-23|title=AIMIM announces launch of new front for UP assembly polls|url=https://www.hindustantimes.com/cities/lucknow-news/aimim-announces-launch-of-new-front-for-up-assembly-polls-101642878223887.html|access-date=2022-01-23|website=Hindustan Times|language=en}}</ref>
{| class="wikitable" style="width:50%;"
|+
!نمبر.
!پارٹی<ref name=":2" />
!پرچم
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
!سوانیاں امیدوار
|-
| style="text-align:center; background:{{party color|All India Majlis-e-Ittehadul Muslimeen}};color:white" ! |'''1.'''
| [[کل ہند مجلس اتحاد المسلمین]]
|[[File:All India Majlis-e-Ittehadul Muslimeen logo.svg|50x50px]]
|[[File:Indian Election Symbol Kite.svg|50x50px]]
|شوکت علی
|[[File:Circle-icons-profile.svg|50x50px]]
|100<ref>{{cite web|last=|first=|title=AIMIM To Contest On 100 Seats In UP Assembly Polls, Babu Kushwaha To Be CM Candidate of Alliance: Owaisi|url=https://www.india.com/news/india/aimim-to-contest-on-100-seats-in-up-assembly-polls-babu-kushwaha-to-be-cm-candidate-of-alliance-owaisi-5212161/|access-date=2022-02-03|website=www.india.com|language=en}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:#b0251e;color:white" ! |'''2.'''
|[[جن ادھیکار پارٹی]]
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|[[بابو سنگھ کشواہا]]
|[[File:Kushwaha2.jpg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:#08ccfc;color:white" ! |'''3.'''
| بھارت مکتی مورچہ
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|[[وامن میشرام]]
|[[File:Waman Meshram on Facebook.jpg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:white;color:black" ! |'''4.'''
|جنتا کرانتی پارٹی
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|انیل سنگھ چوہان
|[[File:Circle-icons-profile.svg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:white;color:black ! |'''5.'''
|بھارتیہ ونچیت سماج پارٹی
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|رام پرساد کشیپ
|[[File:Circle-icons-profile.svg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Peace Party of India}};color:white" !|'''6.'''
|[[پیس پارٹی آف انڈیا]]
|[[File:Peace Party Of India Flag.jpg|50x50px]]
|[[File:Indian election symbol glass tumbler.svg|50px]]
|[[محمد ایوب]]
|[[File:Circle-icons-profile.svg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Rashtriya Ulama Council}};color:white" !|'''7.'''
|[[راشٹریہ علماء کونسل]]
|[[File:Rashtriya Ulama Council (RUC) Flag.jpg|50x50px]]
|[[File:No image available.svg|50x50px]]
|[[عامر رشادی مدنی]]
|[[File:Maulana Aamir Rashadi Madni.jpg|50x50px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|}
=== {{legend2|{{party color|Left Front}}|بایاں محاذ}} ===
{| class="wikitable" style="width:50%;"
|+
!نمبر.
!پارٹی<ref>{{cite web|date=2022-01-18|title=UP polls: Left parties to field candidates on a limited number of seats|url=https://www.hindustantimes.com/cities/lucknow-news/up-polls-left-parties-to-field-candidates-on-a-limited-number-of-seats-101642446882966.html|access-date=2022-01-17|website=Hindustan Times|language=en}}</ref>
!جھنڈا
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
! سوانیاں امیدوار
|-
| style="text-align:center; background:{{party color|Communist Party of India}};color:white" |'''1.'''
|[[بھارتیہ کمیونسٹ پارٹی]]
|[[File:CPI-banner.svg|50x50px]]
|[[File:CPI symbol.svg|50x50px]]
|گریش شرما
|[[File:Circle-icons-profile.svg|50x50px]]
|38{{citation needed|date=فروری 2022}}
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Communist Party of India (Marxist)}};color:white" |'''2.'''
|[[بھارتیہ مارکسوادی کمیونسٹ پارٹی]]
|[[File:CPI-M-flag.svg|50x50px]]
| [[File:CPI(M) election symbol - Hammer Sickle and Star.svg|50x50px]]
|سیتارام یچوری
| [[File:Circle-icons-profile.svg|50x50px]]
|4{{cn|date=مارچ 2022}}
|4
|0
|-
| style="text-align:center; background:{{party color|Communist Party of India (Marxist–Leninist) Liberation}};color:white" |'''3.'''
|[[کمیونسٹ پارٹی آف انڈیا (مارکسسٹ-لینسٹ) لبریشن|کمیونسٹ پارٹی آف انڈیا (مارکسسٹ-لینسٹ)]]
| [[File:CPIML LIBERATION FLAG.jpg|50x50px]]
|[[File:Flag Logo of CPIML.png|50x50px]]
|سدھاکر یادو
|[[File:Circle-icons-profile.svg|50x50px]]
|13{{citation needed|date=فروری 2022}}
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|All India Forward Bloc}};color:white" |'''4.'''
|[[آل انڈیا فارورڈ بلاک]]
|[[File:No image available.svg|50x50px]]
|[[File:Indian Election Symbol Lion.svg|50x50px]]
| جگدیش سنگھ ٹھکرال
|[[File:Circle-icons-profile.svg|50x50px]]
|''''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|}
=== ہور ===
انتخابات توں پہلے اک ماہ دے دوران وڈی سیاسی جماعتاں نے جو کسی وی اتحاد دا حصہ نئيں نيں الیکشن وچ حصہ لینے دے اپنے ارادےآں دا اعلان کيتا۔ {{Citation needed|date=مارچ 2022}}
* [[عام آدمی پارٹی|عآپ]] نے اعلان کيتا کہ اوہ تمام 403 سیٹاں اُتے مقابلہ کرے گی۔ عآپ نے [[سماج وادی پارٹی|سپا]] دے نال اتحاد دی گل گل شروع دی لیکن اتحاد دے لئی گل گل کامیاب نئيں ہوئی۔
* [[شیو سینا]] نے اعلان کيتا کہ اوہ انتخابات وچ تمام 403 سیٹاں اُتے مقابلہ کرن گے جو بعد وچ گھٹ کر 50-100 سیٹاں تک رہ گئی۔
* [[کل ہند مجلس اتحاد المسلمین|اے آئی ایم آئی ایم]] اصل وچ اتحاد دا حصہ سی تے اسنوں 100 نشستاں دا حصہ دتا گیا سی، اُتے جدوں [[سہیل دیو بھارتیہ سماج پارٹی|ایس ڈی بی ایس پی]] نے [[سماجوادی پارٹی|سپا]] توں ہتھ ملانے دے لئی اتحاد توڑ دتا سی۔ [[کل ہند مجلس اتحاد المسلمین|اے آئی ایم آئی ایم]] نے تصدیق دی کہ اوہ 100 سیٹاں اُتے اکیلے الیکشن لڑاں گے۔
بعد وچ پارٹیاں جداں [[وکاس شیل انسان پارٹی|وی آئی پی]]، [[لوک جنہاں شکتی پارٹی (رام ولاس)|ایل جے پی۔ (رام ولاس دا دھڑا)]]، آر آر پی، [[اکھل بھارتیہ ہندو مہاسبھا|اے بی ایچ ایم]] تے اے ایس پی نے وی الیکشن وچ اپنی شرکت کيتی تصدیق کيتی۔{{Citation needed|date=فروری 2022}}
{| class="wikitable" " style="width:50%;"
!نمبر.
!پارٹی
!پرچم
!علامت
!لیڈر
!تصویر
!جن نشستاں اُتے مقابلہ ہويا
!مرد امیدوار
!سوانیاں امیدوار
|-
|! style="text-align:center; background:{{party color|Aam Aadmi Party}};color:white"|'''1.'''
| [[عام آدمی پارٹی]]
| [[File:Aam Aadmi Party logo (English).svg|50px]]
| [[File:AAP Symbol.png|50px]]
| [[سنجے سنگھ (بھارتی سیاست دان)|سنجے سنگھ]]
| [[File:Sanjay Singh (cropped).jpg|50px]]
|403<ref>{{Cite news|last=|first=|date=2021-09-01|title=AAP will contest on all 403 seats in UP assembly polls: Sanjay Singh|work=Business Standard India|url=https://www.business-standard.com/article/politics/aap-will-contest-on-all-403-seats-in-up-assembly-polls-sanjay-singh-121090100043_1.html|access-date=2022-01-24}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
|style="text-align:center;background:{{party color|Janata Dal (United)}};color:white"|'''2.'''
| [[جنتا دل (متحدہ)]]
| [[File:Janata Dal (United) Flag.svg|border|50x50px]]
| [[File:Indian Election Symbol Arrow.svg|50x50px]]
|
| [[File:Circle-icons-profile.svg|50x50px]]
|51<ref>{{cite web|title=Uttar Pradesh Polls: JDU to contest at 51 seats against BJP in UP|url=https://www.freepressjournal.in/india/uttar-pradesh-polls-jdu-to-contest-51-seats-against-bjp-in-up|access-date=2022-01-24|website=Free Press Journal|language=en}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
|! style="text-align:center; background:{{party color|Shiv Sena}};color:white"|'''3.'''
| [[شو سینا]]<ref>{{cite web|last=|first=|title=Uttar Pradesh Assembly Election 2022: Shiv Sena to Contest on 50-100 Seats, Says Sanjay Raut {{!}} India.com|url=https://www.india.com/uttar-pradesh/uttar-pradesh-assembly-elections-2022-shiv-sena-to-contest-on-50-100-seats-says-sanjay-raut-5182605/|access-date=2022-01-24|website=www.india.com|language=en}}</ref>
| [[File:Logo of Shiv Sena.svg|50x50px]]
| [[File:Indian Election Symbol Bow And Arrow.svg|50x50px]]
| ٹھاکر سنگھ
| [[File:Circle-icons-profile.svg|50x50px]]
| 45
| 40
| 5
|-
|! style="text-align:center; background:{{party color|Jansatta Dal (Loktantrik)}};color:black"|'''4.'''
|[[جن ستہ دل (لوک تانترک)]]
|[[File:No image available.svg|50x50px]]
|[[File:No image available.svg|50x50px]]
|[[رگھوراج پرتاپ سنگھ]]
|
|100<ref>{{cite web|title=राजा भैया का एलान: उनकी पार्टी UP की 100 सीटों पर लड़ेगी चुनाव, किसी से गठबंधन का नहीं बनाया मन|url=https://zeenews.india.com/hindi/india/up-uttarakhand/uttar-pradesh/raja-bhaiya-party-jansatta-dal-loktantrik-will-contest-on-100-seats-in-up-election-alliance-with-no-one/1015413|access-date=2022-01-24|website=Zee News|language=hi}}</ref>
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Vikassheel Insaan Party}};color:white" ! |'''5.'''
| [[وکاس شیل انسان پارٹی]]<ref>{{cite web|title=Bihar minister Mukesh Sahani miffed, says his party VIP will contest 165 seats in 2022 UP polls|url=https://www.indiatoday.in/india/story/bihar-minister-mukesh-sahani-vikassheel-insaan-party-2022-uttar-pradesh-polls-1832822-2021-07-26|access-date=2021-09-14|website=India Today|language=en}}</ref>
|
|
| [[مکیش سہانی]]
|
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:{{party color|Lok Janshakti Party (Ram Vilas)}};color:white" ! |'''6.'''
|[[لوک جنہاں شکتی پارٹی (رام ولاس)]]<ref>{{cite web|title=लोजपा यूपी में बन रही है मजबूत, प्रदेश अध्यक्ष की अगुवाई में लड़ेंगे चुनाव- चिराग पासवान|url=https://smart.livehindustan.com/varanasi/news/ljp-leader-chirag-paswan-said-his-party-becoming-stronger-will-fight-up-election-2022-under-the-leadership-of-manishankar-pandey-81631257896072.html|access-date=2021-10-06|website=Hindustan Smart|language=hindi|archive-date=2021-09-10|archive-url=https://web.archive.org/web/20210910074710/https://smart.livehindustan.com/varanasi/news/ljp-leader-chirag-paswan-said-his-party-becoming-stronger-will-fight-up-election-2022-under-the-leadership-of-manishankar-pandey-81631257896072.html|dead-url=yes}}</ref>
|[[File:No image available.svg|50x50px]]
|
|[[چراغ پاسوان]]
| [[File:Chirag Paswan.jpg|70x70px]]
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|-
| style="text-align:center; background:Blue;color:white" |'''7.'''
|آزاد سماج پارٹی<ref>{{cite web|title=Chandrashekhar Azad will soon join Bhagidari Sankalp Morcha, claims Om Prakash Rajbhar|url=https://www.newindianexpress.com/nation/2021/sep/22/chandrashekhar-azad-will-soon-join-bhagidari-sankalp-morcha-claims-om-prakash-rajbhar-2362282.html|access-date=2021-09-24|website=The New Indian Express}}</ref>
| [[File:Azad samaj party.png|50x50px]]
|[[File:Azad samaj party symbol.png|50x50px]]
|[[چندر شیکھر آزاد راون]]
|[[File:Chandrashekhar Azad Ravan (cropped).jpg|51x51px]]
|403
|''اعلان ہونا باقی''
|''اعلان ہونا باقی''
|}
== امیدوار ==
{{Main|اترپردیش مجلس قانون ساز دے انتخابات، 2022ء دے امیدواراں دی فہرست}}
{| class="wikitable" width ="50%" style="text-align:center;"
! colspan="2" | حلقہ
| colspan="3" bgcolor="{{party color|National Democratic Alliance}}" |[[قومی جمہوری اتحاد (بھارت)|<span style="color:white;">'''NDA'''</span>]]
| colspan="3" bgcolor="{{party color|Samajwadi Party}}" |[[سماجوادی پارٹی|<span style="color:white;">'''SP +'''</span>]]
|colspan="3" bgcolor="{{party color|Bahujan Samaj Party}}" |[[بہوجن سماج پارٹی|<span style="color:white;">'''BSP'''</span>]]
| colspan="3" bgcolor="{{party color|United Progressive Alliance}}" |[[متحدہ ترقی پسند اتحاد|<span style="color:white;">'''UPA'''</span>]]
| colspan="3" bgcolor="{{party color|Aam Aadmi Party}}" |[[عام آدمی پارٹی|<span style="color:white;">'''AAP'''</span>]]
|-
! #
! نام
! colspan="2" |پارٹی
! امیدوار
! colspan="2" |پارٹی
!امیدوار
! colspan="2" |پارٹی
!امیدوار
! colspan="2" |پارٹی
!امیدوار
! colspan="2" |پارٹی
!امیدوار
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سہارنپور|<span style="color:white;">'''Saharanpur District'''</span>]]
|-
! 1
| [[Behat (Assembly constituency)|Behat]]
| bgcolor=#FF9933|
| [[بھارتیہ جنتا پارٹی|BJP]]
|
| bgcolor=#FF2222|
| [[سماجوادی پارٹی|SP]]
|
| bgcolor=#22409A|
| [[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 2
| [[Nakur (Assembly constituency)|Nakur]]
| bgcolor=#FF9933|
| [[بھارتیہ جنتا پارٹی|BJP]]
|
| bgcolor=#FF2222|
| [[سماجوادی پارٹی|SP]]
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 3
| [[Saharanpur Nagar (Assembly constituency)|Saharanpur Nagar]]
| bgcolor=#FF9933|
| [[بھارتیہ جنتا پارٹی|BJP]]
|
| bgcolor=#FF2222|
| [[سماجوادی پارٹی|SP]]
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 4
| [[Saharanpur (Assembly constituency)|Saharanpur]]
| bgcolor=#FF9933|
| [[بھارتیہ جنتا پارٹی|BJP]]
|
| bgcolor=#FF2222|
| [[سماجوادی پارٹی|SP]]
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 5
| [[Deoband (Assembly constituency)|Deoband]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 6
| [[Rampur Maniharan (Assembly constituency)|Rampur Maniharan]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 7
| [[Gangoh (Assembly constituency)|Gangoh]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع شاملی|<span style="color:white;">'''Shamli District'''</span>]]
|-
! 8
| [[Kairana (Assembly constituency)|Kairana]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 9
| [[Thana Bhawan (Assembly constituency)|Thana Bhawan]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 10
| [[Shamli (Assembly constituency)|Shamli]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مظفرنگر|<span style="color:white;">'''Muzaffarnagar District'''</span>]]
|-
! 11
| [[Budhana (Assembly constituency)|Budhana]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 12
| [[Charthawal (Assembly constituency)|Charthawal]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 13
| [[Purqazi (Assembly constituency)|Purqazi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 14
| [[Muzaffarnagar (Assembly constituency)|Muzaffarnagar]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 15
| [[Khatauli (Assembly constituency)|Khatauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 16
| [[Meerapur (Assembly constituency)|Meerapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بجنور|<span style="color:white;">'''Bijnor District'''</span>]]
|-
!17
|[[Najibabad (Assembly constituency)|Najibabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 18
| [[Nagina (Assembly constituency)|Nagina]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 19
| [[Barhapur (Assembly constituency)|Barhapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 20
| [[Dhampur (Assembly constituency)|Dhampur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 21
| [[Nehtaur (Assembly constituency)|Nehtaur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 22
| [[Bijnor (Assembly constituency)|Bijnor]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 23
| [[Chandpur (Assembly constituency)|Chandpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 24
| [[Noorpur (Assembly constituency)|Noorpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مرادآباد|<span style="color:white;">'''Moradabad District'''</span>]]
|-
! 25
| [[Kanth (Assembly constituency)|Kanth]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 26
| [[Thakurdwara (Assembly constituency)|Thakurdwara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 27
| [[Moradabad Rural (Assembly constituency)|Moradabad Rural]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 28
| [[Moradabad Nagar (Assembly constituency)|Moradabad Nagar]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 29
| [[Kundarki (Assembly constituency)|Kundarki]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 30
| [[Bilari (Assembly constituency)|Bilari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سنبھل|<span style="color:white;">'''Sambhal District'''</span>]]
|-
! 31
| [[Chandausi (Assembly constituency)|Chandausi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 32
| [[Asmoli (Assembly constituency)|Asmoli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 33
| [[Sambhal (Assembly constituency)|Sambhal]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[رام پور ضلع|<span style="color:white;">'''Rampur District'''</span>]]
|-
! 34
| [[Suar (Assembly constituency)|Suar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 35
| [[Chamraua (Assembly constituency)|Chamraua]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 36
| [[Bilaspur (Assembly constituency)|Bilaspur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 37
| [[Rampur (Assembly constituency)|Rampur]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 38
| [[Milak (Assembly constituency)|Milak]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع امروہہ|<span style="color:white;">'''Amroha District'''</span>]]
|-
! 39
| [[Dhanaura (Assembly constituency)|Dhanaura]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 40
| [[Naugawan Sadat (Assembly constituency)|Naugawan Sadat]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 41
| [[Amroha (Assembly constituency)|Amroha]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 42
| [[Hasanpur (Assembly constituency)|Hasanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع میرٹھ|<span style="color:white;">'''Meerut District'''</span>]]
|-
! 43
| [[Siwalkhas (Assembly constituency)|Siwalkhas]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 44
| [[Sardhana (Assembly constituency)|Sardhana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 45
| [[Hastinapur (Assembly constituency)|Hastinapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 46
| [[Kithore (Assembly constituency)|Kithore]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 47
| [[Meerut Cantt. (Assembly constituency)|Meerut Cantt]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 48
| [[Meerut (Assembly constituency)|Meerut]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 49
| [[Meerut South (Assembly constituency)|Meerut South]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع باغپت|<span style="color:white;">'''Baghpat District'''</span>]]
|-
! 50
| [[Chhaprauli (Assembly constituency)|Chhaprauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 51
| [[Baraut (Assembly constituency)|Baraut]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 52
| [[Bagpat (Assembly constituency)|Bagpat]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع غازی آباد، بھارت|<span style="color:white;">'''Ghaziabad District'''</span>]]
|-
! 53
| [[Loni (Assembly constituency)|Loni]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 54
| [[Muradnagar (Assembly constituency)|Muradnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 55
| [[Sahibabad (Assembly constituency)|Sahibabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 56
| [[Ghaziabad (Assembly constituency)|Ghaziabad]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 57
| [[Modinagar (Assembly constituency)|Modinagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع ہاپڑ|<span style="color:white;">'''Hapur District'''</span>]]
|-
! 58
| [[Dhaulana (Assembly constituency)|Dhaulana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 59
| [[Hapur (Assembly constituency)|Hapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 60
| [[Garhmukteshwar (Assembly constituency)|Garhmukteshwar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع گوتم بدھ نگر|<span style="color:white;">'''Gautam Buddha Nagar District'''</span>]]
|-
!61
| [[Noida (Assembly constituency)|Noida]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 62
| [[Dadri, Uttar Pradesh (Assembly constituency)|Dadri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 63
| [[Jewar (Assembly constituency)|Jewar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بلندشہر|<span style="color:white;">'''Bulandshahr District'''</span>]]
|-
! 64
| [[Sikandrabad (Assembly constituency)|Sikandrabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 65
| [[Bulandshahr (Assembly constituency)|Bulandshahr]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 66
| [[Syana (Assembly constituency)|Syana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 67
| [[Anupshahr (Assembly constituency)|Anupshahr]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 68
| [[Debai (Assembly constituency)|Debai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 69
| [[Shikarpur (Assembly constituency)|Shikarpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 70
| [[Khurja (Assembly constituency)|Khurja]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع علی گڑھ|<span style="color:white;">'''Aligarh District'''</span>]]
|-
! 71
| [[Khair (Assembly constituency)|Khair]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 72
| [[Barauli (Assembly constituency)|Barauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 73
| [[Atrauli (Assembly constituency)|Atrauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 74
| [[Chharra (Assembly constituency)|Chharra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 75
| [[Koil (Assembly constituency)|Koil]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 76
| [[Aligarh (Assembly constituency)|Aligarh]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
| Monika Thapar
|-
! 77
| [[Iglas (Assembly constituency)|Iglas]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع ہتھ رس|<span style="color:white;">'''Hathras District'''</span>]]
|-
! 78
| [[Hathras (Assembly constituency)|Hathras]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 79
| [[Sadabad (Assembly constituency)|Sadabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 80
| [[Sikandra Rao (Assembly constituency)|Sikandra Rao]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع متھرا|<span style="color:white;">'''Mathura District'''</span>]]
|-
! 81
| [[Chhata (Assembly constituency)|Chhata]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 82
| [[Mant (Assembly constituency)|Mant]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 83
| [[Goverdhan (Assembly constituency)|Goverdhan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 84
| [[Mathura (Assembly constituency)|Mathura]]
|
|
|
|
|[[Rashtriya Lok Dal|RLD]]
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 85
| [[Baldev (Assembly constituency)|Baldev]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع آگرہ|<span style="color:white;">'''Agra District'''</span>]]
|-
! 86
| [[Etmadpur (Assembly constituency)|Etmadpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
| Gautam Singh
|-
! 87
| [[Agra Cantonment (Assembly constituency)|Agra Cantonment]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
| Prem Singh Jataw
|-
! 88
| [[Agra South (Assembly constituency)|Agra South]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 89
| [[Agra North (Assembly constituency)|Agra North]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 90
| [[Agra Rural (Assembly constituency)|Agra Rural]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 91
| [[Fatehpur Sikri (Assembly constituency)|Fatehpur Sikri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
| Banne Singh Pahalwan
|-
! 92
| [[Kheragarh (Assembly constituency)|Kheragarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 93
| [[Fatehabad (Assembly constituency)|Fatehabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 94
| [[Bah (Assembly constituency)|Bah]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فیروز آباد|<span style="color:white;">'''Firozabad District'''</span>]]
|-
! 95
| [[Tundla (Assembly constituency)|Tundla]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 96
| [[Jasrana (Assembly constituency)|Jasrana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 97
| [[Firozabad (Assembly constituency)|Firozabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 98
| [[Shikohabad (Assembly constituency)|Shikohabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 99
| [[Sirsaganj (Assembly constituency)|Sirsaganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع کانسی رام نگر|<span style="color:white;">'''Kasganj District'''</span>]]
|-
! 100
| [[Kasganj (Assembly constituency)|Kasganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 101
| [[Amanpur (Assembly constituency)|Amanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 102
| [[Patiyali (Assembly constituency)|Patiyali]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع ایٹہ|<span style="color:white;">'''Etah District'''</span>]]
|-
!103
|[[Aliganj (Assembly constituency)|Aliganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 104
| [[Etah (Assembly constituency)|Etah]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 105
| [[Marhara (Assembly constituency)|Marhara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 106
| [[Jalesar (Assembly constituency)|Jalesar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مین پوری|<span style="color:white;">'''Mainpuri District'''</span>]]
|-
! 107
| [[Mainpuri (Assembly constituency)|Mainpuri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 108
| [[Bhongaon (Assembly constituency)|Bhongaon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 109
| [[Kishni (Assembly constituency)|Kishni]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 110
| [[Karhal (Assembly constituency)|Karhal]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سنبھل|<span style="color:white;">'''Sambhal District'''</span>]]
|-
! 111
| [[Gunnaur (Assembly constituency)|Gunnaur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بدایاں|<span style="color:white;">'''Budaun District'''</span>]]
|-
! 112
| [[Bisauli (Assembly constituency)|Bisauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 113
| [[Sahaswan (Assembly constituency)|Sahaswan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 114
| [[Bilsi (Assembly constituency)|Bilsi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 115
| [[Badaun (Assembly constituency)|Badaun]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 116
| [[Shekhupur (Assembly constituency)|Shekhupur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 117
| [[Dataganj (Assembly constituency)|Dataganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بریلی|<span style="color:white;">'''Bareilly District'''</span>]]
|-
! 118
| [[Baheri (Assembly constituency)|Baheri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 119
| [[Meerganj (Assembly constituency)|Meerganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 120
| [[Bhojipura (Assembly constituency)|Bhojipura]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 121
| [[Nawabganj (Assembly constituency)|Nawabganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 122
| [[Faridpur (Assembly constituency)|Faridpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 123
| [[Bithari Chainpur (Assembly constituency)|Bithari Chainpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 124
| [[بریلی (انتخابی حلقہ)]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 125
| [[Bareilly Cantt. (Assembly constituency)|Bareilly Cantt]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 126
| [[Aonla (Assembly constituency)|Aonla]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع پیلی بھیت|<span style="color:white;">'''Pilibhit District'''</span>]]
|-
! 127
| [[Pilibhit (Assembly constituency)|Pilibhit]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 128
| [[Barkhera (Assembly constituency)|Barkhera]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 129
| [[Puranpur (Assembly constituency)|Puranpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 130
| [[Bisalpur (Assembly constituency)|Bisalpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع شاہجہان پور|<span style="color:white;">'''Shahjahanpur District'''</span>]]
|-
! 131
|[[Katra (Assembly constituency)|Katra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 132
| [[Jalalabad (UP Assembly constituency)|Jalalabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 133
| [[Tilhar (Assembly constituency)|Tilhar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 134
| [[Powayan (Assembly constituency)|Powayan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 135
| [[Shahjahanpur (Assembly constituency)|Shahjahanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 136
| [[Dadraul (Assembly constituency)|Dadraul]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[لکھیم پور کھیری ضلع|<span style="color:white;">'''Lakhimpur Kheri District'''</span>]]
|-
! 137
| [[Palia (Assembly constituency)|Palia]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 138
| [[Nighasan (Assembly constituency)|Nighasan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 139
| [[Gola Gokrannath (Assembly constituency)|Gola Gokrannath]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 140
| [[Sri Nagar (Assembly constituency)|Sri Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 141
| [[Dhaurahra (Assembly constituency)|Dhaurahra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 142
|[[Lakhimpur (Assembly constituency)|Lakhimpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 143
| [[Kasta (Assembly constituency)|Kasta]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 144
| [[Mohammdi (Assembly constituency)|Mohammdi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سیتاپور|<span style="color:white;">'''Sitapur District'''</span>]]
|-
! 145
| [[Maholi (Assembly constituency)|Maholi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 146
| [[Sitapur (Assembly constituency)|Sitapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 147
| [[Hargaon (Assembly constituency)|Hargaon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 148
| [[Laharpur (Assembly constituency)|Laharpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 149
| [[Biswan (Assembly constituency)|Biswan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 150
| [[Sevata (Assembly constituency)|Sevata]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 151
| [[Mahmoodabad (Assembly constituency)|Mahmoodabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 152
| [[Sidhauli (Assembly constituency)|Sidhauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 153
| [[Misrikh (Assembly constituency)|Misrikh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ہردوئی ضلع|<span style="color:white;">'''Hardoi District'''</span>]]
|-
! 154
| [[Sawayazpur (Assembly constituency)|Sawayazpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
| bgcolor=#0066A4|
| [[عام آدمی پارٹی|AAP]]
|
|-
! 155
| [[Shahabad (Assembly constituency)|Shahabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 156
| [[Hardoi (Assembly constituency)|Hardoi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 157
| [[Gopamau (Assembly constituency)|Gopamau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 158
| [[Sandi (Assembly constituency)|Sandi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 159
| [[Bilgram-Mallanwan (Assembly constituency)|Bilgram-Mallanwan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 160
| [[Balamau (Assembly constituency)|Balamau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 161
| [[Sandila (Assembly constituency)|Sandila]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[اناؤ ضلع|<span style="color:white;">'''Unnao District'''</span>]]
|-
! 162
| [[Bangarmau (Assembly constituency)|Bangarmau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 163
| [[Safipur (Assembly constituency)|Safipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 164
| [[Mohan (Assembly constituency)|Mohan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 165
| [[Unnao (Assembly constituency)|Unnao]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 166
| [[Bhagwantnagar (Assembly constituency)|Bhagwantnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 167
| [[Purwa (Assembly constituency)|Purwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع لکھنؤ|<span style="color:white;">'''Lucknow District'''</span>]]
|-
! 168
| [[Malihabad (Assembly constituency)|Malihabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 169
| [[Bakshi Kaa Talab (Assembly constituency)|Bakshi Kaa Talab]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 170
| [[Sarojini Nagar (Assembly constituency)|Sarojini Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 171
| [[Lucknow West (Assembly constituency)|Lucknow West]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 172
| [[Lucknow North (Assembly constituency)|Lucknow North]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 173
| [[Lucknow East (Assembly constituency)|Lucknow East]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 174
| [[Lucknow Central (Assembly constituency)|Lucknow Central]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 175
| [[Lucknow Cantonment (Assembly constituency)|Lucknow Cantonment]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 176
| [[Mohanlalganj (Assembly constituency)|Mohanlalganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[رائے بریلی ضلع|<span style="color:white;">'''Raebareli District'''</span>]]
|-
! 177
| [[Bachhrawan (Assembly constituency)|Bachhrawan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع امیتھی|<span style="color:white;">'''Amethi District'''</span>]]
|-
! 178
| [[Tiloi (Assembly constituency)|Tiloi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[رائے بریلی ضلع|<span style="color:white;">'''Raebareli District'''</span>]]
|-
! 179
| [[Harchandpur (Assembly constituency)|Harchandpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 180
| [[Rae Bareli (Assembly constituency)|Rae Bareli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 181
| [[Salon (Assembly constituency)|Salon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 182
| [[Sareni (Assembly constituency)|Sareni]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 183
| [[Unchahar (Assembly constituency)|Unchahar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع امیتھی|<span style="color:white;">'''Amethi District'''</span>]]
|-
! 184
| [[Jagdishpur (Assembly constituency)|Jagdishpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 185
| [[Gauriganj (Assembly constituency)|Gauriganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 186
| [[Amethi (Assembly constituency)|Amethi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سلطان پور|<span style="color:white;">'''Sultanpur District'''</span>]]
|-
! 187
| [[Isauli (Assembly constituency)|Isauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 188
| [[Sultanpur (Assembly constituency)|Sultanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 189
| [[Sultanpur Sadar (Assembly constituency)|Sultanpur Sadar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 190
| [[Lambhua (Assembly constituency)|Lambhua]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 191
| [[Kadipur (Assembly constituency)|Kadipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فرخ آباد|<span style="color:white;">'''Farrukhabad District'''</span>]]
|-
! 192
| [[Kaimganj (Assembly constituency)|Kaimganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 193
| [[Amritpur (Assembly constituency)|Amritpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 194
| [[Farrukhabad (Assembly constituency)|Farrukhabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 195
| [[Bhojpur (Assembly constituency)|Bhojpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[قنوج ضلع|<span style="color:white;">'''Kannauj District'''</span>]]
|-
! 196
| [[Chhibramau (Assembly constituency)|Chhibramau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 197
| [[Tirwa (Assembly constituency)|Tirwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 198
| [[Kannauj (Assembly constituency)|Kannauj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع اٹاوہ|<span style="color:white;">'''Etawah District'''</span>]]
|-
! 199
| [[Jaswantnagar (Assembly constituency)|Jaswantnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 200
| [[Etawah (Assembly constituency)|Etawah]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 201
| [[Bharthana (Assembly constituency)|Bharthana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع اوریا|<span style="color:white;">'''Auraiya District'''</span>]]
|-
! 202
| [[Bidhuna (Assembly constituency)|Bidhuna]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 203
| [[Dibiyapur (Assembly constituency)|Dibiyapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 204
| [[Auraiya (Assembly constituency)|Auraiya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع کانپور دیہات|<span style="color:white;">'''Kanpur Dehat District'''</span>]]
|-
! 205
| [[Rasulabad (Assembly constituency)|Rasulabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 206
| [[Akbarpur-Raniya (Assembly constituency)|Akbarpur-Raniya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 207
| [[Sikandra (Assembly constituency)|Sikandra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 208
| [[Bhognipur (Assembly constituency)|Bhognipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع کانپور نگر|<span style="color:white;">'''Kanpur Nagar District'''</span>]]
|-
! 209
| [[Bilhaur (Assembly constituency)|Bilhaur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 210
| [[Bithoor (Assembly constituency)|Bithoor]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 211
| [[Kalyanpur, Kanpur (Assembly constituency)|Kalyanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 212
| [[Govind Nagar (Assembly constituency)|Govindnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 213
| [[Sishamau (Assembly constituency)|Sishamau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 214
| [[Arya Nagar (Assembly constituency)|Arya Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 215
| [[Kidwai Nagar (Assembly constituency)|Kidwai Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 216
| [[Kanpur Cantonment (Assembly constituency)|Kanpur Cantonment]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 217
| [[Maharajpur, Kanpur (Assembly constituency)|Maharajpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 218
| [[Ghatampur (Assembly constituency)|Ghatampur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|Prashant Ahirwar
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع جالون|<span style="color:white;">'''Jalaun District'''</span>]]
|-
! 219
| [[Madhogarh (Assembly constituency)|Madhogarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 220
| [[Kalpi (Assembly constituency)|Kalpi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 221
| [[Orai (Assembly constituency)|Orai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[جھانسی ضلع|<span style="color:white;">'''Jhansi District'''</span>]]
|-
! 222
| [[Babina (Assembly constituency)|Babina]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 223
| [[Jhansi Nagar (Assembly constituency)|Jhansi Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 224
| [[Mauranipur (Assembly constituency)|Mauranipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 225
| [[Garautha (Assembly constituency)|Garautha]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[للت پور ضلع، بھارت|<span style="color:white;">'''Lalitpur District'''</span>]]
|-
! 226
| [[Lalitpur (Assembly constituency)|Lalitpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 227
| [[Mehroni (Assembly constituency)|Mehroni]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع حمیرپور، اترپردیش|<span style="color:white;">'''Hamirpur District'''</span>]]
|-
! 228
| [[Hamirpur (Uttar Pradesh Assembly constituency)|Hamirpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 229
| [[Rath (Assembly constituency)|Rath]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[مہوبا ضلع|<span style="color:white;">'''Mahoba District'''</span>]]
|-
! 230
| [[Mahoba (Assembly constituency)|Mahoba]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 231
| [[Charkhari (Assembly constituency)|Charkhari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع باندہ|<span style="color:white;">'''Banda District'''</span>]]
|-
! 232
| [[Tindwari (Assembly constituency)|Tindwari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 233
| [[Baberu (Assembly constituency)|Baberu]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 234
| [[Naraini (Assembly constituency)|Naraini]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 235
| [[Banda (Assembly constituency)|Banda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع چترکوٹ|<span style="color:white;">'''Chitrakoot District'''</span>]]
|-
! 236
| [[Chitrakoot (Assembly constituency)|Chitrakoot]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 237
| [[Manikpur (Assembly constituency)|Manikpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فتح پور|<span style="color:white;">'''Fatehpur District'''</span>]]
|-
! 238
| [[Jahanabad (Vidhan Sabha constituency)|Jahanabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 239
| [[Bindki (Assembly constituency)|Bindki]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 240
| [[Fatehpur (Assembly constituency)|Fatehpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 241
| [[Ayah Shah (Assembly constituency)|Ayah Shah]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 242
| [[Husainganj (Assembly constituency)|Husainganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 243
| [[Khaga (Assembly constituency)|Khaga]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع پرتاپ گڑھ، اتر پردیش|<span style="color:white;">'''Pratapgarh District'''</span>]]
|-
! 244
| [[Rampur Khas (Assembly constituency)|Rampur Khas]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 245
| [[Babaganj (Assembly constituency)|Babaganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 246
| [[Kunda (Assembly constituency)|Kunda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 247
| [[Vishwanathganj (Assembly constituency)|Vishwanathganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 248
| [[Pratapgarh (Assembly constituency)|Pratapgarh]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 249
| [[Patti (Assembly constituency)|Patti]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 250
| [[Raniganj (Uttar Pradesh Assembly constituency)|Raniganj]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع کوشامبی|<span style="color:white;">'''Kaushambi District'''</span>]]
|-
! 251
| [[Sirathu (Assembly constituency)|Sirathu]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 252
| [[Manjhanpur (Assembly constituency)|Manjhanpur]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 253
| [[Chail (Assembly constituency)|Chail]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع الہ آباد|<span style="color:white;">'''Prayagraj District'''</span>]]
|-
! 254
| [[Phaphamau (Assembly constituency)|Phaphamau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 255
| [[Soraon (Assembly constituency)|Soraon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 256
| [[Phulpur (Assembly constituency)|Phulpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 257
| [[Pratappur (Assembly constituency)|Pratappur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 258
| [[Handia (Assembly constituency)|Handia]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 259
| [[Meja (Assembly constituency)|Meja]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 260
| [[Karachhana (Assembly constituency)|Karachhana]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 261
| [[Allahabad West (Assembly constituency)|Allahabad West]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 262
| [[Allahabad North (Assembly constituency)|Allahabad North]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 263
| [[Allahabad South (Assembly constituency)|Allahabad South]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 264
| [[Bara (Assembly constituency)|Bara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 265
| [[Koraon (Assembly constituency)|Koraon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بارہ بنکی|<span style="color:white;">'''Barabanki District'''</span>]]
|-
! 266
| [[Kursi (Assembly constituency)|Kursi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 267
| [[Ram Nagar (Assembly constituency)|Ramnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 268
| [[Barabanki (Assembly constituency)|Barabanki]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 269
| [[Zaidpur (Assembly constituency)|Zaidpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 270
| [[Dariyabad (Assembly constituency)|Dariyabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فیض آباد|<span style="color:white;">'''Ayodhya District'''</span>]]
|-
! 271
| [[Rudauli (Assembly constituency)|Rudauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بارہ بنکی|<span style="color:white;">'''Barabanki District'''</span>]]
|-
! 272
| [[Haidergarh (Assembly constituency)|Haidergarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع فیض آباد|<span style="color:white;">'''Ayodhya District'''</span>]]
|-
! 273
| [[Milkipur (Assembly constituency)|Milkipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 274
| [[Bikapur (Assembly constituency)|Bikapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 275
| [[Ayodhya (Assembly constituency)|Ayodhya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 276
| [[Goshainganj (Assembly constituency)|Goshainganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع امبیڈکر نگر|<span style="color:white;">'''Ambedkar Nagar District'''</span>]]
|-
! 277
| [[Katehari (Assembly constituency)|Katehari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 278
| [[Tanda (Assembly constituency)|Tanda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 279
| [[Alapur (Assembly constituency)|Alapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 280
| [[Jalalpur (Assembly constituency)|Jalalpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 281
| [[Akbarpur (Assembly constituency)|Akbarpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بہرائچ|<span style="color:white;">'''Bahraich District'''</span>]]
|-
! 282
| [[Balha (Assembly constituency)|Balha]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 283
| [[Nanpara (Assembly constituency)|Nanpara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 284
| [[Matera (Assembly constituency)|Matera]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 285
| [[Mahasi (Assembly constituency)|Mahasi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 286
| [[بہرائچ اسمبلی حلقہ]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 287
| [[Payagpur (Assembly constituency)|Payagpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 288
| [[Kaiserganj (Assembly constituency)|Kaiserganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[شراوستی ضلع|<span style="color:white;">'''Shrawasti District'''</span>]]
|-
! 289
| [[Bhinga (Assembly constituency)|Bhinga]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 290
|[[Shrawasti (Assembly constituency)|Shrawasti]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بلرام پور|<span style="color:white;">'''Balrampur District'''</span>]]
|-
! 291
| [[Tulsipur (Assembly constituency)|Tulsipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!292
|[[Gainsari (Assembly constituency)|Gainsari]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!293
|[[Utraula (Assembly constituency)|Utraula]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!294
|[[Balrampur (Assembly constituency)|Balrampur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع گونڈہ|<span style="color:white;">'''Gonda District'''</span>]]
|-
!295
|[[Mehnaun (Assembly constituency)|Mehnaun]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!296
|[[Gonda (Assembly constituency)|Gonda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!297
|[[Katra Bazar (Assembly constituency)|Katra Bazar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!298
|[[Colonelganj (Assembly constituency)|Colonelganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!299
|[[Tarabganj (Assembly constituency)|Tarabganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!300
|[[Mankapur (Assembly constituency)|Mankapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!301
|[[Gaura (Assembly constituency)|Gaura]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[نوگڑھ|<span style="color:white;">'''Siddharthnagar District'''</span>]]
|-
!302
|[[Shohratgarh (Assembly constituency)|Shohratgarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!303
|[[Kapilvastu (Assembly constituency)|Kapilvastu]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!304
|[[Bansi (Assembly constituency)|Bansi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!305
|[[Itwa (Assembly constituency)|Itwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!306
|[[Domariyaganj (Assembly constituency)|Domariyaganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بستی|<span style="color:white;">'''Basti District'''</span>]]
|-
!307
|[[Harraiya (Assembly constituency)|Harraiya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!308
|[[Kaptanganj (Assembly constituency)|Kaptanganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!309
|[[Rudhauli (Assembly constituency)|Rudhauli]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!310
|[[Basti Sadar (Assembly constituency)|Basti Sadar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!311
|[[Mahadewa (Assembly constituency)|Mahadewa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سنت کبیر نگر|<span style="color:white;">'''Sant Kabir Nagar District'''</span>]]
|-
!312
|[[Menhdawal (Assembly constituency)|Menhdawal]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!313
|[[Khalilabad (Assembly constituency)|Khalilabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!314
|[[Dhanghata (Assembly constituency)|Dhanghata]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[مہاراج گنج ضلع|<span style="color:white;">'''Maharajganj District'''</span>]]
|-
!315
|[[Pharenda (Assembly constituency)|Pharenda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!316
|[[Nautanwa (Assembly constituency)|Nautanwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!317
|[[Siswa (Assembly constituency)|Siswa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!318
|[[Maharajganj (Assembly constituency)|Maharajganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!319
|[[Paniyara (Assembly constituency)|Paniyara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع گورکھپور|<span style="color:white;">'''Gorakhpur District'''</span>]]
|-
!320
|[[Caimpiyarganj (Assembly constituency)|Caimpiyarganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!321
|[[Pipraich (Assembly constituency)|Pipraich]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!322
|[[Gorakhpur Urban (Assembly constituency)|Gorakhpur Urban]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!323
|[[Gorakhpur Rural (Assembly constituency)|Gorakhpur Rural]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!324
|[[Sahajanwa (Assembly constituency)|Sahajanwa]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!325
|[[Khajani (Assembly constituency)|Khajani]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!326
|[[Chauri-Chaura (Assembly constituency)|Chauri-Chaura]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!327
|[[Bansgaon (Assembly constituency)|Bansgaon]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!328
|[[Chillupar (Assembly constituency)|Chillupar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[کشی نگر ضلع|<span style="color:white;">'''Kushinagar District'''</span>]]
|-
!329
|[[Khadda (Assembly constituency)|Khadda]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!330
|[[Padrauna (Assembly constituency)|Padrauna]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!331
|[[Tamkuhi Raj (Assembly constituency)|Tamkuhi Raj]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!332
|[[Fazilnagar (Assembly constituency)|Fazilnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!333
|[[Kushinagar (Assembly constituency)|Kushinagar]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!334
|[[Hata (Assembly constituency)|Hata]]
|
|
|
|
|
|
|bgcolor=#22409A|
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!335
|[[Ramkola (Assembly constituency)|Ramkola]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع دیوریا|<span style="color:white;">'''Deoria District'''</span>]]
|-
!336
|[[Rudrapur (Assembly constituency)|Rudrapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!337
|[[Deoria (Assembly constituency)|Deoria]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!338
|[[Pathardeva (Assembly constituency)|Pathardeva]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!339
|[[Rampur Karkhana (Assembly constituency)|Rampur Karkhana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!340
|[[Bhatpar Rani (Assembly constituency)|Bhatpar Rani]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!341
|[[Salempur (Assembly constituency)|Salempur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!342
|[[Barhaj (Assembly constituency)|Barhaj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع اعظم گڑھ|<span style="color:white;">'''Azamgarh District'''</span>]]
|-
!343
|[[Atrauliya (Assembly constituency)|Atrauliya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!344
|[[Gopalpur (Assembly constituency)|Gopalpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!345
|[[Sagri (Assembly constituency)|Sagri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
!346
|[[Mubarakpur (Assembly constituency)|Mubarakpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 347
| [[Azamgarh (Assembly constituency)|Azamgarh]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 348
| [[Nizamabad (Assembly constituency)|Nizamabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 349
| [[Phoolpur Pawai (Assembly constituency)|Phoolpur Pawai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 350
| [[Didarganj (Assembly constituency)|Didarganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 351
| [[Lalganj (Assembly constituency)|Lalganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 352
| [[Mehnagar (Assembly constituency)|Mehnagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مئو|<span style="color:white;">'''Mau District'''</span>]]
|-
! 353
| [[Madhuban (Assembly constituency)|Madhuban]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 354
| [[Ghosi (Assembly constituency)|Ghosi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 355
| [[Muhammadabad-Gohna (Assembly constituency)|Muhammadabad-Gohna]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 356
| [[Mau (Assembly constituency)|Mau]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|Bhim Rajbhar
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع بلیا|<span style="color:white;">'''Ballia District'''</span>]]
|-
! 357
| [[Belthara Road (Assembly constituency)|Belthara Road]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 358
| [[Rasara (Assembly constituency)|Rasara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 359
| [[Sikanderpur (Assembly constituency)|Sikanderpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 360
| [[Phephana (Assembly constituency)|Phephana]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 361
| [[Ballia Nagar (Assembly constituency)|Ballia Nagar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 362
| [[Bansdih (Assembly constituency)|Bansdih]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 363
| [[Bairia (Assembly constituency)|Bairia]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع جونپور|<span style="color:white;">'''Jaunpur District'''</span>]]
|-
! 364
| [[Badlapur (Assembly constituency)|Badlapur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 365
| [[Shahganj (Assembly constituency)|Shahganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 366
| [[Jaunpur (Assembly constituency)|Jaunpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 367
| [[Malhani (Assembly constituency)|Malhani]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 368
| [[Mungra Badshahpur (Assembly constituency)|Mungra Badshahpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 369
| [[Machhlishahr (Assembly constituency)|Machhlishahr]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 370
| [[Mariyahu (Assembly constituency)|Mariyahu]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 371
| [[Zafrabad (Assembly constituency)|Zafrabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 372
| [[Kerakat (Vidhan Sabha constituency)|Kerakat]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع غازی پور|<span style="color:white;">'''Ghazipur District'''</span>]]
|-
! 373
| [[Jakhanian (Assembly constituency)|Jakhanian]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 374
| [[Saidpur (Assembly constituency)|Saidpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 375
| [[Ghazipur Sadar (Assembly constituency)|Ghazipur Sadar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 376
| [[Jangipur (Assembly constituency)|Jangipur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 377
| [[Zahoorabad (Assembly constituency)|Zahoorabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 378
| [[Mohammadabad (Assembly constituency)|Mohammadabad]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 379
| [[Zamania (Assembly constituency)|Zamania]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع چندولی|<span style="color:white;">'''Chandauli District'''</span>]]
|-
! 380
| [[Mughalsarai (Assembly constituency)|Mughalsarai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 381
| [[Sakaldiha (Assembly constituency)|Sakaldiha]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 382
| [[Saiyadraja (Assembly constituency)|Saiyadraja]]
|
|
|Sushil Singh
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 383
| [[Chakia (Assembly constituency)|Chakia]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع وارانسی|<span style="color:white;">'''Varanasi District'''</span>]]
|-
! 384
| [[Pindra (Assembly constituency)|Pindra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|[[Ajai Rai]]
|
|
|
|-
! 385
| [[Ajagara (Assembly constituency)|Ajagara]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 386
| [[Shivpur (Assembly constituency)|Shivpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 387
| [[Rohaniya (Assembly constituency)|Rohaniya]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|Sunil Kumar Rai
|
|
|
|-
! 388
| [[Varanasi North (Assembly constituency)|Varanasi North]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|Dr Rajesh Mishra
|
|
|
|-
! 389
| [[Varanasi South (Assembly constituency)|Varanasi South]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 390
| [[Varanasi Cantt. (Vidhan Sabha constituency)|Varanasi Cantt.]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|Om Prakash Ojha
|
|
|
|-
! 391
| [[Sevapuri (Assembly constituency)|Sevapuri]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع سنت رویداس نگر|<span style="color:white;">'''Bhadohi District'''</span>]]
|-
! 392
| [[Bhadohi (Assembly constituency)|Bhadohi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 393
| [[Gyanpur (Assembly constituency)|Gyanpur]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 394
| [[Aurai (Assembly constituency)|Aurai]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[ضلع مرزاپور|<span style="color:white;">'''Mirzapur District'''</span>]]
|-
! 395
| [[Chhanbey (Assembly constituency)|Chhanbey]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 396
| [[Mirzapur (Assembly constituency)|Mirzapur]]
|
|
|
|
|
|Kailash churasiya
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 397
| [[Majhawan (Assembly constituency)|Majhawan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 398
| [[Chunar (Assembly constituency)|Chunar]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 399
| [[Marihan (Assembly constituency)|Marihan]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
| colspan="17" align="center" bgcolor="grey" | [[سون بھدرا ضلع|<span style="color:white;">'''Sonbhadra District'''</span>]]
|-
! 400
| [[Ghorawal (Assembly constituency)|Ghorawal]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 401
| [[Robertsganj (Assembly constituency)|Robertsganj]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 402
| [[Obra (Assembly constituency)|Obra]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|-
! 403
| [[Duddhi (Assembly constituency)|Duddhi]]
|
|
|
|
|
|
|bgcolor="{{party color|Bahujan Samaj Party}}" |
|[[بہوجن سماج پارٹی|BSP]]
|
| bgcolor=#00BFFF|
| [[انڈین نیشنل کانگریس|INC]]
|
|
|
|
|}
== رائے شماری ==
{|class="wikitable sortable" style="text-align:center;font-size:95%;line-height:16px}"|
!rowspan="2" width="100px"|تریخ اشاعت
!rowspan="2" width="175px"|پولنگ ایجنسی
!style="background:{{party color|Bharatiya Janata Party}}"|
!style="background:{{party color|Samajwadi Party}}"|
!style="text-align:center; background:{{party color|Bahujan Samaj Party}}"|
!style="text-align:center; background:{{party color|Indian National Congress}}"|
!style="background:gray;{{party color|others}}"|
!rowspan="2"|قیادت
|-
!style="width:75px;"|[[قومی جمہوری اتحاد (بھارت)|این ڈی اے]]
!style="width:75px;"|[[سماجوادی پارٹی]]
!style="width:75px;"|[[بہوجن سماج پارٹی|بی ایس پی]]
!style="width:75px;"|[[متحدہ ترقی پسند اتحاد|یو پی اے]]
!style="width:60px;"|ہور
|-
|rowspan="2"|18 مارچ 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|date=2021-03-18|title=ABP-CVoter UP Vote Share Prediction: Yogi Govt Holds Fort, SP-BSP-Congress Still Distant Second|url=https://news.abplive.com/news/india/abp-news-cvoter-up-survey-2021-election-vote-share-uttar-pradesh-seat-projection-bjp-vs-inc-vs-sp-vs-bsp-1449071|website=news.abplive.com}}</ref><ref>{{Cite web|date=2021-03-18|title=ABP-CVoter UP 2021 Seat Predictions: BJP Heads For Second Consecutive Mandate; SP-BSP Fail To Impress Voters|url=https://news.abplive.com/news/india/abp-news-cvoter-up-survey-election-seat-projection-uttar-pradesh-seat-projection-bjp-vs-inc-vs-sp-vs-bsp-1449077|access-date=2021-08-19|website=news.abplive.com}}</ref>
|{{Party shading/BJP}}|'''284-294'''
|54-64
|33-43
|1-7
|10-16
|{{Party shading/BJP}}|'''220-240'''
|-
|{{Party shading/BJP}}|'''41.0%'''
|24.4%
|20.8%
|5.9%
|7.9%
|{{Party shading/BJP}}|'''16.6%'''
|-
|rowspan="2"|3 ستمبر 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|date=2021-09-03|title=UP Election 2022 Predictions: ABP-CVoter Survey Says BJP Will Win But With Fewer Seats|url=https://news.abplive.com/news/india/abp-news-cvoter-survey-up-assembly-election-2022-predictions-vote-share-seat-sharing-kaun-banega-mukhyamantri-bjp-sp-bsp-congress-1480050|access-date=2021-09-03|website=news.abplive.com}}</ref>
|{{Party shading/BJP}}|'''259-267'''
|109-117
|12-16
|3-7
|6-10
|{{Party shading/BJP}}|'''142-158'''
|-
|{{Party shading/BJP}}|'''41.8%'''
|30.2%
|15.7%
|5.1%
|7.2%
|{{Party shading/BJP}}|'''11.6%'''
|-
|rowspan="2"|8 اکتوبر 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|date=2021-10-08|title=ABP-CVoter Survey: BJP To Retain Power In UP With Massive Mandate In 2022 Assembly Polls|url=https://news.abplive.com/news/india/abp-news-cvoter-survey-snap-poll-uttar-pradesh-election-2022-kaun-banerga-mukhyamantri-final-vote-share-seat-share-1486657|access-date=2021-10-14|website=news.abplive.com}}</ref>
|{{Party shading/BJP}}|'''241-249'''
|130-138
|15-19
|3-7
|0-4
|{{Party shading/BJP}}|'''103-119'''
|-
|{{Party shading/BJP}}|'''41.3%'''
|32.4%
|14.7%
|5.6%
|6.0%
|{{Party shading/BJP}}|'''8.9%'''
|-
|rowspan="2"|13 نومبر 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|date=2021-11-13|title=AUP polls: BJP favourite, SP gains momentum, shows ABP-CVoter survey|url=https://www.hindustantimes.com/india-news/up-polls-bjp-favourite-sp-gains-momentum-shows-abp-cvoter-survey-101636778232753.html|access-date=2021-12-09|website=www.hindustantimes.com}}</ref>
|{{Party shading/BJP}}|'''213-221'''
|152-160
|16-20
| 6-10
| NA
|{{Party shading/BJP}}|'''53-69'''
|-
|{{Party shading/BJP}}|'''40.7%'''
|31.1%
|15.1%
|9.0%
|4.1%
|{{Party shading/BJP}}|'''9.6%'''
|-
|rowspan="2"|11 دسمبر 2021
|rowspan="2"|'''ABP-CVoter'''<ref>{{Cite web|last=|first=|date=2021-12-11|title=ABP News-CVoter Survey: BJP In Driver's Seat In UP, Projected To Win 212 To 224 Seats|url=https://news.abplive.com/news/india/abp-news-cvoter-survey-bjp-in-driver-s-seat-in-up-projected-to-win-212-to-224-seats-1499127|url-status=live|access-date=2021-12-11|website=news.abplive.com|language=en}}</ref>
|{{Party shading/BJP}}|'''212-224'''
|151-163
|12-24
| 2-10
| 2-6
|{{Party shading/BJP}}|'''49-73'''
|-
|{{Party shading/BJP}}|'''40.4%'''
|33.6%
|13.2%
|7.3%
|5.5%
|{{Party shading/BJP}}|'''6.8%'''
|}
== حوالے ==
=== نوٹ ===
{{Notelist}}
=== حوالے ===
{{حوالے}}
{{Portal|بھارت}}
[[گٹھ:بھارت وچ انتخابات]]
[[گٹھ:بھارت وچ ریاستی اسمبلی دے انتخابات، 2022ء]]
[[گٹھ:اتر پردیش مجلس قانون ساز دے انتخابات، 2022ء]]
[[گٹھ:صفحات مع گراف]]
[[گٹھ:چھوٹے پیغام خانیاں دا استعمال کرنے والے مضامین]]
8uaus3kyszyd3gzdysak7kme8ipwgp0
ماڈیول:Cite Q
828
116177
690968
685008
2025-07-10T15:44:17Z
Abbas dhothar
361
690968
Scribunto
text/plain
--[[ Cite Q
النسخة العربية
مشتق من النسخة الإنجليزية
]]
local p = {}
require('strict')
local sandbox = ''
local wdib = require('Module:WikidataIB' .. sandbox)
local getValue = wdib._getValue
local getValueFromSnaks = wdib._getValueFromSnaks
local getPropOfProp = wdib._getPropOfProp
local followQid = wdib._followQid
local getPropertyIDs = wdib._getPropertyIDs
local rtl_lang = {ar = true, fa = true, ur = true, ku = true,
he = true, arc = true, dv = true, ha = true, khw = true,
ks = true, ps = true, yi = true, ota = true }
local ref_cash = {}
local aliases = {
['accessdate'] = {'تاريخ-الوصول','تاريخ الوصول', 'تاريخ وصول', 'access-date', 'accessdate'},
['agency'] = {'وكالة', 'agency'},
['archivedate'] = {'تاريخ-الأرشيف', 'تاريخ أرشيف', 'تاريخ الأرشيف', 'archive-date', 'archivedate'},
['archive-format'] = {'صيغة-الأرشيف', 'صيغة الأرشيف', 'archive-format'},
['archive-url'] = {'مسار-الأرشيف', 'مسار أرشيف', 'مسار الأرشيف', 'archive-url', 'archiveurl'},
['article-number'] = {'رقم-المقالة', 'article-number'},
['asin-tld'] = 'asin-tld',
['at'] = {'في', 'at'},
--##TOREVISE
['authors'] = {'المؤلفون', 'المؤلفين', 'authors', 'people', 'host', 'credits', 'أشخاص'},
['book-title'] = {'عنوان الكتاب', 'book-title', 'booktitle', 'عنوان المؤتمر'},
['cartography'] = 'cartography',
['chapter'] = {'الفصل', 'chapter', 'contribution', 'entry', 'article', 'section'},
['chapter-format'] = {'صيغة-الفصل', 'صيغة الفصل', 'تنسيق الفصل', 'chapter-format', 'contribution-format', 'entry-format',
'article-format', 'section-format'},
['chapter-url'] = {'مسار-الفصل', 'مسار الفصل', 'chapter-url', 'contribution-url', 'entry-url', 'article-url', 'section-url'}, -- Used by InternetArchiveBot
['chapter-url-access'] = {'chapter-url-access', 'contribution-url-access',
'entry-url-access', 'article-url-access', 'section-url-access'}, -- Used by InternetArchiveBot
['class'] = {'صنف', 'class'}, -- cite arxiv and arxiv identifier
['collaboration'] = 'collaboration',
['conference'] = {'اسم-المؤتمر', 'اسم المؤتمر', 'conference'},
['conference-format'] = 'conference-format',
['conference-url'] = {'مسار-المؤتمر', 'مسار المؤتمر', 'conference-url'}, -- Used by InternetArchiveBot
['date'] = {'تاريخ', 'التاريخ', 'date', 'air-date', 'airdate'},
['degree'] = {'الدرجة', 'degree'},
['df'] = 'df',
['display-authors'] = {'إظهار-المؤلفين', 'إظهار المؤلفين', 'display-authors', 'display-subjects'},
['display-contributors'] = 'display-contributors',
['display-editors'] = {'إظهار-المحررين', 'إظهار المحررين', 'display-editors'},
['display-interviewers'] = 'display-interviewers',
['display-translators'] = 'display-translators',
['docket'] = 'docket',
['doi-broken-date'] = 'doi-broken-date',
['edition'] = {'طبعة', 'الإصدار', 'الاصدار', 'إصدار', 'اصدار', 'الطبعة', 'رقم الطبعة', 'edition'},
['pmc-embargo-date'] = 'pmc-embargo-date',
['encyclopedia'] = {'موسوعة', 'encyclopedia', 'encyclopaedia', 'اسم المعجم', 'dictionary', 'اسم الموسوعة'}, -- cite encyclopedia only
['episode'] = {'الحلقة', 'episode'}, -- cite serial only TODO: make available to cite episode?
['format'] = {'صيغة', 'التنسيق', 'format', 'تنسيق', 'الصيغة'},
['id'] = {'id', 'ID', 'المعرف'},
['inset'] = {'inset', 'مجموعة'},
['issue'] = {'العدد', 'issue', 'number'},
['language'] = {'لغة', 'اللغة', 'language', 'lang'},
['mailing-list'] = {'القائمة البريدية', 'mailing-list'}, -- cite mailing list only
['map'] = {'الخريطة', 'map'}, -- cite map only
['map-format'] = {'صيغة الخريطة', 'map-format'}, -- cite map only
['map-url'] = {'مسار الخريطة', 'map-url'}, -- cite map only -- Used by InternetArchiveBot
['map-url-access'] = 'map-url-access', -- cite map only -- Used by InternetArchiveBot
['minutes'] = {'دقيقة', 'minutes'},
['mode'] = 'mode',
['name-list-style'] = 'name-list-style',
['network'] = {'الشبكة', 'network'},
['newsgroup'] = {'اسم المجموعة', 'newsgroup'}, -- cite newsgroup only
['nopp'] = {'no-pp', 'nopp'},
['no-tracking'] = {'no-tracking', 'template-doc-demo'},
['number'] = 'number', -- this case only for cite techreport
['orig-date'] = {'orig-date', 'orig-year', 'origyear', 'سنة النشر الأصلية'},
['others'] = {'آخرون','others', 'المحاور', 'المحاورون', 'المحقق'},
['page'] = {'صفحة', 'p', 'الصفحة', 'page', 'الصفحة', 'رقم الصفحة', 'رقم صفحة','ص'}, -- Used by InternetArchiveBot
['pages'] = {'صفحات', 'الصفحات', 'pp', 'أرقام الصفحات', 'أرقم صفحات', 'pages'}, -- Used by InternetArchiveBot
['journal'] = {
'صحيفة',
'journal',
'دورية محكمة',
'مجلة',
'magazine',
'اسم المجلة',
'newspaper',
'جريدة',
'اسم الصحيفة',
'دورية',
'periodical',
'موقع',
'website',
'الموقع',
'عمل',
'work',
'العمل',
'من عمل',
},
['place'] = { 'مكان', 'place', 'المكان', 'مقر', 'المقر', 'location'},
['postscript'] = 'postscript',
['publication-date'] = {'تاريخ-النشر', 'تاريخ النشر', 'publication-date'},
['publication-place'] = {'مكان-النشر', 'مكان النشر', 'publication-place'},
['publisher'] = {'ناشر', 'publisher', 'الناشر', 'institution', 'مصدر', 'الموزع', 'المصدر', 'المؤسسة'},
['quote'] = {'اقتباس', 'quote', 'quotation'},
['quote-page'] = 'quote-page',
['quote-pages'] = 'quote-pages',
['ref'] = {'مرجع', 'ref'},
['scale'] = {'المقياس', 'scale'},
['script-chapter'] = {'script-chapter', 'script-contribution', 'script-entry',
'script-article', 'script-section'},
['script-encyclopedia'] = {'script-encyclopedia', 'script-encyclopaedia'}, -- cite encyclopedia only
['script-map'] = 'script-map',
['script-journal'] = {'script-journal', 'script-magazine', 'script-newspaper',
'script-periodical', 'script-website', 'script-work'},
['script-quote'] = 'script-quote',
['script-title'] = 'script-title', -- Used by InternetArchiveBot
['season'] = {'الموسم', 'season'},
['sections'] = {'الأقسام', 'sections'}, -- cite map only
['series'] = {'سلسلة', 'series', 'version'},
['series-link'] = {'وصلة-سلسلة', 'وصلة سلسلة', 'series-link', 'مسار المسلسل'},
['series-number'] = {'رقم-سلسلة', 'رقم سلسلة', 'series-number', 'series-no'},
['sheet'] = {'ورقة', 'sheet'}, -- cite map only
['sheets'] = {'أوراق', 'sheets'}, -- cite map only
['station'] = {'محطة', 'station'},
['time'] = {'الوقت', 'time'},
['time-caption'] = 'time-caption',
['title'] = {'عنوان', 'title', 'العنوان'},
['title-link'] = {'وصلة-العنوان', 'وصلة العنوان', 'title-link', 'episode-link', 'وصلة الحلقة'},
['title-note'] = {'title-note', 'department'},
['type'] = {'النوع', 'type', 'medium'},
['trans-chapter'] = {'trans-article', 'trans-chapter', 'trans-contribution',
'trans-entry', 'trans-section'},
['transcript'] = 'transcript',
['transcript-format'] = 'transcript-format',
['transcript-url'] = 'transcript-url', -- Used by InternetArchiveBot
['trans-encyclopedia'] = {'trans-encyclopedia', 'trans-encyclopaedia'}, -- cite encyclopedia only
['trans-map'] = 'trans-map', -- cite map only
['trans-journal'] = {'trans-journal', 'trans-magazine', 'trans-newspaper',
'trans-periodical', 'trans-website', 'trans-work'},
['trans-quote'] = 'trans-quote',
['trans-title'] = {'عنوان مترجم', 'العنوان بالعربي', 'العنوان الأجنبي', 'عنوان أجنبي', 'trans-title', 'العنوان المترجم'}, -- Used by InternetArchiveBot
['url'] = {'مسار', 'المسار','وصلة', 'url', 'URL'}, -- Used by InternetArchiveBot
['url-access'] = {'url-access', 'التسجيل'}, -- Used by InternetArchiveBot
['url-status'] = {'url-status','حالة المسار'}, -- Used by InternetArchiveBot
['vauthors'] = {'vauthors', 'عدة مؤلفين'},
['veditors'] = {'veditors', 'عدة محررين' },
['via'] = {'عبر', 'via'},
['volume'] = {'المجلد', 'volume', 'الجزء', 'ج'},
['wikidatacite'] = 'wikidatacite',
['year'] = {'سنة', 'year', 'السنة'},
}
local i18n = {
["unknown-author"] = mw.wikibase.getLabel("Q4233718"):gsub("^%l", mw.ustring.upper),
-- Next Line Edited
["unknown-author-trackingcat"] = "", -- [[تصنيف:Cite Q - author unknown]]
["ordinal"] = {
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["months"] = {
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
["ar"] = {
illustrator = "رسم",
composer = "تلحين",
animator = "رسم الرسوم المتحركة",
director = "إخراج",
screenwriter = "سيناريو",
signatory = "توقيع",
presenter = "تقديم",
performer = "أداء",
annotator = "تحقيق",
reviewer = "مراجعة",
unknown = "مجهول",
supervisor = "إشراف",
["unknown-publication-date"] = '<abbr class="abbr" title="دون تاريخ">د.ت.</abbr>',
["unknown-publisher"] = '<abbr class="abbr" title="دون ناشر">د.ن.</abbr>',
wikidata = "ويكي بيانات"
}
}
local rejected = {
sources = {
Q465 = true,
Q15241312 = true,
Q52 = true
},
properties = { "P1800", "P1566", "P21"},
instances = {
Q5 = true, -- Human is not a direct reference
Q184188 = true,
Q1250464 = true,
-- inatance of refference DBs
Q8513 = true,
Q17152639 = true,
Q7094076 = true,
Q5535082 = true,
Q856638= true,
Q1982918 = true,
Q36524 = true,
Q36218176 = true,
Q526334 = true,
Q5227411 = true
}
}
--[[-------------------< A R G U M E N T _ W R A P P E R >----------------------
Argument wrapper. This function provides support for argument mapping defined
in the configuration file so that multiple names can be transparently aliased to
single internal variable.
]]
local function argument_wrapper ( arglist )
local origin = {};
local nilargs = {};
return setmetatable({
ORIGIN = function ( self, k )
local dummy = self[k]; -- force the variable to be loaded.
return origin[k];
end
},
{
__index = function ( tbl, k )
local v = rawget(tbl,k)
if v then
return v
elseif nilargs[k] then
return nil
end
local list = (type(k)=="number") and k or aliases[k];
if type( list ) == 'table' then
for _, alias_key in pairs( list ) do
if arglist[alias_key] then
v = arglist[alias_key]
origin[k] = alias_key
break;
end
end
elseif list ~= nil then
v = arglist[list]
if v then
origin[k] = list
end
end
if v == nil then
nilargs[k] = true
else
rawset( tbl, k, v )
end
return v
end,
});
end
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above i18n
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
p.makeOrdinal = function(cardinal)
local card = tonumber(cardinal)
if not card then return cardinal end
local ordsuffix = i18n.ordinal.default
if card % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif card % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif card % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (card % 100 == 11) or (card % 100 == 12) or (card % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return card .. ordsuffix
end
-- Table of simple properties that can be fetched in roughly the same way:
-- id = PXXX
-- maxvals = maximum number of multiple values (0 for all)
-- linked = "no" suppresses linking
-- populate_from_journal = true/false determines whether to look in a journal where the source is published
-- rank = "best", "preferred", normal, etc. determines how Wikidata ranks are treated
-- others = true - the value for the property goes to "others" section
local simple_properties = {
-- Next Line Edited
publisher = {id = "P123", maxvals = 3},
oclc = {id = "P243", maxvals = 1},
['publication-place'] = {id = "P291", maxvals = 0, linked = 'no'}, -- publication place (don't put into |place=; is treated specially in {{citation}} if both are given)
doi = {id = "P356", maxvals = 1}, -- take care of |doi-broken-date= (WD "reason for deprecation"/"stated as") and |doi-access= (WD "access status")?
issue = {id = "P433", maxvals = 0, populate_from_journal = true}, -- distinguish from |number= ("P1545"?) if both are given (still blocked by {{citation}}, but will be supported in the future)
pmid = {id = "P698", maxvals = 1},
-- gbooks = {id = "P675", maxvals = 1}, -- to be added to {{citation}}
-- ia = {id = "P724", maxvals = 1}, -- to be added to {{citation}}
arxiv = {id = "P818", maxvals = 1},
bibcode = {id = "P819", maxvals = 1}, -- take care of |bibcode-access=?
jstor = {id = "P888", maxvals = 1}, -- take care of |jstor-access=?
mr = {id = "P889", maxvals = 1},
rfc = {id = "P892", maxvals = 1},
zbl = {id = "P894", maxvals = 1},
ssrn = {id = "P893", maxvals = 1},
place = {id = "P1071", maxvals = 0, linked = 'no'}, -- written-at place
-- ['total-pages'] = {id = "P1104", maxvals = 0, linked = 'no'}, -- to be added to {{citation}} / COinS &rft.tpages=
-- coden = {id = "P1159", maxvals = 1}, -- to be added to {{citation}} / COinS &rft.coden=
s2cid = {id = "P8299", maxvals = 1}, -- take care of |s2cid-access=?
pmc = {id = "P932", maxvals = 1}, -- take care of |pmc-embargo-date= (WD "reason for deprecation")?
lccn = {id = "P1144", maxvals = 1},
hdl = {id = "P1184", maxvals = 1}, -- take care of |hdl-access=?
ismn = {id = "P1208", maxvals = 1},
journal = {id = "P1433", maxvals = 1},
citeseerx = {id = "P3784", maxvals = 1},
osti = {id = "P3894", maxvals = 1}, -- take care of |osti-access=?
biorxiv = {id = "P3951", maxvals = 1},
asin = {id = "P5749", maxvals = 1}, -- What about |asin-tld=? (WD examples resolve to .com at present, but may change)
-- ['catalog-number'] = {id = "P528", maxvals = 0}, -- to be added to {{citation}} / COinS &rft.artnum=
isbn = {id = "P212", maxvals = 1, populate_from_journal = true}, -- ISBN 13
issn = {id = "P236", maxvals = 1, populate_from_journal = true}, -- distinguish from |eissn= for electronic issues?
-- jfm = {id = "P?", maxvals = 1}, -- Jahrbuch über die Fortschritte der Mathematik (not Zbl)
-- sbn = {id = "P?", maxvals = 1}, -- Standard Book Number (predecessor of ISBN, not ICCU)
-- message-id = {id = "P?", maxvals = 1}, -- Usenet message ID
chapter = {id = "P792", maxvals = 1},
['publication-date'] = {id = "P577", maxvals = 1, populate_from_journal = true}, -- publication date (don't use |date=; is treated specially in {{citation}} if both are given.)
series = {id = "P179", maxvals = 1, populate_from_journal = true, qual = "P1545"},
version = {id = "P348", maxvals = 0},
edition = {id = "P393", maxvals = 0},
volume = {id = "P478", maxvals = 0, populate_from_journal = true},
-- part = {id = "P1545"?, maxvals = 0}, -- to be added to {{citation}} / COinS &rft.part=
title = {id = "P1476", rank="p n"},
-- url = {id = "P953", maxvals = 1}, -- deal with this along with archive-url
pages = {id = "P304", maxvals = 0, populate_from_journal = true},
at = {id = "P958", maxvals = 0, populate_from_journal = true}, -- also incorporate lines (P7421) and columns (P3903) into this (cite map also supports |section=)
-- sheets = {id = "P7416", maxvals = 0, populate_from_journal = true},
-- interviewer = {id = "P?", maxvals = 0}, -- does **not** go to "others" section! Multiple interviewers should be n-enumerated
illustrator = {id = "P110", maxvals = 10, others = true}, -- goes to "others" section
-- foreword and afterword, when contributions to another author's work, are contributions so belong in |contribution=;
-- the writer's name goes in |contributor=; requires |title= and |author=
-- However, this might need to add support for multiple contributors and their roles to {{citation}}, see Help_talk:Citation_Style_1#Others
-- foreword = {id = "P2679", maxvals = 10, others = true}, -- goes to "others" section
-- afterword = {id = "P2680", maxvals = 10, others = true}, -- goes to "others" section
composer = {id = "P86", maxvals = 10, others = true}, -- goes to "others" section
animator = {id = "P6942", maxvals = 10, others = true}, -- goes to "others" section
director = {id = "P57", maxvals = 10, others = true}, -- goes to "others" section
screenwriter = {id = "P58", maxvals = 10, others = true}, -- goes to "others" section
signatory = {id = "P1891", maxvals = 10, others = true}, -- goes to "others" section
presenter = {id = "P371", maxvals = 10, others = true}, -- goes to "others" section
performer = {id = "P175", maxvals = 10, others = true}, -- goes to "others" section
-- next 2 lines added for Arabic Wikipedia
annotator = {id ="P11105", maxvals = 10, others = true}, -- goes to "others" section
reviewer = {id ="P4032", maxvals = 10, others = true}, -- goes to "others" section
supervisor = {id ="P7604", maxvals = 3, others = true}, -- goes to "others" section
}
local used_args = {accessdate=true, language=true, mode=true, ol=true, other=true, ['display-authors']=true, ['display-editors']=true, ['archive-url']=true, ['archive-date']=true, url=true, title=true}
-- all_used_properties
local used_properties = {
P1071 = {arg= "place", maxvals = 0, linked = 'no'}, -- written-at place
P110 = {arg= "illustrator", maxvals = 10, others = true}, -- goes to "others" section
P11105 = {arg= "annotator", maxvals = 10, others = true}, -- goes to "others" section
P1144 = {arg= "lccn", maxvals = 1},
P1184 = {arg= "hdl", maxvals = 1}, -- take care of |hdl-access=?
P1208 = {arg= "ismn", maxvals = 1},
P123 = {arg= "publisher", maxvals = 3},
P1433 = {arg= "journal", maxvals = 1},
P1476 = {arg= "title", rank="p n"},
P1680 = true,
P175 = {arg= "performer", maxvals = 10, others = true}, -- goes to "others" section
P179 = {arg= "series", maxvals = 1, populate_from_journal = true},
P1891 = {arg= "signatory", maxvals = 10, others = true}, -- goes to "others" section
P1932 = true,
P2093 = true, -- author string
P212 = {arg= "isbn", maxvals = 1, populate_from_journal = true}, -- ISBN 13
P236 = {arg= "issn", maxvals = 1, populate_from_journal = true}, -- distinguish from |eissn= for electronic issues?
P243 = {arg= "oclc", maxvals = 1},
P2699 = true,
P291 = {arg= "publication-place", maxvals = 0, linked = 'no'}, -- publication place (don't put into |place=; is treated specially in {{citation}} if both are given)
P304 = {arg= "pages", maxvals = 0, populate_from_journal = true},
P348 = {arg= "version", maxvals = 0},
P356 = {arg= "doi", maxvals = 1}, -- take care of |doi-broken-date= (WD "reason for deprecation"/"stated as") and |doi-access= (WD "access status")?
P371 = {arg= "presenter", maxvals = 10, others = true}, -- goes to "others" section
P3784 = {arg= "citeseerx", maxvals = 1},
P3894 = {arg= "osti", maxvals = 1}, -- take care of |osti-access=?
P393 = {arg= "edition", maxvals = 0},
P3951 = {arg= "biorxiv", maxvals = 1},
P4032 = {arg= "reviewer", maxvals = 10, others = true}, -- goes to "others" section
P407 = true,
P433 = {arg= "issue", maxvals = 0, populate_from_journal = true}, -- distinguish from |number= ("P1545"?) if both are given (still blocked by {{citation}}, but will be supported in the future)
P478 = {arg= "volume", maxvals = 0, populate_from_journal = true},
P50 = true, -- author
P57 = {arg= "director", maxvals = 10, others = true}, -- goes to "others" section
P5749 = {arg= "asin", maxvals = 1}, -- What about |asin-tld=? (WD examples resolve to .com at present, but may change)
P5769 = true, --editor
P577 = {arg= "publication-date", maxvals = 1, populate_from_journal = true}, -- publication date (don't use |date=; is treated specially in {{citation}} if both are given.)
P58 = {arg= "screenwriter", maxvals = 10, others = true}, -- goes to "others" section
P655 = true,
P6942 = {arg= "animator", maxvals = 10, others = true}, -- goes to "others" section
P698 = {arg= "pmid", maxvals = 1},
P7604 = {arg ="supervisor", maxvals = 3, others = true}, -- goes to "others" section
P792 = {arg= "chapter", maxvals = 1},
P818 = {arg= "arxiv", maxvals = 1},
P819 = {arg= "bibcode", maxvals = 1}, -- take care of |bibcode-access=?
P8299 = {arg= "s2cid", maxvals = 1}, -- take care of |s2cid-access=?
P856 = true,
P86 = {arg= "composer", maxvals = 10, others = true}, -- goes to "others" section
P888 = {arg= "jstor", maxvals = 1}, -- take care of |jstor-access=?
P889 = {arg= "mr", maxvals = 1},
P892 = {arg= "rfc", maxvals = 1},
P893 = {arg= "ssrn", maxvals = 1},
P894 = {arg= "zbl", maxvals = 1},
P932 = {arg= "pmc", maxvals = 1}, -- take care of |pmc-embargo-date= (WD "reason for deprecation")?
P953 = true,
P958 = {arg= "at", maxvals = 0, populate_from_journal = true}, -- also incorporate lines (P7421) and columns (P3903) into this (cite map also supports |section=)
P98 = true,
P854 = true,
}
--[[--------------------------< I S _ S E T >--------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '')
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack (taken from Module:Citation/CS1/Utilities)
]]
local function in_array( needle, haystack )
if needle == nil then
return false
end
for n, v in ipairs( haystack ) do
if v == needle then
return n
end
end
return false
end
--[[--------------------------< A C C E P T _ V A L U E >-------------------------------------------------------
Accept WD value by framing in ((...)) if param_val is equal to keyword; else pass-through WD value as is.
]]
local function accept_value( param_val, wd_val )
local val = param_val
if val then
if in_array (val, {'accept', '))((', ':d:'}) then
val = '((' .. wd_val .. '))'
elseif '((accept))' == val then
val = 'accept'
elseif '(())(())' == val then
val = '))(('
elseif '((:d:))' == val then
val = ':d:'
else
val = wd_val
end
end
return val
end
-- function to fetch a value to display
local function makelink(v, out, link, maxpos, wdl, lang)
local label
if v.mainsnak.snaktype == "value" then
if v.mainsnak.datatype == "wikibase-item" then
local qnumber = v.mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qnumber)
if qnumber == "Q2818964" then sitelink = nil end -- suppress link to "Various authors"
-- من المهم التحقق من وجود datavalue
if v.qualifiers and v.qualifiers.P1932 and v.qualifiers.P1932[1].datavalue then
label = v.qualifiers.P1932[1].datavalue.value
else
label = mw.wikibase.getLabelByLang(qnumber, lang) or mw.wikibase.getLabel(qnumber)
if label then
label = mw.text.nowiki(label)
else
label = qnumber -- should add tracking category
end
end
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
if sitelink then
-- just the plain name,
-- but keep a record of the links, using the same index
out[position] = label
link[position] = sitelink
else
if wdl then
-- show that there's a Wikidata entry available
out[position] = "[[:d:Q" .. v.mainsnak.datavalue.value["numeric-id"] .. "|" .. label .. "]] <span title='" .. i18n["errors"]["local-article-not-found"] .. "'>[[ملف:Wikidata-logo.svg|16px|alt=|link=]]</span>"
else
-- no Wikidata links wanted, so just give the plain label
out[position] = label
end
end
elseif v.mainsnak.datatype == "string" then
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
out[position] = v.mainsnak.datavalue.value
else
-- not a wikibase-item or a string!
end
else
-- code here if we want to return something when author is "unknown"
-- من المهم التحقق من وجود datavalue
if v.qualifiers and v.qualifiers.P1932 and v.qualifiers.P1932[1].datavalue then
label = v.qualifiers.P1932[1].datavalue.value
else
label = mw.wikibase.getLabelByLang("Q4233718", lang):gsub("^%l", mw.ustring.upper)
end
maxpos = maxpos + 1
out[maxpos] = label
end
return maxpos
end
--[=[-------------------------< G E T _ N A M E _ L I S T >----------------------------------------------------
get_name_list -- adapted from getAuthors code taken from Module:RexxS
arguments:
nl_type - type of name list to fetch: nl_type = 'author' for authors; 'editor' for editors; 'translator' for translators
args - pointer to the parameter arguments table from the template call
qid - value from |qid= parameter; the Q-id of the source (book, etc.) in qid
wdl - value from the |wdl= parameter; a Boolean passed to enable links to Wikidata when no article exists
returns nothing; modifies the args table
]=]
local function get_name_list (nl_type, args, qid, wdl, lang, refsnak)
local propertyID = "P50"
local fallbackID = "P2093" -- author name string
if nl_type =="author" then
propertyID = 'P50' -- for authors
fallbackID = 'P2093' -- author-string
elseif nl_type =="editor" then
propertyID = 'P5769' -- "editor-in-chief"
fallbackID = 'P98' -- for editors - So-called "fallbacks" are actually a second set of properties processed
-- TBD. Take book series editors into account as well (if they have a separate P code as well)?
elseif nl_type == "translator" then
propertyID = 'P655' -- for translators
fallbackID = nil
-- elseif 'contributor' == nl_type then
-- f.e. author of forewords (P2679) and afterwords (P2680); requires |contribution=, |title= and |author=
-- propertyID = 'P' -- for contributors
-- fallbackID = nil
else
return -- not specified so return
end
-- wdl is a Boolean passed to enable links to Wikidata when no article exists
-- if "false" or "no" or "0" is passed set it false
-- if nothing or an empty string is passed set it false
if wdl and (#wdl > 0) then
wdl = wdl:lower()
wdl = in_array (wdl, {"false", "no", "0"})
else
-- wdl is empty, so
wdl = false
end
local props = nil
local fallback = nil
if qid then
if mw.wikibase.entityExists(qid) then
props = mw.wikibase.getAllStatements(qid, propertyID)
if #props == 0 and fallbackID then
fallback = mw.wikibase.getAllStatements(qid, fallbackID)
end
end
elseif refsnak then
props = refsnak[propertyID]
if not props and fallbackID then
fallback = refsnak[fallbackID]
end
end
-- Make sure it actually has at least one of the properties requested
if not (props and props[1]) and not (fallback and fallback[1]) then
return nil
end
-- So now we have something to return:
-- table 'out' is going to store the names(s):
-- and table 'link' will store any links to the name's article
local out = {}
local link = {}
local maxpos = 0
if props and props[1] then
for k, v in pairs(props) do
maxpos = makelink(v, out, link, maxpos, wdl, lang)
end
end
if fallback and fallback[1] then
-- second properties
for k, v in pairs(fallback) do
maxpos = makelink(v, out, link, maxpos, wdl, lang)
end
end
-- if there's anything to return, then insert the additions in the template arguments table
-- in the form |author1=firstname secondname |author2= ...
-- Renumber, in case we have inconsistent numbering
local keys = {}
for k, v in pairs(out) do
keys[#keys + 1] = k
end
table.sort(keys) -- as they might be out of order
for i, k in ipairs(keys) do
out[k] = out[k]:gsub (''', '\''); -- prevent cs1|2 multiple names categorization; replace html entity with the actual character
if args[nl_type .. i] then -- name gets overwritten
-- pull corresponding -link only if overwritten name is same as WD name
if link[k] and (args[nl_type .. i] == out[k]) then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
else -- name does not get overwritten, so pull name from WD
args[nl_type .. i] = out[k]
if link[k] then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
end
end
end
-- gets language codes used for a monolingual text property as a table
function p._getLangOfProp(qid, pid)
if not pid or not qid then return {} end
local out = {}
local props = mw.wikibase.getAllStatements(qid, pid)
for i, v in ipairs(props) do
if v.mainsnak.datatype == "monolingualtext" and v.mainsnak.datavalue then
out[#out + 1] = v.mainsnak.datavalue.value.language
end
end
return out
end
function p._getLangOfSnakProp(snak, pid)
if not pid or not snak then return {} end
local out = {}
local props = snak[pid]
for i, v in ipairs(props) do
if v.datatype == "monolingualtext" and v.datavalue then
out[#out + 1] = v.datavalue.value.language
end
end
return out
end
function p.getLangOfProp(frame)
local pid = frame.args.pid or mw.text.trim(frame.args[1] or "")
if pid == "" then return end
local qid = frame.args.qid
if qid == "" then qid = nil end
return table.concat(p._getLangOfProp(qid, pid), ", ")
end
-- gets the language codes of a Wikidata entry as a table
local function _lang_code(qid)
local lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P424", ps = 1} )
if lc then return mw.text.split( lc, "[,، ]+" ) end --modified
lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P218", ps = 1} )
if lc then return mw.text.split( lc, "[,، ]+" ) end --modified
return p._getLangOfProp(qid, "P1476")
end
function p.lang_code(frame)
return table.concat(_lang_code(frame.args.qid or mw.text.trim(frame.args[1] or "")), ", ")
end
-- export for debug
function p.getPropOfProp(frame)
return getPropOfProp(frame.args)
end
-- wraps a string in nowiki unless disable flag is set
local function wrap_nowiki(str, disable)
if disable then return str or '' end
return mw.text.nowiki(str or '')
end
-- sort sequence table whose values are key-value pairs by key
local function comp_key(a, b)
return a[1] < b[1]
end
-- sort sequence table whose values are key-value pairs by value
local function comp_val(a, b)
return a[2] < b[2]
end
-- ref filtering for citing from wikidata
local function is_rejected(item)
-- rejected Q
if rejected.sources[item]==true then
return true;
end
-- rejected Properties
local item_entity = mw.wikibase.getEntity(item);
for _, v in pairs(rejected.properties) do
if (#item_entity:getAllStatements( v )>0 ) then
return true;
end
end
-- Rejected InatanceOf
local instance = item_entity:getAllStatements( "P31" )
for _,v in pairs(instance) do
if rejected.instances[v.mainsnak.datavalue.value.id] then
return true;
end
end
--No used Properties
local has_properties = false
for k, _ in pairs(used_properties) do
if (#item_entity:getAllStatements( k )>0 ) then
has_properties = true;
break;
end
end
return not has_properties;
end
function p._cite_web(citeq_args)
local refsnak= citeq_args.snak
citeq_args.snak = nil
-- retrieve all the parameters
local pqid = citeq_args.pqid
citeq_args.pqid = nil
local wdl = false
local qid = nil
local multi_args = {
P50 = "author",
P2093 = "author",
P5769 = "editor",
P98 = "editor",
P655 = "translator",
}
-- find language
local langcodes = {}
if refsnak["P1476"] then
langcodes = p._getLangOfSnakProp(refsnak, "P1476")
citeq_args.language = citeq_args.language or langcodes[1]
end
langcodes[#langcodes+1] = 'ar'
langcodes[#langcodes+1] = 'en'
local labellang = langcodes[1]
local rtl = rtl_lang[langcodes[1]] or false
local oth={}
for i in pairs(refsnak) do
local label = ""
-- multiple authors may be given
if refsnak[i][1].snaktype ~= 'novalue' then
if multi_args[i] then
get_name_list (multi_args[i], citeq_args, qid, wdl, labellang)
elseif used_properties[i] and type(used_properties[i]) == "table" then
local data = used_properties[i]
local langidx = 1
while citeq_args[data.arg] == nil and langidx<=#langcodes do
citeq_args[data.arg] = getValueFromSnaks( {i, fwd = "ALL", osd = "no", noicon = "true", maxvals = data.maxvals, linked = data.linked, rank = data.rank or "best", lang=langcodes[langidx], snak = refsnak } )
if citeq_args[data.arg] == nil then
break
elseif citeq_args[data.arg]:find('[[تصنيف:Articles with missing Wikidata information]]', 1, true) then
citeq_args[data.arg] = nil
langidx = langidx + 1
else
break
end
end
if not citeq_args[data.arg] then
citeq_args[data.arg] = getValueFromSnaks( {i, ps = 1, qid = qid, maxvals = data.maxvals, linked = data.linked, snak = refsnak} )
if citeq_args[data.arg]:find('^Q%d+$') then -- qid was returned
-- try fallback to qid's native language
local qid_languages = _lang_code(citeq_args[data.arg])
citeq_args[data.arg] = getValueFromSnaks( {i, ps = 1, qid = qid, maxvals = data.maxvals, linked = data.linked, lang = qid_languages[1], snak = refsnak} )
if citeq_args[data.arg]:find('^Q%d+$') then -- qid was returned again
citeq_args[data.arg] = nil
else
-- record the language found if no lang specified
citeq_args.language = citeq_args.language or qid_languages[1]
end
end
end
--- translate unknown value
if citeq_args[data.arg] == "Unknown" then
if rtl then
citeq_args[data.arg] = i18n.ar["unknown-" .. data.arg] or i18n.ar["unknown"]
else
citeq_args[data.arg] = mw.wikibase.getLabelByLang("Q4233718", lang):gsub("^%l", mw.ustring.upper)
end
end
-----------------
if data.others then
oth[#oth + 1] = citeq_args[data.arg] and ((i18n.ar[data.arg] or data.arg:gsub("^%l", string.upper)) .. ": " .. citeq_args[data.arg])
citeq_args[data.arg] = nil
end
elseif used_properties[i] then
if i == "P648" then
citeq_args.ol = (getValueFromSnaks( {"P648", ps = 1, maxvals = 1, snak = refsnak, citeq_args.ol } ) or ''):gsub("^OL(.+)$", "%1")
if citeq_args.ol == "" then
citeq_args.ol = nil
end
elseif i == "P957" then
citeq_args.isbn = getValueFromSnaks( {"P957", ps = 1, maxvals = 1, rank="best", snak = refsnak } )
elseif in_array(i,{"P854", "P953", "P856", "P2699"}) then
local url;
for _, pr in ipairs( {"P854", "P953", "P856", "P2699"} ) do
url = getValueFromSnaks( {pr, ps = 1,osd = "no", noicon = "true", maxvals = 1, snak = refsnak } )
if url then
citeq_args.url = mw.text.split( url, " (", true )[1]
local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present
if arcurl then
local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)")
if arcy and arcm and arcd then
citeq_args["archive-url"] = arcurl
citeq_args["archive-date"] = tonumber(arcd) .. " " .. i18n.months[tonumber(arcm)] .. " " .. arcy
end
end
break
end
end
end
end
end
end
if citeq_args.url then
if refsnak["P813"] then
citeq_args.accessdate = getValueFromSnaks( {"P813", ps = 1,osd = "no", noicon = "true", maxvals = 1, snak = refsnak } )
end
if refsnak["P1065"] and refsnak["P2960"] then
citeq_args["archive-url"] = getValueFromSnaks( {"P1065", ps = 1,osd = "no", noicon = "true", maxvals = 1, snak = refsnak } )
citeq_args["archive-date"]= getValueFromSnaks( {"P2960", ps = 1,osd = "no", noicon = "true", maxvals = 1, snak = refsnak } )
end
end
citeq_args.others = citeq_args.others or table.concat(oth, ". ")
if citeq_args.others == "" then
citeq_args.others = nil
end
citeq_args.biorxiv = citeq_args.biorxiv and ("10.1101/" .. citeq_args.biorxiv)
-- if url then see if there's an archive: citeq_args.url
local url
if citeq_args.publisher == "Unknown" then -- look for "stated as" (P1932)
local stated_as = getValue( {"P123", ps = 1, qid = qid, maxvals = 1, qual="P1932", qo="y"} )
if stated_as then citeq_args.publisher = stated_as end
end
local title_display = citeq_args.title
if citeq_args.url then
citeq_args.title = wrap_nowiki(title_display)
end
-- TBD: incorporate |at, |sheets= and |sheet= here as well
-- Sort out what should happen if several of them are given at the same time
if citeq_args.page or citeq_args.p then -- let single take precedence over multiple
citeq_args.pages = nil
citeq_args.pp = nil
end
if citeq_args.pages then
local _, count = string.gsub(citeq_args.pages, "[,;%s]%d+", "")
if count == 1 then
citeq_args.page = citeq_args.pages
citeq_args.pages = nil
end
end
for k, v in pairs(citeq_args) do
if in_array (v, {'(())', 'unset', 'ignore'}) or 'string' ~= type(k) then -- empty accept-as-is-written (()) markup to indicate an empty/unused parameter value, other ((...)) markups are deliberately passed down to {{citation}}
citeq_args[k] = nil
elseif in_array (v, {'((unset))', '((ignore))'}) then -- strip off markup for free-text values clashing with local keywords
citeq_args[k] = 'unset'
end
end
local author_count = 0
for k, v in pairs(citeq_args) do
if k:find("^author%d+$") then
author_count = author_count + 1
end
end
if author_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-authors'] then
citeq_args['display-authors'] = nil; -- unset because no longer needed
else
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names
end
end
-- replace no-break space by space, User:Mr. Ibrahem
if citeq_args.title then
citeq_args.title = mw.ustring.gsub( citeq_args.title, "\194\160", " " )
end
local editor_count = 0
for k, v in pairs(citeq_args) do
if k:find("^editor%d+$") then
editor_count = editor_count + 1
end
end
if editor_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-editors'] then
citeq_args['display-editors'] = nil; -- unset because no longer needed
else
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names
end
end
-- code to make a guess what template to use from the supplied parameters
-- (first draft for proof-of-concept)
local template = "ويب"
-- |id= could hold more than one identifier pulled from Wikidata not supported by {{citation}}, right now only add our qid to the list
local list_sep = '. '
if citeq_args.mode ~= 'cs1' then
list_sep = ', '
end
-- clean up any blank parameters
for k, v in pairs(citeq_args) do
if v == "" then citeq_args[k] = nil end
end
if template then
-- citeq_args.mode = citeq_args.mode or "cs1" -- a cs1 template already knows that it is cs1 so this line is superfluous
template = "استشهاد " .. template
else
-- citeq_args.mode = citeq_args.mode or "cs2" -- a cs2 template already knows that it is cs2 so this line is superfluous
template = "استشهاد"
end
citeq_args['no-tracking'] = 'true' -- لإيقاف ظهور تصانيف التتبع
return mw.getCurrentFrame():expandTemplate{title = template, args = citeq_args} -- render the template
end
--[[-------------------------< C I T E _ Q >------------------------------------------------------------------
Takes standard CS1|2 template parameters and passes all to {{citation}}. If neither of |author= and |author1=
are set, calls get_authors() to try to get an author name-list from Wikidata. The result is passed to
{{citation}} for rendering.
--]]
function p._cite_q (in_citeq_args)
local frame = mw.getCurrentFrame()
local citeq_args = {}
local origin_args = {}
-- parameters that don't get passed to Citation
local expand = in_citeq_args.expand -- when set to anything, causes {{cite q}} to render <code><nowiki>{{citation|...}}</nowiki></code>
local qid = in_citeq_args.qid or in_citeq_args[1]
local wdl = in_citeq_args.wdl
local template = in_citeq_args.template
local cite_class = 'citation'
local rtl = true
local snak = in_citeq_args.snak or {}
local pqid = in_citeq_args.pqid
in_citeq_args.expand = nil
in_citeq_args[1] = nil
in_citeq_args.qid = nil
in_citeq_args.wdl = nil
in_citeq_args.template = nil
in_citeq_args.snak = nil
in_citeq_args.pqid = nil
if in_citeq_args.wikidatacite then
citeq_args = in_citeq_args
else
local A = argument_wrapper(in_citeq_args)
local loaded_args ={}
for _,args_table in pairs({simple_properties,used_args}) do
for k,_ in pairs(args_table) do
if A[k] then
citeq_args[k] = A[k]
if k ~= A:ORIGIN(k) then
origin_args[k] = A:ORIGIN(k)
table.insert(loaded_args, A:ORIGIN(k))
else
table.insert(loaded_args, k)
end
end
end
end
for k,v in pairs(in_citeq_args) do
if not in_array(k,loaded_args) then
citeq_args[k] = v
end
end
end
local labellang = 'ar'
-- if title supplied, flag to not read html title
local titleforced = (citeq_args.title ~= nil)
local oth = {}
-- put the language codes into a sequential table langcodes[]
local langcodes = {}
if citeq_args.language then
-- check these are a supported language codes
for lc in mw.text.gsplit( citeq_args.language, "[,، ]+", false ) do --modified
langcodes[#langcodes+1] = mw.language.isSupportedLanguage(lc) and lc
end
end
if not langcodes[1] then
-- try to find language of work
langcodes = _lang_code(qid)
end
if not langcodes[1] then
-- try fallback to journal's language
local journal_qid = followQid({qid = qid, props = "P1433"})
langcodes = journal_qid and _lang_code(journal_qid)
end
citeq_args.language = citeq_args.language or table.concat(langcodes, ", ")
labellang = langcodes[1] or labellang
rtl = rtl_lang[langcodes[1]] or false
-- loop through list of simple properties and get their values in citeq_args
for name, data in pairs(simple_properties) do
citeq_args[name] = getValue( {data.id, fwd = "ALL", osd = "no", noicon = "true", qid = qid, maxvals = data.maxvals, linked = data.linked, rank = data.rank or "best", lang = labellang, snak = snak, citeq_args[name], qual=data.qual } )
if data.populate_from_journal then
local publishedin = getValue( {"P1433", ps = 1, qid = qid, maxvals = 0, lang = labellang, citeq_args[name], qual = data.id, qualsonly = 'yes'} )
citeq_args[name] = publishedin or getPropOfProp({qid = qid, prop1 = "P1433", prop2 = data.id, lang = labellang, maxvals = data.maxvals, ps = 1})
end
if citeq_args[name] and citeq_args[name]:find('[[تصنيف:Articles with missing Wikidata information]]', 1, true) then
-- try fallback to work's native language
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = data.linked, lang = labellang, snak = snak} )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned
-- try fallback to qid's native language
local qid_languages = _lang_code(citeq_args[name])
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = data.linked, lang = qid_languages[1], snak = snak} )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned again
citeq_args[name] = nil
else
-- record the language found if no lang specified
citeq_args.language = citeq_args.language or qid_languages[1]
end
end
end
if citeq_args[name] and snak[data.id] then
snak[data.id] = nil
end
--- translate unknown value
if citeq_args[name] == "Unknown" and rtl then
citeq_args[name] = i18n.ar["unknown-" .. name] or i18n.ar["unknown"]
end
-----------------
if data.others then
oth[#oth + 1] = citeq_args[name] and ((rtl and i18n.ar[name] or name:gsub("^%l", string.upper)) .. ": " .. citeq_args[name])
citeq_args[name] = nil
end
end
citeq_args.others = citeq_args.others or table.concat(oth, ". ")
if citeq_args.others == "" then
citeq_args.others = nil
end
citeq_args.journal = citeq_args.journal and citeq_args.journal:gsub("^''", ""):gsub("''$", ""):gsub("|''", "|"):gsub("'']]", "]]")
citeq_args.ol = (getValue( {"P648", ps = 1, qid = qid, maxvals = 1, snak = snak, citeq_args.ol } ) or ''):gsub("^OL(.+)$", "%1")
if citeq_args.ol == "" then
citeq_args.ol = nil
end
-- TBD. Take care of |ol-access=?
citeq_args.biorxiv = citeq_args.biorxiv and ("10.1101/" .. citeq_args.biorxiv)
citeq_args.isbn = getValue( {"P957", ps = 1, qid = qid, maxvals = 1, rank="best", snak = snak, citeq_args.isbn } ) -- try ISBN 10 (only one value accepted)
-- if url then see if there's an archive: citeq_args.url
local url
--find formatted url
if snak ~= {} then
for k, v in pairs(snak) do
if (v[1].datatype == "external-id") then
local furl = mw.wikibase.getBestStatements( k, "P1630" )
if 0 ~= #furl then
furl = furl[1]["mainsnak"]["datavalue"]["value"]
citeq_args.url = mw.message.newRawMessage(furl, {v[1]["datavalue"]["value"]}):plain()
snak[k] = nil
break;
end
end
end
if citeq_args.url == nil and pqid and qid then
local refproperty = mw.wikibase.getBestStatements(qid , "P1687" )
if 0 ~= #refproperty then
-- خطأ لوا في وحدة:Cite_Q على السطر 1124: attempt to index field 'datavalue' (a nil value).
if refproperty[1]["mainsnak"] and refproperty[1]["mainsnak"]["datavalue"] and refproperty[1]["mainsnak"]["datavalue"]["value"] then
refproperty=refproperty[1]["mainsnak"]["datavalue"]["value"]["id"]
local furl = mw.wikibase.getBestStatements( refproperty, "P1630" )
if 0 ~= #furl then
furl = furl[1]["mainsnak"]["datavalue"]["value"]
local refval = mw.wikibase.getBestStatements( pqid, refproperty )
refval = (0 ~= #refval) and refval[1]["mainsnak"]["datavalue"]["value"]
if refval then
citeq_args.url = mw.message.newRawMessage(furl, {refval}):plain()
end
end
end
end
end
end
if not citeq_args.url then
for i, pr in ipairs( {"P953", "P856", "P2699"} ) do
url = getValue( {pr, ps = 1, qid = qid, maxvals = 1, snak = snak, qual="P1065" } )
if url then
citeq_args.url = mw.text.split( url, " (", true )[1]
local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present
if arcurl then
local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)")
if arcy and arcm and arcd then
citeq_args["archive-url"] = arcurl
citeq_args["archive-date"] = tonumber(arcd) .. " " .. i18n.months[tonumber(arcm)] .. " " .. arcy
end
end
break
end
end
end
if citeq_args.publisher == "Unknown" then -- look for "stated as" (P1932)
local stated_as = getValue( {"P123", ps = 1, qid = qid, maxvals = 1, qual="P1932", qo="y"} )
if stated_as then citeq_args.publisher = stated_as end
end
if not titleforced then
-- Handle subtitle.
if citeq_args.title then
local subtitle = mw.wikibase.getBestStatements (qid, 'P1680');
if 0 ~= #subtitle and subtitle[1].mainsnak.snaktype == 'value' then
subtitle = subtitle[1].mainsnak.datavalue.value.text;
citeq_args.title = citeq_args.title .. ": " .. subtitle
end
end
local htmltitle = getValue( {"P1476", qual = "P6833", ps = 1, qid = qid, snak = snak, maxvals = 1, qo = "y"} )
if htmltitle then
citeq_args.title = htmltitle:gsub("</?i>", "''")
else
local title_display = citeq_args.title
or (langcodes[1] and mw.wikibase.getLabelByLang(qid, langcodes[1]))
or mw.wikibase.getLabel(qid)
if title_display and snak and snak.P1810 then
title_display=title_display .. " | " .. snak.P1810[1].datavalue.value
snak.P1810 = nil
end
title_display = title_display or ("No label or title -- debug: " .. qid)
if citeq_args.url then
citeq_args.title = wrap_nowiki(title_display)
else
local slink = mw.wikibase.getSitelink(qid)
local slink_flag = false
local wrap_title = ''
local wslink = false
if not slink then
-- See if we have wikisource
if not citeq_args.url then
local wikisource_sitelink = mw.wikibase.getSitelink(qid, "enwikisource") or nil
if wikisource_sitelink then
slink = ':s:'..wikisource_sitelink
wslink = true
end
end
end
if citeq_args.title then
if slink then
wrap_title = wrap_nowiki(citeq_args.title)
slink_flag = true
else
citeq_args.title = wrap_nowiki(citeq_args.title)
end
else
if slink and not wslink then
if slink:lower() == title_display:lower() then
citeq_args.title = '[[' .. slink .. ']]'
else
wrap_title = wrap_nowiki(slink:gsub("%s%(.+%)$", ""):gsub(",.+$", ""))
slink_flag = true
end
elseif wslink then
wrap_title = wrap_nowiki(title_display)
slink_flag = true
else
citeq_args.title = wrap_nowiki(title_display)
end
end
if slink_flag then
if slink == wrap_title and not wslink then -- direct link
citeq_args.title = '[[' .. slink .. ']]'
else -- piped link
citeq_args.title = '[[' .. slink .. '|' .. wrap_title .. ']]'
end
end
end
end
end
-- replace no-break space by space, User:Mr. Ibrahem
if citeq_args.title then
citeq_args.title = mw.ustring.gsub( citeq_args.title, "\194\160", " " )
end
-- fetch other snak properties for debugging
-- if snak and snak ~= {} then
-- for k,v in pairs(snak) do
-- if not used_properties[k] then
-- end
-- end
-- end
-- TBD: incorporate |at, |sheets= and |sheet= here as well
-- Sort out what should happen if several of them are given at the same time
if citeq_args.page then -- let single take precedence over multiple
citeq_args.pages = nil
citeq_args.pp = nil
end
if citeq_args.pages then
local _, count = string.gsub(citeq_args.pages, "[,;%s]%d+", "")
if count == 1 then
citeq_args.page = citeq_args.pages
citeq_args.pages = nil
end
end
if is_set (qid) then
if not is_set (citeq_args.author) and not is_set (citeq_args.author1)
and not is_set (citeq_args.subject) and not is_set (citeq_args.subject1)
and not is_set (citeq_args.host) and not is_set (citeq_args.host1)
and not is_set (citeq_args.last) and not is_set (citeq_args.last1)
and not is_set (citeq_args.surname) and not is_set (citeq_args.surname1)
and not is_set (citeq_args['author-last']) and not is_set (citeq_args['author-last1']) and not is_set (citeq_args['author1-last'])
and not is_set (citeq_args['author-surname']) and not is_set (citeq_args['author-surname1']) and not is_set (citeq_args['author1-surname1']) then -- if neither are set, try to get authors from Wikidata
get_name_list ('author', citeq_args, qid, wdl, labellang) -- modify citeq_args table with authors from Wikidata
end
if not is_set (citeq_args.editor) and not is_set (citeq_args.editor1)
and not is_set (citeq_args['editor-last']) and not is_set (citeq_args['editor-last1']) and not is_set (citeq_args['editor1-last'])
and not is_set (citeq_args['editor-surname']) and not is_set (citeq_args['editor-surname1']) and not is_set (citeq_args['editor1-surname']) then -- if neither are set, try to get editors from Wikidata
get_name_list ('editor', citeq_args, qid, wdl, labellang) -- modify citeq_args table with editors from Wikidata
end
if not is_set (citeq_args.translator) and not is_set (citeq_args.translator1)
and not is_set (citeq_args['translator-last']) and not is_set (citeq_args['translator-last1']) and not is_set (citeq_args['translator1-last'])
and not is_set (citeq_args['translator-surname']) and not is_set (citeq_args['translator-surname1']) and not is_set (citeq_args['translator1-surname']) then -- if neither are set, try to get translators from Wikidata
get_name_list ('translator', citeq_args, qid, wdl, labellang) -- modify citeq_args table with translators from Wikidata
end
end
for k, v in pairs(citeq_args) do
if in_array (v, {'(())', 'unset', 'ignore'}) or 'string' ~= type(k) then -- empty accept-as-is-written (()) markup to indicate an empty/unused parameter value, other ((...)) markups are deliberately passed down to {{citation}}
citeq_args[k] = nil
elseif in_array (v, {'((unset))', '((ignore))'}) then -- strip off markup for free-text values clashing with local keywords
citeq_args[k] = 'unset'
end
end
local author_count = 0
for k, v in pairs(citeq_args) do
if k:find("^author%d+$") then
author_count = author_count + 1
end
end
if author_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-authors'] then
citeq_args['display-authors'] = nil; -- unset because no longer needed
else
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names
end
end
local editor_count = 0
for k, v in pairs(citeq_args) do
if k:find("^editor%d+$") then
editor_count = editor_count + 1
end
end
if editor_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-editors'] then
citeq_args['display-editors'] = nil; -- unset because no longer needed
else
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names
end
end
-- change edition to ordinal if it's set and numeric
if (rtl == false) then citeq_args.edition = citeq_args.edition and p.makeOrdinal(citeq_args.edition) end
-- code to make a guess what template to use from the supplied parameters
-- (first draft for proof-of-concept)
if citeq_args.journal then
template = template or "بدورية محكمة"
elseif citeq_args.isbn then
template = template or "بكتاب"
citeq_args.asin = nil -- suppress ASIN if ISBN exists
elseif citeq_args.website then
template = template or "ويب"
end
-- template is CS1 designator: journal, web, news, etc.
if template then
-- citeq_args.mode = citeq_args.mode or "cs1" -- a cs1 template already knows that it is cs1 so this line is superfluous
local citeclasses = {["بدورية محكمة"] = 'journal', ["بكتاب"] = "book", ["ويب"] = "web" }
cite_class = citeclasses[template]
template = "استشهاد " .. template
else
-- citeq_args.mode = citeq_args.mode or "cs2" -- a cs2 template already knows that it is cs2 so this line is superfluous
template = "استشهاد"
end
-- |id= could hold more than one identifier pulled from Wikidata not supported by {{citation}}, right now only add our qid to the list
local list_sep = '. '
if citeq_args.mode ~= 'cs1' then
list_sep = ', '
end
local id = '[[ويكي بيانات|QID]]:[[:d:' .. qid .. '|' .. qid .. ']]' -- go through "WDQ (identifier)" redirect to reduce clutter in "What links here" and improve reverse lookup. Keep in sync with {{QID}}.
local old_id = citeq_args.id
if wdl then -- show WD logo
id = id .. '[[ملف:Wikidata-logo.svg|16px|alt=|link=]]' -- possibly replace by WD edit icon?
end
if is_set (old_id) then
citeq_args.id = old_id .. list_sep .. id -- append to user-specified contents
else
citeq_args.id = id
end
-- clean up any blank parameters
for k, v in pairs(citeq_args) do
if v == "" then citeq_args[k] = nil end
end
-- use real param names for CS1 messages
for k,v in pairs(origin_args) do
if citeq_args[k] and citeq_args[k] == in_citeq_args[v] then
citeq_args[v] = citeq_args[k]
citeq_args[k] = nil
end
end
-- if |expand=<anything>, write a nowiki'd version to see what the {{citation}} template call looks like
if expand then
local expand_args = { "{{" .. template .. "\n" } -- init with citation template
if expand == "self" then
citeq_args.id = old_id -- restore original |id= parameter
expand_args = { "{{cite Q|" .. qid } -- expand to itself
end
-- make a sortable table and sort it by param name
local sorttable = {}
for param, val in pairs (citeq_args) do
table.insert(sorttable, {param, val})
end
table.sort(sorttable, comp_key)
-- add contents to expand_args
for idx, val in ipairs(sorttable) do
table.insert(expand_args, val[1] .. '=' .. val[2] .. "\n")
end
-- make the nowiki'd string and done
return table.concat (expand_args, '| ') .. "\n}}"
end
local erratumid = getPropertyIDs( { "P2507", qid = qid, fwd = "ALL", osd = "no", rank = "best", maxvals = 1 } )
if erratumid then
erratumid = " [[d:" .. erratumid .. "|(erratum)]]" .. "[[تصنيف:Cite Q - cites a work with an erratum]]"
else
erratumid = ""
end
local opt_cat = ''
if getValue( {"P5824", ps = 1, qid = qid} ) then
opt_cat = '[[تصنيف:Cite Q - cites a retracted work]]<!-- retracted -->'
end
if getValue( {"P1366", ps = 1, qid = qid} ) then
opt_cat = opt_cat .. '[[تصنيف:Cite Q - cites a replaced work]]<!-- replaced -->'
end
if citeq_args.wikidatacite then
return frame:expandTemplate{title = template, args = citeq_args} .. erratumid .. opt_cat -- render the template
else
local CS = require("Module:citation/CS1" .. sandbox)
return CS._citation(frame , citeq_args, {['CitationClass'] = cite_class}) .. erratumid .. opt_cat
end
end
--[[-------------------------< C I T E _ Q >------------------------------------------------------------------
Takes standard CS1|2 template parameters and passes all to {{citation}}. If neither of |author= and |author1=
are set, calls get_authors() to try to get an author name-list from Wikidata. The result is passed to
{{citation}} for rendering.
--]]
function p._cite_wikidata (ref, pqid)
-- early exit
if not ref then
return nil
end
local snak = ref.snaks
-- مراجع غير مقبولة
if snak.P143 or snak.P3452 then
return nil
end
local hash = ref.hash
if hash and hash ~= "" and ref_cash[hash] then
return ref_cash[hash]
end
local citeq_args = {}
local frame = mw.getCurrentFrame()
if snak.P248 then
for _, prop in pairs(snak.P248) do
if prop.snaktype == "value" then
citeq_args.qid = "Q" .. prop.datavalue.value["numeric-id"]
end
end
snak.P248 = nil;
end
if citeq_args.qid and is_rejected(citeq_args.qid) == true then
return nil
end
local reference
citeq_args.snak = snak
citeq_args.pqid = pqid
citeq_args.wikidatacite = 1
if citeq_args.qid then
reference = p._cite_q(citeq_args)
else
local has_properties = false
for k, _ in pairs(used_properties) do
if snak[k] then
has_properties = true;
break;
end
end
reference = (has_properties and p._cite_web(citeq_args) or nil)
end
if reference and reference ~= "" then
reference = frame:extensionTag("ref", reference, {name = 'wikidata-' .. hash})
end
if hash and hash ~= "" then
ref_cash[hash] = reference
end
return reference
end
function p.cite_q (frame)
local args = {}
for k, v in pairs(frame:getParent().args) do
if v ~= "" then args[k] = v end
end
for k, v in pairs(frame.args) do
if v ~= "" then args[k] = v end
end
args.qid = args.qid or args[1] or ""
if args.qid == "" then return nil end
args[1] = nil
local citesep = (args.citesep or "")
if citesep == "" then citesep = ", " end
citesep = citesep:gsub('"', '') -- strip double quotes after setting default to allow |citesep="" as a blank separator
args.citesep = nil
local tag = args.tag or ""
if tag == "" then tag = nil end
args.tag = nil
local list = args.list or ""
if list == "" then list = nil end
args.list = nil
args.language = args.language or args.lang
args.lang = nil
local cites = {}
for q in args.qid:gmatch("Q%d+") do
-- make a new copy of the arguments
local newargs = {}
for k, v in pairs(args) do
if k ~= "qid" then
newargs[k] = v
end
end
newargs.qid = q
if tag == "ref" then
cites[#cites + 1] = frame:callParserFunction{ name = "#tag:ref", args = { p._cite_q(newargs), name = q } }
-- expand like this: args = { p._cite_q(newargs), name = 'foo', group = 'bar' }
else
cites[#cites + 1] = p._cite_q(newargs)
end
end
if list then
return frame:expandTemplate{ title = list, args = cites }
else
return table.concat(cites, citesep)
end
end
return p
k6htobrqkdvhxx7h5z2aa1v6dwalxx0
690976
690968
2025-07-10T16:07:06Z
Abbas dhothar
361
690976
Scribunto
text/plain
-- Version: 2021-10-19
local p = {}
require('strict')
local wdib = require('Module:WikidataIB')
local getValue = wdib._getValue
local getPropOfProp = wdib._getPropOfProp
local followQid = wdib._followQid
local getPropertyIDs = wdib._getPropertyIDs
local i18n = {
["unknown-author"] = mw.wikibase.getLabel("Q4233718"):gsub("^%l", mw.ustring.upper),
["unknown-author-trackingcat"] = "[[Category:Cite Q - author unknown]]",
["ordinal"] = {
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["months"] = {
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
}
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above i18n
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
p.makeOrdinal = function(cardinal)
local card = tonumber(cardinal)
if not card then return cardinal end
local ordsuffix = i18n.ordinal.default
if card % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif card % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif card % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (card % 100 == 11) or (card % 100 == 12) or (card % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return card .. ordsuffix
end
-- Table of simple properties that can be fetched in roughly the same way:
-- id = PXXX
-- maxvals = maximum number of multiple values (0 for all)
-- linked = "no" suppresses linking
-- populate_from_journal = true/false determines whether to look in a journal where the source is published
-- rank = "best", "preferred", normal, etc. determines how Wikidata ranks are treated
-- others = true - the value for the property goes to "others" section
local simple_properties = {
publisher = {id = "P123", maxvals = 1},
oclc = {id = "P243", maxvals = 1},
['publication-place'] = {id = "P291", maxvals = 0, linked = 'no'}, -- publication place (don't put into |place=; is treated specially in {{citation}} if both are given)
doi = {id = "P356", maxvals = 1}, -- take care of |doi-broken-date= (WD "reason for deprecation"/"stated as") and |doi-access= (WD "access status")?
issue = {id = "P433", maxvals = 0, populate_from_journal = true}, -- distinguish from |number= ("P1545"?) if both are given (still blocked by {{citation}}, but will be supported in the future)
pmid = {id = "P698", maxvals = 1},
-- gbooks = {id = "P675", maxvals = 1}, -- to be added to {{citation}}
-- ia = {id = "P724", maxvals = 1}, -- to be added to {{citation}}
arxiv = {id = "P818", maxvals = 1},
bibcode = {id = "P819", maxvals = 1}, -- take care of |bibcode-access=?
jstor = {id = "P888", maxvals = 1}, -- take care of |jstor-access=?
mr = {id = "P889", maxvals = 1},
rfc = {id = "P892", maxvals = 1},
zbl = {id = "P894", maxvals = 1},
ssrn = {id = "P893", maxvals = 1},
place = {id = "P1071", maxvals = 0, linked = 'no'}, -- written-at place
-- ['total-pages'] = {id = "P1104", maxvals = 0, linked = 'no'}, -- to be added to {{citation}} / COinS &rft.tpages=
-- coden = {id = "P1159", maxvals = 1}, -- to be added to {{citation}} / COinS &rft.coden=
s2cid = {id = "P8299", maxvals = 1}, -- take care of |s2cid-access=?
pmc = {id = "P932", maxvals = 1}, -- take care of |pmc-embargo-date= (WD "reason for deprecation")?
lccn = {id = "P1144", maxvals = 1},
hdl = {id = "P1184", maxvals = 1}, -- take care of |hdl-access=?
ismn = {id = "P1208", maxvals = 1},
journal = {id = "P1433", maxvals = 1},
citeseerx = {id = "P3784", maxvals = 1},
osti = {id = "P3894", maxvals = 1}, -- take care of |osti-access=?
biorxiv = {id = "P3951", maxvals = 1},
asin = {id = "P5749", maxvals = 1}, -- What about |asin-tld=? (WD examples resolve to .com at present, but may change)
-- ['catalog-number'] = {id = "P528", maxvals = 0}, -- to be added to {{citation}} / COinS &rft.artnum=
isbn = {id = "P212", maxvals = 1, populate_from_journal = true}, -- ISBN 13
issn = {id = "P236", maxvals = 1, populate_from_journal = true}, -- distinguish from |eissn= for electronic issues?
-- jfm = {id = "P?", maxvals = 1}, -- Jahrbuch über die Fortschritte der Mathematik (not Zbl)
-- sbn = {id = "P?", maxvals = 1}, -- Standard Book Number (predecessor of ISBN, not ICCU)
-- message-id = {id = "P?", maxvals = 1}, -- Usenet message ID
chapter = {id = "P792", maxvals = 1},
['publication-date'] = {id = "P577", maxvals = 1, populate_from_journal = true}, -- publication date (don't use |date=; is treated specially in {{citation}} if both are given.)
series = {id = "P179", maxvals = 1, populate_from_journal = true},
version = {id = "P348", maxvals = 0},
edition = {id = "P393", maxvals = 0},
volume = {id = "P478", maxvals = 0, populate_from_journal = true},
-- part = {id = "P1545"?, maxvals = 0}, -- to be added to {{citation}} / COinS &rft.part=
title = {id = "P1476", rank="p n"},
-- url = {id = "P953", maxvals = 1}, -- deal with this along with archive-url
pages = {id = "P304", maxvals = 0, populate_from_journal = true},
at = {id = "P958", maxvals = 0, populate_from_journal = true}, -- also incorporate lines (P7421) and columns (P3903) into this (cite map also supports |section=)
-- sheets = {id = "P7416", maxvals = 0, populate_from_journal = true},
-- interviewer = {id = "P?", maxvals = 0}, -- does **not** go to "others" section! Multiple interviewers should be n-enumerated
illustrator = {id = "P110", maxvals = 10, others = true}, -- goes to "others" section
-- foreword and afterword, when contributions to another author's work, are contributions so belong in |contribution=;
-- the writer's name goes in |contributor=; requires |title= and |author=
-- However, this might need to add support for multiple contributors and their roles to {{citation}}, see Help_talk:Citation_Style_1#Others
-- foreword = {id = "P2679", maxvals = 10, others = true}, -- goes to "others" section
-- afterword = {id = "P2680", maxvals = 10, others = true}, -- goes to "others" section
composer = {id = "P86", maxvals = 10, others = true}, -- goes to "others" section
animator = {id = "P6942", maxvals = 10, others = true}, -- goes to "others" section
director = {id = "P57", maxvals = 10, others = true}, -- goes to "others" section
screenwriter = {id = "P58", maxvals = 10, others = true}, -- goes to "others" section
signatory = {id = "P1891", maxvals = 10, others = true}, -- goes to "others" section
presenter = {id = "P371", maxvals = 10, others = true}, -- goes to "others" section
performer = {id = "P175", maxvals = 10, others = true}, -- goes to "others" section
}
--[[--------------------------< I S _ S E T >--------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '')
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack (taken from Module:Citation/CS1/Utilities)
]]
local function in_array( needle, haystack )
if needle == nil then
return false
end
for n, v in ipairs( haystack ) do
if v == needle then
return n
end
end
return false
end
--[[--------------------------< A C C E P T _ V A L U E >-------------------------------------------------------
Accept WD value by framing in ((...)) if param_val is equal to keyword; else pass-through WD value as is.
]]
local function accept_value( param_val, wd_val )
local val = param_val
if val then
if in_array (val, {'accept', '))((', ':d:'}) then
val = '((' .. wd_val .. '))'
elseif '((accept))' == val then
val = 'accept'
elseif '(())(())' == val then
val = '))(('
elseif '((:d:))' == val then
val = ':d:'
else
val = wd_val
end
end
return val
end
-- function to fetch a value to display
local function makelink(v, out, link, maxpos, wdl)
local label
if v.mainsnak.snaktype == "value" then
if v.mainsnak.datatype == "wikibase-item" then
local qnumber = v.mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qnumber)
if qnumber == "Q2818964" then sitelink = nil end -- suppress link to "Various authors"
if v.qualifiers and v.qualifiers.P1932 then
label = v.qualifiers.P1932[1].datavalue.value
else
label = mw.wikibase.getLabel(qnumber)
if label then
label = mw.text.nowiki(label)
else
label = qnumber -- should add tracking category
end
end
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
if sitelink then
-- just the plain name,
-- but keep a record of the links, using the same index
out[position] = label
link[position] = sitelink
else
if wdl then
-- show that there's a Wikidata entry available
out[position] = "[[:d:Q" .. v.mainsnak.datavalue.value["numeric-id"] .. "|" .. label .. "]] <span title='" .. i18n["errors"]["local-article-not-found"] .. "'>[[File:Wikidata-logo.svg|16px|alt=|link=]]</span>"
else
-- no Wikidata links wanted, so just give the plain label
out[position] = label
end
end
elseif v.mainsnak.datatype == "string" then
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
out[position] = v.mainsnak.datavalue.value
else
-- not a wikibase-item or a string!
end
else
-- code here if we want to return something when author is "unknown"
if v.qualifiers and v.qualifiers.P1932 then
label = v.qualifiers.P1932[1].datavalue.value
else
label = i18n["unknown-author"] .. (i18n["unknown-author-trackingcat"] or "")
end
maxpos = maxpos + 1
out[maxpos] = label
end
return maxpos
end
--[=[-------------------------< G E T _ N A M E _ L I S T >----------------------------------------------------
get_name_list -- adapted from getAuthors code taken from Module:RexxS
arguments:
nl_type - type of name list to fetch: nl_type = 'author' for authors; 'editor' for editors; 'translator' for translators
args - pointer to the parameter arguments table from the template call
qid - value from |qid= parameter; the Q-id of the source (book, etc.) in qid
wdl - value from the |wdl= parameter; a Boolean passed to enable links to Wikidata when no article exists
returns nothing; modifies the args table
]=]
local function get_name_list (nl_type, args, qid, wdl)
local propertyID = "P50"
local fallbackID = "P2093" -- author name string
if nl_type =="author" then
propertyID = 'P50' -- for authors
fallbackID = 'P2093' -- author-string
elseif nl_type =="editor" then
propertyID = 'P5769' -- "editor-in-chief"
fallbackID = 'P98' -- for editors - So-called "fallbacks" are actually a second set of properties processed
-- TBD. Take book series editors into account as well (if they have a separate P code as well)?
elseif nl_type == "translator" then
propertyID = 'P655' -- for translators
fallbackID = nil
-- elseif 'contributor' == nl_type then
-- f.e. author of forewords (P2679) and afterwords (P2680); requires |contribution=, |title= and |author=
-- propertyID = 'P' -- for contributors
-- fallbackID = nil
else
return -- not specified so return
end
-- wdl is a Boolean passed to enable links to Wikidata when no article exists
-- if "false" or "no" or "0" is passed set it false
-- if nothing or an empty string is passed set it false
if wdl and (#wdl > 0) then
wdl = wdl:lower()
wdl = in_array (wdl, {"false", "no", "0"})
else
-- wdl is empty, so
wdl = false
end
local props = nil
local fallback = nil
if mw.wikibase.entityExists(qid) then
props = mw.wikibase.getAllStatements(qid, propertyID)
if props and fallbackID then
fallback = mw.wikibase.getAllStatements(qid, fallbackID)
end
end
-- Make sure it actually has at least one of the properties requested
if not (props and props[1]) and not (fallback and fallback[1]) then
return nil
end
-- So now we have something to return:
-- table 'out' is going to store the names(s):
-- and table 'link' will store any links to the name's article
local out = {}
local link = {}
local maxpos = 0
if props and props[1] then
for k, v in pairs(props) do
maxpos = makelink(v, out, link, maxpos, wdl)
end
end
if fallback and fallback[1] then
-- second properties
for k, v in pairs(fallback) do
maxpos = makelink(v, out, link, maxpos, wdl)
end
end
-- if there's anything to return, then insert the additions in the template arguments table
-- in the form |author1=firstname secondname |author2= ...
-- Renumber, in case we have inconsistent numbering
local keys = {}
for k, v in pairs(out) do
keys[#keys + 1] = k
end
table.sort(keys) -- as they might be out of order
for i, k in ipairs(keys) do
out[k] = out[k]:gsub (''', '\''); -- prevent cs1|2 multiple names categorization; replace html entity with the actual character
mw.log(i .. " " .. k .. " " .. (out[k]))
if args[nl_type .. i] then -- name gets overwritten
-- pull corresponding -link only if overwritten name is same as WD name
if link[k] and (args[nl_type .. i] == out[k]) then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
else -- name does not get overwritten, so pull name from WD
args[nl_type .. i] = out[k]
if link[k] then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
end
end
end
-- gets language codes used for a monolingual text property as a table
function p._getLangOfProp(qid, pid)
if not pid then return {} end
local out = {}
local props = mw.wikibase.getAllStatements(qid, pid)
for i, v in ipairs(props) do
if v.mainsnak.datatype == "monolingualtext" and v.mainsnak.datavalue then
out[#out + 1] = v.mainsnak.datavalue.value.language
end
end
return out
end
function p.getLangOfProp(frame)
local pid = frame.args.pid or mw.text.trim(frame.args[1] or "")
if pid == "" then return end
local qid = frame.args.qid
if qid == "" then qid = nil end
return table.concat(p._getLangOfProp(qid, pid), ", ")
end
-- gets the language codes of a Wikidata entry as a table
local function _lang_code(qid)
local lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P424", ps = 1} )
if lc then return mw.text.split( lc, "[, ]+" ) end
lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P218", ps = 1} )
if lc then return mw.text.split( lc, "[, ]+" ) end
return p._getLangOfProp(qid, "P1476")
end
function p.lang_code(frame)
return table.concat(_lang_code(frame.args.qid or mw.text.trim(frame.args[1] or "")), ", ")
end
-- export for debug
function p.getPropOfProp(frame)
return getPropOfProp(frame.args)
end
-- wraps a string in nowiki unless disable flag is set
local function wrap_nowiki(str, disable)
if disable then return str or '' end
return mw.text.nowiki(str or '')
end
-- sort sequence table whose values are key-value pairs by key
local function comp_key(a, b)
return a[1] < b[1]
end
-- sort sequence table whose values are key-value pairs by value
local function comp_val(a, b)
return a[2] < b[2]
end
--[[-------------------------< C I T E _ Q >------------------------------------------------------------------
Takes standard CS1|2 template parameters and passes all to {{citation}}. If neither of |author= and |author1=
are set, calls get_authors() to try to get an author name-list from Wikidata. The result is passed to
{{citation}} for rendering.
--]]
function p._cite_q (citeq_args)
local frame = mw.getCurrentFrame()
-- parameters that don't get passed to Citation
local expand = citeq_args.expand -- when set to anything, causes {{cite q}} to render <code><nowiki>{{citation|...}}</nowiki></code>
local qid = citeq_args.qid or citeq_args[1]
local wdl = citeq_args.wdl
local template = citeq_args.template
citeq_args.expand = nil
citeq_args[1] = nil
citeq_args.qid = nil
citeq_args.wdl = nil
citeq_args.template = nil
-- if title supplied, flag to not read html title
local titleforced = (citeq_args.title ~= nil)
local oth = {}
-- put the language codes into a sequential table langcodes[]
local langcodes = {}
if citeq_args.language then
-- check these are a supported language codes
for lc in mw.text.gsplit( citeq_args.language, "[, ]+", false ) do
langcodes[#langcodes+1] = mw.language.isSupportedLanguage(citeq_args.language) and citeq_args.language
end
end
if not langcodes[1] then
-- try to find language of work
langcodes = _lang_code(qid)
end
if not langcodes[1] then
-- try fallback to journal's language
local journal_qid = followQid({qid = qid, props = "P1433"})
langcodes = journal_qid and _lang_code(journal_qid)
end
citeq_args.language = citeq_args.language or table.concat(langcodes, ", ")
-- loop through list of simple properties and get their values in citeq_args
for name, data in pairs(simple_properties) do
citeq_args[name] = getValue( {data.id, fwd = "ALL", osd = "no", noicon = "true", qid = qid, maxvals = data.maxvals, linked = data.linked, rank = data.rank or "best", citeq_args[name] } )
if data.populate_from_journal then
local publishedin = getValue( {"P1433", ps = 1, qid = qid, maxvals = 0, citeq_args[name], qual = data.id, qualsonly = 'yes'} )
citeq_args[name] = publishedin or getPropOfProp({qid = qid, prop1 = "P1433", prop2 = data.id, maxvals = data.maxvals, ps = 1})
end
if citeq_args[name] and citeq_args[name]:find('[[Category:Articles with missing Wikidata information]]', 1, true) then
-- try fallback to work's native language
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = "no", lang = langcodes[1] } )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned
-- try fallback to qid's native language
local qid_languages = _lang_code(citeq_args[name])
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = "no", lang = qid_languages[1] } )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned again
citeq_args[name] = nil
else
-- record the language found if no lang specified
citeq_args.language = citeq_args.language or qid_languages[1]
end
end
end
if data.others then
oth[#oth + 1] = citeq_args[name] and (name:gsub("^%l", string.upper) .. ": " .. citeq_args[name])
citeq_args[name] = nil
end
end
citeq_args.others = citeq_args.others or table.concat(oth, ". ")
if citeq_args.others == "" then
citeq_args.others = nil
end
citeq_args.journal = citeq_args.journal and citeq_args.journal:gsub("^''", ""):gsub("''$", ""):gsub("|''", "|"):gsub("'']]", "]]")
citeq_args.ol = (getValue( {"P648", ps = 1, qid = qid, maxvals = 1, citeq_args.ol } ) or ''):gsub("^OL(.+)$", "%1")
if citeq_args.ol == "" then
citeq_args.ol = nil
end
-- TBD. Take care of |ol-access=?
citeq_args.biorxiv = citeq_args.biorxiv and ("10.1101/" .. citeq_args.biorxiv)
citeq_args.isbn = getValue( {"P957", ps = 1, qid = qid, maxvals = 1, rank="best", citeq_args.isbn } ) -- try ISBN 10 (only one value accepted)
-- if url then see if there's an archive: citeq_args.url
local url
if not citeq_args.url then
for i, pr in ipairs( {"P953", "P856", "P2699"} ) do
url = getValue( {pr, ps = 1, qid = qid, maxvals = 1, qual="P1065" } )
if url then
citeq_args.url = mw.text.split( url, " (", true )[1]
local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present
if arcurl then
local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)")
if arcy and arcm and arcd then
citeq_args["archive-url"] = arcurl
citeq_args["archive-date"] = tonumber(arcd) .. " " .. i18n.months[tonumber(arcm)] .. " " .. arcy
end
end
break
end
end
end
if citeq_args.publisher == "Unknown" then -- look for "stated as" (P1932)
local stated_as = getValue( {"P123", ps = 1, qid = qid, maxvals = 1, qual="P1932", qo="y"} )
if stated_as then citeq_args.publisher = stated_as end
end
if not titleforced then
-- Handle subtitle.
if citeq_args.title then
local subtitle = mw.wikibase.getBestStatements (qid, 'P1680');
if 0 ~= #subtitle then
subtitle = subtitle[1].mainsnak.datavalue.value.text;
citeq_args.title = citeq_args.title .. ": " .. subtitle
end
end
local htmltitle = getValue( {"P1476", qual = "P6833", ps = 1, qid = qid, maxvals = 1, qo = "y"} )
if htmltitle then
citeq_args.title = htmltitle:gsub("</?i>", "''")
else
local title_display = citeq_args.title
or mw.wikibase.getLabel(qid)
or (langcodes[1] and mw.wikibase.getLabelByLang(qid, langcodes[1]))
or ("No label or title -- debug: " .. qid)
if citeq_args.url then
citeq_args.title = wrap_nowiki(title_display)
else
local slink = mw.wikibase.getSitelink(qid)
local slink_flag = false
local wrap_title = ''
local wslink = false
if not slink then
-- See if we have wikisource
if not citeq_args.url then
local wikisource_sitelink = mw.wikibase.getSitelink(qid, "enwikisource") or nil
if wikisource_sitelink then
slink = ':s:'..wikisource_sitelink
wslink = true
end
end
end
if citeq_args.title then
if slink then
wrap_title = wrap_nowiki(citeq_args.title)
slink_flag = true
else
citeq_args.title = wrap_nowiki(citeq_args.title)
end
else
if slink and not wslink then
if slink:lower() == title_display:lower() then
citeq_args.title = '[[' .. slink .. ']]'
else
wrap_title = wrap_nowiki(slink:gsub("%s%(.+%)$", ""):gsub(",.+$", ""))
slink_flag = true
end
elseif wslink then
wrap_title = wrap_nowiki(title_display)
slink_flag = true
else
citeq_args.title = wrap_nowiki(title_display)
end
end
if slink_flag then
if slink == wrap_title and not wslink then -- direct link
citeq_args.title = '[[' .. slink .. ']]'
else -- piped link
citeq_args.title = '[[' .. slink .. '|' .. wrap_title .. ']]'
end
end
end
end
end
-- TBD: incorporate |at, |sheets= and |sheet= here as well
-- Sort out what should happen if several of them are given at the same time
if citeq_args.page or citeq_args.p then -- let single take precedence over multiple
citeq_args.pages = nil
citeq_args.pp = nil
end
if citeq_args.pages then
local _, count = string.gsub(citeq_args.pages, "[,;%s]%d+", "")
if count == 1 then
citeq_args.page = citeq_args.pages
citeq_args.pages = nil
end
end
if is_set (qid) then
if not is_set (citeq_args.author) and not is_set (citeq_args.author1)
and not is_set (citeq_args.subject) and not is_set (citeq_args.subject1)
and not is_set (citeq_args.host) and not is_set (citeq_args.host1)
and not is_set (citeq_args.last) and not is_set (citeq_args.last1)
and not is_set (citeq_args.surname) and not is_set (citeq_args.surname1)
and not is_set (citeq_args['author-last']) and not is_set (citeq_args['author-last1']) and not is_set (citeq_args['author1-last'])
and not is_set (citeq_args['author-surname']) and not is_set (citeq_args['author-surname1']) and not is_set (citeq_args['author1-surname1']) then -- if neither are set, try to get authors from Wikidata
get_name_list ('author', citeq_args, qid, wdl) -- modify citeq_args table with authors from Wikidata
end
if not is_set (citeq_args.editor) and not is_set (citeq_args.editor1)
and not is_set (citeq_args['editor-last']) and not is_set (citeq_args['editor-last1']) and not is_set (citeq_args['editor1-last'])
and not is_set (citeq_args['editor-surname']) and not is_set (citeq_args['editor-surname1']) and not is_set (citeq_args['editor1-surname']) then -- if neither are set, try to get editors from Wikidata
get_name_list ('editor', citeq_args, qid, wdl) -- modify citeq_args table with editors from Wikidata
end
if not is_set (citeq_args.translator) and not is_set (citeq_args.translator1)
and not is_set (citeq_args['translator-last']) and not is_set (citeq_args['translator-last1']) and not is_set (citeq_args['translator1-last'])
and not is_set (citeq_args['translator-surname']) and not is_set (citeq_args['translator-surname1']) and not is_set (citeq_args['translator1-surname']) then -- if neither are set, try to get translators from Wikidata
get_name_list ('translator', citeq_args, qid, wdl) -- modify citeq_args table with translators from Wikidata
end
end
for k, v in pairs(citeq_args) do
if in_array (v, {'(())', 'unset', 'ignore'}) or 'string' ~= type(k) then -- empty accept-as-is-written (()) markup to indicate an empty/unused parameter value, other ((...)) markups are deliberately passed down to {{citation}}
citeq_args[k] = nil
elseif in_array (v, {'((unset))', '((ignore))'}) then -- strip off markup for free-text values clashing with local keywords
citeq_args[k] = 'unset'
end
end
local author_count = 0
for k, v in pairs(citeq_args) do
if k:find("^author%d+$") then
author_count = author_count + 1
end
end
if author_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-authors'] then
citeq_args['display-authors'] = nil; -- unset because no longer needed
else
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names
end
end
local editor_count = 0
for k, v in pairs(citeq_args) do
if k:find("^editor%d+$") then
editor_count = editor_count + 1
end
end
if editor_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-editors'] then
citeq_args['display-editors'] = nil; -- unset because no longer needed
else
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names
end
end
-- change edition to ordinal if it's set and numeric
citeq_args.edition = citeq_args.edition and p.makeOrdinal(citeq_args.edition)
-- code to make a guess what template to use from the supplied parameters
-- (first draft for proof-of-concept)
if citeq_args.isbn then
template = template or "book"
citeq_args.asin = nil -- suppress ASIN if ISBN exists
elseif citeq_args.journal then
template = template or "journal"
elseif citeq_args.website then
template = template or "web"
end
-- template is CS1 designator: journal, web, news, etc.
if template then
-- citeq_args.mode = citeq_args.mode or "cs1" -- a cs1 template already knows that it is cs1 so this line is superfluous
template = "Cite " .. template
else
-- citeq_args.mode = citeq_args.mode or "cs2" -- a cs2 template already knows that it is cs2 so this line is superfluous
template = "Citation"
end
-- |id= could hold more than one identifier pulled from Wikidata not supported by {{citation}}, right now only add our qid to the list
local list_sep = '. '
if citeq_args.mode ~= 'cs1' then
list_sep = ', '
end
local id = '[[WDQ (identifier)|Wikidata]] [[:d:' .. qid .. '|' .. qid .. ']]' -- go through "WDQ (identifier)" redirect to reduce clutter in "What links here" and improve reverse lookup. Keep in sync with {{QID}}.
local old_id = citeq_args.id
if wdl then -- show WD logo
id = id .. '[[File:Wikidata-logo.svg|16px|alt=|link=]]' -- possibly replace by WD edit icon?
end
if is_set (old_id) then
citeq_args.id = old_id .. list_sep .. id -- append to user-specified contents
else
citeq_args.id = id
end
-- clean up any blank parameters
for k, v in pairs(citeq_args) do
if v == "" then citeq_args[k] = nil end
end
-- if |expand=<anything>, write a nowiki'd version to see what the {{citation}} template call looks like
if expand then
local expand_args = { "{{" .. template } -- init with citation template
if expand == "self" then
citeq_args.id = old_id -- restore original |id= parameter
expand_args = { "{{cite Q|" .. qid } -- expand to itself
end
-- make a sortable table and sort it by param name
local sorttable = {}
for param, val in pairs (citeq_args) do
table.insert(sorttable, {param, val})
end
table.sort(sorttable, comp_key)
-- add contents to expand_args
for idx, val in ipairs(sorttable) do
table.insert(expand_args, val[1] .. '=' .. val[2])
end
-- make the nowiki'd string and done
return frame:preprocess (table.concat ({'<syntaxhighlight lang="wikitext" inline="1">', table.concat (expand_args, ' |') .. '}}', '</syntaxhighlight>'}));
end
local erratumid = getPropertyIDs( { "P2507", qid = qid, fwd = "ALL", osd = "no", rank = "best", maxvals = 1 } )
if erratumid then
erratumid = " [[d:" .. erratumid .. "|(erratum)]]" .. "[[Category:Cite Q - cites a work with an erratum]]"
else
erratumid = ""
end
local opt_cat = ''
if getValue( {"P5824", ps = 1, qid = qid} ) then
opt_cat = '[[Category:Cite Q - cites a retracted work]]<!-- retracted -->'
end
if getValue( {"P1366", ps = 1, qid = qid} ) then
opt_cat = opt_cat .. '[[Category:Cite Q - cites a replaced work]]<!-- replaced -->'
end
return frame:expandTemplate{title = template, args = citeq_args} .. erratumid .. opt_cat -- render the template
end
function p.cite_q (frame)
local args = {}
for k, v in pairs(frame:getParent().args) do
if v ~= "" then args[k] = v end
end
for k, v in pairs(frame.args) do
if v ~= "" then args[k] = v end
end
args.qid = args.qid or args[1] or ""
if args.qid == "" then return nil end
args[1] = nil
local citesep = (args.citesep or "")
if citesep == "" then citesep = ", " end
citesep = citesep:gsub('"', '') -- strip double quotes after setting default to allow |citesep="" as a blank separator
args.citesep = nil
local tag = args.tag or ""
if tag == "" then tag = nil end
args.tag = nil
local list = args.list or ""
if list == "" then list = nil end
args.list = nil
args.language = args.language or args.lang
args.lang = nil
local cites = {}
for q in args.qid:gmatch("Q%d+") do
-- make a new copy of the arguments
local newargs = {}
for k, v in pairs(args) do
if k ~= "qid" then
newargs[k] = v
end
end
newargs.qid = q
if tag == "ref" then
cites[#cites + 1] = frame:callParserFunction{ name = "#tag:ref", args = { p._cite_q(newargs), name = q } }
-- expand like this: args = { p._cite_q(newargs), name = 'foo', group = 'bar' }
else
cites[#cites + 1] = p._cite_q(newargs)
end
end
if list then
return frame:expandTemplate{ title = list, args = cites }
else
return table.concat(cites, citesep)
end
end
return p
gs3mbxmbk7fka5q6zjnw9c8ub9k1ngt
691004
690976
2025-07-10T16:58:50Z
Abbas dhothar
361
691004
Scribunto
text/plain
-- Version: 2021-10-19
local p = {}
require('strict')
local wdib = require('Module:WikidataIB/en')
local getValue = wdib._getValue
local getPropOfProp = wdib._getPropOfProp
local followQid = wdib._followQid
local getPropertyIDs = wdib._getPropertyIDs
local i18n = {
["unknown-author"] = mw.wikibase.getLabel("Q4233718"):gsub("^%l", mw.ustring.upper),
["unknown-author-trackingcat"] = "", -- [[Category:Cite Q - author unknown]] removed as misplaced; someone is welcome to restore it if it is placed outside of the template parameter value
["ordinal"] = {
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["months"] = {
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
}
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above i18n
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
p.makeOrdinal = function(cardinal)
local card = tonumber(cardinal)
if not card then return cardinal end
local ordsuffix = i18n.ordinal.default
if card % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif card % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif card % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (card % 100 == 11) or (card % 100 == 12) or (card % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return card .. ordsuffix
end
-- Table of simple properties that can be fetched in roughly the same way:
-- id = PXXX
-- maxvals = maximum number of multiple values (0 for all)
-- linked = "no" suppresses linking
-- populate_from_journal = true/false determines whether to look in a journal where the source is published
-- rank = "best", "preferred", normal, etc. determines how Wikidata ranks are treated
-- others = true - the value for the property goes to "others" section
local simple_properties = {
publisher = {id = "P123", maxvals = 1},
oclc = {id = "P243", maxvals = 1},
['publication-place'] = {id = "P291", maxvals = 0, linked = 'no'}, -- publication place (don't put into |place=; is treated specially in {{citation}} if both are given)
doi = {id = "P356", maxvals = 1}, -- take care of |doi-broken-date= (WD "reason for deprecation"/"stated as") and |doi-access= (WD "access status")?
issue = {id = "P433", maxvals = 0, populate_from_journal = true}, -- distinguish from |number= ("P1545"?) if both are given (still blocked by {{citation}}, but will be supported in the future)
pmid = {id = "P698", maxvals = 1},
-- gbooks = {id = "P675", maxvals = 1}, -- to be added to {{citation}}
-- ia = {id = "P724", maxvals = 1}, -- to be added to {{citation}}
arxiv = {id = "P818", maxvals = 1},
bibcode = {id = "P819", maxvals = 1}, -- take care of |bibcode-access=?
jstor = {id = "P888", maxvals = 1}, -- take care of |jstor-access=?
mr = {id = "P889", maxvals = 1},
rfc = {id = "P892", maxvals = 1},
zbl = {id = "P894", maxvals = 1},
ssrn = {id = "P893", maxvals = 1},
place = {id = "P1071", maxvals = 0, linked = 'no'}, -- written-at place
-- ['total-pages'] = {id = "P1104", maxvals = 0, linked = 'no'}, -- to be added to {{citation}} / COinS &rft.tpages=
-- coden = {id = "P1159", maxvals = 1}, -- to be added to {{citation}} / COinS &rft.coden=
s2cid = {id = "P8299", maxvals = 1}, -- take care of |s2cid-access=?
pmc = {id = "P932", maxvals = 1}, -- take care of |pmc-embargo-date= (WD "reason for deprecation")?
lccn = {id = "P1144", maxvals = 1},
hdl = {id = "P1184", maxvals = 1}, -- take care of |hdl-access=?
ismn = {id = "P1208", maxvals = 1},
journal = {id = "P1433", maxvals = 1},
citeseerx = {id = "P3784", maxvals = 1},
osti = {id = "P3894", maxvals = 1}, -- take care of |osti-access=?
biorxiv = {id = "P3951", maxvals = 1},
asin = {id = "P5749", maxvals = 1}, -- What about |asin-tld=? (WD examples resolve to .com at present, but may change)
-- ['catalog-number'] = {id = "P528", maxvals = 0}, -- to be added to {{citation}} / COinS &rft.artnum=
isbn = {id = "P212", maxvals = 1, populate_from_journal = true}, -- ISBN 13
issn = {id = "P236", maxvals = 1, populate_from_journal = true}, -- distinguish from |eissn= for electronic issues?
-- jfm = {id = "P?", maxvals = 1}, -- Jahrbuch über die Fortschritte der Mathematik (not Zbl)
-- sbn = {id = "P?", maxvals = 1}, -- Standard Book Number (predecessor of ISBN, not ICCU)
-- message-id = {id = "P?", maxvals = 1}, -- Usenet message ID
chapter = {id = "P792", maxvals = 1},
['publication-date'] = {id = "P577", maxvals = 1, populate_from_journal = true}, -- publication date (don't use |date=; is treated specially in {{citation}} if both are given.)
series = {id = "P179", maxvals = 1, populate_from_journal = true},
version = {id = "P348", maxvals = 0},
edition = {id = "P393", maxvals = 0},
volume = {id = "P478", maxvals = 0, populate_from_journal = true},
-- part = {id = "P1545"?, maxvals = 0}, -- to be added to {{citation}} / COinS &rft.part=
title = {id = "P1476", rank="p n"},
-- url = {id = "P953", maxvals = 1}, -- deal with this along with archive-url
pages = {id = "P304", maxvals = 0, populate_from_journal = true},
at = {id = "P958", maxvals = 0, populate_from_journal = true}, -- also incorporate lines (P7421) and columns (P3903) into this (cite map also supports |section=)
-- sheets = {id = "P7416", maxvals = 0, populate_from_journal = true},
-- interviewer = {id = "P?", maxvals = 0}, -- does **not** go to "others" section! Multiple interviewers should be n-enumerated
illustrator = {id = "P110", maxvals = 10, others = true}, -- goes to "others" section
-- foreword and afterword, when contributions to another author's work, are contributions so belong in |contribution=;
-- the writer's name goes in |contributor=; requires |title= and |author=
-- However, this might need to add support for multiple contributors and their roles to {{citation}}, see Help_talk:Citation_Style_1#Others
-- foreword = {id = "P2679", maxvals = 10, others = true}, -- goes to "others" section
-- afterword = {id = "P2680", maxvals = 10, others = true}, -- goes to "others" section
composer = {id = "P86", maxvals = 10, others = true}, -- goes to "others" section
animator = {id = "P6942", maxvals = 10, others = true}, -- goes to "others" section
director = {id = "P57", maxvals = 10, others = true}, -- goes to "others" section
screenwriter = {id = "P58", maxvals = 10, others = true}, -- goes to "others" section
signatory = {id = "P1891", maxvals = 10, others = true}, -- goes to "others" section
presenter = {id = "P371", maxvals = 10, others = true}, -- goes to "others" section
performer = {id = "P175", maxvals = 10, others = true}, -- goes to "others" section
}
--[[--------------------------< I S _ S E T >--------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '')
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack (taken from Module:Citation/CS1/Utilities)
]]
local function in_array( needle, haystack )
if needle == nil then
return false
end
for n, v in ipairs( haystack ) do
if v == needle then
return n
end
end
return false
end
--[[--------------------------< A C C E P T _ V A L U E >-------------------------------------------------------
Accept WD value by framing in ((...)) if param_val is equal to keyword; else pass-through WD value as is.
]]
local function accept_value( param_val, wd_val )
local val = param_val
if val then
if in_array (val, {'accept', '))((', ':d:'}) then
val = '((' .. wd_val .. '))'
elseif '((accept))' == val then
val = 'accept'
elseif '(())(())' == val then
val = '))(('
elseif '((:d:))' == val then
val = ':d:'
else
val = wd_val
end
end
return val
end
-- function to fetch a value to display
local function makelink(v, out, link, maxpos, wdl)
local label
if v.mainsnak.snaktype == "value" then
if v.mainsnak.datatype == "wikibase-item" then
local qnumber = v.mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qnumber)
if qnumber == "Q2818964" then sitelink = nil end -- suppress link to "Various authors"
if v.qualifiers and v.qualifiers.P1932 then
label = v.qualifiers.P1932[1].datavalue.value
else
label = mw.wikibase.getLabel(qnumber)
if label then
label = mw.text.nowiki(label)
else
label = qnumber -- should add tracking category
end
end
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
if sitelink then
-- just the plain name,
-- but keep a record of the links, using the same index
out[position] = label
link[position] = sitelink
else
if wdl then
-- show that there's a Wikidata entry available
out[position] = "[[:d:Q" .. v.mainsnak.datavalue.value["numeric-id"] .. "|" .. label .. "]] <span title='" .. i18n["errors"]["local-article-not-found"] .. "'>[[File:Wikidata-logo.svg|16px|alt=|link=]]</span>"
else
-- no Wikidata links wanted, so just give the plain label
out[position] = label
end
end
elseif v.mainsnak.datatype == "string" then
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
out[position] = v.mainsnak.datavalue.value
else
-- not a wikibase-item or a string!
end
else
-- code here if we want to return something when author is "unknown"
if v.qualifiers and v.qualifiers.P1932 then
label = v.qualifiers.P1932[1].datavalue.value
else
label = i18n["unknown-author"] .. (i18n["unknown-author-trackingcat"] or "")
end
maxpos = maxpos + 1
out[maxpos] = label
end
return maxpos
end
--[=[-------------------------< G E T _ N A M E _ L I S T >----------------------------------------------------
get_name_list -- adapted from getAuthors code taken from Module:RexxS
arguments:
nl_type - type of name list to fetch: nl_type = 'author' for authors; 'editor' for editors; 'translator' for translators
args - pointer to the parameter arguments table from the template call
qid - value from |qid= parameter; the Q-id of the source (book, etc.) in qid
wdl - value from the |wdl= parameter; a Boolean passed to enable links to Wikidata when no article exists
returns nothing; modifies the args table
]=]
local function get_name_list (nl_type, args, qid, wdl)
local propertyID = "P50"
local fallbackID = "P2093" -- author name string
if nl_type =="author" then
propertyID = 'P50' -- for authors
fallbackID = 'P2093' -- author-string
elseif nl_type =="editor" then
propertyID = 'P5769' -- "editor-in-chief"
fallbackID = 'P98' -- for editors - So-called "fallbacks" are actually a second set of properties processed
-- TBD. Take book series editors into account as well (if they have a separate P code as well)?
elseif nl_type == "translator" then
propertyID = 'P655' -- for translators
fallbackID = nil
-- elseif 'contributor' == nl_type then
-- f.e. author of forewords (P2679) and afterwords (P2680); requires |contribution=, |title= and |author=
-- propertyID = 'P' -- for contributors
-- fallbackID = nil
else
return -- not specified so return
end
-- wdl is a Boolean passed to enable links to Wikidata when no article exists
-- if "false" or "no" or "0" is passed set it false
-- if nothing or an empty string is passed set it false
if wdl and (#wdl > 0) then
wdl = wdl:lower()
wdl = in_array (wdl, {"false", "no", "0"})
else
-- wdl is empty, so
wdl = false
end
local props = nil
local fallback = nil
if mw.wikibase.entityExists(qid) then
props = mw.wikibase.getAllStatements(qid, propertyID)
if props and fallbackID then
fallback = mw.wikibase.getAllStatements(qid, fallbackID)
end
end
-- Make sure it actually has at least one of the properties requested
if not (props and props[1]) and not (fallback and fallback[1]) then
return nil
end
-- So now we have something to return:
-- table 'out' is going to store the names(s):
-- and table 'link' will store any links to the name's article
local out = {}
local link = {}
local maxpos = 0
if props and props[1] then
for k, v in pairs(props) do
maxpos = makelink(v, out, link, maxpos, wdl)
end
end
if fallback and fallback[1] then
-- second properties
for k, v in pairs(fallback) do
maxpos = makelink(v, out, link, maxpos, wdl)
end
end
-- if there's anything to return, then insert the additions in the template arguments table
-- in the form |author1=firstname secondname |author2= ...
-- Renumber, in case we have inconsistent numbering
local keys = {}
for k, v in pairs(out) do
keys[#keys + 1] = k
end
table.sort(keys) -- as they might be out of order
for i, k in ipairs(keys) do
out[k] = out[k]:gsub (''', '\''); -- prevent cs1|2 multiple names categorization; replace html entity with the actual character
mw.log(i .. " " .. k .. " " .. (out[k]))
if args[nl_type .. i] then -- name gets overwritten
-- pull corresponding -link only if overwritten name is same as WD name
if link[k] and (args[nl_type .. i] == out[k]) then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
else -- name does not get overwritten, so pull name from WD
args[nl_type .. i] = out[k]
if link[k] then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
end
end
end
-- gets language codes used for a monolingual text property as a table
function p._getLangOfProp(qid, pid)
if not pid then return {} end
local out = {}
local props = mw.wikibase.getAllStatements(qid, pid)
for i, v in ipairs(props) do
if v.mainsnak.datatype == "monolingualtext" and v.mainsnak.datavalue then
out[#out + 1] = v.mainsnak.datavalue.value.language
end
end
return out
end
function p.getLangOfProp(frame)
local pid = frame.args.pid or mw.text.trim(frame.args[1] or "")
if pid == "" then return end
local qid = frame.args.qid
if qid == "" then qid = nil end
return table.concat(p._getLangOfProp(qid, pid), ", ")
end
-- gets the language codes of a Wikidata entry as a table
local function _lang_code(qid)
local lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P424", ps = 1} )
if lc then return mw.text.split( lc, "[, ]+" ) end
lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P218", ps = 1} )
if lc then return mw.text.split( lc, "[, ]+" ) end
return p._getLangOfProp(qid, "P1476")
end
function p.lang_code(frame)
return table.concat(_lang_code(frame.args.qid or mw.text.trim(frame.args[1] or "")), ", ")
end
-- export for debug
function p.getPropOfProp(frame)
return getPropOfProp(frame.args)
end
-- wraps a string in nowiki unless disable flag is set
local function wrap_nowiki(str, disable)
if disable then return str or '' end
return mw.text.nowiki(str or '')
end
-- sort sequence table whose values are key-value pairs by key
local function comp_key(a, b)
return a[1] < b[1]
end
-- sort sequence table whose values are key-value pairs by value
local function comp_val(a, b)
return a[2] < b[2]
end
--[[-------------------------< C I T E _ Q >------------------------------------------------------------------
Takes standard CS1|2 template parameters and passes all to {{citation}}. If neither of |author= and |author1=
are set, calls get_authors() to try to get an author name-list from Wikidata. The result is passed to
{{citation}} for rendering.
--]]
function p._cite_q (citeq_args)
local frame = mw.getCurrentFrame()
-- parameters that don't get passed to Citation
local expand = citeq_args.expand -- when set to anything, causes {{cite q}} to render <code><nowiki>{{citation|...}}</nowiki></code>
local qid = citeq_args.qid or citeq_args[1]
local wdl = citeq_args.wdl
local template = citeq_args.template
citeq_args.expand = nil
citeq_args[1] = nil
citeq_args.qid = nil
citeq_args.wdl = nil
citeq_args.template = nil
-- if title supplied, flag to not read html title
local titleforced = (citeq_args.title ~= nil)
local oth = {}
-- put the language codes into a sequential table langcodes[]
local langcodes = {}
if citeq_args.language then
-- check these are a supported language codes
for lc in mw.text.gsplit( citeq_args.language, "[, ]+", false ) do
langcodes[#langcodes+1] = mw.language.isSupportedLanguage(citeq_args.language) and citeq_args.language
end
end
if not langcodes[1] then
-- try to find language of work
langcodes = _lang_code(qid)
end
if not langcodes[1] then
-- try fallback to journal's language
local journal_qid = followQid({qid = qid, props = "P1433"})
langcodes = journal_qid and _lang_code(journal_qid)
end
citeq_args.language = citeq_args.language or table.concat(langcodes, ", ")
-- loop through list of simple properties and get their values in citeq_args
for name, data in pairs(simple_properties) do
citeq_args[name] = getValue( {data.id, fwd = "ALL", osd = "no", noicon = "true", qid = qid, maxvals = data.maxvals, linked = data.linked, rank = data.rank or "best", citeq_args[name] } )
if data.populate_from_journal then
local publishedin = getValue( {"P1433", ps = 1, qid = qid, maxvals = 0, citeq_args[name], qual = data.id, qualsonly = 'yes'} )
citeq_args[name] = publishedin or getPropOfProp({qid = qid, prop1 = "P1433", prop2 = data.id, maxvals = data.maxvals, ps = 1})
end
if citeq_args[name] and citeq_args[name]:find('[[Category:Articles with missing Wikidata information]]', 1, true) then
-- try fallback to work's native language
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = "no", lang = langcodes[1] } )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned
-- try fallback to qid's native language
local qid_languages = _lang_code(citeq_args[name])
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = "no", lang = qid_languages[1] } )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned again
citeq_args[name] = nil
else
-- record the language found if no lang specified
citeq_args.language = citeq_args.language or qid_languages[1]
end
end
end
if data.others then
oth[#oth + 1] = citeq_args[name] and (name:gsub("^%l", string.upper) .. ": " .. citeq_args[name])
citeq_args[name] = nil
end
end
citeq_args.others = citeq_args.others or table.concat(oth, ". ")
if citeq_args.others == "" then
citeq_args.others = nil
end
citeq_args.journal = citeq_args.journal and citeq_args.journal:gsub("^''", ""):gsub("''$", ""):gsub("|''", "|"):gsub("'']]", "]]")
citeq_args.ol = (getValue( {"P648", ps = 1, qid = qid, maxvals = 1, citeq_args.ol } ) or ''):gsub("^OL(.+)$", "%1")
if citeq_args.ol == "" then
citeq_args.ol = nil
end
-- TBD. Take care of |ol-access=?
citeq_args.biorxiv = citeq_args.biorxiv and ("10.1101/" .. citeq_args.biorxiv)
citeq_args.isbn = getValue( {"P957", ps = 1, qid = qid, maxvals = 1, rank="best", citeq_args.isbn } ) -- try ISBN 10 (only one value accepted)
-- if url then see if there's an archive: citeq_args.url
local url
if not citeq_args.url then
for i, pr in ipairs( {"P953", "P856", "P2699"} ) do
url = getValue( {pr, ps = 1, qid = qid, maxvals = 1, qual="P1065" } )
if url then
citeq_args.url = mw.text.split( url, " (", true )[1]
local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present
if arcurl then
local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)")
if arcy and arcm and arcd then
citeq_args["archive-url"] = arcurl
citeq_args["archive-date"] = tonumber(arcd) .. " " .. i18n.months[tonumber(arcm)] .. " " .. arcy
end
end
break
end
end
end
if citeq_args.publisher == "Unknown" then -- look for "stated as" (P1932)
local stated_as = getValue( {"P123", ps = 1, qid = qid, maxvals = 1, qual="P1932", qo="y"} )
if stated_as then citeq_args.publisher = stated_as end
end
if not titleforced then
-- Handle subtitle.
if citeq_args.title then
local subtitle = mw.wikibase.getBestStatements (qid, 'P1680');
if 0 ~= #subtitle then
subtitle = subtitle[1].mainsnak.datavalue.value.text;
citeq_args.title = citeq_args.title .. ": " .. subtitle
end
end
local htmltitle = getValue( {"P1476", qual = "P6833", ps = 1, qid = qid, maxvals = 1, qo = "y"} )
if htmltitle then
citeq_args.title = htmltitle:gsub("</?i>", "''")
else
local title_display = citeq_args.title
or mw.wikibase.getLabel(qid)
or (langcodes[1] and mw.wikibase.getLabelByLang(qid, langcodes[1]))
or ("No label or title -- debug: " .. qid)
if citeq_args.url then
citeq_args.title = wrap_nowiki(title_display)
else
local slink = mw.wikibase.getSitelink(qid)
local slink_flag = false
local wrap_title = ''
local wslink = false
if not slink then
-- See if we have wikisource
if not citeq_args.url then
local wikisource_sitelink = mw.wikibase.getSitelink(qid, "enwikisource") or nil
if wikisource_sitelink then
slink = ':s:'..wikisource_sitelink
wslink = true
end
end
end
if citeq_args.title then
if slink then
wrap_title = wrap_nowiki(citeq_args.title)
slink_flag = true
else
citeq_args.title = wrap_nowiki(citeq_args.title)
end
else
if slink and not wslink then
if slink:lower() == title_display:lower() then
citeq_args.title = '[[' .. slink .. ']]'
else
wrap_title = wrap_nowiki(slink:gsub("%s%(.+%)$", ""):gsub(",.+$", ""))
slink_flag = true
end
elseif wslink then
wrap_title = wrap_nowiki(title_display)
slink_flag = true
else
citeq_args.title = wrap_nowiki(title_display)
end
end
if slink_flag then
if slink == wrap_title and not wslink then -- direct link
citeq_args.title = '[[' .. slink .. ']]'
else -- piped link
citeq_args.title = '[[' .. slink .. '|' .. wrap_title .. ']]'
end
end
end
end
end
-- TBD: incorporate |at, |sheets= and |sheet= here as well
-- Sort out what should happen if several of them are given at the same time
if citeq_args.page or citeq_args.p then -- let single take precedence over multiple
citeq_args.pages = nil
citeq_args.pp = nil
end
if citeq_args.pages then
local _, count = string.gsub(citeq_args.pages, "[,;%s]%d+", "")
if count == 1 then
citeq_args.page = citeq_args.pages
citeq_args.pages = nil
end
end
if is_set (qid) then
if not is_set (citeq_args.author) and not is_set (citeq_args.author1)
and not is_set (citeq_args.subject) and not is_set (citeq_args.subject1)
and not is_set (citeq_args.host) and not is_set (citeq_args.host1)
and not is_set (citeq_args.last) and not is_set (citeq_args.last1)
and not is_set (citeq_args.surname) and not is_set (citeq_args.surname1)
and not is_set (citeq_args['author-last']) and not is_set (citeq_args['author-last1']) and not is_set (citeq_args['author1-last'])
and not is_set (citeq_args['author-surname']) and not is_set (citeq_args['author-surname1']) and not is_set (citeq_args['author1-surname1']) then -- if neither are set, try to get authors from Wikidata
get_name_list ('author', citeq_args, qid, wdl) -- modify citeq_args table with authors from Wikidata
end
if not is_set (citeq_args.editor) and not is_set (citeq_args.editor1)
and not is_set (citeq_args['editor-last']) and not is_set (citeq_args['editor-last1']) and not is_set (citeq_args['editor1-last'])
and not is_set (citeq_args['editor-surname']) and not is_set (citeq_args['editor-surname1']) and not is_set (citeq_args['editor1-surname']) then -- if neither are set, try to get editors from Wikidata
get_name_list ('editor', citeq_args, qid, wdl) -- modify citeq_args table with editors from Wikidata
end
if not is_set (citeq_args.translator) and not is_set (citeq_args.translator1)
and not is_set (citeq_args['translator-last']) and not is_set (citeq_args['translator-last1']) and not is_set (citeq_args['translator1-last'])
and not is_set (citeq_args['translator-surname']) and not is_set (citeq_args['translator-surname1']) and not is_set (citeq_args['translator1-surname']) then -- if neither are set, try to get translators from Wikidata
get_name_list ('translator', citeq_args, qid, wdl) -- modify citeq_args table with translators from Wikidata
end
end
for k, v in pairs(citeq_args) do
if in_array (v, {'(())', 'unset', 'ignore'}) or 'string' ~= type(k) then -- empty accept-as-is-written (()) markup to indicate an empty/unused parameter value, other ((...)) markups are deliberately passed down to {{citation}}
citeq_args[k] = nil
elseif in_array (v, {'((unset))', '((ignore))'}) then -- strip off markup for free-text values clashing with local keywords
citeq_args[k] = 'unset'
end
end
local author_count = 0
for k, v in pairs(citeq_args) do
if k:find("^author%d+$") then
author_count = author_count + 1
end
end
if author_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-authors'] then
citeq_args['display-authors'] = nil; -- unset because no longer needed
else
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names
end
end
local editor_count = 0
for k, v in pairs(citeq_args) do
if k:find("^editor%d+$") then
editor_count = editor_count + 1
end
end
if editor_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-editors'] then
citeq_args['display-editors'] = nil; -- unset because no longer needed
else
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names
end
end
-- change edition to ordinal if it's set and numeric
citeq_args.edition = citeq_args.edition and p.makeOrdinal(citeq_args.edition)
-- code to make a guess what template to use from the supplied parameters
-- (first draft for proof-of-concept)
if citeq_args.isbn then
template = template or "book"
citeq_args.asin = nil -- suppress ASIN if ISBN exists
elseif citeq_args.journal then
template = template or "journal"
elseif citeq_args.website then
template = template or "web"
end
-- template is CS1 designator: journal, web, news, etc.
if template then
-- citeq_args.mode = citeq_args.mode or "cs1" -- a cs1 template already knows that it is cs1 so this line is superfluous
template = "Cite " .. template
else
-- citeq_args.mode = citeq_args.mode or "cs2" -- a cs2 template already knows that it is cs2 so this line is superfluous
template = "Citation"
end
-- |id= could hold more than one identifier pulled from Wikidata not supported by {{citation}}, right now only add our qid to the list
local list_sep = '. '
if citeq_args.mode ~= 'cs1' then
list_sep = ', '
end
local id = '[[:en:WDQ (identifier)|Wikidata]] [[:d:' .. qid .. '|' .. qid .. ']]' -- go through "WDQ (identifier)" redirect to reduce clutter in "What links here" and improve reverse lookup. Keep in sync with {{QID}}.
local old_id = citeq_args.id
if wdl then -- show WD logo
id = id .. '[[File:Wikidata-logo.svg|16px|alt=|link=]]' -- possibly replace by WD edit icon?
end
if is_set (old_id) then
citeq_args.id = old_id .. list_sep .. id -- append to user-specified contents
else
citeq_args.id = id
end
-- clean up any blank parameters
for k, v in pairs(citeq_args) do
if v == "" then citeq_args[k] = nil end
end
-- if |expand=<anything>, write a nowiki'd version to see what the {{citation}} template call looks like
if expand then
local expand_args = { "{{" .. template } -- init with citation template
if expand == "self" then
citeq_args.id = old_id -- restore original |id= parameter
expand_args = { "{{cite Q|" .. qid } -- expand to itself
end
-- make a sortable table and sort it by param name
local sorttable = {}
for param, val in pairs (citeq_args) do
table.insert(sorttable, {param, val})
end
table.sort(sorttable, comp_key)
-- add contents to expand_args
for idx, val in ipairs(sorttable) do
table.insert(expand_args, val[1] .. '=' .. val[2])
end
-- make the nowiki'd string and done
return frame:preprocess (table.concat ({'<syntaxhighlight lang="wikitext" inline="1">', table.concat (expand_args, ' |') .. '}}', '</syntaxhighlight>'}));
end
local erratumid = getPropertyIDs( { "P2507", qid = qid, fwd = "ALL", osd = "no", rank = "best", maxvals = 1 } )
if erratumid then
erratumid = " [[d:" .. erratumid .. "|(erratum)]]" .. "[[Category:Cite Q - cites a work with an erratum]]"
else
erratumid = ""
end
local opt_cat = ''
if getValue( {"P5824", ps = 1, qid = qid} ) then
opt_cat = '[[Category:Cite Q - cites a retracted work]]<!-- retracted -->'
end
if getValue( {"P1366", ps = 1, qid = qid} ) then
opt_cat = opt_cat .. '[[Category:Cite Q - cites a replaced work]]<!-- replaced -->'
end
return frame:expandTemplate{title = template, args = citeq_args} .. erratumid .. opt_cat -- render the template
end
function p.cite_q (frame)
local args = {}
for k, v in pairs(frame:getParent().args) do
if v ~= "" then args[k] = v end
end
for k, v in pairs(frame.args) do
if v ~= "" then args[k] = v end
end
args.qid = args.qid or args[1] or ""
if args.qid == "" then return nil end
args[1] = nil
local citesep = (args.citesep or "")
if citesep == "" then citesep = ", " end
citesep = citesep:gsub('"', '') -- strip double quotes after setting default to allow |citesep="" as a blank separator
args.citesep = nil
local tag = args.tag or ""
if tag == "" then tag = nil end
args.tag = nil
local list = args.list or ""
if list == "" then list = nil end
args.list = nil
args.language = args.language or args.lang
args.lang = nil
local cites = {}
for q in args.qid:gmatch("Q%d+") do
-- make a new copy of the arguments
local newargs = {}
for k, v in pairs(args) do
if k ~= "qid" then
newargs[k] = v
end
end
newargs.qid = q
if tag == "ref" then
cites[#cites + 1] = frame:callParserFunction{ name = "#tag:ref", args = { p._cite_q(newargs), name = q } }
-- expand like this: args = { p._cite_q(newargs), name = 'foo', group = 'bar' }
else
cites[#cites + 1] = p._cite_q(newargs)
end
end
if list then
return frame:expandTemplate{ title = list, args = cites }
else
return table.concat(cites, citesep)
end
end
return p
4u3u13ot6ksub1cnfybua39myd65059
احمد بن موسی کاظم
0
136024
691012
671859
2025-07-10T20:11:34Z
Mohsen1355
41539
691012
wikitext
text/x-wiki
{{خانہ معلومات راوی حدیث
|
| سابقة تشريفية = اہل بیت
| اسم كامل =
| name =
| الاسم =
| اسم =
| لاحقة تشريفية =
| الصورة = Ahmed bin Musa AKadhim.png
| اسم_الصورة =
| image =
| حجم الصورة =
| image_size =
| حجم_الصورة =
| التعليق =
| caption =
| عنوان_الصورة =
| اسم الولادة =
| اسم_الميلاد =
| birth_name =
| تاريخ الولادة =
| تاريخ_الولادة =
| الميلاد =
| تاريخ الميلاد =
| ميلاد =
| تاريخ_الميلاد =
| مكان الميلاد =
| مكان الولادة =
| مكان_الولادة =
| birth_place =
| مكان_الميلاد =
| تاريخ الوفاة =۱۷ رجب ۲۰۳ ه.ق
| تاريخ_الوفاة =
| الوفاة =
| وفاة =
| death_date =
| مكان الوفاة =
| death_place =
| مكان_الوفاة =
| سبب الوفاة = شہادت
| death_cause =
| مكان الدفن =حرم شاهچراغ، شیراز
| resting place =
| resting_place =
| restingplace =
| احداثيات مكان الدفن =
| resting place coordinates =
| resting_place_coordinates =
| restingplacecoordinates =
| معالم =
| نصب تذكارية =
| النصب التذكارية =
| monuments =
| إقامة = [[مدینہ]] ، [[بصرہ]]
| الإقامة =
| residence =
| جنسية =
| الجنسية =
| nationality =
| أسماء أخرى =
| other_names =
| عرقية =
| ethnicity =
| عرق =
| مواطنة =
| المواطنة =
| citizenship =
| اللقب =
| لقب =
| المهنة =
| العمل =
| عمل =
| مهنة =
| المجالات =
| المجال =
| الاهتمامات الرئيسية =
| طالب علماں =
| تعلم لدى =
| الكنية = ابو داؤد
| الطبقة =
| النسب =
| إشتهر_بأنه =
| مرتبتة_عند_ابن_حجر =
| مرتبتة_عند_الذهبي =
| تاريخ_الإسلام =
| عدد_الأحاديث =
| روى_له =
| لم_يروى_له =
| سنوات نشاط =
| سنوات النشاط =
| years_active =
| اشتهر بـ =
| اشتهر_بـ =
| أعمال ملحوظة =
| تأثر بـ =
| تأثر_بـ =
| أثر في =
| أثر_في =
| أثر بـ =
| دين =
| ديانة =
| الديانة =
| مذهب =
| زوج =
| الزوج =
| الزوجة =
| الزوج(ة) =
| الأزواج =
| الزوجات =
| زوجاته =
| أبناء =
| الأبناء =
| الأطفال =
| أطفال =
| أبنائه =
| والد =
| الأب =
| أب =
| أبوه =
| والدة =
| الأم =
| أم =
| أمه =
| أقاربه = '''والد:''' [[امام موسی کاظم]] <br /> *'''والدہ:''' ام احمد <br /> *'''بھائی:''' <br /> [[علی رضا]] <br />، [[ابراہیم بن موسی کاظم|ابراہیم اکبر]] <br />، [[فاطمہ بنت موسی|فاطمہ معصوصہ]] <br />، [[محمد بن موسی کاظم]] <br />، [[آمنہ بنت موسی کاظم]] <br />، [[مقبرہ حمزہ کاظم (کاشمر)|حمزہ بن موسى کاظم]] <br />، [[احمد بن موسی کاظم]] <br />، ابراہیم اصغر<br /> *'''آپ دے بیٹے:'''<br />، محمد، <br /> علی <br /> ، عبد اللہ ،<br /> داؤد <br /> ایہ وی دسیا گیا کہ شہر قم وچ مدفون فید القمی دے ناں توں مشہور ابراہیم احمد بن موسیٰ دے بیٹےآں وچوں اک نيں۔
| الغزوات =
}}
'''احمد بن موسی (وفات : [[شیراز]] ، ۱۷ رجب [[202ھ]])''' [[اہل تشیع]] دے ستويں امام ، [[موسی بن جعفر|موسی کاظم]] دے بیٹےآں وچوں اک نيں۔ تے اوہ امام [[علی رضا]] دے بھائی نيں۔ آپ نے اپنے بھائی رضا دی عیادت دے لئی [[مدینہ منورہ|مدینہ]] توں [[خراسان]] دی طرف ہجرت کی، لیکن اوہ راستے وچ [[ایران]] دے شہر [[شیراز]] وچ شہید کر دتے گئے تے اوتھے دفن ہوئے۔ آپ دا مزار، جسنوں [[شاہ چراغ]] مسجد دے ناں توں جانیا جاندا اے، [[اہل تشیع]] دے لئی اہم تھانواں تے مزارات وچوں اک سمجھیا جاندا اے۔ <ref>[http://arabic.shahecheragh.ir/menu.aspx?id=11654 نبذة عن سیرة و فضائله حضرة أحمد بن موسى الکاظم] ، من موقع العتبة الاحمدیة والمحمدیة المقدسة علیهما السلام. {{Webarchive|url=https://web.archive.org/web/20160913184511/http://arabic.shahecheragh.ir/menu.aspx?id=11654 |date=13 سبتمبر 2016}}</ref>
== ناں و نسب ==
* وہ نيں: احمد بن [[موسی بن جعفر|موسی کاظم]] بن [[جعفر صادق]] بن [[محمد باقر]] بن [[زین العابدین|علی سجاد]] بن [[حسین بن علی|حسین]] بن [[علی ابن ابی طالب|علی بن ابی طالب]]۔
* آپ دی والدہ: اوہ ام احمد نيں، تے اوہ موسیٰ کاظم دی نیک عورتاں وچوں سی۔ عالم مجلسی نے کتاب آئینہ دماغ وچ کہیا اے: "ام احمد امام موسیٰ دے بعض بچےآں دی ماں سی، تے اوہ انہاں دی بیویاں وچ علم، تقویٰ تے وقار وچ نیک عورتاں وچوں سی، اس دے راز تے امانتاں اس دے سپرد کر دیؤ سی۔"<ref>الأربلي، كشف الغمة في معرفة الأئمة، ج2، ص: 236؛ ابن صباغ المالكي، الفصول المهمة، ج 2، ص961.</ref>
=== ہجرت تے شہادت ===
جب امام علی بن موسی رضا ، [[مامون الرشید]] دے دباؤ وچ مدینہ توں خراسان منتقل ہوئے تاں انہاں دے بھائی احمد بن موسیٰ نے بنو ہاشم دے اک گروہ دے نال انہاں دے نال شامل ہوݨ دا فیصلہ کيتا۔ چنانچہ انہاں نے شہر چھڈ دتا - 198ھ توں 203ھ دے نیڑے بصرہ دے راستے خراسان دی طرف روانہ ہوئے۔ اس گروہ دی تعداد تن ہزار سی جويں جويں اوہ شہراں تے قصبےآں توں گزردے گئے، انہاں دی تعداد ودھدتی گئی تے وڈی تعداد وچ شیعہ انہاں دے سفر وچ شامل ہُندے گئے ایتھے تک کہ اوہ پندرہ ہزار دے نیڑے پہنچ گئے۔ اس تحریک وچ سب توں اگے [[امام موسی کاظم]] دے بیٹے احمد، محمد تے حسین سن ۔ جدوں اوہ جنوبی فارس دے شہر [[شیراز]] وچ پہنچے تاں شیراز دے گورنر نے [[مامون الرشید]] دے حکم توں انہاں نوں سفر کرنے توں روک دتا۔ انہاں دے درمیان لڑائیاں ہوئیاں جنہاں دا اختتام بنو ہاشم دے متعدد افراد دے قتل اُتے ہويا تے باقی وکھ وکھ علاقےآں وچ منتشر ہو گئے سید احمد بن موسیٰ تے انہاں دے بھائی محمد نے شیراز وچ اپنے چند وفادارےآں دے گھر پناہ لی تے اوتھے چھپ گئے۔ ایتھے تک کہ حاکم نوں اپنے جاسوساں دے ذریعے انہاں دے ٹھکانے دا پتہ چل گیا، چنانچہ اس نے گھر اُتے حملہ کر کے انہاں نوں قتل کرنے دا حکم دتا، چنانچہ انہاں نے مکان وچ داخل ہو کے انہاں نوں شہید کردتا ۔ إِنَّا لِلّهِ وَإِنَّـا إِلَيْهِ رَاجِعونَ ۔ <ref>الشهرستاني، الملل والنحل، ج 1، ص 169؛ الأشعري، مقالات الإسلاميين، ص 30؛ النوبختي، فرق الشيعة، ص 85.</ref><ref>محمد علي المعلم، [https://www.almaaref.org/maarefdetails.php?id=3448&subcatid=1278&cid=344&supcat=39 فاطمة المعصومة قبس من أشعة الزهراء] ، دار الهادي، ط1، بيروت/لبنان، 1421هـ/2000م، ص132-150.. {{Webarchive|url=https://web.archive.org/web/20180323030432/http://www.almaaref.org/maarefdetails.php?id=3448&subcatid=1278&cid=344&supcat=39 |date=23 مارس 2018}}</ref>
=== فضائل ===
* روایت اے کہ اوہ سخی سن تے امام کاظم علیہ السلام انہاں توں بہت محبت کردے سن ۔ شیخ المفید انہاں دے مقام و مرتبے دے بارے وچ فرماندے نيں: احمد بن موسیٰ سخی، شریف تے پرہیزگار سن، تے ابو حسن موسیٰ علیہ السلام انہاں نال محبت کردے سن تے انہاں دا احترام کردے سن، تے انہاں نوں اپنی جاگیر عطا کيتی سی جسنوں السیرہ کہیا جاندا اے۔ کہیا جاندا اے: احمد بن موسیٰ نے اک ہزار مملوکاں نوں آزاد کيتا سی۔
* شیخ مفید نے اک ہور روایت وچ اسماعیل بن موسیٰ بن جعفر دے حوالے توں بیان کيتا اے کہ اوہ اپنے والد موسیٰ بن جعفر دے بعض سفراں دا ذکر کردے نيں جتھے احمد انہاں دے نال سن اوہ کہندے نيں: میرے والد دے ویہہ احمد بن موسیٰ دے نال سن ۔ جے احمد کھڑا ہُندا تاں اوہ اس دے نال بیٹھدے تے اس دے بعد میرے والد نے اس دی دیکھ بھال دی جسنوں اوہ نظر انداز کردے سن ۔ <ref>الشيخ صالح الكرباسي ، [https://www.islam4u.com/ar/almojib/%D9%85%D9%86-%D9%87%D9%88-%D8%A7%D9%84%D8%B3%D9%8A%D8%AF-%D8%A7%D8%AD%D9%85%D8%AF-%D8%A8%D9%86-%D9%85%D9%88%D8%B3%D9%89-%D8%A7%D9%84%D9%85%D8%B9%D8%B1%D9%88%D9%81-%D8%A8%D9%87-%D8%B4%D8%A7%D9%87-%D8%AC%D8%B1%D8%A7%D8%BA-%D8%A8%D8%B4%D9%8A%D8%B1%D8%A7%D8%B2-%D8%9F " السيد احمد بن موسى المعروف به ( شاه جراغ ) بشيراز "] ، مركز الإشعاع الإسلامي. {{Webarchive|url=https://web.archive.org/web/20170802190102/http://www.islam4u.com/ar/almojib/من-هو-السيد-احمد-بن-موسى-المعروف-به-شاه-جراغ-بشيراز-؟ |date=02 أغسطس 2017}}</ref>
=== مزار ===
[[تصویر:Shiraz shah cheragh.jpg|200بك|يسار|thumb|مسجد شاه جراغ.]]
احمد بن امام کاظم نوں شہر [[شیراز]] وچ دفن کيتا گیا تے انہاں دی قبر اک طویل عرصے تک پوشیدہ رہی ایتھے تک کہ شہزادہ مقرب الدین مسعود بن بدر (623-658ھ) دے دور حکومت وچ انہاں دی قبر دریافت ہوئی۔ اس دی قبر وچ انگوٹھی ملی، اس اُتے لکھیا سی: "پاک اے خدا احمد بن موسی بن جعفر"۔ <ref>[http://arabic.irib.ir/programs/item/1378 احمد بن الامام موسى بن جعفر] ، من موقع اذاعة طهران العربية ، 2006-11-07 {{Webarchive|url=https://web.archive.org/web/20171026053732/http://arabic.irib.ir/programs/item/1378 |date=26 أكتوبر 2017}}</ref>
=== اولاد ===
اکثر نسب داناں نے ایہ ذکر نئيں کيتا کہ احمد بن موسیٰ دی اولاد سی اس لئی انھاں نے کوئی تبصرہ نئيں کیتا، لیکن کچھ ایداں دے نيں جنہاں نے ذکر کيتا کہ انہاں دی اولاد سی جداں ضامن ابن شدقم، جنہاں نے کہیا کہ انہاں دے چار بچے نيں: محمد ، علی، عبد اللہ، تے داؤد دے بارے وچ ایہ وی دسیا گیا اے کہ ابراہیم جو کہ فیض القمی دے ناں توں مشہور نيں، شہر قم وچ مدفون نيں، اوہ احمد بن موسیٰ دے بیٹےآں وچوں نيں۔ <ref>المعقبين، ص 43؛ سر السلسلة العلوية، ص 43؛ تهذيب الأنساب، ص 147.</ref> ،<ref>تحفة الأزهار، ج 3، ص 296.</ref> .<ref>كنجنه آثار قم (كنز التراث القمي)، ج 2 ص 364-371.</ref>
=== حوالے ===
{{حوالے}}
{{شیعہ اسلام وچ مقدس ترین تھانواں}}
[[گٹھ:نويں صدی دیاں عباسی شخصیتاں]]
[[گٹھ:نويں صدی دیاں عرب شخصیتاں]]
[[گٹھ:اٹھويں صدی دیاں عرب شخصیتاں]]
[[گٹھ:علمائے اہلسنت]]
[[گٹھ:بنو ہاشم]]
[[گٹھ:اٹھويں صدی دیاں عباسی شخصیتاں]]
[[گٹھ:202ھ دیاں موتاں]]
[[گٹھ:شیعہ]]
[[گٹھ:سال پیدائش نامعلوم]]
[[گٹھ:مدنی شخصیتاں]]
[[گٹھ:مدینہ منورہ وچ پیدا ہوݨ والیاں شخصیتاں]]
[[گٹھ:شیراز دی وفیات]]
i1rroh2dst8hdqof8xrtlulamgrovnx
ماڈیول:Citation/CS1/en/Utilities
828
136756
690975
674788
2025-07-10T16:05:37Z
Abbas dhothar
361
690975
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = mw.ustring.gsub (str, '^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = mw.ustring.gsub (str, '^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = mw.ustring.gsub (str, "(%(%(.-%)%))", function(m) return mw.ustring.gsub(mw.ustring.gsub(m, ",", ","), ";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = mw.ustring.gsub (str, '&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = mw.ustring.gsub (str, '-', '-'); -- replace HTML numeric entity with hyphen character
str = mw.ustring.gsub (str, ' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if mw.ustring.match (item, '^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
mw.ustring.match (item, '^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
mw.ustring.match (item, '^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
mw.ustring.match (item, '^%d+%s*%-%s*%d+$') or -- digit hyphen digit
mw.ustring.match (item, '^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = mw.ustring.gsub (item, '(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return mw.ustring.gsub(mw.ustring.gsub(temp_str, ",", ","), ";", ";");
else
return mw.ustring.gsub(mw.ustring.gsub(temp_str, ",", ","), ";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = mw.ustring.gsub (alias, '#', index); -- replace '#' with the value in index
else
alias = mw.ustring.gsub (alias, '#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if mw.ustring.sub (str, 1, 1) == "'" then str = "<span></span>" .. str; end
if mw.ustring.sub (str, -1, -1) == "'" then str = str .. "<span></span>"; end
return mw.ustring.gsub (str, '\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if mw.ustring.match (alias, '#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (mw.ustring.gsub (str, "%[%[([^%[%]]*)%]%]", function(l)
return mw.ustring.gsub(mw.ustring.gsub(l, "^[^|]*|(.*)$", "%1" ), "^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not mw.ustring.match (str, '^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = mw.ustring.match (str, '^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = mw.ustring.match (str, '^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == mw.ustring.find (argument, "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if mw.ustring.find (argument, "'''''", 1, true) then -- bold italic (5)
argument, flag = mw.ustring.gsub (argument, "%'%'%'%'%'", ""); -- remove all instances of it
elseif mw.ustring.find (argument, "''''", 1, true) then -- italic start and end without content (4)
argument, flag= mw.ustring.gsub (argument, "%'%'%'%'", "");
elseif mw.ustring.find (argument, "'''", 1, true) then -- bold (3)
argument, flag= mw.ustring.gsub (argument, "%'%'%'", "");
elseif mw.ustring.find (argument, "''", 1, true) then -- italic (2)
argument, flag = mw.ustring.gsub (argument, "%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
z = z, -- exported table
}
kytc6kr5t1wrqjxi7hm61dsp54hf837
690978
690975
2025-07-10T16:11:12Z
Abbas dhothar
361
690978
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
z = z, -- exported table
}
kk801mqzkv4xrvmuck62gy23fyu6dl0
690981
690978
2025-07-10T16:20:16Z
Abbas dhothar
361
690981
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
local function make_sep_error_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
local i; local rep_count;
local function append_string(str1,str2)
local ret_str='';
local rep_count;
ret_str, rep_count = mw.ustring.gsub(str1, "</span>$", str2 .. "</span>")
if rep_count==0 then
ret_str = str1 .. str2;
end
return ret_str;
end
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 1==count then
list = list_seq[1]
elseif 2 == count then
list = append_string(list_seq[1], sep_list_pair) .. list_seq[2]
elseif 2 < count then
for i = 1, count-2, 1 do
list = list .. append_string(list_seq[i], sep_list)
end
list = list .. append_string(list_seq[count-1], sep_list_end) .. list_seq[count]
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
make_sep_error_list = make_sep_error_list,
z = z, -- exported table
}
3vlvbguy8fmaix9510qf8im76rjmsg7
690982
690981
2025-07-10T16:21:40Z
Abbas dhothar
361
ایس صفحے نوں خالی کرو
690982
Scribunto
text/plain
phoiac9h4m842xq45sp7s6u21eteeq1
690988
690982
2025-07-10T16:30:30Z
Abbas dhothar
361
690988
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
z = z, -- exported table
}
kk801mqzkv4xrvmuck62gy23fyu6dl0
690989
690988
2025-07-10T16:34:00Z
Abbas dhothar
361
690989
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for n, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
local function make_sep_error_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
local i; local rep_count;
local function append_string(str1,str2)
local ret_str='';
local rep_count;
ret_str, rep_count = mw.ustring.gsub(str1, "</span>$", str2 .. "</span>")
if rep_count==0 then
ret_str = str1 .. str2;
end
return ret_str;
end
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 1==count then
list = list_seq[1]
elseif 2 == count then
list = append_string(list_seq[1], sep_list_pair) .. list_seq[2]
elseif 2 < count then
for i = 1, count-2, 1 do
list = list .. append_string(list_seq[i], sep_list)
end
list = list .. append_string(list_seq[count-1], sep_list_end) .. list_seq[count]
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
make_sep_error_list = make_sep_error_list,
z = z, -- exported table
}
3vlvbguy8fmaix9510qf8im76rjmsg7
690997
690989
2025-07-10T16:50:10Z
Abbas dhothar
361
690997
Scribunto
text/plain
local z = {
error_cats_t = {}; -- for categorizing citations that contain errors
error_ids_t = {}; -- list of error identifiers; used to prevent duplication of certain errors; local to this module
error_msgs_t = {}; -- sequence table of error messages
maint_cats_t = {}; -- for categorizing citations that aren't erroneous per se, but could use a little work
prop_cats_t = {}; -- for categorizing citations based on certain properties, language of source for instance
prop_keys_t = {}; -- for adding classes to the citation's <cite> tag
};
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
]]
local cfg; -- table of tables imported from selected Module:Citation/CS1/Configuration
--[[--------------------------< I S _ S E T >------------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set (var)
return not (var == nil or var == '');
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack
]]
local function in_array (needle, haystack)
if needle == nil then
return false;
end
for p, v in ipairs (haystack) do
if v == needle then
return n;
end
end
return false;
end
--[[--------------------------< H A S _ A C C E P T _ A S _ W R I T T E N >------------------------------------
When <str> is wholly wrapped in accept-as-written markup, return <str> without markup and true; return <str> and false else
with allow_empty = false, <str> must have at least one character inside the markup
with allow_empty = true, <str> the markup frame can be empty like (()) to distinguish an empty template parameter from the specific condition "has no applicable value" in citation-context.
After further evaluation the two cases might be merged at a later stage, but should be kept separated for now.
]]
local function has_accept_as_written (str, allow_empty)
if not is_set (str) then
return str, false;
end
local count;
if true == allow_empty then
str, count = str:gsub ('^%(%((.*)%)%)$', '%1'); -- allows (()) to be an empty set
else
str, count = str:gsub ('^%(%((.+)%)%)$', '%1');
end
return str, 0 ~= count;
end
--[[--------------------------< S U B S T I T U T E >----------------------------------------------------------
Populates numbered arguments in a message string using an argument table. <args> may be a single string or a
sequence table of multiple strings.
]]
local function substitute (msg, args)
return args and mw.message.newRawMessage (msg, args):plain() or msg;
end
--[[--------------------------< E R R O R _ C O M M E N T >----------------------------------------------------
Wraps error messages with CSS markup according to the state of hidden. <content> may be a single string or a
sequence table of multiple strings.
]]
local function error_comment (content, hidden)
return substitute (hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content);
end
--[[--------------------------< H Y P H E N _ T O _ D A S H >--------------------------------------------------
Converts a hyphen to a dash under certain conditions. The hyphen must separate
like items; unlike items are returned unmodified. These forms are modified:
letter - letter (A - B)
digit - digit (4-5)
digit separator digit - digit separator digit (4.1-4.5 or 4-1-4-5)
letterdigit - letterdigit (A1-A5) (an optional separator between letter and
digit is supported – a.1-a.5 or a-1-a-5)
digitletter - digitletter (5a - 5d) (an optional separator between letter and
digit is supported – 5.a-5.d or 5-a-5-d)
any other forms are returned unmodified.
str may be a comma- or semicolon-separated list
]]
local function hyphen_to_dash (str)
if not is_set (str) then
return str;
end
local accept; -- boolean
str = str:gsub ("(%(%(.-%)%))", function(m) return m:gsub(",", ","):gsub(";", ";") end) -- replace commas and semicolons in accept-as-written markup with similar unicode characters so they'll be ignored during the split
str = str:gsub ('&[nm]dash;', {['–'] = '–', ['—'] = '—'}); -- replace — and – entities with their characters; semicolon mucks up the text.split
str = str:gsub ('-', '-'); -- replace HTML numeric entity with hyphen character
str = str:gsub (' ', ' '); -- replace entity with generic keyboard space character
local out = {};
local list = mw.text.split (str, '%s*[,;]%s*'); -- split str at comma or semicolon separators if there are any
for _, item in ipairs (list) do -- for each item in the list
item, accept = has_accept_as_written (item); -- remove accept-this-as-written markup when it wraps all of item
if not accept and mw.ustring.match (item, '^%w*[%.%-]?%w+%s*[%-–—]%s*%w*[%.%-]?%w+$') then -- if a hyphenated range or has endash or emdash separators
if item:match ('^%a+[%.%-]?%d+%s*%-%s*%a+[%.%-]?%d+$') or -- letterdigit hyphen letterdigit (optional separator between letter and digit)
item:match ('^%d+[%.%-]?%a+%s*%-%s*%d+[%.%-]?%a+$') or -- digitletter hyphen digitletter (optional separator between digit and letter)
item:match ('^%d+[%.%-]%d+%s*%-%s*%d+[%.%-]%d+$') or -- digit separator digit hyphen digit separator digit
item:match ('^%d+%s*%-%s*%d+$') or -- digit hyphen digit
item:match ('^%a+%s*%-%s*%a+$') then -- letter hyphen letter
item = item:gsub ('(%w*[%.%-]?%w+)%s*%-%s*(%w*[%.%-]?%w+)', '%1–%2'); -- replace hyphen, remove extraneous space characters
else
item = mw.ustring.gsub (item, '%s*[–—]%s*', '–'); -- for endash or emdash separated ranges, replace em with en, remove extraneous whitespace
end
end
table.insert (out, item); -- add the (possibly modified) item to the output table
end
local temp_str = ''; -- concatenate the output table into a comma separated string
temp_str, accept = has_accept_as_written (table.concat (out, ', ')); -- remove accept-this-as-written markup when it wraps all of concatenated out
if accept then
temp_str = has_accept_as_written (str); -- when global markup removed, return original str; do it this way to suppress boolean second return value
return temp_str:gsub(",", ","):gsub(";", ";");
else
return temp_str:gsub(",", ","):gsub(";", ";"); -- else, return assembled temp_str
end
end
--[=[-------------------------< M A K E _ W I K I L I N K >----------------------------------------------------
Makes a wikilink; when both link and display text is provided, returns a wikilink in the form [[L|D]]; if only
link is provided (or link and display are the same), returns a wikilink in the form [[L]]; if neither are
provided or link is omitted, returns an empty string.
]=]
local function make_wikilink (link, display)
if not is_set (link) then return '' end
if is_set (display) and link ~= display then
return table.concat ({'[[', link, '|', display, ']]'});
else
return table.concat ({'[[', link, ']]'});
end
end
--[[--------------------------< S E T _ M E S S A G E >----------------------------------------------------------
Sets an error message using the ~/Configuration error_conditions{} table along with arguments supplied in the function
call, inserts the resulting message in z.error_msgs_t{} sequence table, and returns the error message.
<error_id> – key value for appropriate error handler in ~/Configuration error_conditions{} table
<arguments> – may be a single string or a sequence table of multiple strings to be subsititued into error_conditions[error_id].message
<raw> – boolean
true – causes this function to return the error message not wrapped in visible-error, hidden-error span tag;
returns error_conditions[error_id].hidden as a second return value
does not add message to z.error_msgs_t sequence table
false, nil – adds message wrapped in visible-error, hidden-error span tag to z.error_msgs_t
returns the error message wrapped in visible-error, hidden-error span tag; there is no second return value
<prefix> – string to be prepended to <message> -- TODO: remove support for these unused(?) arguments?
<suffix> – string to be appended to <message>
TODO: change z.error_cats_t and z.maint_cats_t to have the form cat_name = true? this to avoid dups without having to have an extra table
]]
local added_maint_cats = {} -- list of maintenance categories that have been added to z.maint_cats_t; TODO: figure out how to delete this table
local function set_message (error_id, arguments, raw, prefix, suffix)
local error_state = cfg.error_conditions[error_id];
prefix = prefix or '';
suffix = suffix or '';
if error_state == nil then
error (cfg.messages['undefined_error'] .. ': ' .. error_id); -- because missing error handler in Module:Citation/CS1/Configuration
elseif is_set (error_state.category) then
if error_state.message then -- when error_state.message defined, this is an error message
table.insert (z.error_cats_t, error_state.category);
else
if not added_maint_cats[error_id] then
added_maint_cats[error_id] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (error_state.category, arguments)); -- make cat name then add to table
end
return; -- because no message, nothing more to do
end
end
local message = substitute (error_state.message, arguments);
message = table.concat (
{
message,
' (',
make_wikilink (
table.concat (
{
cfg.messages['help page link'],
'#',
error_state.anchor
}),
cfg.messages['help page label']),
')'
});
z.error_ids_t[error_id] = true;
if z.error_ids_t['err_citation_missing_title'] and -- if missing-title error already noted
in_array (error_id, {'err_bare_url_missing_title', 'err_trans_missing_title'}) then -- and this error is one of these
return '', false; -- don't bother because one flavor of missing title is sufficient
end
message = table.concat ({prefix, message, suffix});
if true == raw then
return message, error_state.hidden; -- return message not wrapped in visible-error, hidden-error span tag
end
message = error_comment (message, error_state.hidden); -- wrap message in visible-error, hidden-error span tag
table.insert (z.error_msgs_t, message); -- add it to the messages sequence table
return message; -- and done; return value generally not used but is used as a flag in various functions of ~/Identifiers
end
--[[-------------------------< I S _ A L I A S _ U S E D >-----------------------------------------------------
This function is used by select_one() to determine if one of a list of alias parameters is in the argument list
provided by the template.
Input:
args – pointer to the arguments table from calling template
alias – one of the list of possible aliases in the aliases lists from Module:Citation/CS1/Configuration
index – for enumerated parameters, identifies which one
enumerated – true/false flag used to choose how enumerated aliases are examined
value – value associated with an alias that has previously been selected; nil if not yet selected
selected – the alias that has previously been selected; nil if not yet selected
error_list – list of aliases that are duplicates of the alias already selected
Returns:
value – value associated with alias we selected or that was previously selected or nil if an alias not yet selected
selected – the alias we selected or the alias that was previously selected or nil if an alias not yet selected
]]
local function is_alias_used (args, alias, index, enumerated, value, selected, error_list)
if enumerated then -- is this a test for an enumerated parameters?
alias = alias:gsub ('#', index); -- replace '#' with the value in index
else
alias = alias:gsub ('#', ''); -- remove '#' if it exists
end
if is_set (args[alias]) then -- alias is in the template's argument list
if value ~= nil and selected ~= alias then -- if we have already selected one of the aliases
local skip;
for _, v in ipairs (error_list) do -- spin through the error list to see if we've added this alias
if v == alias then
skip = true;
break; -- has been added so stop looking
end
end
if not skip then -- has not been added so
table.insert (error_list, alias); -- add error alias to the error list
end
else
value = args[alias]; -- not yet selected an alias, so select this one
selected = alias;
end
end
return value, selected; -- return newly selected alias, or previously selected alias
end
--[[--------------------------< A D D _ M A I N T _ C A T >------------------------------------------------------
Adds a category to z.maint_cats_t using names from the configuration file with additional text if any.
To prevent duplication, the added_maint_cats table lists the categories by key that have been added to z.maint_cats_t.
]]
local function add_maint_cat (key, arguments)
if not added_maint_cats [key] then
added_maint_cats [key] = true; -- note that we've added this category
table.insert (z.maint_cats_t, substitute (cfg.maint_cats [key], arguments)); -- make name then add to table
end
end
--[[--------------------------< A D D _ P R O P _ C A T >--------------------------------------------------------
Adds a category to z.prop_cats_t using names from the configuration file with additional text if any.
foreign_lang_source and foreign_lang_source_2 keys have a language code appended to them so that multiple languages
may be categorized but multiples of the same language are not categorized.
added_prop_cats is a table declared in page scope variables above
]]
local added_prop_cats = {}; -- list of property categories that have been added to z.prop_cats_t
local function add_prop_cat (key, arguments, key_modifier)
local key_modified = key .. ((key_modifier and key_modifier) or ''); -- modify <key> with <key_modifier> if present and not nil
if not added_prop_cats [key_modified] then
added_prop_cats [key_modified] = true; -- note that we've added this category
table.insert (z.prop_cats_t, substitute (cfg.prop_cats [key], arguments)); -- make name then add to table
table.insert (z.prop_keys_t, 'cs1-prop-' .. key); -- convert key to class for use in the citation's <cite> tag
end
end
--[[--------------------------< S A F E _ F O R _ I T A L I C S >----------------------------------------------
Protects a string that will be wrapped in wiki italic markup '' ... ''
Note: We cannot use <i> for italics, as the expected behavior for italics specified by ''...'' in the title is that
they will be inverted (i.e. unitalicized) in the resulting references. In addition, <i> and '' tend to interact
poorly under Mediawiki's HTML tidy.
]]
local function safe_for_italics (str)
if not is_set (str) then return str end
if str:sub (1, 1) == "'" then str = "<span></span>" .. str; end
if str:sub (-1, -1) == "'" then str = str .. "<span></span>"; end
return str:gsub ('\n', ' '); -- Remove newlines as they break italics.
end
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
]]
local function wrap_style (key, str)
if not is_set (str) then
return "";
elseif in_array (key, {'italic-title', 'trans-italic-title'}) then
str = safe_for_italics (str);
end
return substitute (cfg.presentation[key], {str});
end
--[[--------------------------< M A K E _ S E P _ L I S T >------------------------------------------------------------
make a separated list of items using provided separators.
<sep_list> - typically '<comma><space>'
<sep_list_pair> - typically '<space>and<space>'
<sep_list_end> - typically '<comma><space>and<space>' or '<comma><space>&<space>'
defaults to cfg.presentation['sep_list'], cfg.presentation['sep_list_pair'], and cfg.presentation['sep_list_end']
if <sep_list_end> is specified, <sep_list> and <sep_list_pair> must also be supplied
]]
local function make_sep_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 2 >= count then
list = table.concat (list_seq, sep_list_pair); -- insert separator between two items; returns list_seq[1] then only one item
elseif 2 < count then
list = table.concat (list_seq, sep_list, 1, count - 1); -- concatenate all but last item with plain list separator
list = table.concat ({list, list_seq[count]}, sep_list_end); -- concatenate last item onto end of <list> with final separator
end
return list;
end
local function make_sep_error_list (count, list_seq, sep_list, sep_list_pair, sep_list_end)
local list = '';
local i; local rep_count;
local function append_string(str1,str2)
local ret_str='';
local rep_count;
ret_str, rep_count = mw.ustring.gsub(str1, "</span>$", str2 .. "</span>")
if rep_count==0 then
ret_str = str1 .. str2;
end
return ret_str;
end
if not sep_list then -- set the defaults
sep_list = cfg.presentation['sep_list'];
sep_list_pair = cfg.presentation['sep_list_pair'];
sep_list_end = cfg.presentation['sep_list_end'];
end
if 1==count then
list = list_seq[1]
elseif 2 == count then
list = append_string(list_seq[1], sep_list_pair) .. list_seq[2]
elseif 2 < count then
for i = 1, count-2, 1 do
list = list .. append_string(list_seq[i], sep_list)
end
list = list .. append_string(list_seq[count-1], sep_list_end) .. list_seq[count]
end
return list;
end
--[[--------------------------< S E L E C T _ O N E >----------------------------------------------------------
Chooses one matching parameter from a list of parameters to consider. The list of parameters to consider is just
names. For parameters that may be enumerated, the position of the numerator in the parameter name is identified
by the '#' so |author-last1= and |author1-last= are represented as 'author-last#' and 'author#-last'.
Because enumerated parameter |<param>1= is an alias of |<param>= we must test for both possibilities.
Generates an error if more than one match is present.
]]
local function select_one (args, aliases_list, error_condition, index)
local value = nil; -- the value assigned to the selected parameter
local selected = ''; -- the name of the parameter we have chosen
local error_list = {};
if index ~= nil then index = tostring(index); end
for _, alias in ipairs (aliases_list) do -- for each alias in the aliases list
if alias:match ('#') then -- if this alias can be enumerated
if '1' == index then -- when index is 1 test for enumerated and non-enumerated aliases
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- first test for non-enumerated alias
end
value, selected = is_alias_used (args, alias, index, true, value, selected, error_list); -- test for enumerated alias
else
value, selected = is_alias_used (args, alias, index, false, value, selected, error_list); -- test for non-enumerated alias
end
end
if #error_list > 0 and 'none' ~= error_condition then -- for cases where this code is used outside of extract_names()
for i, v in ipairs (error_list) do
error_list[i] = wrap_style ('parameter', v);
end
table.insert (error_list, wrap_style ('parameter', selected));
set_message (error_condition, {make_sep_list (#error_list, error_list)});
end
return value, selected;
end
--[=[-------------------------< R E M O V E _ W I K I _ L I N K >----------------------------------------------
Gets the display text from a wikilink like [[A|B]] or [[B]] gives B
The str:gsub() returns either A|B froma [[A|B]] or B from [[B]] or B from B (no wikilink markup).
In l(), l:gsub() removes the link and pipe (if they exist); the second :gsub() trims whitespace from the label
if str was wrapped in wikilink markup. Presumably, this is because without wikimarkup in str, there is no match
in the initial gsub, the replacement function l() doesn't get called.
]=]
local function remove_wiki_link (str)
return (str:gsub ("%[%[([^%[%]]*)%]%]", function(l)
return l:gsub ("^[^|]*|(.*)$", "%1" ):gsub ("^%s*(.-)%s*$", "%1");
end));
end
--[=[-------------------------< I S _ W I K I L I N K >--------------------------------------------------------
Determines if str is a wikilink, extracts, and returns the wikilink type, link text, and display text parts.
If str is a complex wikilink ([[L|D]]):
returns wl_type 2 and D and L from [[L|D]];
if str is a simple wikilink ([[D]])
returns wl_type 1 and D from [[D]] and L as empty string;
if not a wikilink:
returns wl_type 0, str as D, and L as empty string.
trims leading and trailing whitespace and pipes from L and D ([[L|]] and [[|D]] are accepted by MediaWiki and
treated like [[D]]; while [[|D|]] is not accepted by MediaWiki, here, we accept it and return D without the pipes).
]=]
local function is_wikilink (str)
local D, L
local wl_type = 2; -- assume that str is a complex wikilink [[L|D]]
if not str:match ('^%[%[[^%]]+%]%]$') then -- is str some sort of a wikilink (must have some sort of content)
return 0, str, ''; -- not a wikilink; return wl_type as 0, str as D, and empty string as L
end
L, D = str:match ('^%[%[([^|]+)|([^%]]+)%]%]$'); -- get L and D from [[L|D]]
if not is_set (D) then -- if no separate display
D = str:match ('^%[%[([^%]]*)|*%]%]$'); -- get D from [[D]] or [[D|]]
wl_type = 1;
end
D = mw.text.trim (D, '%s|'); -- trim white space and pipe characters
return wl_type, D, L or '';
end
--[[--------------------------< S T R I P _ A P O S T R O P H E _ M A R K U P >--------------------------------
Strip wiki italic and bold markup from argument so that it doesn't contaminate COinS metadata.
This function strips common patterns of apostrophe markup. We presume that editors who have taken the time to
markup a title have, as a result, provided valid markup. When they don't, some single apostrophes are left behind.
Returns the argument without wiki markup and a number; the number is more-or-less meaningless except as a flag
to indicate that markup was replaced; do not rely on it as an indicator of how many of any kind of markup was
removed; returns the argument and nil when no markup removed
]]
local function strip_apostrophe_markup (argument)
if not is_set (argument) then
return argument, nil; -- no argument, nothing to do
end
if nil == argument:find ( "''", 1, true ) then -- Is there at least one double apostrophe? If not, exit.
return argument, nil;
end
local flag;
while true do
if argument:find ("'''''", 1, true) then -- bold italic (5)
argument, flag = argument:gsub ("%'%'%'%'%'", ""); -- remove all instances of it
elseif argument:find ("''''", 1, true) then -- italic start and end without content (4)
argument, flag=argument:gsub ("%'%'%'%'", "");
elseif argument:find ("'''", 1, true) then -- bold (3)
argument, flag=argument:gsub ("%'%'%'", "");
elseif argument:find ("''", 1, true) then -- italic (2)
argument, flag = argument:gsub ("%'%'", "");
else
break;
end
end
return argument, flag; -- done
end
--[[--------------------------< S E T _ S E L E C T E D _ M O D U L E S >--------------------------------------
Sets local cfg table to same (live or sandbox) as that used by the other modules.
]]
local function set_selected_modules (cfg_table_ptr)
cfg = cfg_table_ptr;
end
--[[--------------------------< E X P O R T S >----------------------------------------------------------------
]]
return {
add_maint_cat = add_maint_cat, -- exported functions
add_prop_cat = add_prop_cat,
error_comment = error_comment,
has_accept_as_written = has_accept_as_written,
hyphen_to_dash = hyphen_to_dash,
in_array = in_array,
is_set = is_set,
is_wikilink = is_wikilink,
make_sep_list = make_sep_list,
make_wikilink = make_wikilink,
remove_wiki_link = remove_wiki_link,
safe_for_italics = safe_for_italics,
select_one = select_one,
set_message = set_message,
set_selected_modules = set_selected_modules,
strip_apostrophe_markup = strip_apostrophe_markup,
substitute = substitute,
wrap_style = wrap_style,
make_sep_error_list = make_sep_error_list,
z = z, -- exported table
}
knnovit8cnd21j9yaebzrkjyv5r6xe2
سانچہ:استشهاد بويكي بيانات
10
136760
690998
674794
2025-07-10T16:52:52Z
Abbas dhothar
361
ایس صفحے نوں خالی کرو
690998
wikitext
text/x-wiki
phoiac9h4m842xq45sp7s6u21eteeq1
691003
690998
2025-07-10T16:57:01Z
Abbas dhothar
361
691003
wikitext
text/x-wiki
<includeonly>{{#invoke:Cite Q|cite_q}}</includeonly><noinclude>
{{توثيق}}
</noinclude>
to5dfmsrauzrsrce5sah0pgh7soli9x
سانچہ:حوالہ ویکی ڈیٹا
10
139564
690954
685007
2025-07-10T15:21:28Z
Abbas dhothar
361
690954
wikitext
text/x-wiki
<includeonly>{{#invoke:Cite Q/en|cite_q|qid={{{1|{{{qid|}}}}}} }}</includeonly><noinclude>
{{دستاویز}}
</noinclude>
8rjx54lqw0rpr8blch53t677w12sbvs
690993
690954
2025-07-10T16:38:25Z
Abbas dhothar
361
690993
wikitext
text/x-wiki
<includeonly>{{#invoke:Cite Q|cite_q}}</includeonly><noinclude>
{{توثيق}}
</noinclude>
to5dfmsrauzrsrce5sah0pgh7soli9x
690994
690993
2025-07-10T16:40:33Z
Abbas dhothar
361
690994
wikitext
text/x-wiki
<includeonly>{{#invoke:Cite Q|cite_q|qid={{{1}}} }}</includeonly><noinclude>
{{documentation}}
</noinclude>
024pb13zlk0gfuvqbp5bpz3oj73l6u4
690995
690994
2025-07-10T16:41:45Z
Abbas dhothar
361
690995
wikitext
text/x-wiki
<includeonly>{{#invoke:Cite Q/en|cite_q|qid={{{1|{{{qid|}}}}}} }}</includeonly><noinclude>
{{دستاویز}}
</noinclude>
8rjx54lqw0rpr8blch53t677w12sbvs
بھارت دے سربراہان دی فہرست
0
141216
690950
690875
2025-07-10T14:59:26Z
EmausBot
1944
Bot: Migrating 1 interwiki links, now provided by [[Wikipedia:Wikidata|Wikidata]] on [[d:Q17054345]]
690950
wikitext
text/x-wiki
{| class="wikitable sortable" style="text-align:center" width="98%"
|-
! width=2% |#
! width=14% |نام
! width=10% |تصویر
! width=10% |دفتر لیا
! width=10% |دفتر چھڈیا
! width=12% |نائب-صدر
|-
| 1
| [[ڈاکٹر راجیندر پرساد]]<br><small>(1884–1963)
|[[File:Food Minister Rajendra Prasad during a radio broadcast in Dec 1947 cropped.jpg|100px]]
| 26 جنوری 1950
| 13 مئی 1962
| [[سرویپلی رادھاکرشنن]]
|-
| 2
| [[سرویپلی رادھاکرشنن]]<br><small>(1888–1975)
|[[Image:Radhakrishnan.jpg|70px]]
| 13 مئی 1962
| 13 مئی 1967
| [[ذاکر حسین |ذاکر حسین]]
|-
| 3
| [[ذاکر حسین]]<br><small>(1897–1969)
|
| 13 مئی 1967
| 3 مئی 1969
| [[وراہگری وینکٹ گری]]
|- style="background-color:Wheat"
|
| [[وراہگری وینکٹ گری]] *<br><small>(1894–1980)
|
| 3 مئی 1969
| 20 جولائی 1969
|
|- style="background-color:Wheat"
|
| [[محمد ہدایت اللہ]] *<br><small>(1905–1992)
|
| 20 جولائی 1969
| 24 اگست 1969
|
|-
| 4
| [[وراہگری وینکٹ گری]]<br><small>(1894–1980)
|
| 24 اگست 1969
| 24 اگست 1974
| [[گوپال سوروپ پاٹھک]]
|-
| 5
| [[فخرالدین علی احمد]]<br><small>(1905–1977)
|
| 24 اگست 1974
| 11 فروری 1977
| [[بسپا دناپا جتی]]
|- style="background-color:Wheat"
|
| [[بسپا دناپا جتی]] *<br><small>(1912–2002)
|
| 11 فروری 1977
| 25 جولائی 1977
|
|-
| 6
| [[نیلم سنجیو ریڈی]]<br><small>(1913–1996)
| [[Image:NeelamSanjeevaReddy.jpg|70px]]
| 25 جولائی 1977
| 25 جولائی 1982
| [[محمد ہدایت اللہ]]
|-
| 7
| [[گیانی ذیل سنگھ]]<br><small>(1916–1994)
|
| 25 جولائی 1982
| 25 جولائی 1987
| [[راماسوامی وینکٹرمن]]
|-
| 8
| [[راماسوامی وینکٹرمن]] <br><small>(1910–2009)
| [[Image:R Venkataraman.jpg|70px]]
| 25 جولائی 1987
| 25 جولائی 1992
| [[شنکر دیال شرما]]
|-
| 9
| [[شنکر دیال شرما]] <br><small>(1918–1999)
| [[Image:Shankar Dayal Sharma 36.jpg|70px]]
| 25 جولائی 1992
| 25 جولائی 1997
| [[کوچیرل رمن نارائنن]]
|-
| 10
| [[کوچیرل رمن نارائنن]] <br><small>(1920–2005)
|[[image:K. R. Narayanan.jpg|70px]]
| 25 جولائی 1997
| 25 جولائی 2002
| [[کرشن کانت]]
|-
| 11
| [[عبدالکلام]]<br><small>(1931–)
|[[File:A. P. J. Abdul Kalam in 2008.jpg|70px]]
| 25 جولائی 2002
| 25 جولائی 2007
| [[بھیروں سنگھ شیکھاوت]]
|-
| 12
| [[پرتبھا پاٹل]]<br><small>(1934–)
| [[File:Pratibha Patil 2.jpg|70px]]
| 25 جولائی 2007
| 25 جولائی 2012
| [[محمد حامد انصاری]]
|-
| 13
| [[پرناب مکھرجی]]<br><small>(1935–)
| [[File:Pranab Mukherjee-World Economic Forum Annual Meeting Davos 2009 crop(2).jpg|100px]]
| 25 جولائی 2012
| 25 جولائی 2017
| [[محمد حامد انصاری]]
|-
| 14
| [[رام ناتھ کووند]]<br><small>(1945–)
| [[File:Ram Nath Kovind official portrait.jpg|100px]]
| 25 جولائی 2017
| 25 جولائی 2022
| [[محمد حامد انصاری]] (2017)
----[[وینکائیا نائیڈو]] (2017 تا 2022)
|-
| 15
| [[دروپدی مرمو]]<br><small>(1958–)
| [[File:President Droupadi Murmu official portrait higher version.jpg|100px]]
| 25 جولائی 2022
| ہُݨ تک
|[[وینکائیا نائیڈو]] (2022)
----جگدیپ دھنکار(2022-)
|}
ایہ '''بھارتی نائب صدراں دی مکمل لسٹ''' ہے، لسٹ وچ انہاں سب دا ذکر ہے جنھاں نے 1950ء وچ [[بھارت دا آئین|بھارتی آئین]] اپنانے دے بعد بطور نائب صدر بھارت دے حلف چُکیا۔
{| class="wikitable" style="text-align:center" width="98%"
|-
! №
! width=25%|نام<br />{{small|(تاریخ پیدائش)}}
! تصویر
! منتخب
! دفتر سنبھالا
! رخصت ہوئے
! صدر
|- style="background-color:#EEEEEE"
! 1
| '''[[رادھا کرشنن|سروا پلی رادھاکرشنن]]'''<br /><small>(1888–1975)</small>
| [[Image:Photograph of Sarvepalli Radhakrishnan presented to First Lady Jacqueline Kennedy in 1962.jpg|100px]]
| 1952<br />1957
| 13 مئی 1952
| 12 مئی 1962
| '''[[راجندر پرشاد]]'''
|- style="background-color:#EEEEEE"
! 2
| '''[[ذاکر حسین]]'''<br /><small>(1897–1969)</small>
| [[File:No image.svg|100px]]<!-- DO NOT ADD A NON-FREE IMAGE FOR THIS PERSON – ONLY FREELY LICENCED IMAGES ARE ALLOWED FOR LISTS. SEE WP:NFLISTS -->
| 1962
| 13 مئی 1962
| 12 مئی 1967
| '''[[سروے پلی رادھاکرشنن]]'''
|- style="background-color:#EEEEEE"
! 3
| '''[[وی وی گیری]]'''<br /><small>(1894–1980)</small>
| [[File:No image.png|100px]]<!-- DO NOT ADD A NON-FREE IMAGE FOR THIS PERSON – ONLY FREELY LICENCED IMAGES ARE ALLOWED FOR LISTS. SEE WP:NFLISTS -->
| 1967
| 13 مئی 1967
| 3 مئی 1969
| '''[[ذاکر حسین]]'''
|- style="background-color:#EEEEEE"
! 4
| '''[[گوپال سواروپ پاٹھک]]'''<br /><small>(1896–1982)</small>
| [[File:No image.svg|100px]]<!-- DO NOT ADD A NON-FREE IMAGE FOR THIS PERSON – ONLY FREELY LICENCED IMAGES ARE ALLOWED FOR LISTS. SEE WP:NFLISTS -->
| 1969
| 31 اگست 1969
| 30 اگست 1974
| '''[[وی وی گری|وی وی گیری]]'''
|- style="background-color:#EEEEEE"
! 5
| '''[[بساپا دناپا جٹی|بسپا دانپہ جتی]]'''<br /><small>(1912–2002)</small>
| [[File:No image.svg|100px]]<!-- DO NOT ADD A NON-FREE IMAGE FOR THIS PERSON – ONLY FREELY LICENCED IMAGES ARE ALLOWED FOR LISTS. SEE WP:NFLISTS -->
| 1974
| 31 اگست 1974
| 30 اگست 1979
| '''[[فخرالدین علی احمد]]''' <br /> '''[[نیلم سنجیوا ریڈی]]'''
|- style="background-color:#EEEEEE"
! 6
| '''[[محمد ہدایت اللہ]]'''<br /><small>(1905–1992)</small>
| [[File:No image.svg|100px]]<!-- DO NOT ADD A NON-FREE IMAGE FOR THIS PERSON – ONLY FREELY LICENCED IMAGES ARE ALLOWED FOR LISTS. SEE WP:NFLISTS -->
| 1979
| 31 اگست 1979
| 30 اگست 1984
| '''[[نیلم سنجیوا ریڈی]]''' <br /> '''[[ذیل سنگھ]]'''
|- style="background-color:#EEEEEE"
! 7
| '''[[وینکٹارامن]]'''<br /><small>(1910–2009)</small>
| [[File:R Venkataraman.jpg|100px]]
| 1984
| 31 اگست 1984
| 24 جولائی 1987
| '''[[ذیل سنگھ]]'''
|- style="background-color:#EEEEEE"
! 8
| '''[[شنکر دیال شرما]]'''<br /><small>(1918–1999)</small>
| [[File:Shankar Dayal Sharma 36.jpg|100px]]
| 1987
| 3 ستمبر 1987
| 24 جولائی 1992
| '''[[وینکٹارامن]]'''
|- style="background-color:#EEEEEE"
! 9
| '''[[نارائنن|کے آر نارائن]]'''<br /><small>(1920–2005)</small>
| [[File:K. R. Narayanan.jpg|100px]]
| 1992
| 21 اگست 1992
| 24 جولائی 1997
| '''[[شنکر دیال شرما]]'''
|- style="background-color:#EEEEEE"
! 10
| '''[[کرشن کانت]]'''<br /><small>(1927–2002)</small>
| [[File:No image.svg|100px]]<!-- DO NOT ADD A NON-FREE IMAGE FOR THIS PERSON – ONLY FREELY LICENCED IMAGES ARE ALLOWED FOR LISTS. SEE WP:NFLISTS -->
| [[Indian vice presidential election, 1997|1997]]
| 21 اگست 1997
| 27 جولائی 2002 †
| '''[[کے آر نارائن]]'''<br />'''[[عبدالکلام]]'''
|- style="background-color:#EEEEEE"
! 11
| '''[[بھیروں سنگھ شیکھاوت]]'''<br /><small>(1923–2010)</small>
| [[File:Bhairon Singh Shekhawat.jpg|100px]]
| [[Indian vice presidential election, 2002|2002]]
| 19 اگست 2002
| 21 جولائی 2007
| '''[[عبدالکلام]]'''
|- style="background-color:#EEEEEE"
! 12
| '''[[محمد حامد انصاری]]'''<br /><small>(پیدائش 1937ء)</small><ref>[http://www.hindu.com/thehindu/holnus/000200708101901.htm The Hindu – Hamid Ansari wins Vice-Presidential poll]</ref><ref>{{Cite web |title=Archive copy |url=http://www.hindustantimes.com/India-news/NewDelhi/Hamid-Ansari-sworn-in-as-14th-vice-president-of-India/Article1-911830.aspx |access-date=2017-02-11 |archive-date=2013-06-14 |archive-url=https://web.archive.org/web/20130614044129/http://www.hindustantimes.com/India-news/NewDelhi/Hamid-Ansari-sworn-in-as-14th-vice-president-of-India/Article1-911830.aspx |dead-url=yes }}</ref>
| [[File:Hamid ansari.jpg|100px]]
| [[Indian vice presidential election, 2007|2007]]<br />[[Indian vice presidential election, 2012|2012]]
| 11 اگست 2007
| 10 اگست 2017
| '''[[پراتیبھا پاٹیل]]'''<br />'''[[پرنب مکھرجی]]'''
|}
; اشارہ
* † بطور نائب صدر وفات
0zyty0ufbtymyrky41ae0h2fi8oaxnx
المہذب فیما وقع فی القرآن من المعرب
0
141230
690951
2025-07-10T15:16:57Z
Abbas dhothar
361
"{{صندوق معلومات كتاب | الاسم = | العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب | محقق = | مترجم = | صورة = | عنوان الصورة = | مؤلف = [[جلال الدين السيوطي]] | مصور = | فنان الغلاف = |..." نال صفحہ بنایا گیا۔
690951
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-911ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{استشهاد بويكي بيانات|Q125916031|ص=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
ayvax30vjmuptwjnbz7uvgc3x0uohxq
690952
690951
2025-07-10T15:18:40Z
Abbas dhothar
361
690952
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-911ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{استشهاد بويكي بيانات|Q125916031|ص=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
aefs53qcayfokfxcag27c6s5b5kyrgp
690953
690952
2025-07-10T15:20:11Z
Abbas dhothar
361
690953
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-911ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{حوالہ ویکی ڈیٹا|Q125916031|ص=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
2m3oc54mlrug8gaoswm384hx8a4evwi
690977
690953
2025-07-10T16:08:31Z
Abbas dhothar
361
اصلاح اعداد، انگریزی اعداد
690977
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{حوالہ ویکی ڈیٹا|Q۱۲۵۹۱۶۰۳۱|ص=۶۱|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
jwzn9qt8fv26pjx11pv7bbykded0fum
690979
690977
2025-07-10T16:12:52Z
Abbas dhothar
361
انگریزی اعداد
690979
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{حوالہ ویکی ڈیٹا|Q125916031|page=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
fywqeio9e63jn81wxfqdgye121p7yz5
690983
690979
2025-07-10T16:24:21Z
Abbas dhothar
361
690983
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{حوالہ ویکی ڈیٹا|Q125916031|page=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،{{حوالہ ویکی ڈیٹا|Q15625490}}
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
r1mg1bdj5j05rsymxwbtab6h3zy76od
690984
690983
2025-07-10T16:25:06Z
Abbas dhothar
361
690984
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{حوالہ ویکی ڈیٹا|Q125916031}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
ndeapsa1vqaq84c5fs3nehyv8w43wuc
690985
690984
2025-07-10T16:25:49Z
Abbas dhothar
361
690985
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref>{{حوالہ ویکی ڈیٹا|Q125916031}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
8enjutd672pt3ifg9fgdbistu9fr78u
690986
690985
2025-07-10T16:28:49Z
Abbas dhothar
361
690986
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{حوالہ ویکی ڈیٹا|Q125916031|page=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،<ref>{{حوالہ ویکی ڈیٹا|Q15625490}}</ref>
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
kys61bdpojjlh57md51kuvk3e0kj4nf
690987
690986
2025-07-10T16:29:18Z
Abbas dhothar
361
690987
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{حوالہ ویکی ڈیٹا|Q125916031|page=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،<ref>{{حوالہ ویکی ڈیٹا|Q125916031}}</ref>
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
8vagxtr880gtl3visa8jowljboit7pw
690999
690987
2025-07-10T16:54:05Z
Abbas dhothar
361
690999
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{Cite Q|Q125916031|page=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،<ref>{{حوالہ ویکی ڈیٹا|Q125916031}}</ref>
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
qd1iaieiw7i0ynuuo4qerd3d3cip1c7
691001
690999
2025-07-10T16:55:12Z
Abbas dhothar
361
691001
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{Cite Q|Q125916031|ص=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،<ref>{{حوالہ ویکی ڈیٹا|Q125916031}}</ref>
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
bj5q79pz5qxfi22yarf3wghb075ez66
691002
691001
2025-07-10T16:56:14Z
Abbas dhothar
361
691002
wikitext
text/x-wiki
{{صندوق معلومات كتاب
| الاسم =
| العنوان الأصلي = كتاب المهذب فيما وقع في القرآن من المعرب
| محقق =
| مترجم =
| صورة =
| عنوان الصورة =
| مؤلف = [[جلال الدين السيوطي]]
| مصور =
| فنان الغلاف =
| البلد =
| لغة =
| سلسلة =
| موضوع =
| نوع أدبي =
| عدد الأجزاء =
| ناشر =
| ناشر الترجمة =
| تاريخ الإصدار =
| تاريخ الإصدار المترجم =
| نوع الطباعة =
| قياس =
| وزن =
| جوائز =
| أكلس =
| ردمك =
| ردمك ترجمة =
| جود ريدز =
| ويكي مصدر =
| ديوي =
| كونغرس =
| سبقه =
| تبعه =
}}
'''"المہذب فيما وقع في القرآن من المُعرَّب"''' اک کتاب اے جسنوں [[جلال الدین سیوطی|حافظ جلال الدین سیوطی]] (849-۹۱۱ھ) نے تصنیف کيتا۔ انہاں نے ایہ کتاب انہاں لفظاں نوں واضح کرنے دے لئی لکھی جو قرآن مجید وچ وارد ہوئے نيں مگر اصل وچ عربی نئيں بلکہ کسی دوسری بولی توں ماخوذ نيں، فیر اوہ لفظاں عربی وچ مستعمل ہو گئے۔
مصنف نے کتاب دی تمہید وچ قرآن وچ ایداں دے معرَّب لفظاں دے وقوع اُتے گفتگو دی اے تے ایہ رائے اختیار کيتی اے کہ قرآن وچ ایداں دے لفظاں موجود نيں، تے ایہ گل قرآن دے کمال تے اس دے تمام علوم اُتے محیط ہوݨ دی دلیل اے۔<ref name="مولد تلقائيا1">{{حوالہ ویکی ڈیٹا|Q125916031|ص=61|via=[[المكتبة الشاملة]]}}</ref>
مصنف نے انہاں لفظاں نوں حروفِ تہجی دی ترتیب توں ذکر کيتا اے، ہر لفظ دی اصل بولی بیان کيتی اے، تے اس سلسلے وچ پہلے دے مفسرین تے ماہرینِ لغت دی آراء وی نقل کيتی نيں۔
کتاب دے آخر وچ سیوطی نے:
[[تاج الدین سبکی|ابن سبکی]] دے انہاں معرَّب لفظاں اُتے مشتمل منظوم کلام نوں نقل کیتا،
فیر [[ابن حجر عسقلانی]] دی جانب توں کيتے گئے اضافات نوں وی شامل کیتا،<ref>{{حوالہ ویکی ڈیٹا|Q125916031}}</ref>
اور آخر وچ خود سیوطی نے انہاں دونے اُتے جو وادھا کیتا، اسنوں وی نظم دی صورت وچ درج کيتا۔ <ref name="مولد تلقائيا2">{{استشهاد بويكي بيانات|Q125916031|ص=170|via=[[المكتبة الشاملة]]}}</ref>
== کتاب دا موضوع ==
[[جلال الدین سیوطی|سیوطی]] نے کتاب دی تمہید وچ ذکر کيتا اے کہ انہاں نے قرآن کریم وچ وارد ہوݨ والے معرَّب لفظاں (یعنی اوہ لفظاں جو اصل وچ عربی نئيں بلکہ ہور زباناں توں عربی وچ داخل ہوئے) نوں جمع کيتا اے۔ لہٰذا ایہ کتاب اک ایداں دے خصوصی معجم دی حیثیت رکھدی اے جو صرف معرَّب لفظاں اُتے مشتمل اے۔
سیوطی نے ابتدا وچ اس مسئلہ اُتے روشنی پائی کہ آیا قرآن وچ غیر عربی لفظاں موجود نيں یا نئيں، تے علماء دے وکھ وکھ اقوال بیان کيتے۔ انہاں نے انہاں علماء دی رائے نوں اختیار کيتا جنہاں دا کہنا اے کہ قرآن وچ غیر عربی لفظاں موجود نيں، تے اس موقف دی دلیل ایہ دتی کہ:<ref>{{استشهاد بويكي بيانات|Q125916031|ص=57|via=[[المكتبة الشاملة]]}}</ref>
“قرآن وچ سابقہ و لاحقہ امتاں دے علوم تے ہر طرح دی خبر موجود اے، لہٰذا ضروری اے کہ قرآن وچ وکھ وکھ زباناں دی طرف اشارہ ہو، تاکہ اس دی جامعیت تے ہمہ گیری مکمل ہوئے۔ ايسے لئی ہر زبانہاں وچوں سب توں شیريں، نرم تے عرباں وچ معروف لفظاں دا انتخاب کيتا گیا۔”<ref name="مولد تلقائيا1" />
=== مصنف دا منہج ===
* . سیوطی نے انہاں تمام لفظاں نوں حروفِ تہجی دی ترتیب توں مرتب کيتا۔
* . ہر لفظ دے تحت مفسرین تے لغویین دی آراء نقل کاں، تے انہاں دا حوالہ وی دتا۔
* . بعض اقوال دے نال اسناد وی ذکر کاں، تے بعض وچ صرف قول نقل کيتا۔
* . کتاب دے آخر وچ :
ابن سبکی دی نظم شامل کی، جس وچ 27 معرَّب لفظاں سن،
فیر ابن حجر عسقلانی دی نظم شامل کی، جس وچ 24 ہور لفظاں دا وادھا سی،
آخر وچ خود سیوطی نے انہاں دونے اُتے 72 لفظاں دا وادھا کیتا، تے اسنوں وی نظم وچ شامل کيتا۔ <ref name="مولد تلقائيا2" />
=== کتاب دی اہمیت ===
کتاب دی پہلی اہمیت اس دے موضوع دی وجہ توں اے: ایہ قرآن دے انہاں معرَّب لفظاں اُتے مکمل تحقیق اے، جو اس توں پہلے وکھ کتاب وچ اس طرح جمع نئيں کيتے گئے سن ۔
دوسری اہمیت مصنف دی شخصیت اے: سیوطی علومِ قرآن تے علومِ عربیہ دے ماہر تے کثیر اللکھتاں عالم سن ۔ انہاں نے آخر وچ لکھیا کہ انہاں نے اس موضوع اُتے کئی سال محنت کی، وکھ وکھ کتاباں دا مطالعہ کيتا تے فیر اس مجموعے نوں ترتیب دتا۔<ref>المهذب، السيوطي، مطبعة فضالة، (168)</ref>
==ہورویکھو==
==حوالے==
{{حوالے}}
==باہرلےجوڑ==
[[گٹھ:لکھتاں جلال الدین سیوطی]]
[[گٹھ:کتب علوم القرآن]]
[[گٹھ:قرآنی علوم]]
[[گٹھ:ویکی ڈیٹا والے صفحات]]
[[گٹھ:مرکزی موضوع ویکی ڈیٹا توں ماخوذ]]
kmrpqxs7029n0y8o74i9khuojtaumkj
سانچہ:حوالہ ویکی ڈیٹا/دستاویز
10
141231
690955
2025-07-10T15:22:38Z
Abbas dhothar
361
"<div class="mw-content-ltr"> {{Documentation subpage}} {{تنبیہ|From the [[Wikipedia:Templates for discussion/Log/2017 September 15#Template:Cite Q|TfD closure]]: "Until the matter of transcluding Wikidata on Wikipedia is resolved (most likely with a huge and contentious RFC) usage of this template should be extremely vetted to ensure that all of the transcluded information is accurate."}} <!-- Please place categories where indicated at the botto..." نال صفحہ بنایا گیا۔
690955
wikitext
text/x-wiki
<div class="mw-content-ltr">
{{Documentation subpage}}
{{تنبیہ|From the [[Wikipedia:Templates for discussion/Log/2017 September 15#Template:Cite Q|TfD closure]]: "Until the matter of transcluding Wikidata on Wikipedia is resolved (most likely with a huge and contentious RFC) usage of this template should be extremely vetted to ensure that all of the transcluded information is accurate."}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
{{لوا|Module:Cite Q}}
{{Uses Wikidata|section=Parameter / entity map}}
This template, a wrapper for {{سا|Citation}}, returns a formatted citation from statements stored on a [[ویکی ڈیٹا]] item (referred to by its ''Q identifier'' or ''QID'') describing a citable source such as a scholarly article.
You can read about the template in:
:{{حوالہ ویکی ڈیٹا|Q104831003}}
'''Note:''' While Wikipedia [[Wikipedia:Citing sources#Wikidata|does not regard Wikidata as a reliable source]], citations using Cite Q are ''not'' citing Wikidata; they cite the individual work stated, using metadata about that work, which is held on Wikidata for convenience.
== Usage ==
For example, Wikidata item {{Q|Q15625490}} is a scholarly item. To cite this as a source:
:<code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490}}</nowiki></code> →
::{{حوالہ ویکی ڈیٹا|Q15625490|doi-access=free}}
An example of an article using this template for ''all'' of its references is [[South Pole Telescope]]; an example using Harvard style citations is [[Suffix automaton]].
By default, if there are more than eight author names, the template displays three, followed by "et al". This can be changed using {{پیرا|display-authors}}; setting that parameter to <code>all</code> displays them all. The same applies to multiple editors – see the test-case pages.
Citations of papers which have been retracted ({{WDP|P5824}}) will appear in [[:Category:Cite Q - cites a retracted work]].
Citations of papers which have been replaced ({{WDP|P1366}}) will appear in [[:Category:Cite Q - cites a replaced work]].
You can also use {{سا|Cite Q bulleted}} if you want to have a bullet returned before the citation (useful for automatic lists)
===Parameters ===
* {{پیرا|1}} = Wikidata QID for the article
Additionally, any named parameter used in {{سا|citation}} may be entered and will overwrite the value in Wikidata. Using such parameters, with a value of <code>unset</code>, will suppress display of data from Wikidata.
=== Blank ===
:<code><nowiki><ref name="">{{حوالہ ویکی ڈیٹا|Q00000000}}</ref></nowiki></code>
=== Reference naming ===
For ease of use, you may wish to name your references to reflect the cited work, for example:
:<code><nowiki><ref name="Williams-2010">{{حوالہ ویکی ڈیٹا|Q15625490}}</ref></nowiki></code>
===Parameter / entity map===
This section lists where each of the template's supported parameters gets its data.
{{Columns-start}}
====Bibliographic parameters====
*{{پیرا|at}} = {{WDP|P958}}
*{{پیرا|author''n''}} = {{WDP|P50}}; {{WDP|P2093}}
*{{پیرا|chapter}} = {{WDP|P792}}
<!-- *{{پیرا|contributor''n''}} = {{WDP|P2680}}, {{WDP|P1891}} -->
*{{پیرا|edition}} = {{WDP|P393}}
*{{پیرا|editor''n''}} = {{WDP|P98}}; {{WDP|P5769}}
*{{پیرا|issue}} = {{WDP|P433}}
*{{پیرا|journal}} = {{WDP|P1433}}
*{{پیرا|language}} = {{WDP|P407}}
*{{پیرا|pages}} = {{WDP|P304}}
*{{پیرا|place}} = {{WDP|P1071}} (for written-at place)
*{{پیرا|publication-date}} = {{WDP|P577}} (treated like {{پیرا|date}} unless both are given)
*{{پیرا|publication-place}} = {{WDP|P291}} (for publication place, treated like {{پیرا|place}} unless both are given)
*{{پیرا|publisher}} = {{WDP|P123}}
*{{پیرا|series}} = {{WDP|P179}}
*{{پیرا|title}} = {{WDP|P1476}} (Wikidata label)
*{{پیرا|translator''n''}} = {{WDP|P655}}
*{{پیرا|url}} = {{WDP|P953}}, {{WDP|P856}}, {{WDP|P2699}}
*{{پیرا|version}} = {{WDP|P348}}
*{{پیرا|volume}} = {{WDP|P478}}
*{{پیرا|others}} = {{WDP|P86}}, {{WDP|P110}}, {{WDP|P2679}}, {{WDP|P371}}, {{WDP|P175}}
{{column}}
====Identifier parameters====
*{{پیرا|asin}} = {{WDP|P5749}} (add {{پیرا|asin-tld}} for some locales)
*{{پیرا|arxiv}} = {{WDP|P818}}
*{{پیرا|bibcode}} = {{WDP|P819}} (add {{پیرا|bibcode-access}} to indicate free)
*{{پیرا|biorxiv}} = {{WDP|P3951}}
*{{پیرا|citeseerx}} = {{WDP|P3784}}
*{{پیرا|doi}} = {{WDP|P356}} (add {{پیرا|doi-access}} to indicate free; add {{پیرا|doi-broken-date}} if deprecated)
*{{پیرا|hdl}} = {{WDP|P1184}} (add {{پیرا|hdl-access}} to indicate free)
*{{پیرا|isbn}} = {{WDP|P212}} (falls back to {{WDP|P957}})
*{{پیرا|ismn}} = {{WDP|P1208}}
*{{پیرا|issn}} = {{WDP|P236}}
*{{پیرا|jstor}} = {{WDP|P888}} (add {{پیرا|jstor-access}} to indicate free)
*{{پیرا|lccn}} = {{WDP|P1144}}
*{{پیرا|mr}} = {{WDP|P889}}
*{{پیرا|oclc}} = {{WDP|P243}}
*{{پیرا|ol}} = {{WDP|P648}} (add {{پیرا|ol-access}} to indicate free)
*{{پیرا|osti}} = {{WDP|P3894}} (add {{پیرا|osti-access}} to indicate free)
*{{پیرا|pmc}} = {{WDP|P932}} (add {{پیرا|pmc-embargo-date}} if embargoed)
*{{پیرا|pmid}} = {{WDP|P698}}
*{{پیرا|rfc}} = {{WDP|P892}}
*{{پیرا|ssrn}} = {{WDP|P893}}
*{{پیرا|s2cid}} = {{WDP|P8299}} (add {{پیرا|s2cid-access}} to indicate free)
*{{پیرا|zbl}} = {{WDP|P894}}
{{Columns-end}}
{{Columns-start}}
====Archival parameters====
*{{پیرا|archive-url}} = {{WDP|P1065}} (the long URL with a date is needed; see [[WP:WEBARCHIVES]] for e.g. Archive Today)
{{Columns-end}}
=== Examples ===
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q15625490|doi-access=free}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490|page=42}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q15625490|page=42|doi-access=free}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490|access-date=18 May 2017}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q15625490|access-date=18 May 2017|doi-access=free}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490|quote=lorem ipsum}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q15625490|quote=lorem ipsum|doi-access=free}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q25766745}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q25766745}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q25766745 |chapter=The Final Cut}}</nowiki></code> (with chapter specified)
:{{حوالہ ویکی ڈیٹا|Q25766745 |chapter=The Final Cut}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q25766745 |pages=48-52}}</nowiki></code> (with pages)
:{{حوالہ ویکی ڈیٹا|Q25766745 |pages=48-52}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490|access-date=18 May 2017}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q15625490|access-date=18 May 2017|doi-access=free}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q25766745|mode=cs1}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q25766745|mode=cs1}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q25766745|mode=cs2}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q25766745|mode=cs2}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q25766745|author-mask=1}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q25766745|author-mask=1}}
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q25766745|editor=unset}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q25766745|editor=unset}}
For an example of a bibliography, updated periodically by [https://listeria.toolforge.org/ Listeriabot], see [[User:Mike Peel/publications]].
For additional examples, see [[Template:Cite Q/testcases|testcases]] and [[Template:Cite Q/testcases/many names|testcases/many names]].
== Workflow ==
The template used with a single parameter, the Q-number of the article on Wikidata, will produce a citation using the default display parameters from [[Template:Citation]] and the styling of the author and editor names as they are stored on Wikidata. This is rarely the same as required by the citation formatting in any given article. The guidance at [[WP:CITEVAR]] requires that editors match the formatting of citations that they add to that of the article where it is added. At present, {{سا|Cite Q}} does not know what style the formatting in an article requires (although it is possible that common styles could be marked or recognised automatically as is done for date formatting).
The result is that editors using {{سا|Cite Q}} must take care to preview their edits and ensure that the formatting rendered matches that of the rest of the article. The commonest formatting issues are:
# Order of first and last names of authors and editors:
#: A typical output might be:
#* <code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490}}</nowiki></code> →
#* {{حوالہ ویکی ڈیٹا|Q15625490|doi-access=free}}
#: If that were used in an article that used "Last, First" format for author names, then the editor would have to find a way to format the Cite Q author names correctly. The best option, which will apply to all articles using Cite Q with a given ID, is to modify the Wikidata property for each author and editor, adding "object named as" with the author's name in "Last, First" format. See [[:d:Q45922947#P98]] for an example.
#: Editors can also supply those author names manually in the desired format within the Cite Q template. It's often worth previewing the citation in expanded form to show what is being passed to the actual citation template:
#* <code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490 |expand=yes}}</nowiki></code> →
#* {{حوالہ ویکی ڈیٹا|Q15625490 |expand=yes}}
#: That would make the author names (and author-links) easily available for copy and paste, followed by tweaking into the desired format:
#* <code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E.}}</nowiki></code> →
#* {{حوالہ ویکی ڈیٹا|Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E.|doi-access=free}}
# Punctuation:
#: The separators between elements in the above citation is a comma, which is the default for a CS2-style format produced by {{سا|Citation}}. Careful examination in a particular article will often show the separator punctuation to be a full stop (period). That may be selected by setting {{پیرا|mode|cs1}}:
#* <code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1}}</nowiki></code> →
#* {{حوالہ ویکی ڈیٹا|Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1|doi-access=free}}
#* Sometimes, the article will have author names with initials, and those initials are terminated with a full stop (period). It may be necessary to manually add or remove the punctuation in the author names to match the style of the target article (note: this does not apply to author-links, which match the title of the author's article):
#* <code><nowiki>{{حوالہ ویکی ڈیٹا|Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1}}</nowiki></code> →
#* {{حوالہ ویکی ڈیٹا|Q15625490 |author6=Etnoyer, Peter |author4=Hoetjes, Paul |author7=Smith, Michael |author5=Toller, Wes |author3=Van Tassell, James L. |author-link2=Kent E. Carpenter |author1=Williams, Jeffrey T. |author2=Carpenter, Kent E. |mode=cs1|doi-access=free}}
# Italicisation in titles:
#: Titles drawn from Wikidata cannot contain formatting, so editors using {{سا|Cite Q}} may have to add appropriate formatting.
#: {{سا|Citation}} will automatically apply italicisation to titles of books, etc. so that does not need to be added:
#* <code><nowiki>{{حوالہ ویکی ڈیٹا|Q25766745}}</nowiki></code> →
#* {{حوالہ ویکی ڈیٹا|Q25766745}}
#: However, some titles require partial italicisation, and that has to be done manually when the whole title is not italicised, although that is rare. Titles of chapters may also need to be checked:
#* For example (from {{آئی ایس بی این|978-0-521-32115-0}}): <code><nowiki>|chapter= ''Porphyra'' as food: cultivation and economic</nowiki></code>
== Module:Wd ==
[[Module:Wd]] can automatically cause this template to be invoked, e.g.,
;<code><nowiki>{{ویکی ڈیٹا قدر|references|raw|Q2978|P2046|P585=1987-05-25}}</nowiki></code>
:{{ویکی ڈیٹا قدر|references|raw|Q2978|P2046|P585=1987-05-25}}
currently causes the following to be invoked:
;<code><nowiki>{{حوالہ ویکی ڈیٹا|Q15707237|pages=242}}</nowiki></code>
:{{حوالہ ویکی ڈیٹا|Q15707237|pages=242}}
because an {{wikidata entity link|P2046}} statement on {{wikidata entity link|Q2978}} is referenced to be {{wikidata entity link|P248}} {{wikidata entity link|Q15707237}} with {{wikidata entity link|P304}} = 242.
{{سرنامہ|See [[d:Q2978#P2046]]}}
== Issues ==
=== Future developments ===
* Once robust the functionality should be merged into {{سا|Citation}}
* Eventually, each signed-in reader should be able to set, under their "Preferences", the style in which they wish to see citations rendered. No more [[WP:CITEVAR|CiteVar]] wars!
* We should have a [[:mw:Global templates|global template repository]], so the code can be used by multiple wikis, without having to manually copy it after every update.
=== To do list ===
* Properties
** More properties/ parameters to add
** Parameters with no equivalent property?
* Internationalisation
* Check/resolve handling of redirected QID
* Order of precedence for rendering author names:
*# <s>{{Wikidata entity link|P1932}} qualifier on {{Wikidata entity link|P50}}</s>
*# <s>{{Wikidata entity link|P1810}} qualifier on {{Wikidata entity link|P50}}</s>
*# <s>{{Wikidata entity link|P2093}}</s>
*# <s>{{Wikidata entity link|P50}} label in English</s>
*# {{Wikidata entity link|P50}} label in any other language
** <s>Regardless of which of the above is used, link to the author biography article if available, via {{Wikidata entity link|P50}} (matched via {{Wikidata entity link|P1545}} if applicable)</s>
* Add tracking categories for each parameter where the local value differs from the corresponding WD value so that either the WD entry can be updated/corrected or the local override can be corrected/removed
** Other tracking categories?
* Links to sister projects: Wikisource, if a transcription project exists; Wikibooks; Wikiversity (esp. the WikiJournals there); perhaps more
**Avoid <code><nowiki><ref name="dicc">{{حوالہ ویکی ڈیٹا|Q100160262}} {{cite wikisource|wslanguage=pt|wslink=Diccionario Bibliographico Brazileiro/Francisco Antonio de Almeida|title=Transcription}}</ref></nowiki></code>!
**Also add links to authors who have pages on Wikisource but not on Wikipedia. Related query: [https://w.wiki/qTu Authors on Wikisource but not other projects, who are linked to by an item which is a subclass of Q47461344 (written work)]
* Link to Wikisource should take priority over all URL properties, but only if accompanied by {{WDP|P996}}. If not, {{WDP|P996}} should take precedence over URLs.<!-- The rationale is that Wikisource books with the originals are both verifiable and can link to Wikipedia, Wiktionary etc. Wikisource books without the originals are not as trustworthy as the original files on Commons, so Commons files should be preferred -->
* <s>Where there is a Wikipedia article about the work cited, link the title to that, overriding the URL if necessary (example: [[:d:Q25766745]])</s>
** Ditto for editions of works
* At present a WD pages entry of "1" will result in |pages=1–1 (and metadata &rft.pages=1-1) rather than |page=1 (and metadata &rft.pages=1).
* Implement evaluation of generic keyword for all parameters to denote that a WD value should be accepted by framing its value in accept-this-as-written markup ((..)). See talk thread for possible keyword names.
* Check all parameter aliases when scanning for override parameters (at present some alias parameter names are ignored, possibly leading to inconsistent behaviour if they are set as well).
* Consider including a link to [[Special:EntityUsage]], in the form, say, [[Special:EntityUsage/Q101607488|Other cites]] or with a small icon.
* Take possible template parameter usage as hint which parameter to use in the generated output. F.e. if the journal/magazine/newspaper parameter is used, the template should use the same in the output. The underlying template {citation} will switch the output format accordingly.
* Try to utilize given parameter values as filter for retrieved WD data. If an editor specifies |edition=2 or |volume=3, cite Q should select correlating data (f.e. page ranges, identifiers etc.) while retrieving data from WD (in cases where more than one entry is available for a particular parameter)
* When the author is cited as {{Q|2818964}}, the label should start with an upper case letter
**Quick and dirty workaround: <code><nowiki>{{ucfirst:{{Cite Q|xxxx}}</nowiki></code>
* Make [https://species.wikimedia.org/w/index.php?title=Module:Cite_Q&diff=8090723&oldid=8090081 this fix] unnecessary.
* Add indication alongside citations of retracted/ replaced works
* Consider cases where citing a retracted/ replaced work is deliberate
* Make use of {{پیرا|archive-url}}, {{پیرا|archive-date}}, and consider how to use {{پیرا|url-status}}
** Partially implemented for the cases where {{WDP|P1065}} is a qualifier of {{WDP|P953}} and is a URL showing the date in a recognised format (per a regex)
* Use {{WDP|P6833}}, where present.
* Ability to cite chapters, per [[Template talk:Cite Q#Cite Q chapter broken]]
* Use something like {{WDP|P2441}} so that {{پیرا|trans-title}} [[Template talk:Cite Q#Reminder for title-trans|is used to provide the English translated title, if present]], in addition to the non-English original title.
=== Deferred ===
Feel free to tackle these; the core team working on Cite Q sees them as low priority, or too complex.
* Resolve special case of newspaper articles
** Is the following topic of "hint parameters" related to this?
* Author names (Western-style, at least) should display as "Last, First Middle" to match Wikipedia house style
** How to deal with [[Tussenvoegsel]]s etc.
***In Romance languages, it should be, e.g., "Quental, Antero de" instead of "de Quental, Antero"
* Handle volume in a serial
** '''Clarification needed:''' What is meant by this? |part=, or output format differences journal vs. magazine?
* Is there a Pxxxx code for book series editors to add them to the list of "normal" editors?
** resolve at Wikidata first
===Done===
* <s>Multiple author names treated as one blob</s>
* <s>Linking author name(s)</s>
* <s>Title for a book uses <code><nowiki>{{ #invoke:WikidataIB |getLink |{{{1}}} }}</nowiki></code> and may be expensive</s>
* <s>Fix {{پیرا|ol}} values</s>
* <s>Need to add manual date for newspaper articles/ website articles.</s>
* <s>Make publisher a link, where appropriate</s>
* <s>Improve handing of unexpected multiple values</s>
** <s>e.g. Handle multiple DOIs</s>
* <s>Author name string ({{Wikidata entity link|P2093}}) values (e.g. on [[d:Q38000000|Q38000000]])</s>
* <s>Pseudonymous author personas such as [[P. D. Q. Bach]] or [[مارک ٹوین]]</s>
* <s>Title not in English</s>
* <s>Handle volume, issue and page(s) as qualifiers of {{Wikidata entity link|P1433}}</s>
* <s>Wider variety of examples/ test cases</s>
* <s>If language of work or name is set (and not the local language); pass that; if not but language of title is set (and not the local language), use that</s>
* <s>The <code>url</code> parameter should also pick up data from the properties {{Wikidata property link|953}} and {{Wikidata property link|2699}}</s>
* <s>Linking title to Wikipedia article, if any</s>
* <s>Fetch ISSN etc. from item about journal</s>
* <s>Move Wikidata link before {{پیرا|quote}} (and after other IDs like {{پیرا|pmid}})</s>
** <s>Also fixes postscript character issues in conjunction with {{پیرا|mode|cs1}} and with {{پیرا|quote}}</s>
* <s>Fix page evaluation code to accept comma- and semicolon-separated lists</s>
* <s>Use canonical parameter names when calling down to {citation} (f.e. |page= rather than |p=)</s>
* <s>Is there a Pxxxx code for SBNs ([[بین الاقوامی معیاری کتابی عدد]] to support |sbn= parameter?</s>
**<s>Apparently not</s> -> Add SBN property to WD. (Also add [[Serial Item and Contribution Identifier|SICI]] and [[Book Item and Component Identifier|BICI]] properties corresponding with COinS &rft.sici and &rft.bici.)
* <s>Is there a Pxxxx code for JFM ([[Jahrbuch über die Fortschritte der Mathematik]]) to support |jfm= parameter?</s>
**<s>{{WDP|P894}}? No, Zbl uses the same resolving link, but it is a different ID.</s>
* Are there values of {{پیرا||others}} which are not illustrators? Possibly:
** <s>{{WDP|P2679}}</s>
** <s>{{WDP|1891}}</s>
*** <s>Fails for very high numbers</s>
** <s>{{WDP|P371}}</s>
** <s>{{WDP|P175}}</s>
* <s>Add a tracking category for references with a {{WDP|P1366}} statement</s>
* <s>Add a tracking category for references with a {{WDP|P5824}} statement</s>
* <s>Render {{Wikidata entity link|P1680}}, following the title with a <code>:</code></s>
* <s>Convert WikiData's edition number (e.g., ''1'') into the ordinal (''1st'') expected by {{سا|citation}}.</s>
=== Won't fix ===
* Improve date formatting options
** This is done in {{سا|Citation}}
* Fix unnecessary piping of author/editor and journal links if link and label are the same, f.e. <nowiki>[[Author|Author]]</nowiki> -> <nowiki>[[Author]]</nowiki>, <nowiki>[[Journal|Journal]]</nowiki> -> <nowiki>[[Journal]]</nowiki> for improved reusability, cleaniness of output, reduced size of resulting page code, and to avoid potential future extra text errors thrown by the underlying {citation} template
** See talk
* Fix invocation with {{پیرا|qid|}} instead of unnamed parameter. At present <nowiki>{{حوالہ ویکی ڈیٹا|qid=Q12345}}</nowiki> instead of <nowiki>{{حوالہ ویکی ڈیٹا|Q12345}}</nowiki> gives an error.
** This is intended; please discuss on talk
** Fix ready for test in template sandbox: <nowiki>{{cite Q/sandbox|qid=Q15625490}}</nowiki> gives {{cite Q/sandbox|qid=Q15625490|doi-access=free}}
* Replace the QID with a pen icon
** The QID is valid metadata about the cited work.
* Consider case where author is given as {{Q|Q311624}}
** If last author/editor is named "et al." (and variants), mute this entry and set display-authors/editors=etal instead before passing down to {citation}
*** Disputed; see [[Template talk:Citation#Et al]]
* Improve rendering when both {{WDP|P50}} and {{WDP|2093}} are present.
** Example: ''<nowiki>{{حوالہ ویکی ڈیٹا|Q108740476}}</nowiki>'' → {{حوالہ ویکی ڈیٹا|Q108740476}}
** Current rendering of author name uses semicolon: “Camelia-Manuela Lățăianu; Manuela Lataianu”
** Suggested improved rendering of author name: “Manuela Lataianu [= Camelia-Manuela Lățăianu]”
** Such instances should be fixed on Wikidata, [https://www.wikidata.org/w/index.php?title=Q108740476&type=revision&diff=1630505802&oldid=1505280341 as done here]
</div>
ooqkb3risqfnxi1w4emvxigaazk8qdj
ماڈیول:Cite Q/en
828
141232
690956
2025-07-10T15:24:25Z
Abbas dhothar
361
"-- Version: 2021-10-19 local p = {} require('strict') local wdib = require('Module:WikidataIB/en') local getValue = wdib._getValue local getPropOfProp = wdib._getPropOfProp local followQid = wdib._followQid local getPropertyIDs = wdib._getPropertyIDs local i18n = { ["unknown-author"] = mw.wikibase.getLabel("Q4233718"):gsub("^%l", mw.ustring.upper), ["unknown-author-trackingcat"] = "", -- [[Category:Cite Q - author unknown]] removed as misplaced;..." نال صفحہ بنایا گیا۔
690956
Scribunto
text/plain
-- Version: 2021-10-19
local p = {}
require('strict')
local wdib = require('Module:WikidataIB/en')
local getValue = wdib._getValue
local getPropOfProp = wdib._getPropOfProp
local followQid = wdib._followQid
local getPropertyIDs = wdib._getPropertyIDs
local i18n = {
["unknown-author"] = mw.wikibase.getLabel("Q4233718"):gsub("^%l", mw.ustring.upper),
["unknown-author-trackingcat"] = "", -- [[Category:Cite Q - author unknown]] removed as misplaced; someone is welcome to restore it if it is placed outside of the template parameter value
["ordinal"] = {
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["months"] = {
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
}
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above i18n
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
p.makeOrdinal = function(cardinal)
local card = tonumber(cardinal)
if not card then return cardinal end
local ordsuffix = i18n.ordinal.default
if card % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif card % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif card % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (card % 100 == 11) or (card % 100 == 12) or (card % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return card .. ordsuffix
end
-- Table of simple properties that can be fetched in roughly the same way:
-- id = PXXX
-- maxvals = maximum number of multiple values (0 for all)
-- linked = "no" suppresses linking
-- populate_from_journal = true/false determines whether to look in a journal where the source is published
-- rank = "best", "preferred", normal, etc. determines how Wikidata ranks are treated
-- others = true - the value for the property goes to "others" section
local simple_properties = {
publisher = {id = "P123", maxvals = 1},
oclc = {id = "P243", maxvals = 1},
['publication-place'] = {id = "P291", maxvals = 0, linked = 'no'}, -- publication place (don't put into |place=; is treated specially in {{citation}} if both are given)
doi = {id = "P356", maxvals = 1}, -- take care of |doi-broken-date= (WD "reason for deprecation"/"stated as") and |doi-access= (WD "access status")?
issue = {id = "P433", maxvals = 0, populate_from_journal = true}, -- distinguish from |number= ("P1545"?) if both are given (still blocked by {{citation}}, but will be supported in the future)
pmid = {id = "P698", maxvals = 1},
-- gbooks = {id = "P675", maxvals = 1}, -- to be added to {{citation}}
-- ia = {id = "P724", maxvals = 1}, -- to be added to {{citation}}
arxiv = {id = "P818", maxvals = 1},
bibcode = {id = "P819", maxvals = 1}, -- take care of |bibcode-access=?
jstor = {id = "P888", maxvals = 1}, -- take care of |jstor-access=?
mr = {id = "P889", maxvals = 1},
rfc = {id = "P892", maxvals = 1},
zbl = {id = "P894", maxvals = 1},
ssrn = {id = "P893", maxvals = 1},
place = {id = "P1071", maxvals = 0, linked = 'no'}, -- written-at place
-- ['total-pages'] = {id = "P1104", maxvals = 0, linked = 'no'}, -- to be added to {{citation}} / COinS &rft.tpages=
-- coden = {id = "P1159", maxvals = 1}, -- to be added to {{citation}} / COinS &rft.coden=
s2cid = {id = "P8299", maxvals = 1}, -- take care of |s2cid-access=?
pmc = {id = "P932", maxvals = 1}, -- take care of |pmc-embargo-date= (WD "reason for deprecation")?
lccn = {id = "P1144", maxvals = 1},
hdl = {id = "P1184", maxvals = 1}, -- take care of |hdl-access=?
ismn = {id = "P1208", maxvals = 1},
journal = {id = "P1433", maxvals = 1},
citeseerx = {id = "P3784", maxvals = 1},
osti = {id = "P3894", maxvals = 1}, -- take care of |osti-access=?
biorxiv = {id = "P3951", maxvals = 1},
asin = {id = "P5749", maxvals = 1}, -- What about |asin-tld=? (WD examples resolve to .com at present, but may change)
-- ['catalog-number'] = {id = "P528", maxvals = 0}, -- to be added to {{citation}} / COinS &rft.artnum=
isbn = {id = "P212", maxvals = 1, populate_from_journal = true}, -- ISBN 13
issn = {id = "P236", maxvals = 1, populate_from_journal = true}, -- distinguish from |eissn= for electronic issues?
-- jfm = {id = "P?", maxvals = 1}, -- Jahrbuch über die Fortschritte der Mathematik (not Zbl)
-- sbn = {id = "P?", maxvals = 1}, -- Standard Book Number (predecessor of ISBN, not ICCU)
-- message-id = {id = "P?", maxvals = 1}, -- Usenet message ID
chapter = {id = "P792", maxvals = 1},
['publication-date'] = {id = "P577", maxvals = 1, populate_from_journal = true}, -- publication date (don't use |date=; is treated specially in {{citation}} if both are given.)
series = {id = "P179", maxvals = 1, populate_from_journal = true},
version = {id = "P348", maxvals = 0},
edition = {id = "P393", maxvals = 0},
volume = {id = "P478", maxvals = 0, populate_from_journal = true},
-- part = {id = "P1545"?, maxvals = 0}, -- to be added to {{citation}} / COinS &rft.part=
title = {id = "P1476", rank="p n"},
-- url = {id = "P953", maxvals = 1}, -- deal with this along with archive-url
pages = {id = "P304", maxvals = 0, populate_from_journal = true},
at = {id = "P958", maxvals = 0, populate_from_journal = true}, -- also incorporate lines (P7421) and columns (P3903) into this (cite map also supports |section=)
-- sheets = {id = "P7416", maxvals = 0, populate_from_journal = true},
-- interviewer = {id = "P?", maxvals = 0}, -- does **not** go to "others" section! Multiple interviewers should be n-enumerated
illustrator = {id = "P110", maxvals = 10, others = true}, -- goes to "others" section
-- foreword and afterword, when contributions to another author's work, are contributions so belong in |contribution=;
-- the writer's name goes in |contributor=; requires |title= and |author=
-- However, this might need to add support for multiple contributors and their roles to {{citation}}, see Help_talk:Citation_Style_1#Others
-- foreword = {id = "P2679", maxvals = 10, others = true}, -- goes to "others" section
-- afterword = {id = "P2680", maxvals = 10, others = true}, -- goes to "others" section
composer = {id = "P86", maxvals = 10, others = true}, -- goes to "others" section
animator = {id = "P6942", maxvals = 10, others = true}, -- goes to "others" section
director = {id = "P57", maxvals = 10, others = true}, -- goes to "others" section
screenwriter = {id = "P58", maxvals = 10, others = true}, -- goes to "others" section
signatory = {id = "P1891", maxvals = 10, others = true}, -- goes to "others" section
presenter = {id = "P371", maxvals = 10, others = true}, -- goes to "others" section
performer = {id = "P175", maxvals = 10, others = true}, -- goes to "others" section
}
--[[--------------------------< I S _ S E T >--------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '')
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack (taken from Module:Citation/CS1/Utilities)
]]
local function in_array( needle, haystack )
if needle == nil then
return false
end
for n, v in ipairs( haystack ) do
if v == needle then
return n
end
end
return false
end
--[[--------------------------< A C C E P T _ V A L U E >-------------------------------------------------------
Accept WD value by framing in ((...)) if param_val is equal to keyword; else pass-through WD value as is.
]]
local function accept_value( param_val, wd_val )
local val = param_val
if val then
if in_array (val, {'accept', '))((', ':d:'}) then
val = '((' .. wd_val .. '))'
elseif '((accept))' == val then
val = 'accept'
elseif '(())(())' == val then
val = '))(('
elseif '((:d:))' == val then
val = ':d:'
else
val = wd_val
end
end
return val
end
-- function to fetch a value to display
local function makelink(v, out, link, maxpos, wdl)
local label
if v.mainsnak.snaktype == "value" then
if v.mainsnak.datatype == "wikibase-item" then
local qnumber = v.mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qnumber)
if qnumber == "Q2818964" then sitelink = nil end -- suppress link to "Various authors"
if v.qualifiers and v.qualifiers.P1932 then
label = v.qualifiers.P1932[1].datavalue.value
else
label = mw.wikibase.getLabel(qnumber)
if label then
label = mw.text.nowiki(label)
else
label = qnumber -- should add tracking category
end
end
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
if sitelink then
-- just the plain name,
-- but keep a record of the links, using the same index
out[position] = label
link[position] = sitelink
else
if wdl then
-- show that there's a Wikidata entry available
out[position] = "[[:d:Q" .. v.mainsnak.datavalue.value["numeric-id"] .. "|" .. label .. "]] <span title='" .. i18n["errors"]["local-article-not-found"] .. "'>[[File:Wikidata-logo.svg|16px|alt=|link=]]</span>"
else
-- no Wikidata links wanted, so just give the plain label
out[position] = label
end
end
elseif v.mainsnak.datatype == "string" then
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
out[position] = v.mainsnak.datavalue.value
else
-- not a wikibase-item or a string!
end
else
-- code here if we want to return something when author is "unknown"
if v.qualifiers and v.qualifiers.P1932 then
label = v.qualifiers.P1932[1].datavalue.value
else
label = i18n["unknown-author"] .. (i18n["unknown-author-trackingcat"] or "")
end
maxpos = maxpos + 1
out[maxpos] = label
end
return maxpos
end
--[=[-------------------------< G E T _ N A M E _ L I S T >----------------------------------------------------
get_name_list -- adapted from getAuthors code taken from Module:RexxS
arguments:
nl_type - type of name list to fetch: nl_type = 'author' for authors; 'editor' for editors; 'translator' for translators
args - pointer to the parameter arguments table from the template call
qid - value from |qid= parameter; the Q-id of the source (book, etc.) in qid
wdl - value from the |wdl= parameter; a Boolean passed to enable links to Wikidata when no article exists
returns nothing; modifies the args table
]=]
local function get_name_list (nl_type, args, qid, wdl)
local propertyID = "P50"
local fallbackID = "P2093" -- author name string
if nl_type =="author" then
propertyID = 'P50' -- for authors
fallbackID = 'P2093' -- author-string
elseif nl_type =="editor" then
propertyID = 'P5769' -- "editor-in-chief"
fallbackID = 'P98' -- for editors - So-called "fallbacks" are actually a second set of properties processed
-- TBD. Take book series editors into account as well (if they have a separate P code as well)?
elseif nl_type == "translator" then
propertyID = 'P655' -- for translators
fallbackID = nil
-- elseif 'contributor' == nl_type then
-- f.e. author of forewords (P2679) and afterwords (P2680); requires |contribution=, |title= and |author=
-- propertyID = 'P' -- for contributors
-- fallbackID = nil
else
return -- not specified so return
end
-- wdl is a Boolean passed to enable links to Wikidata when no article exists
-- if "false" or "no" or "0" is passed set it false
-- if nothing or an empty string is passed set it false
if wdl and (#wdl > 0) then
wdl = wdl:lower()
wdl = in_array (wdl, {"false", "no", "0"})
else
-- wdl is empty, so
wdl = false
end
local props = nil
local fallback = nil
if mw.wikibase.entityExists(qid) then
props = mw.wikibase.getAllStatements(qid, propertyID)
if props and fallbackID then
fallback = mw.wikibase.getAllStatements(qid, fallbackID)
end
end
-- Make sure it actually has at least one of the properties requested
if not (props and props[1]) and not (fallback and fallback[1]) then
return nil
end
-- So now we have something to return:
-- table 'out' is going to store the names(s):
-- and table 'link' will store any links to the name's article
local out = {}
local link = {}
local maxpos = 0
if props and props[1] then
for k, v in pairs(props) do
maxpos = makelink(v, out, link, maxpos, wdl)
end
end
if fallback and fallback[1] then
-- second properties
for k, v in pairs(fallback) do
maxpos = makelink(v, out, link, maxpos, wdl)
end
end
-- if there's anything to return, then insert the additions in the template arguments table
-- in the form |author1=firstname secondname |author2= ...
-- Renumber, in case we have inconsistent numbering
local keys = {}
for k, v in pairs(out) do
keys[#keys + 1] = k
end
table.sort(keys) -- as they might be out of order
for i, k in ipairs(keys) do
out[k] = out[k]:gsub (''', '\''); -- prevent cs1|2 multiple names categorization; replace html entity with the actual character
mw.log(i .. " " .. k .. " " .. (out[k]))
if args[nl_type .. i] then -- name gets overwritten
-- pull corresponding -link only if overwritten name is same as WD name
if link[k] and (args[nl_type .. i] == out[k]) then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
else -- name does not get overwritten, so pull name from WD
args[nl_type .. i] = out[k]
if link[k] then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
end
end
end
-- gets language codes used for a monolingual text property as a table
function p._getLangOfProp(qid, pid)
if not pid then return {} end
local out = {}
local props = mw.wikibase.getAllStatements(qid, pid)
for i, v in ipairs(props) do
if v.mainsnak.datatype == "monolingualtext" and v.mainsnak.datavalue then
out[#out + 1] = v.mainsnak.datavalue.value.language
end
end
return out
end
function p.getLangOfProp(frame)
local pid = frame.args.pid or mw.text.trim(frame.args[1] or "")
if pid == "" then return end
local qid = frame.args.qid
if qid == "" then qid = nil end
return table.concat(p._getLangOfProp(qid, pid), ", ")
end
-- gets the language codes of a Wikidata entry as a table
local function _lang_code(qid)
local lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P424", ps = 1} )
if lc then return mw.text.split( lc, "[, ]+" ) end
lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P218", ps = 1} )
if lc then return mw.text.split( lc, "[, ]+" ) end
return p._getLangOfProp(qid, "P1476")
end
function p.lang_code(frame)
return table.concat(_lang_code(frame.args.qid or mw.text.trim(frame.args[1] or "")), ", ")
end
-- export for debug
function p.getPropOfProp(frame)
return getPropOfProp(frame.args)
end
-- wraps a string in nowiki unless disable flag is set
local function wrap_nowiki(str, disable)
if disable then return str or '' end
return mw.text.nowiki(str or '')
end
-- sort sequence table whose values are key-value pairs by key
local function comp_key(a, b)
return a[1] < b[1]
end
-- sort sequence table whose values are key-value pairs by value
local function comp_val(a, b)
return a[2] < b[2]
end
--[[-------------------------< C I T E _ Q >------------------------------------------------------------------
Takes standard CS1|2 template parameters and passes all to {{citation}}. If neither of |author= and |author1=
are set, calls get_authors() to try to get an author name-list from Wikidata. The result is passed to
{{citation}} for rendering.
--]]
function p._cite_q (citeq_args)
local frame = mw.getCurrentFrame()
-- parameters that don't get passed to Citation
local expand = citeq_args.expand -- when set to anything, causes {{cite q}} to render <code><nowiki>{{citation|...}}</nowiki></code>
local qid = citeq_args.qid or citeq_args[1]
local wdl = citeq_args.wdl
local template = citeq_args.template
citeq_args.expand = nil
citeq_args[1] = nil
citeq_args.qid = nil
citeq_args.wdl = nil
citeq_args.template = nil
-- if title supplied, flag to not read html title
local titleforced = (citeq_args.title ~= nil)
local oth = {}
-- put the language codes into a sequential table langcodes[]
local langcodes = {}
if citeq_args.language then
-- check these are a supported language codes
for lc in mw.text.gsplit( citeq_args.language, "[, ]+", false ) do
langcodes[#langcodes+1] = mw.language.isSupportedLanguage(citeq_args.language) and citeq_args.language
end
end
if not langcodes[1] then
-- try to find language of work
langcodes = _lang_code(qid)
end
if not langcodes[1] then
-- try fallback to journal's language
local journal_qid = followQid({qid = qid, props = "P1433"})
langcodes = journal_qid and _lang_code(journal_qid)
end
citeq_args.language = citeq_args.language or table.concat(langcodes, ", ")
-- loop through list of simple properties and get their values in citeq_args
for name, data in pairs(simple_properties) do
citeq_args[name] = getValue( {data.id, fwd = "ALL", osd = "no", noicon = "true", qid = qid, maxvals = data.maxvals, linked = data.linked, rank = data.rank or "best", citeq_args[name] } )
if data.populate_from_journal then
local publishedin = getValue( {"P1433", ps = 1, qid = qid, maxvals = 0, citeq_args[name], qual = data.id, qualsonly = 'yes'} )
citeq_args[name] = publishedin or getPropOfProp({qid = qid, prop1 = "P1433", prop2 = data.id, maxvals = data.maxvals, ps = 1})
end
if citeq_args[name] and citeq_args[name]:find('[[Category:Articles with missing Wikidata information]]', 1, true) then
-- try fallback to work's native language
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = "no", lang = langcodes[1] } )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned
-- try fallback to qid's native language
local qid_languages = _lang_code(citeq_args[name])
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = "no", lang = qid_languages[1] } )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned again
citeq_args[name] = nil
else
-- record the language found if no lang specified
citeq_args.language = citeq_args.language or qid_languages[1]
end
end
end
if data.others then
oth[#oth + 1] = citeq_args[name] and (name:gsub("^%l", string.upper) .. ": " .. citeq_args[name])
citeq_args[name] = nil
end
end
citeq_args.others = citeq_args.others or table.concat(oth, ". ")
if citeq_args.others == "" then
citeq_args.others = nil
end
citeq_args.journal = citeq_args.journal and citeq_args.journal:gsub("^''", ""):gsub("''$", ""):gsub("|''", "|"):gsub("'']]", "]]")
citeq_args.ol = (getValue( {"P648", ps = 1, qid = qid, maxvals = 1, citeq_args.ol } ) or ''):gsub("^OL(.+)$", "%1")
if citeq_args.ol == "" then
citeq_args.ol = nil
end
-- TBD. Take care of |ol-access=?
citeq_args.biorxiv = citeq_args.biorxiv and ("10.1101/" .. citeq_args.biorxiv)
citeq_args.isbn = getValue( {"P957", ps = 1, qid = qid, maxvals = 1, rank="best", citeq_args.isbn } ) -- try ISBN 10 (only one value accepted)
-- if url then see if there's an archive: citeq_args.url
local url
if not citeq_args.url then
for i, pr in ipairs( {"P953", "P856", "P2699"} ) do
url = getValue( {pr, ps = 1, qid = qid, maxvals = 1, qual="P1065" } )
if url then
citeq_args.url = mw.text.split( url, " (", true )[1]
local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present
if arcurl then
local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)")
if arcy and arcm and arcd then
citeq_args["archive-url"] = arcurl
citeq_args["archive-date"] = tonumber(arcd) .. " " .. i18n.months[tonumber(arcm)] .. " " .. arcy
end
end
break
end
end
end
if citeq_args.publisher == "Unknown" then -- look for "stated as" (P1932)
local stated_as = getValue( {"P123", ps = 1, qid = qid, maxvals = 1, qual="P1932", qo="y"} )
if stated_as then citeq_args.publisher = stated_as end
end
if not titleforced then
-- Handle subtitle.
if citeq_args.title then
local subtitle = mw.wikibase.getBestStatements (qid, 'P1680');
if 0 ~= #subtitle then
subtitle = subtitle[1].mainsnak.datavalue.value.text;
citeq_args.title = citeq_args.title .. ": " .. subtitle
end
end
local htmltitle = getValue( {"P1476", qual = "P6833", ps = 1, qid = qid, maxvals = 1, qo = "y"} )
if htmltitle then
citeq_args.title = htmltitle:gsub("</?i>", "''")
else
local title_display = citeq_args.title
or mw.wikibase.getLabel(qid)
or (langcodes[1] and mw.wikibase.getLabelByLang(qid, langcodes[1]))
or ("No label or title -- debug: " .. qid)
if citeq_args.url then
citeq_args.title = wrap_nowiki(title_display)
else
local slink = mw.wikibase.getSitelink(qid)
local slink_flag = false
local wrap_title = ''
local wslink = false
if not slink then
-- See if we have wikisource
if not citeq_args.url then
local wikisource_sitelink = mw.wikibase.getSitelink(qid, "enwikisource") or nil
if wikisource_sitelink then
slink = ':s:'..wikisource_sitelink
wslink = true
end
end
end
if citeq_args.title then
if slink then
wrap_title = wrap_nowiki(citeq_args.title)
slink_flag = true
else
citeq_args.title = wrap_nowiki(citeq_args.title)
end
else
if slink and not wslink then
if slink:lower() == title_display:lower() then
citeq_args.title = '[[' .. slink .. ']]'
else
wrap_title = wrap_nowiki(slink:gsub("%s%(.+%)$", ""):gsub(",.+$", ""))
slink_flag = true
end
elseif wslink then
wrap_title = wrap_nowiki(title_display)
slink_flag = true
else
citeq_args.title = wrap_nowiki(title_display)
end
end
if slink_flag then
if slink == wrap_title and not wslink then -- direct link
citeq_args.title = '[[' .. slink .. ']]'
else -- piped link
citeq_args.title = '[[' .. slink .. '|' .. wrap_title .. ']]'
end
end
end
end
end
-- TBD: incorporate |at, |sheets= and |sheet= here as well
-- Sort out what should happen if several of them are given at the same time
if citeq_args.page or citeq_args.p then -- let single take precedence over multiple
citeq_args.pages = nil
citeq_args.pp = nil
end
if citeq_args.pages then
local _, count = string.gsub(citeq_args.pages, "[,;%s]%d+", "")
if count == 1 then
citeq_args.page = citeq_args.pages
citeq_args.pages = nil
end
end
if is_set (qid) then
if not is_set (citeq_args.author) and not is_set (citeq_args.author1)
and not is_set (citeq_args.subject) and not is_set (citeq_args.subject1)
and not is_set (citeq_args.host) and not is_set (citeq_args.host1)
and not is_set (citeq_args.last) and not is_set (citeq_args.last1)
and not is_set (citeq_args.surname) and not is_set (citeq_args.surname1)
and not is_set (citeq_args['author-last']) and not is_set (citeq_args['author-last1']) and not is_set (citeq_args['author1-last'])
and not is_set (citeq_args['author-surname']) and not is_set (citeq_args['author-surname1']) and not is_set (citeq_args['author1-surname1']) then -- if neither are set, try to get authors from Wikidata
get_name_list ('author', citeq_args, qid, wdl) -- modify citeq_args table with authors from Wikidata
end
if not is_set (citeq_args.editor) and not is_set (citeq_args.editor1)
and not is_set (citeq_args['editor-last']) and not is_set (citeq_args['editor-last1']) and not is_set (citeq_args['editor1-last'])
and not is_set (citeq_args['editor-surname']) and not is_set (citeq_args['editor-surname1']) and not is_set (citeq_args['editor1-surname']) then -- if neither are set, try to get editors from Wikidata
get_name_list ('editor', citeq_args, qid, wdl) -- modify citeq_args table with editors from Wikidata
end
if not is_set (citeq_args.translator) and not is_set (citeq_args.translator1)
and not is_set (citeq_args['translator-last']) and not is_set (citeq_args['translator-last1']) and not is_set (citeq_args['translator1-last'])
and not is_set (citeq_args['translator-surname']) and not is_set (citeq_args['translator-surname1']) and not is_set (citeq_args['translator1-surname']) then -- if neither are set, try to get translators from Wikidata
get_name_list ('translator', citeq_args, qid, wdl) -- modify citeq_args table with translators from Wikidata
end
end
for k, v in pairs(citeq_args) do
if in_array (v, {'(())', 'unset', 'ignore'}) or 'string' ~= type(k) then -- empty accept-as-is-written (()) markup to indicate an empty/unused parameter value, other ((...)) markups are deliberately passed down to {{citation}}
citeq_args[k] = nil
elseif in_array (v, {'((unset))', '((ignore))'}) then -- strip off markup for free-text values clashing with local keywords
citeq_args[k] = 'unset'
end
end
local author_count = 0
for k, v in pairs(citeq_args) do
if k:find("^author%d+$") then
author_count = author_count + 1
end
end
if author_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-authors'] then
citeq_args['display-authors'] = nil; -- unset because no longer needed
else
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names
end
end
local editor_count = 0
for k, v in pairs(citeq_args) do
if k:find("^editor%d+$") then
editor_count = editor_count + 1
end
end
if editor_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-editors'] then
citeq_args['display-editors'] = nil; -- unset because no longer needed
else
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names
end
end
-- change edition to ordinal if it's set and numeric
citeq_args.edition = citeq_args.edition and p.makeOrdinal(citeq_args.edition)
-- code to make a guess what template to use from the supplied parameters
-- (first draft for proof-of-concept)
if citeq_args.isbn then
template = template or "book"
citeq_args.asin = nil -- suppress ASIN if ISBN exists
elseif citeq_args.journal then
template = template or "journal"
elseif citeq_args.website then
template = template or "web"
end
-- template is CS1 designator: journal, web, news, etc.
if template then
-- citeq_args.mode = citeq_args.mode or "cs1" -- a cs1 template already knows that it is cs1 so this line is superfluous
template = "Cite " .. template
else
-- citeq_args.mode = citeq_args.mode or "cs2" -- a cs2 template already knows that it is cs2 so this line is superfluous
template = "Citation"
end
-- |id= could hold more than one identifier pulled from Wikidata not supported by {{citation}}, right now only add our qid to the list
local list_sep = '. '
if citeq_args.mode ~= 'cs1' then
list_sep = ', '
end
local id = '[[:en:WDQ (identifier)|Wikidata]] [[:d:' .. qid .. '|' .. qid .. ']]' -- go through "WDQ (identifier)" redirect to reduce clutter in "What links here" and improve reverse lookup. Keep in sync with {{QID}}.
local old_id = citeq_args.id
if wdl then -- show WD logo
id = id .. '[[File:Wikidata-logo.svg|16px|alt=|link=]]' -- possibly replace by WD edit icon?
end
if is_set (old_id) then
citeq_args.id = old_id .. list_sep .. id -- append to user-specified contents
else
citeq_args.id = id
end
-- clean up any blank parameters
for k, v in pairs(citeq_args) do
if v == "" then citeq_args[k] = nil end
end
-- if |expand=<anything>, write a nowiki'd version to see what the {{citation}} template call looks like
if expand then
local expand_args = { "{{" .. template } -- init with citation template
if expand == "self" then
citeq_args.id = old_id -- restore original |id= parameter
expand_args = { "{{cite Q|" .. qid } -- expand to itself
end
-- make a sortable table and sort it by param name
local sorttable = {}
for param, val in pairs (citeq_args) do
table.insert(sorttable, {param, val})
end
table.sort(sorttable, comp_key)
-- add contents to expand_args
for idx, val in ipairs(sorttable) do
table.insert(expand_args, val[1] .. '=' .. val[2])
end
-- make the nowiki'd string and done
return frame:preprocess (table.concat ({'<syntaxhighlight lang="wikitext" inline="1">', table.concat (expand_args, ' |') .. '}}', '</syntaxhighlight>'}));
end
local erratumid = getPropertyIDs( { "P2507", qid = qid, fwd = "ALL", osd = "no", rank = "best", maxvals = 1 } )
if erratumid then
erratumid = " [[d:" .. erratumid .. "|(erratum)]]" .. "[[Category:Cite Q - cites a work with an erratum]]"
else
erratumid = ""
end
local opt_cat = ''
if getValue( {"P5824", ps = 1, qid = qid} ) then
opt_cat = '[[Category:Cite Q - cites a retracted work]]<!-- retracted -->'
end
if getValue( {"P1366", ps = 1, qid = qid} ) then
opt_cat = opt_cat .. '[[Category:Cite Q - cites a replaced work]]<!-- replaced -->'
end
return frame:expandTemplate{title = template, args = citeq_args} .. erratumid .. opt_cat -- render the template
end
function p.cite_q (frame)
local args = {}
for k, v in pairs(frame:getParent().args) do
if v ~= "" then args[k] = v end
end
for k, v in pairs(frame.args) do
if v ~= "" then args[k] = v end
end
args.qid = args.qid or args[1] or ""
if args.qid == "" then return nil end
args[1] = nil
local citesep = (args.citesep or "")
if citesep == "" then citesep = ", " end
citesep = citesep:gsub('"', '') -- strip double quotes after setting default to allow |citesep="" as a blank separator
args.citesep = nil
local tag = args.tag or ""
if tag == "" then tag = nil end
args.tag = nil
local list = args.list or ""
if list == "" then list = nil end
args.list = nil
args.language = args.language or args.lang
args.lang = nil
local cites = {}
for q in args.qid:gmatch("Q%d+") do
-- make a new copy of the arguments
local newargs = {}
for k, v in pairs(args) do
if k ~= "qid" then
newargs[k] = v
end
end
newargs.qid = q
if tag == "ref" then
cites[#cites + 1] = frame:callParserFunction{ name = "#tag:ref", args = { p._cite_q(newargs), name = q } }
-- expand like this: args = { p._cite_q(newargs), name = 'foo', group = 'bar' }
else
cites[#cites + 1] = p._cite_q(newargs)
end
end
if list then
return frame:expandTemplate{ title = list, args = cites }
else
return table.concat(cites, citesep)
end
end
return p
4u3u13ot6ksub1cnfybua39myd65059
ماڈیول:WikidataIB/en
828
141233
690957
2025-07-10T15:26:21Z
Abbas dhothar
361
"-- Version: 2023-07-10 -- Module to implement use of a blacklist and whitelist for infobox fields -- Can take a named parameter |qid which is the Wikidata ID for the article -- if not supplied, it will use the Wikidata ID associated with the current page. -- Fields in blacklist are never to be displayed, i.e. module must return nil in all circumstances -- Fields in whitelist return local value if it exists or the Wikidata value otherwise -- The name o..." نال صفحہ بنایا گیا۔
690957
Scribunto
text/plain
-- Version: 2023-07-10
-- Module to implement use of a blacklist and whitelist for infobox fields
-- Can take a named parameter |qid which is the Wikidata ID for the article
-- if not supplied, it will use the Wikidata ID associated with the current page.
-- Fields in blacklist are never to be displayed, i.e. module must return nil in all circumstances
-- Fields in whitelist return local value if it exists or the Wikidata value otherwise
-- The name of the field that this function is called from is passed in named parameter |name
-- The name is compulsory when blacklist or whitelist is used,
-- so the module returns nil if it is not supplied.
-- blacklist is passed in named parameter |suppressfields (or |spf)
-- whitelist is passed in named parameter |fetchwikidata (or |fwd)
require("strict")
local p = {}
local cdate -- initialise as nil and only load _complex_date function if needed
-- Module:Complex date is loaded lazily and has the following dependencies:
-- Module:Calendar
-- Module:ISOdate
-- Module:DateI18n
-- Module:I18n/complex date
-- Module:Ordinal
-- Module:I18n/ordinal
-- Module:Yesno
-- Module:Formatnum
-- Module:Linguistic
--
-- The following, taken from https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times,
-- is needed to use Module:Complex date which seemingly requires date precision as a string.
-- It would work better if only the authors of the mediawiki page could spell 'millennium'.
local dp = {
[6] = "millennium",
[7] = "century",
[8] = "decade",
[9] = "year",
[10] = "month",
[11] = "day",
}
local i18n =
{
["errors"] =
{
["property-not-found"] = "Property not found.",
["No property supplied"] = "No property supplied",
["entity-not-found"] = "Wikidata entity not found.",
["unknown-claim-type"] = "Unknown claim type.",
["unknown-entity-type"] = "Unknown entity type.",
["qualifier-not-found"] = "Qualifier not found.",
["site-not-found"] = "Wikimedia project not found.",
["labels-not-found"] = "No labels found.",
["descriptions-not-found"] = "No descriptions found.",
["aliases-not-found"] = "No aliases found.",
["unknown-datetime-format"] = "Unknown datetime format.",
["local-article-not-found"] = "Article is available on Wikidata, but not on Wikipedia",
["dab-page"] = " (dab)",
},
["months"] =
{
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
["century"] = "century",
["BC"] = "BC",
["BCE"] = "BCE",
["ordinal"] =
{
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["filespace"] = "File",
["Unknown"] = "Unknown",
["NaN"] = "Not a number",
-- set the following to the name of a tracking category,
-- e.g. "[[Category:Articles with missing Wikidata information]]", or "" to disable:
["missinginfocat"] = "[[Category:Articles with missing Wikidata information]]",
["editonwikidata"] = "Edit this on Wikidata",
["latestdatequalifier"] = function (date) return "before " .. date end,
-- some languages, e.g. Bosnian use a period as a suffix after each number in a date
["datenumbersuffix"] = "",
["list separator"] = ", ",
["multipliers"] = {
[0] = "",
[3] = " thousand",
[6] = " million",
[9] = " billion",
[12] = " trillion",
}
}
-- This allows an internationisation module to override the above table
if 'en' ~= mw.getContentLanguage():getCode() then
require("Module:i18n").loadI18n("Module:WikidataIB/i18n", i18n)
end
-- This piece of html implements a collapsible container. Check the classes exist on your wiki.
local collapsediv = '<div class="mw-collapsible mw-collapsed" style="width:100%; overflow:auto;" data-expandtext="{{int:show}}" data-collapsetext="{{int:hide}}">'
-- Some items should not be linked.
-- Each wiki can create a list of those in Module:WikidataIB/nolinks
-- It should return a table called itemsindex, containing true for each item not to be linked
local donotlink = {}
local nolinks_exists, nolinks = pcall(mw.loadData, "Module:WikidataIB/nolinks")
if nolinks_exists then
donotlink = nolinks.itemsindex
end
-- To satisfy Wikipedia:Manual of Style/Titles, certain types of items are italicised, and others are quoted.
-- The submodule [[Module:WikidataIB/titleformats]] lists the entity-ids used in 'instance of' (P31),
-- which allows this module to identify the values that should be formatted.
-- WikidataIB/titleformats exports a table p.formats, which is indexed by entity-id, and contains the value " or ''
local formats = {}
local titleformats_exists, titleformats = pcall(mw.loadData, "Module:WikidataIB/titleformats")
if titleformats_exists then
formats = titleformats.formats
end
-------------------------------------------------------------------------------
-- Private functions
-------------------------------------------------------------------------------
--
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above:
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local makeOrdinal = function(cardinal)
local ordsuffix = i18n.ordinal.default
if cardinal % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif cardinal % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif cardinal % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return tostring(cardinal) .. ordsuffix
end
-------------------------------------------------------------------------------
-- findLang takes a "langcode" parameter if supplied and valid
-- otherwise it tries to create it from the user's set language ({{int:lang}})
-- failing that it uses the wiki's content language.
-- It returns a language object
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local findLang = function(langcode)
local langobj
langcode = mw.text.trim(langcode or "")
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langcode = mw.getCurrentFrame():callParserFunction('int', {'lang'})
if mw.language.isKnownLanguageTag(langcode) then
langobj = mw.language.new( langcode )
else
langobj = mw.language.getContentLanguage()
end
end
return langobj
end
-------------------------------------------------------------------------------
-- _getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getItemLangCode = function(qid)
qid = mw.text.trim(qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local prop17 = mw.wikibase.getBestStatements(qid, "P17")[1]
if not prop17 or prop17.mainsnak.snaktype ~= "value" then return end
local qid17 = prop17.mainsnak.datavalue.value.id
local prop37 = mw.wikibase.getBestStatements(qid17, "P37")[1]
if not prop37 or prop37.mainsnak.snaktype ~= "value" then return end
local qid37 = prop37.mainsnak.datavalue.value.id
local prop424 = mw.wikibase.getBestStatements(qid37, "P424")[1]
if not prop424 or prop424.mainsnak.snaktype ~= "value" then return end
return prop424.mainsnak.datavalue.value
end
-------------------------------------------------------------------------------
-- roundto takes a number (x)
-- and returns it rounded to (sf) significant figures
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local roundto = function(x, sf)
if x == 0 then return 0 end
local s = 1
if x < 0 then
x = -x
s = -1
end
if sf < 1 then sf = 1 end
local p = 10 ^ (math.floor(math.log10(x)) - sf + 1)
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
return x
end
-------------------------------------------------------------------------------
-- decimalToDMS takes a decimal degrees (x) with precision (p)
-- and returns degrees/minutes/seconds according to the precision
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalToDMS = function(x, p)
-- if p is not supplied, use a precision around 0.1 seconds
if not tonumber(p) then p = 1e-4 end
local d = math.floor(x)
local ms = (x - d) * 60
if p > 0.5 then -- precision is > 1/2 a degree
if ms > 30 then d = d + 1 end
ms = 0
end
local m = math.floor(ms)
local s = (ms - m) * 60
if p > 0.008 then -- precision is > 1/2 a minute
if s > 30 then m = m +1 end
s = 0
elseif p > 0.00014 then -- precision is > 1/2 a second
s = math.floor(s + 0.5)
elseif p > 0.000014 then -- precision is > 1/20 second
s = math.floor(10 * s + 0.5) / 10
elseif p > 0.0000014 then -- precision is > 1/200 second
s = math.floor(100 * s + 0.5) / 100
else -- cap it at 3 dec places for now
s = math.floor(1000 * s + 0.5) / 1000
end
return d, m, s
end
-------------------------------------------------------------------------------
-- decimalPrecision takes a decimal (x) with precision (p)
-- and returns x rounded approximately to the given precision
-- precision should be between 1 and 1e-6, preferably a power of 10.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local decimalPrecision = function(x, p)
local s = 1
if x < 0 then
x = -x
s = -1
end
-- if p is not supplied, pick an arbitrary precision
if not tonumber(p) then p = 1e-4
elseif p > 1 then p = 1
elseif p < 1e-6 then p = 1e-6
else p = 10 ^ math.floor(math.log10(p))
end
x = math.floor(x / p + 0.5) * p * s
-- if it's integral, cast to an integer:
if x == math.floor(x) then x = math.floor(x) end
-- if it's less than 1e-4, it will be in exponent form, so return a string with 6dp
-- 9e-5 becomes 0.000090
if math.abs(x) < 1e-4 then x = string.format("%f", x) end
return x
end
-------------------------------------------------------------------------------
-- formatDate takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues
-- like "1 August 30 BCE" as parameter 1
-- and formats it according to the df (date format) and bc parameters
-- df = ["dmy" / "mdy" / "y"] default will be "dmy"
-- bc = ["BC" / "BCE"] default will be "BCE"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local format_Date = function(datetime, dateformat, bc)
local datetime = datetime or "1 August 30 BCE" -- in case of nil value
-- chop off multiple vales and/or any hours, mins, etc.
-- keep anything before punctuation - we just want a single date:
local dateval = string.match( datetime, "[%w ]+")
local dateformat = string.lower(dateformat or "dmy") -- default to dmy
local bc = string.upper(bc or "") -- can't use nil for bc
-- we only want to accept two possibilities: BC or default to BCE
if bc == "BC" then
bc = " " .. i18n["BC"] -- prepend a non-breaking space.
else
bc = " " .. i18n["BCE"]
end
local postchrist = true -- start by assuming no BCE
local dateparts = {}
for word in string.gmatch(dateval, "%w+") do
if word == "BCE" or word == "BC" then -- *** internationalise later ***
postchrist = false
else
-- we'll keep the parts that are not 'BCE' in a table
dateparts[#dateparts + 1] = word
end
end
if postchrist then bc = "" end -- set AD dates to no suffix *** internationalise later ***
local sep = " " -- separator is nbsp
local fdate = table.concat(dateparts, sep) -- set formatted date to same order as input
-- if we have day month year, check dateformat
if #dateparts == 3 then
if dateformat == "y" then
fdate = dateparts[3]
elseif dateformat == "mdy" then
fdate = dateparts[2] .. sep .. dateparts[1] .. "," .. sep .. dateparts[3]
end
elseif #dateparts == 2 and dateformat == "y" then
fdate = dateparts[2]
end
return fdate .. bc
end
-------------------------------------------------------------------------------
-- dateFormat is the handler for properties that are of type "time"
-- It takes timestamp, precision (6 to 11 per mediawiki), dateformat (y/dmy/mdy), BC format (BC/BCE),
-- a plaindate switch (yes/no/adj) to en/disable "sourcing circumstances"/use adjectival form,
-- any qualifiers for the property, the language, and any adjective to use like 'before'.
-- It passes the date through the "complex date" function
-- and returns a string with the internatonalised date formatted according to preferences.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); cdate(); dp[]
-------------------------------------------------------------------------------
local dateFormat = function(timestamp, dprec, df, bcf, pd, qualifiers, lang, adj, model)
-- output formatting according to preferences (y/dmy/mdy/ymd)
df = (df or ""):lower()
-- if ymd is required, return the part of the timestamp in YYYY-MM-DD form
-- but apply Year zero#Astronomers fix: 1 BC = 0000; 2 BC = -0001; etc.
if df == "ymd" then
if timestamp:sub(1,1) == "+" then
return timestamp:sub(2,11)
else
local yr = tonumber(timestamp:sub(2,5)) - 1
yr = ("000" .. yr):sub(-4)
if yr ~= "0000" then yr = "-" .. yr end
return yr .. timestamp:sub(6,11)
end
end
-- A year can be stored like this: "+1872-00-00T00:00:00Z",
-- which is processed here as if it were the day before "+1872-01-01T00:00:00Z",
-- and that's the last day of 1871, so the year is wrong.
-- So fix the month 0, day 0 timestamp to become 1 January instead:
timestamp = timestamp:gsub("%-00%-00T", "-01-01T")
-- just in case date precision is missing
dprec = dprec or 11
-- override more precise dates if required dateformat is year alone:
if df == "y" and dprec > 9 then dprec = 9 end
-- complex date only deals with precisions from 6 to 11, so clip range
dprec = dprec>11 and 11 or dprec
dprec = dprec<6 and 6 or dprec
-- BC format is "BC" or "BCE"
bcf = (bcf or ""):upper()
-- plaindate only needs the first letter (y/n/a)
pd = (pd or ""):sub(1,1):lower()
if pd == "" or pd == "n" or pd == "f" or pd == "0" then pd = false end
-- in case language isn't passed
lang = lang or findLang().code
-- set adj as empty if nil
adj = adj or ""
-- extract the day, month, year from the timestamp
local bc = timestamp:sub(1, 1)=="-" and "BC" or ""
local year, month, day = timestamp:match("[+-](%d*)-(%d*)-(%d*)T")
local iso = tonumber(year) -- if year is missing, let it throw an error
-- this will adjust the date format to be compatible with cdate
-- possible formats are Y, YY, YYY0, YYYY, YYYY-MM, YYYY-MM-DD
if dprec == 6 then iso = math.floor( (iso - 1) / 1000 ) + 1 end
if dprec == 7 then iso = math.floor( (iso - 1) / 100 ) + 1 end
if dprec == 8 then iso = math.floor( iso / 10 ) .. "0" end
if dprec == 10 then iso = year .. "-" .. month end
if dprec == 11 then iso = year .. "-" .. month .. "-" .. day end
-- add "circa" (Q5727902) from "sourcing circumstances" (P1480)
local sc = not pd and qualifiers and qualifiers.P1480
if sc then
for k1, v1 in pairs(sc) do
if v1.datavalue and v1.datavalue.value.id == "Q5727902" then
adj = "circa"
break
end
end
end
-- deal with Julian dates:
-- no point in saying that dates before 1582 are Julian - they are by default
-- doesn't make sense for dates less precise than year
-- we can suppress it by setting |plaindate, e.g. for use in constructing categories.
local calendarmodel = ""
if tonumber(year) > 1582
and dprec > 8
and not pd
and model == "http://www.wikidata.org/entity/Q1985786" then
calendarmodel = "julian"
end
if not cdate then
cdate = require("Module:Complex date")._complex_date
end
local fdate = cdate(calendarmodel, adj, tostring(iso), dp[dprec], bc, "", "", "", "", lang, 1)
-- this may have QuickStatements info appended to it in a div, so remove that
fdate = fdate:gsub(' <div style="display: none;">[^<]*</div>', '')
-- it may also be returned wrapped in a microformat, so remove that
fdate = fdate:gsub("<[^>]*>", "")
-- there may be leading zeros that we should remove
fdate = fdate:gsub("^0*", "")
-- if a plain date is required, then remove any links (like BC linked)
if pd then
fdate = fdate:gsub("%[%[.*|", ""):gsub("]]", "")
end
-- if 'circa', use the abbreviated form *** internationalise later ***
fdate = fdate:gsub('circa ', '<abbr title="circa">c.</abbr> ')
-- deal with BC/BCE
if bcf == "BCE" then
fdate = fdate:gsub('BC', 'BCE')
end
-- deal with mdy format
if df == "mdy" then
fdate = fdate:gsub("(%d+) (%w+) (%d+)", "%2 %1, %3")
end
-- deal with adjectival form *** internationalise later ***
if pd == "a" then
fdate = fdate:gsub(' century', '-century')
end
return fdate
end
-------------------------------------------------------------------------------
-- parseParam takes a (string) parameter, e.g. from the list of frame arguments,
-- and makes "false", "no", and "0" into the (boolean) false
-- it makes the empty string and nil into the (boolean) value passed as default
-- allowing the parameter to be true or false by default.
-- It returns a boolean.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseParam = function(param, default)
if type(param) == "boolean" then param = tostring(param) end
if param and param ~= "" then
param = param:lower()
if (param == "false") or (param:sub(1,1) == "n") or (param == "0") then
return false
else
return true
end
else
return default
end
end
-------------------------------------------------------------------------------
-- _getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local _getSitelink = function(qid, wiki)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
wiki = wiki or ""
local sitelink
if wiki == "" then
sitelink = mw.wikibase.getSitelink(qid)
else
sitelink = mw.wikibase.getSitelink(qid, wiki)
end
return sitelink
end
-------------------------------------------------------------------------------
-- _getCommonslink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the Wikidata entity - but not if onlycat=true and it's not a category;
-- the Commons sitelink of the topic's main category of the Wikidata entity;
-- the Commons category of the Wikidata entity - unless fallback=false.
-------------------------------------------------------------------------------
-- Dependencies: _getSitelink(); parseParam()
-------------------------------------------------------------------------------
local _getCommonslink = function(qid, onlycat, fallback)
qid = (qid or ""):upper()
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
onlycat = parseParam(onlycat, false)
if fallback == "" then fallback = nil end
local sitelink = _getSitelink(qid, "commonswiki")
if onlycat and sitelink and sitelink:sub(1,9) ~= "Category:" then sitelink = nil end
if not sitelink then
-- check for topic's main category
local prop910 = mw.wikibase.getBestStatements(qid, "P910")[1]
if prop910 then
local tmcid = prop910.mainsnak.datavalue and prop910.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
if not sitelink then
-- check for list's main category
local prop1754 = mw.wikibase.getBestStatements(qid, "P1754")[1]
if prop1754 then
local tmcid = prop1754.mainsnak.datavalue and prop1754.mainsnak.datavalue.value.id
sitelink = _getSitelink(tmcid, "commonswiki")
end
end
end
if not sitelink and fallback then
-- check for Commons category (string value)
local prop373 = mw.wikibase.getBestStatements(qid, "P373")[1]
if prop373 then
sitelink = prop373.mainsnak.datavalue and prop373.mainsnak.datavalue.value
if sitelink then sitelink = "Category:" .. sitelink end
end
end
return sitelink
end
-------------------------------------------------------------------------------
-- The label in a Wikidata item is subject to vulnerabilities
-- that an attacker might try to exploit.
-- It needs to be 'sanitised' by removing any wikitext before use.
-- If it doesn't exist, return the id for the item
-- a second (boolean) value is also returned, value is true when the label exists
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local labelOrId = function(id, lang)
if lang == "default" then lang = findLang().code end
local label
if lang then
label = mw.wikibase.getLabelByLang(id, lang)
else
label = mw.wikibase.getLabel(id)
end
if label then
return mw.text.nowiki(label), true
else
return id, false
end
end
-------------------------------------------------------------------------------
-- linkedItem takes an entity-id and returns a string, linked if possible.
-- This is the handler for "wikibase-item". Preferences:
-- 1. Display linked disambiguated sitelink if it exists
-- 2. Display linked label if it is a redirect
-- 3. TBA: Display an inter-language link for the label if it exists other than in default language
-- 4. Display unlinked label if it exists
-- 5. Display entity-id for now to indicate a label could be provided
-- dtxt is text to be used instead of label, or nil.
-- shortname is boolean switch to use P1813 (short name) instead of label if true.
-- lang is the current language code.
-- uselbl is boolean switch to force display of the label instead of the sitelink (default: false)
-- linkredir is boolean switch to allow linking to a redirect (default: false)
-- formatvalue is boolean switch to allow formatting as italics or quoted (default: false)
-------------------------------------------------------------------------------
-- Dependencies: labelOrId(); donotlink[]
-------------------------------------------------------------------------------
local linkedItem = function(id, args)
local lprefix = (args.lp or args.lprefix or args.linkprefix or ""):gsub('"', '') -- toughen against nil values passed
local lpostfix = (args.lpostfix or ""):gsub('"', '')
local prefix = (args.prefix or ""):gsub('"', '')
local postfix = (args.postfix or ""):gsub('"', '')
local dtxt = args.dtxt
local shortname = args.shortname or args.sn
local lang = args.lang or "en" -- fallback to default if missing
local uselbl = args.uselabel or args.uselbl
uselbl = parseParam(uselbl, false)
local linkredir = args.linkredir
linkredir = parseParam(linkredir, false)
local formatvalue = args.formatvalue or args.fv
formatvalue = parseParam(formatvalue, false)
-- see if item might need italics or quotes
local fmt = ""
if next(formats) and formatvalue then
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P31") ) do
if v.mainsnak.datavalue and formats[v.mainsnak.datavalue.value.id] then
fmt = formats[v.mainsnak.datavalue.value.id]
break -- pick the first match
end
end
end
local disp
local sitelink = mw.wikibase.getSitelink(id)
local label, islabel
if dtxt then
label, islabel = dtxt, true
elseif shortname then
-- see if there is a shortname in our language, and set label to it
for k, v in ipairs( mw.wikibase.getBestStatements(id, "P1813") ) do
if v.mainsnak.datavalue.value.language == lang then
label, islabel = v.mainsnak.datavalue.value.text, true
break
end -- test for language match
end -- loop through values of short name
-- if we have no label set, then there was no shortname available
if not islabel then
label, islabel = labelOrId(id)
shortname = false
end
else
label, islabel = labelOrId(id)
end
if mw.site.siteName ~= "Wikimedia Commons" then
if sitelink then
if not (dtxt or shortname) then
-- if sitelink and label are the same except for case, no need to process further
if sitelink:lower() ~= label:lower() then
-- strip any namespace or dab from the sitelink
local pos = sitelink:find(":") or 0
local slink = sitelink
if pos > 0 then
local pfx = sitelink:sub(1,pos-1)
if mw.site.namespaces[pfx] then -- that prefix is a valid namespace, so remove it
slink = sitelink:sub(pos+1)
end
end
-- remove stuff after commas or inside parentheses - ie. dabs
slink = slink:gsub("%s%(.+%)$", ""):gsub(",.+$", "")
-- if uselbl is false, use sitelink instead of label
if not uselbl then
-- use slink as display, preserving label case - find("^%u") is true for 1st char uppercase
if label:find("^%u") then
label = slink:gsub("^(%l)", string.upper)
else
label = slink:gsub("^(%u)", string.lower)
end
end
end
end
if donotlink[label] then
disp = prefix .. fmt .. label .. fmt .. postfix
else
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
elseif islabel then
-- no sitelink, label exists, so check if a redirect with that title exists, if linkredir is true
-- display plain label by default
disp = prefix .. fmt .. label .. fmt .. postfix
if linkredir then
local artitle = mw.title.new(label, 0) -- only nil if label has invalid chars
if not donotlink[label] and artitle and artitle.redirectTarget then
-- there's a redirect with the same title as the label, so let's link to that
disp = "[[".. lprefix .. label .. lpostfix .. "|" .. prefix .. fmt .. label .. fmt .. postfix .. "]]"
end
end -- test if article title exists as redirect on current Wiki
else
-- no sitelink and no label, so return whatever was returned from labelOrId for now
-- add tracking category [[Category:Articles with missing Wikidata information]]
-- for enwiki, just return the tracking category
if mw.wikibase.getGlobalSiteId() == "enwiki" then
disp = i18n.missinginfocat
else
disp = prefix .. label .. postfix .. i18n.missinginfocat
end
end
else
local ccat = mw.wikibase.getBestStatements(id, "P373")[1]
if ccat and ccat.mainsnak.datavalue then
ccat = ccat.mainsnak.datavalue.value
disp = "[[" .. lprefix .. "Category:" .. ccat .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
elseif sitelink then
-- this asumes that if a sitelink exists, then a label also exists
disp = "[[" .. lprefix .. sitelink .. lpostfix .. "|" .. prefix .. label .. postfix .. "]]"
else
-- no sitelink and no Commons cat, so return label from labelOrId for now
disp = prefix .. label .. postfix
end
end
return disp
end
-------------------------------------------------------------------------------
-- sourced takes a table representing a statement that may or may not have references
-- it looks for a reference sourced to something not containing the word "wikipedia"
-- it returns a boolean = true if it finds a sourced reference.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local sourced = function(claim)
if claim.references then
for kr, vr in pairs(claim.references) do
local ref = mw.wikibase.renderSnaks(vr.snaks)
if not ref:find("Wiki") then
return true
end
end
end
end
-------------------------------------------------------------------------------
-- setRanks takes a flag (parameter passed) that requests the values to return
-- "b[est]" returns preferred if available, otherwise normal
-- "p[referred]" returns preferred
-- "n[ormal]" returns normal
-- "d[eprecated]" returns deprecated
-- multiple values are allowed, e.g. "preferred normal" (which is the default)
-- "best" will override the other flags, and set p and n
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local setRanks = function(rank)
rank = (rank or ""):lower()
-- if nothing passed, return preferred and normal
-- if rank == "" then rank = "p n" end
local ranks = {}
for w in string.gmatch(rank, "%a+") do
w = w:sub(1,1)
if w == "b" or w == "p" or w == "n" or w == "d" then
ranks[w] = true
end
end
-- check if "best" is requested or no ranks requested; and if so, set preferred and normal
if ranks.b or not next(ranks) then
ranks.p = true
ranks.n = true
end
return ranks
end
-------------------------------------------------------------------------------
-- parseInput processes the Q-id , the blacklist and the whitelist
-- if an input parameter is supplied, it returns that and ends the call.
-- it returns (1) either the qid or nil indicating whether or not the call should continue
-- and (2) a table containing all of the statements for the propertyID and relevant Qid
-- if "best" ranks are requested, it returns those instead of all non-deprecated ranks
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
local parseInput = function(frame, input_parm, property_id)
-- There may be a local parameter supplied, if it's blank, set it to nil
input_parm = mw.text.trim(input_parm or "")
if input_parm == "" then input_parm = nil end
-- return nil if Wikidata is not available
if not mw.wikibase then return false, input_parm end
local args = frame.args
-- can take a named parameter |qid which is the Wikidata ID for the article.
-- if it's not supplied, use the id for the current page
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
-- if there's no Wikidata item for the current page return nil
if not qid then return false, input_parm end
-- The blacklist is passed in named parameter |suppressfields
local blacklist = args.suppressfields or args.spf or ""
-- The whitelist is passed in named parameter |fetchwikidata
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
-- The name of the field that this function is called from is passed in named parameter |name
local fieldname = args.name or ""
if blacklist ~= "" then
-- The name is compulsory when blacklist is used, so return nil if it is not supplied
if fieldname == "" then return false, nil end
-- If this field is on the blacklist, then return nil
if blacklist:find(fieldname) then return false, nil end
end
-- If we got this far then we're not on the blacklist
-- The blacklist overrides any locally supplied parameter as well
-- If a non-blank input parameter was supplied return it
if input_parm then return false, input_parm end
-- We can filter out non-valid properties
if property_id:sub(1,1):upper() ~="P" or property_id == "P0" then return false, nil end
-- Otherwise see if this field is on the whitelist:
-- needs a bit more logic because find will return its second value = 0 if fieldname is ""
-- but nil if fieldname not found on whitelist
local _, found = whitelist:find(fieldname)
found = ((found or 0) > 0)
if whitelist ~= 'ALL' and (whitelist:upper() == "NONE" or not found) then
return false, nil
end
-- See what's on Wikidata (the call always returns a table, but it may be empty):
local props = {}
if args.reqranks.b then
props = mw.wikibase.getBestStatements(qid, property_id)
else
props = mw.wikibase.getAllStatements(qid, property_id)
end
if props[1] then
return qid, props
end
-- no property on Wikidata
return false, nil
end
-------------------------------------------------------------------------------
-- createicon assembles the "Edit at Wikidata" pen icon.
-- It returns a wikitext string inside a span class="penicon"
-- if entityID is nil or empty, the ID associated with current page is used
-- langcode and propertyID may be nil or empty
-------------------------------------------------------------------------------
-- Dependencies: i18n[];
-------------------------------------------------------------------------------
local createicon = function(langcode, entityID, propertyID)
langcode = langcode or ""
if not entityID or entityID == "" then entityID= mw.wikibase.getEntityIdForCurrentPage() end
propertyID = propertyID or ""
local icon = " <span class='penicon autoconfirmed-show'>[["
-- " <span data-bridge-edit-flow='overwrite' class='penicon'>[[" -> enable Wikidata Bridge
.. i18n["filespace"]
.. ":OOjs UI icon edit-ltr-progressive.svg |frameless |text-top |10px |alt="
.. i18n["editonwikidata"]
.. "|link=https://www.wikidata.org/wiki/" .. entityID
if langcode ~= "" then icon = icon .. "?uselang=" .. langcode end
if propertyID ~= "" then icon = icon .. "#" .. propertyID end
icon = icon .. "|" .. i18n["editonwikidata"] .. "]]</span>"
return icon
end
-------------------------------------------------------------------------------
-- assembleoutput takes the sequence table containing the property values
-- and formats it according to switches given. It returns a string or nil.
-- It uses the entityID (and optionally propertyID) to create a link in the pen icon.
-------------------------------------------------------------------------------
-- Dependencies: parseParam();
-------------------------------------------------------------------------------
local assembleoutput = function(out, args, entityID, propertyID)
-- sorted is a boolean passed to enable sorting of the values returned
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local sorted = parseParam(args.sorted, false)
-- noicon is a boolean passed to suppress the trailing "edit at Wikidata" icon
-- for use when the value is processed further by the infobox
-- if nothing or an empty string is passed set it false
-- if "false" or "no" or "0" is passed set it false
local noic = parseParam(args.noicon, false)
-- list is the name of a template that a list of multiple values is passed through
-- examples include "hlist" and "ubl"
-- setting it to "prose" produces something like "1, 2, 3, and 4"
local list = args.list or ""
-- sep is a string that is used to separate multiple returned values
-- if nothing or an empty string is passed set it to the default
-- any double-quotes " are stripped out, so that spaces may be passed
-- e.g. |sep=" - "
local sepdefault = i18n["list separator"]
local separator = args.sep or ""
separator = string.gsub(separator, '"', '')
if separator == "" then
separator = sepdefault
end
-- collapse is a number that determines the maximum number of returned values
-- before the output is collapsed.
-- Zero or not a number result in no collapsing (default becomes 0).
local collapse = tonumber(args.collapse) or 0
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
-- if there's anything to return, then return a list
-- comma-separated by default, but may be specified by the sep parameter
-- optionally specify a hlist or ubl or a prose list, etc.
local strout
if #out > 0 then
if sorted then table.sort(out) end
-- if there's something to display and a pen icon is wanted, add it the end of the last value
local hasdisplay = false
for i, v in ipairs(out) do
if v ~= i18n.missinginfocat then
hasdisplay = true
break
end
end
if not noic and hasdisplay then
out[#out] = out[#out] .. createicon(args.langobj.code, entityID, propertyID)
end
if list == "" then
strout = table.concat(out, separator)
elseif list:lower() == "prose" then
strout = mw.text.listToText( out )
else
strout = mw.getCurrentFrame():expandTemplate{title = list, args = out}
end
if collapse >0 and #out > collapse then
strout = collapsediv .. strout .. "</div>"
end
else
strout = nil -- no items had valid reference
end
if replacetext ~= "" and strout then strout = replacetext end
return strout
end
-------------------------------------------------------------------------------
-- rendersnak takes a table (propval) containing the information stored on one property value
-- and returns the value as a string and its language if monolingual text.
-- It handles data of type:
-- wikibase-item
-- time
-- string, url, commonsMedia, external-id
-- quantity
-- globe-coordinate
-- monolingualtext
-- It also requires linked, the link/pre/postfixes, uabbr, and the arguments passed from frame.
-- The optional filter parameter allows quantities to be be filtered by unit Qid.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); labelOrId(); i18n[]; dateFormat();
-- roundto(); decimalPrecision(); decimalToDMS(); linkedItem();
-------------------------------------------------------------------------------
local rendersnak = function(propval, args, linked, lpre, lpost, pre, post, uabbr, filter)
lpre = lpre or ""
lpost = lpost or ""
pre = pre or ""
post = post or ""
args.lang = args.lang or findLang().code
-- allow values to display a fixed text instead of label
local dtxt = args.displaytext or args.dt
if dtxt == "" then dtxt = nil end
-- switch to use display of short name (P1813) instead of label
local shortname = args.shortname or args.sn
shortname = parseParam(shortname, false)
local snak = propval.mainsnak or propval
local dtype = snak.datatype
local dv = snak.datavalue
dv = dv and dv.value
-- value and monolingual text language code returned
local val, mlt
if propval.rank and not args.reqranks[propval.rank:sub(1, 1)] then
-- val is nil: value has a rank that isn't requested
------------------------------------
elseif snak.snaktype == "somevalue" then -- value is unknown
val = i18n["Unknown"]
------------------------------------
elseif snak.snaktype == "novalue" then -- value is none
-- val = "No value" -- don't return anything
------------------------------------
elseif dtype == "wikibase-item" then -- data type is a wikibase item:
-- it's wiki-linked value, so output as link if enabled and possible
local qnumber = dv.id
if linked then
val = linkedItem(qnumber, args)
else -- no link wanted so check for display-text, otherwise test for lang code
local label, islabel
if dtxt then
label = dtxt
else
label, islabel = labelOrId(qnumber)
local langlabel = mw.wikibase.getLabelByLang(qnumber, args.lang)
if langlabel then
label = mw.text.nowiki( langlabel )
end
end
val = pre .. label .. post
end -- test for link required
------------------------------------
elseif dtype == "time" then -- data type is time:
-- time is in timestamp format
-- date precision is integer per mediawiki
-- output formatting according to preferences (y/dmy/mdy)
-- BC format as BC or BCE
-- plaindate is passed to disable looking for "sourcing cirumstances"
-- or to set the adjectival form
-- qualifiers (if any) is a nested table or nil
-- lang is given, or user language, or site language
--
-- Here we can check whether args.df has a value
-- If not, use code from Module:Sandbox/RexxS/Getdateformat to set it from templates like {{Use mdy dates}}
val = dateFormat(dv.time, dv.precision, args.df, args.bc, args.pd, propval.qualifiers, args.lang, "", dv.calendarmodel)
------------------------------------
-- data types which are strings:
elseif dtype == "commonsMedia" or dtype == "external-id" or dtype == "string" or dtype == "url" then
-- commonsMedia or external-id or string or url
-- all have mainsnak.datavalue.value as string
if (lpre == "" or lpre == ":") and lpost == "" then
-- don't link if no linkpre/postfix or linkprefix is just ":"
val = pre .. dv .. post
elseif dtype == "external-id" then
val = "[" .. lpre .. dv .. lpost .. " " .. pre .. dv .. post .. "]"
else
val = "[[" .. lpre .. dv .. lpost .. "|" .. pre .. dv .. post .. "]]"
end -- check for link requested (i.e. either linkprefix or linkpostfix exists)
------------------------------------
-- data types which are quantities:
elseif dtype == "quantity" then
-- quantities have mainsnak.datavalue.value.amount and mainsnak.datavalue.value.unit
-- the unit is of the form http://www.wikidata.org/entity/Q829073
--
-- implement a switch to turn on/off numerical formatting later
local fnum = true
--
-- a switch to turn on/off conversions - only for en-wiki
local conv = parseParam(args.conv or args.convert, false)
-- if we have conversions, we won't have formatted numbers or scales
if conv then
uabbr = true
fnum = false
args.scale = "0"
end
--
-- a switch to turn on/off showing units, default is true
local showunits = parseParam(args.su or args.showunits, true)
--
-- convert amount to a number
local amount = tonumber(dv.amount) or i18n["NaN"]
--
-- scale factor for millions, billions, etc.
local sc = tostring(args.scale or ""):sub(1,1):lower()
local scale
if sc == "a" then
-- automatic scaling
if amount > 1e15 then
scale = 12
elseif amount > 1e12 then
scale = 9
elseif amount > 1e9 then
scale = 6
elseif amount > 1e6 then
scale = 3
else
scale = 0
end
else
scale = tonumber(args.scale) or 0
if scale < 0 or scale > 12 then scale = 0 end
scale = math.floor(scale/3) * 3
end
local factor = 10^scale
amount = amount / factor
-- ranges:
local range = ""
-- check if upper and/or lower bounds are given and significant
local upb = tonumber(dv.upperBound)
local lowb = tonumber(dv.lowerBound)
if upb and lowb then
-- differences rounded to 2 sig fig:
local posdif = roundto(upb - amount, 2) / factor
local negdif = roundto(amount - lowb, 2) / factor
upb, lowb = amount + posdif, amount - negdif
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
if posdif ~= negdif then
-- non-symmetrical
range = " +" .. posdif .. " -" .. negdif
elseif posdif ~= 0 then
-- symmetrical and non-zero
range = " ±" .. posdif
else
-- otherwise range is zero, so leave it as ""
end
else
-- round scaled numbers to integers or 4 sig fig
if (scale > 0 or sc == "a") then
if amount < 1e4 then
amount = roundto(amount, 4)
else
amount = math.floor(amount + 0.5)
end
end
if fnum then amount = args.langobj:formatNum( amount ) end
end
-- unit names and symbols:
-- extract the qid in the form 'Qnnn' from the value.unit url
-- and then fetch the label from that - or symbol if unitabbr is true
local unit = ""
local usep = ""
local usym = ""
local unitqid = string.match( dv.unit, "(Q%d+)" )
if filter and unitqid ~= filter then return nil end
if unitqid and showunits then
local uname = mw.wikibase.getLabelByLang(unitqid, args.lang) or ""
if uname ~= "" then usep, unit = " ", uname end
if uabbr then
-- see if there's a unit symbol (P5061)
local unitsymbols = mw.wikibase.getBestStatements(unitqid, "P5061")
-- construct fallback table, add local lang and multiple languages
local fbtbl = mw.language.getFallbacksFor( args.lang )
table.insert( fbtbl, 1, args.lang )
table.insert( fbtbl, 1, "mul" )
local found = false
for idx1, us in ipairs(unitsymbols) do
for idx2, fblang in ipairs(fbtbl) do
if us.mainsnak.datavalue.value.language == fblang then
usym = us.mainsnak.datavalue.value.text
found = true
break
end
if found then break end
end -- loop through fallback table
end -- loop through values of P5061
if found then usep, unit = " ", usym end
end
end
-- format display:
if conv then
if range == "" then
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {amount, unit}}
else
val = mw.getCurrentFrame():expandTemplate{title = "cvt", args = {lowb, "to", upb, unit}}
end
elseif unit == "$" or unit == "£" then
val = unit .. amount .. range .. i18n.multipliers[scale]
else
val = amount .. range .. i18n.multipliers[scale] .. usep .. unit
end
------------------------------------
-- datatypes which are global coordinates:
elseif dtype == "globe-coordinate" then
-- 'display' parameter defaults to "inline, title" *** unused for now ***
-- local disp = args.display or ""
-- if disp == "" then disp = "inline, title" end
--
-- format parameter switches from deg/min/sec to decimal degrees
-- default is deg/min/sec -- decimal degrees needs |format = dec
local form = (args.format or ""):lower():sub(1,3)
if form ~= "dec" then form = "dms" end -- not needed for now
--
-- show parameter allows just the latitude, or just the longitude, or both
-- to be returned as a signed decimal, ignoring the format parameter.
local show = (args.show or ""):lower()
if show ~= "longlat" then show = show:sub(1,3) end
--
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
if show == "lat" then
val = decimalPrecision(lat, prec)
elseif show == "lon" then
val = decimalPrecision(long, prec)
elseif show == "longlat" then
val = decimalPrecision(long, prec) .. ", " .. decimalPrecision(lat, prec)
else
local ns = "N"
local ew = "E"
if lat < 0 then
ns = "S"
lat = - lat
end
if long < 0 then
ew = "W"
long = - long
end
if form == "dec" then
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
val = lat .. "°" .. ns .. " " .. long .. "°" .. ew
else
local latdeg, latmin, latsec = decimalToDMS(lat, prec)
local longdeg, longmin, longsec = decimalToDMS(long, prec)
if latsec == 0 and longsec == 0 then
if latmin == 0 and longmin == 0 then
val = latdeg .. "°" .. ns .. " " .. longdeg .. "°" .. ew
else
val = latdeg .. "°" .. latmin .. "′" .. ns .. " "
val = val .. longdeg .. "°".. longmin .. "′" .. ew
end
else
val = latdeg .. "°" .. latmin .. "′" .. latsec .. "″" .. ns .. " "
val = val .. longdeg .. "°" .. longmin .. "′" .. longsec .. "″" .. ew
end
end
end
------------------------------------
elseif dtype == "monolingualtext" then -- data type is Monolingual text:
-- has mainsnak.datavalue.value as a table containing language/text pairs
-- collect all the values in 'out' and languages in 'mlt' and process them later
val = pre .. dv.text .. post
mlt = dv.language
------------------------------------
else
-- some other data type so write a specific handler
val = "unknown data type: " .. dtype
end -- of datatype/unknown value/sourced check
return val, mlt
end
-------------------------------------------------------------------------------
-- propertyvalueandquals takes a property object, the arguments passed from frame,
-- and a qualifier propertyID.
-- It returns a sequence (table) of values representing the values of that property
-- and qualifiers that match the qualifierID if supplied.
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); sourced(); labelOrId(); i18n.latestdatequalifier(); format_Date();
-- makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS(); assembleoutput();
-------------------------------------------------------------------------------
local function propertyvalueandquals(objproperty, args, qualID)
-- needs this style of declaration because it's re-entrant
-- onlysourced is a boolean passed to return only values sourced to other than Wikipedia
-- if nothing or an empty string is passed set it true
local onlysrc = parseParam(args.onlysourced or args.osd, true)
-- linked is a a boolean that enables the link to a local page via sitelink
-- if nothing or an empty string is passed set it true
local linked = parseParam(args.linked, true)
-- prefix is a string that may be nil, empty (""), or a string of characters
-- this is prefixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local prefix = (args.prefix or ""):gsub('"', '')
-- postfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local postfix = (args.postfix or ""):gsub('"', '')
-- linkprefix is a string that may be nil, empty (""), or a string of characters
-- this creates a link and is then prefixed to each value
-- useful when when multiple values are returned and indirect links are needed
-- any double-quotes " are stripped out, so that spaces may be passed
local lprefix = (args.linkprefix or args.lp or ""):gsub('"', '')
-- linkpostfix is a string that may be nil, empty (""), or a string of characters
-- this is postfixed to each value when linking is enabled with lprefix
-- useful when when multiple values are returned
-- any double-quotes " are stripped out, so that spaces may be passed
local lpostfix = (args.linkpostfix or ""):gsub('"', '')
-- wdlinks is a boolean passed to enable links to Wikidata when no article exists
-- if nothing or an empty string is passed set it false
local wdl = parseParam(args.wdlinks or args.wdl, false)
-- unitabbr is a boolean passed to enable unit abbreviations for common units
-- if nothing or an empty string is passed set it false
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
-- qualsonly is a boolean passed to return just the qualifiers
-- if nothing or an empty string is passed set it false
local qualsonly = parseParam(args.qualsonly or args.qo, false)
-- maxvals is a string that may be nil, empty (""), or a number
-- this determines how many items may be returned when multiple values are available
-- setting it = 1 is useful where the returned string is used within another call, e.g. image
local maxvals = tonumber(args.maxvals) or 0
-- pd (plain date) is a string: yes/true/1 | no/false/0 | adj
-- to disable/enable "sourcing cirumstances" or use adjectival form for the plain date
local pd = args.plaindate or args.pd or "no"
args.pd = pd
-- allow qualifiers to have a different date format; default to year unless qualsonly is set
args.qdf = args.qdf or args.qualifierdateformat or args.df or (not qualsonly and "y")
local lang = args.lang or findLang().code
-- qualID is a string list of wanted qualifiers or "ALL"
qualID = qualID or ""
-- capitalise list of wanted qualifiers and substitute "DATES"
qualID = qualID:upper():gsub("DATES", "P580, P582")
local allflag = (qualID == "ALL")
-- create table of wanted qualifiers as key
local qwanted = {}
-- create sequence of wanted qualifiers
local qorder = {}
for q in mw.text.gsplit(qualID, "%p") do -- split at punctuation and iterate
local qtrim = mw.text.trim(q)
if qtrim ~= "" then
qwanted[mw.text.trim(q)] = true
qorder[#qorder+1] = qtrim
end
end
-- qsep is the output separator for rendering qualifier list
local qsep = (args.qsep or ""):gsub('"', '')
-- qargs are the arguments to supply to assembleoutput()
local qargs = {
["osd"] = "false",
["linked"] = tostring(linked),
["prefix"] = args.qprefix,
["postfix"] = args.qpostfix,
["linkprefix"] = args.qlinkprefix or args.qlp,
["linkpostfix"] = args.qlinkpostfix,
["wdl"] = "false",
["unitabbr"] = tostring(uabbr),
["maxvals"] = 0,
["sorted"] = tostring(args.qsorted),
["noicon"] = "true",
["list"] = args.qlist,
["sep"] = qsep,
["langobj"] = args.langobj,
["lang"] = args.langobj.code,
["df"] = args.qdf,
["sn"] = parseParam(args.qsn or args.qshortname, false),
}
-- all proper values of a Wikidata property will be the same type as the first
-- qualifiers don't have a mainsnak, properties do
local datatype = objproperty[1].datatype or objproperty[1].mainsnak.datatype
-- out[] holds the a list of returned values for this property
-- mlt[] holds the language code if the datatype is monolingual text
local out = {}
local mlt = {}
for k, v in ipairs(objproperty) do
local hasvalue = true
if (onlysrc and not sourced(v)) then
-- no value: it isn't sourced when onlysourced=true
hasvalue = false
else
local val, lcode = rendersnak(v, args, linked, lprefix, lpostfix, prefix, postfix, uabbr)
if not val then
hasvalue = false -- rank doesn't match
elseif qualsonly and qualID then
-- suppress value returned: only qualifiers are requested
else
out[#out+1], mlt[#out+1] = val, lcode
end
end
-- See if qualifiers are to be returned:
local snak = v.mainsnak or v
if hasvalue and v.qualifiers and qualID ~= "" and snak.snaktype~="novalue" then
-- collect all wanted qualifier values returned in qlist, indexed by propertyID
local qlist = {}
local timestart, timeend = "", ""
-- loop through qualifiers
for k1, v1 in pairs(v.qualifiers) do
if allflag or qwanted[k1] then
if k1 == "P1326" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "before")
elseif k1 == "P1319" then
local ts = v1[1].datavalue.value.time
local dp = v1[1].datavalue.value.precision
qlist[k1] = dateFormat(ts, dp, args.qdf, args.bc, pd, "", lang, "after")
elseif k1 == "P580" then
timestart = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one start time as valid
elseif k1 == "P582" then
timeend = propertyvalueandquals(v1, qargs)[1] or "" -- treat only one end time as valid
else
local q = assembleoutput(propertyvalueandquals(v1, qargs), qargs)
-- we already deal with circa via 'sourcing circumstances' if the datatype was time
-- circa may be either linked or unlinked *** internationalise later ***
if datatype ~= "time" or q ~= "circa" and not (type(q) == "string" and q:find("circa]]")) then
qlist[k1] = q
end
end
end -- of test for wanted
end -- of loop through qualifiers
-- set date separator
local t = timestart .. timeend
-- *** internationalise date separators later ***
local dsep = "–"
if t:find("%s") or t:find(" ") then dsep = " – " end
-- set the order for the list of qualifiers returned; start time and end time go last
if next(qlist) then
local qlistout = {}
if allflag then
for k2, v2 in pairs(qlist) do
qlistout[#qlistout+1] = v2
end
else
for i2, v2 in ipairs(qorder) do
qlistout[#qlistout+1] = qlist[v2]
end
end
if t ~= "" then
qlistout[#qlistout+1] = timestart .. dsep .. timeend
end
local qstr = assembleoutput(qlistout, qargs)
if qualsonly then
out[#out+1] = qstr
else
out[#out] = out[#out] .. " (" .. qstr .. ")"
end
elseif t ~= "" then
if qualsonly then
if timestart == "" then
out[#out+1] = timeend
elseif timeend == "" then
out[#out+1] = timestart
else
out[#out+1] = timestart .. dsep .. timeend
end
else
out[#out] = out[#out] .. " (" .. timestart .. dsep .. timeend .. ")"
end
end
end -- of test for qualifiers wanted
if maxvals > 0 and #out >= maxvals then break end
end -- of for each value loop
-- we need to pick one value to return if the datatype was "monolingualtext"
-- if there's only one value, use that
-- otherwise look through the fallback languages for a match
if datatype == "monolingualtext" and #out >1 then
lang = mw.text.split( lang, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( lang )
table.insert( fbtbl, 1, lang )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return out
end
-------------------------------------------------------------------------------
-- Common code for p.getValueByQual and p.getValueByLang
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getvaluebyqual = function(frame, qualID, checkvalue)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
if propertyID == "" then return "no property supplied" end
if qualID == "" then return "no qualifier supplied" end
-- onlysourced is a boolean passed to return property values
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, args[2], propertyID)
local linked = parseParam(args.linked, true)
local lpre = (args.linkprefix or args.lp or ""):gsub('"', '')
local lpost = (args.linkpostfix or ""):gsub('"', '')
local pre = (args.prefix or ""):gsub('"', '')
local post = (args.postfix or ""):gsub('"', '')
local uabbr = parseParam(args.unitabbr or args.uabbr, false)
local filter = (args.unit or ""):upper()
local maxvals = tonumber(args.maxvals) or 0
if filter == "" then filter = nil end
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is "pronunciation audio (P443)" in propertyID
-- with a qualifier like "language of work or name (P407)" in qualID
-- whose value has the required ID, like "British English (Q7979)", in qval
for k1, v1 in ipairs(props) do
if v1.mainsnak.snaktype == "value" then
-- check if it has the right qualifier
local v1q = v1.qualifiers
if v1q and v1q[qualID] then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- so see if matches the required value
-- We'll only deal with wikibase-items and strings for now
if v1q[qualID][1].datatype == "wikibase-item" then
if checkvalue(v1q[qualID][1].datavalue.value.id) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
elseif v1q[qualID][1].datatype == "string" then
if checkvalue(v1q[qualID][1].datavalue.value) then
out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
else
return nil
end -- of check for string
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- _location takes Q-id and follows P276 (location)
-- or P131 (located in the administrative territorial entity) or P706 (located on terrain feature)
-- from the initial item to higher level territories/locations until it reaches the highest.
-- An optional boolean, 'first', determines whether the first item is returned (default: false).
-- An optional boolean 'skip' toggles the display to skip to the last item (default: false).
-- It returns a table containing the locations - linked where possible, except for the highest.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); labelOrId(); linkedItem
-------------------------------------------------------------------------------
local _location = function(qid, first, skip)
first = parseParam(first, false)
skip = parseParam(skip, false)
local locs = {"P276", "P131", "P706"}
local out = {}
local langcode = findLang():getCode()
local finished = false
local count = 0
local prevqid = "Q0"
repeat
local prop
for i1, v1 in ipairs(locs) do
local proptbl = mw.wikibase.getBestStatements(qid, v1)
if #proptbl > 1 then
-- there is more than one higher location
local prevP131, prevP131id
if prevqid ~= "Q0" then
prevP131 = mw.wikibase.getBestStatements(prevqid, "P131")[1]
prevP131id = prevP131
and prevP131.mainsnak.datavalue
and prevP131.mainsnak.datavalue.value.id
end
for i2, v2 in ipairs(proptbl) do
local parttbl = v2.qualifiers and v2.qualifiers.P518
if parttbl then
-- this higher location has qualifier 'applies to part' (P518)
for i3, v3 in ipairs(parttbl) do
if v3.snaktype == "value" and v3.datavalue.value.id == prevqid then
-- it has a value equal to the previous location
prop = proptbl[i2]
break
end -- of test for matching last location
end -- of loop through values of 'applies to part'
else
-- there's no qualifier 'applies to part' (P518)
-- so check if the previous location had a P131 that matches this alternate
if qid == prevP131id then
prop = proptbl[i2]
break
end -- of test for matching previous P131
end
end -- of loop through parent locations
-- fallback to second value if match not found
prop = prop or proptbl[2]
elseif #proptbl > 0 then
prop = proptbl[1]
end
if prop then break end
end
-- check if it's an instance of (P31) a country (Q6256) or sovereign state (Q3624078)
-- and terminate the chain if it is
local inst = mw.wikibase.getAllStatements(qid, "P31")
if #inst > 0 then
for k, v in ipairs(inst) do
local instid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
-- stop if it's a country (or a country within the United Kingdom if skip is true)
if instid == "Q6256" or instid == "Q3624078" or (skip and instid == "Q3336843") then
prop = nil -- this will ensure this is treated as top-level location
break
end
end
end
-- get the name of this location and update qid to point to the parent location
if prop and prop.mainsnak.datavalue then
if not skip or count == 0 then
local args = { lprefix = ":" }
out[#out+1] = linkedItem(qid, args) -- get a linked value if we can
end
qid, prevqid = prop.mainsnak.datavalue.value.id, qid
else
-- This is top-level location, so get short name except when this is the first item
-- Use full label if there's no short name or this is the first item
local prop1813 = mw.wikibase.getAllStatements(qid, "P1813")
-- if there's a short name and this isn't the only item
if prop1813[1] and (#out > 0)then
local shortname
-- short name is monolingual text, so look for match to the local language
-- choose the shortest 'short name' in that language
for k, v in pairs(prop1813) do
if v.mainsnak.datavalue.value.language == langcode then
local name = v.mainsnak.datavalue.value.text
if (not shortname) or (#name < #shortname) then
shortname = name
end
end
end
-- add the shortname if one is found, fallback to the label
-- but skip it if it's "USA"
if shortname ~= "USA" then
out[#out+1] = shortname or labelOrId(qid)
else
if skip then out[#out+1] = "US" end
end
else
-- no shortname, so just add the label
local loc = labelOrId(qid)
-- exceptions go here:
if loc == "United States of America" then
out[#out+1] = "United States"
else
out[#out+1] = loc
end
end
finished = true
end
count = count + 1
until finished or count >= 10 -- limit to 10 levels to avoid infinite loops
-- remove the first location if not required
if not first then table.remove(out, 1) end
-- we might have duplicate text for consecutive locations, so remove them
if #out > 2 then
local plain = {}
for i, v in ipairs(out) do
-- strip any links
plain[i] = v:gsub("^%[%[[^|]*|", ""):gsub("]]$", "")
end
local idx = 2
repeat
if plain[idx] == plain[idx-1] then
-- duplicate found
local removeidx = 0
if (plain[idx] ~= out[idx]) and (plain[idx-1] == out[idx-1]) then
-- only second one is linked, so drop the first
removeidx = idx - 1
elseif (plain[idx] == out[idx]) and (plain[idx-1] ~= out[idx-1]) then
-- only first one is linked, so drop the second
removeidx = idx
else
-- pick one
removeidx = idx - (os.time()%2)
end
table.remove(out, removeidx)
table.remove(plain, removeidx)
else
idx = idx +1
end
until idx >= #out
end
return out
end
-------------------------------------------------------------------------------
-- _getsumofparts scans the property 'has part' (P527) for values matching a list.
-- The list (args.vlist) consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifer 'quantity' (P1114), those quantites are summed.
-- The sum is returned as a number (i.e. 0 if none)
-- a table of arguments is supplied implementing the usual parameters.
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseParam; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
local _getsumofparts = function(args)
local vallist = (args.vlist or ""):upper()
if vallist == "" then return end
args.reqranks = setRanks(args.rank)
local f = {}
f.args = args
local qid, props = parseInput(f, "", "P527")
if not qid then return 0 end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local sum = 0
for k1, v1 in ipairs(props) do
if (onlysrc == false or sourced(v1))
and v1.mainsnak.snaktype == "value"
and v1.mainsnak.datavalue.type == "wikibase-entityid"
and vallist:match( v1.mainsnak.datavalue.value.id )
and v1.qualifiers
then
local quals = v1.qualifiers["P1114"]
if quals then
for k2, v2 in ipairs(quals) do
sum = sum + v2.datavalue.value.amount
end
end
end
end
return sum
end
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Public functions
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- _getValue makes the functionality of getValue available to other modules
-------------------------------------------------------------------------------
-- Dependencies: setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p._getValue = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
-- implement eid parameter
local eid = args.eid
if eid == "" then
return nil
elseif eid then
args.qid = eid
end
local propertyID = mw.text.trim(args[1] or "")
args.reqranks = setRanks(args.rank)
-- replacetext (rt) is a string that is returned instead of any non-empty Wikidata value
-- this is useful for tracking and debugging, so we set fetchwikidata=ALL to fill the whitelist
local replacetext = mw.text.trim(args.rt or args.replacetext or "")
if replacetext ~= "" then
args.fetchwikidata = "ALL"
end
local f = {}
f.args = args
local entityid, props = parseInput(f, f.args[2], propertyID)
if not entityid then
return props -- either the input parameter or nothing
end
-- qual is a string containing the property ID of the qualifier(s) to be returned
-- if qual == "ALL" then all qualifiers returned
-- if qual == "DATES" then qualifiers P580 (start time) and P582 (end time) returned
-- if nothing or an empty string is passed set it nil -> no qualifiers returned
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
-- set a language object and code in the args table
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- table 'out' stores the return value(s):
local out = propertyvalueandquals(props, args, qualID)
-- format the table of values and return it as a string:
return assembleoutput(out, args, entityid, propertyID)
end
-------------------------------------------------------------------------------
-- getValue is used to get the value(s) of a property
-- The property ID is passed as the first unnamed parameter and is required.
-- A locally supplied parameter may optionaly be supplied as the second unnamed parameter.
-- The function will now also return qualifiers if parameter qual is supplied
-------------------------------------------------------------------------------
-- Dependencies: _getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getValue = function(frame)
local args= frame.args
if not args[1] then
args = frame:getParent().args
if not args[1] then return i18n.errors["No property supplied"] end
end
return p._getValue(args)
end
-------------------------------------------------------------------------------
-- getPreferredValue is used to get a value,
-- (or a comma separated list of them if multiple values exist).
-- If preferred ranks are set, it will return those values, otherwise values with normal ranks
-- now redundant to getValue with |rank=best
-------------------------------------------------------------------------------
-- Dependencies: p.getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput;
-- parseParam; sourced; labelOrId; i18n.latestdatequalifier; format_Date;
-- makeOrdinal; roundto; decimalPrecision; decimalToDMS;
-------------------------------------------------------------------------------
p.getPreferredValue = function(frame)
frame.args.rank = "best"
return p.getValue(frame)
end
-------------------------------------------------------------------------------
-- getCoords is used to get coordinates for display in an infobox
-- whitelist and blacklist are implemented
-- optional 'display' parameter is allowed, defaults to nil - was "inline, title"
-------------------------------------------------------------------------------
-- Dependencies: setRanks(); parseInput(); decimalPrecision();
-------------------------------------------------------------------------------
p.getCoords = function(frame)
local propertyID = "P625"
-- if there is a 'display' parameter supplied, use it
-- otherwise default to nothing
local disp = frame.args.display or ""
if disp == "" then
disp = nil -- default to not supplying display parameter, was "inline, title"
end
-- there may be a format parameter to switch from deg/min/sec to decimal degrees
-- default is deg/min/sec
-- decimal degrees needs |format = dec
local form = (frame.args.format or ""):lower():sub(1,3)
if form ~= "dec" then
form = "dms"
end
-- just deal with best values
frame.args.reqranks = setRanks("best")
local qid, props = parseInput(frame, frame.args[1], propertyID)
if not qid then
return props -- either local parameter or nothing
else
local dv = props[1].mainsnak.datavalue.value
local lat, long, prec = dv.latitude, dv.longitude, dv.precision
lat = decimalPrecision(lat, prec)
long = decimalPrecision(long, prec)
local lat_long = { lat, long }
lat_long["display"] = disp
lat_long["format"] = form
-- invoke template Coord with the values stored in the table
return frame:expandTemplate{title = 'coord', args = lat_long}
end
end
-------------------------------------------------------------------------------
-- getQualifierValue is used to get a formatted value of a qualifier
--
-- The call needs: a property (the unnamed parameter or 1=)
-- a target value for that property (pval=)
-- a qualifier for that target value (qual=)
-- The usual whitelisting and blacklisting of the property is implemented
-- The boolean onlysourced= parameter can be set to return nothing
-- when the property is unsourced (or only sourced to Wikipedia)
-------------------------------------------------------------------------------
-- Dependencies: parseParam(); setRanks(); parseInput(); sourced();
-- propertyvalueandquals(); assembleoutput();
-- labelOrId(); i18n.latestdatequalifier(); format_Date();
-- findLang(); makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS();
-------------------------------------------------------------------------------
p.getQualifierValue = function(frame)
-- The property ID that will have a qualifier is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or "")
-- The value of the property we want to match whose qualifier value is to be returned
-- is passed in named parameter |pval=
local propvalue = frame.args.pval
-- The property ID of the qualifier
-- whose value is to be returned is passed in named parameter |qual=
local qualifierID = frame.args.qual
-- A filter can be set like this: filter=P642==Q22674854
local filter, fprop, fval
local ftable = mw.text.split(frame.args.filter or "", "==")
if ftable[2] then
fprop = mw.text.trim(ftable[1])
fval = mw.text.trim(ftable[2])
filter = true
end
-- onlysourced is a boolean passed to return qualifiers
-- only when property values are sourced to something other than Wikipedia
-- if nothing or an empty string is passed set it true
-- if "false" or "no" or 0 is passed set it false
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set a language object and language code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- check for locally supplied parameter in second unnamed parameter
-- success means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
-- Scan through the values of the property
-- we want something like property is P793, significant event (in propertyID)
-- whose value is something like Q385378, construction (in propvalue)
-- then we can return the value(s) of a qualifier such as P580, start time (in qualifierID)
for k1, v1 in pairs(props) do
if v1.mainsnak.snaktype == "value" and v1.mainsnak.datavalue.type == "wikibase-entityid" then
-- It's a wiki-linked value, so check if it's the target (in propvalue) and if it has qualifiers
if v1.mainsnak.datavalue.value.id == propvalue and v1.qualifiers then
if onlysrc == false or sourced(v1) then
-- if we've got this far, we have a (sourced) claim with qualifiers
-- which matches the target, so apply the filter and find the value(s) of the qualifier we want
if not filter or (v1.qualifiers[fprop] and v1.qualifiers[fprop][1].datavalue.value.id == fval) then
local quals = v1.qualifiers[qualifierID]
if quals then
-- can't reference qualifer, so set onlysourced = "no" (args are strings, not boolean)
local qargs = frame.args
qargs.onlysourced = "no"
local vals = propertyvalueandquals(quals, qargs, qid)
for k, v in ipairs(vals) do
out[#out + 1] = v
end
end
end
end -- of check for sourced
end -- of check for matching required value and has qualifiers
end -- of check for wikibase entity
end -- of loop through values of propertyID
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- either local parameter or nothing
end -- of test for success
return nil
end
-------------------------------------------------------------------------------
-- getSumOfParts scans the property 'has part' (P527) for values matching a list.
-- The list is passed in parameter vlist.
-- It consists of a string of Qids separated by spaces or any usual punctuation.
-- If the matched values have a qualifier 'quantity' (P1114), those quantities are summed.
-- The sum is returned as a number or nothing if zero.
-------------------------------------------------------------------------------
-- Dependencies: _getsumofparts;
-------------------------------------------------------------------------------
p.getSumOfParts = function(frame)
local sum = _getsumofparts(frame.args)
if sum == 0 then return end
return sum
end
-------------------------------------------------------------------------------
-- getValueByQual gets the value of a property which has a qualifier with a given entity value
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the ID of a qualifier for that property (qualID=Pyyy)
-- either the Wikibase-entity ID of a value for that qualifier (qvalue=Qzzz)
-- or a string value for that qualifier (qvalue=abc123)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced;
-- assembleoutput;
-------------------------------------------------------------------------------
p.getValueByQual = function(frame)
local qualID = frame.args.qualID
-- The Q-id of the value for the qualifier we want to match is in named parameter |qvalue=
local qval = frame.args.qvalue or ""
if qval == "" then return "no qualifier value supplied" end
local function checkQID(id)
return id == qval
end
return _getvaluebyqual(frame, qualID, checkQID)
end
-------------------------------------------------------------------------------
-- getValueByLang gets the value of a property which has a qualifier P407
-- ("language of work or name") whose value has the given language code
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the MediaWiki language code to match the language (lang=xx[-yy])
-- (if no code is supplied, it uses the default language)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced; assembleoutput;
-------------------------------------------------------------------------------
p.getValueByLang = function(frame)
-- The language code for the qualifier we want to match is in named parameter |lang=
local langcode = findLang(frame.args.lang).code
local function checkLanguage(id)
-- id should represent a language like "British English (Q7979)"
-- it should have string property "Wikimedia language code (P424)"
-- qlcode will be a table:
local qlcode = mw.wikibase.getBestStatements(id, "P424")
if (#qlcode > 0) and (qlcode[1].mainsnak.datavalue.value == langcode) then
return true
end
end
return _getvaluebyqual(frame, "P407", checkLanguage)
end
-------------------------------------------------------------------------------
-- getValueByRefSource gets the value of a property which has a reference "stated in" (P248)
-- whose value has the given entity-ID.
-- The call needs:
-- a property ID (the unnamed parameter or 1=Pxxx)
-- the entity ID of a value to match where the reference is stated in (match=Qzzz)
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getValueByRefSource = function(frame)
-- The property ID that we want to check is the first unnamed parameter
local propertyID = mw.text.trim(frame.args[1] or ""):upper()
if propertyID == "" then return "no property supplied" end
-- The Q-id of the value we want to match is in named parameter |qvalue=
local qval = (frame.args.match or ""):upper()
if qval == "" then qval = "Q21540096" end
local unit = (frame.args.unit or ""):upper()
if unit == "" then unit = "Q4917" end
local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)
-- set the requested ranks flags
frame.args.reqranks = setRanks(frame.args.rank)
-- set a language object and code in the frame.args table
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local linked = parseParam(frame.args.linked, true)
local uabbr = parseParam(frame.args.uabbr or frame.args.unitabbr, false)
-- qid not nil means no local parameter and the property exists
local qid, props = parseInput(frame, frame.args[2], propertyID)
if qid then
local out = {}
local mlt= {}
for k1, v1 in ipairs(props) do
if onlysrc == false or sourced(v1) then
if v1.references then
for k2, v2 in ipairs(v1.references) do
if v2.snaks.P248 then
for k3, v3 in ipairs(v2.snaks.P248) do
if v3.datavalue.value.id == qval then
out[#out+1], mlt[#out+1] = rendersnak(v1, frame.args, linked, "", "", "", "", uabbr, unit)
if not mlt[#out] then
-- we only need one match per property value
-- unless datatype was monolingual text
break
end
end -- of test for match
end -- of loop through values "stated in"
end -- of test that "stated in" exists
end -- of loop through references
end -- of test that references exist
end -- of test for sourced
end -- of loop through values of propertyID
if #mlt > 0 then
local langcode = frame.args.lang
langcode = mw.text.split( langcode, '-', true )[1]
local fbtbl = mw.language.getFallbacksFor( langcode )
table.insert( fbtbl, 1, langcode )
local bestval = ""
local found = false
for idx1, lang1 in ipairs(fbtbl) do
for idx2, lang2 in ipairs(mlt) do
if (lang1 == lang2) and not found then
bestval = out[idx2]
found = true
break
end
end -- loop through values of property
end -- loop through fallback languages
if found then
-- replace output table with a table containing the best value
out = { bestval }
else
-- more than one value and none of them on the list of fallback languages
-- sod it, just give them the first one
out = { out[1] }
end
end
return assembleoutput(out, frame.args, qid, propertyID)
else
return props -- no property or local parameter supplied
end -- of test for success
end
-------------------------------------------------------------------------------
-- getPropertyIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropertyIDs = function(args)
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( snak.datatype == "wikibase-item" )
and ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
out[#out+1] = snak.datavalue.value.id
end
if maxvals > 0 and #out >= maxvals then break end
end
return assembleoutput(out, args, qid, pid)
end
p.getPropertyIDs = function(frame)
local args = frame.args
return p._getPropertyIDs(args)
end
-------------------------------------------------------------------------------
-- getQualifierIDs takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- It takes a property-id as the first unnamed parameter, and an optional parameter qlist
-- which is a list of qualifier property-ids to search for (default is "ALL")
-- It returns the Entity-IDs (Qids) of the values of a property if it is a Wikibase-Entity.
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getQualifierIDs = function(frame)
local args = frame.args
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
-- change default for noicon to true
args.noicon = tostring(parseParam(args.noicon or "", true))
local f = {}
f.args = args
local pid = mw.text.trim(args[1] or ""):upper()
-- get the qid and table of claims for the property, or nothing and the local value passed
local qid, props = parseInput(f, args[2], pid)
if not qid then return props end
if not props[1] then return nil end
-- get the other parameters
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qlist = args.qlist or ""
if qlist == "" then qlist = "ALL" end
qlist = qlist:gsub("[%p%s]+", " ") .. " "
local out = {}
for i, v in ipairs(props) do
local snak = v.mainsnak
if ( v.rank and args.reqranks[v.rank:sub(1, 1)] )
and ( snak.snaktype == "value" )
and ( sourced(v) or not onlysrc )
then
if v.qualifiers then
for k1, v1 in pairs(v.qualifiers) do
if qlist == "ALL " or qlist:match(k1 .. " ") then
for i2, v2 in ipairs(v1) do
if v2.datatype == "wikibase-item" and v2.snaktype == "value" then
out[#out+1] = v2.datavalue.value.id
end -- of test that id exists
end -- of loop through qualifier values
end -- of test for kq in qlist
end -- of loop through qualifiers
end -- of test for qualifiers
end -- of test for rank value, sourced, and value exists
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through property values
return assembleoutput(out, args, qid, pid)
end
-------------------------------------------------------------------------------
-- getPropOfProp takes two propertyIDs: prop1 and prop2 (as well as the usual parameters)
-- If the value(s) of prop1 are of type "wikibase-item" then it returns the value(s) of prop2
-- of each of those wikibase-items.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p._getPropOfProp = function(args)
-- parameter sets for commonly used groups of parameters
local paraset = tonumber(args.ps or args.parameterset or 0)
if paraset == 1 then
-- a common setting
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
elseif paraset == 2 then
-- equivalent to raw
args.rank = "best"
args.fetchwikidata = "ALL"
args.onlysourced = "no"
args.noicon = "true"
args.linked = "no"
args.pd = "true"
elseif paraset == 3 then
-- third set goes here
end
args.reqranks = setRanks(args.rank)
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pid1 = args.prop1 or args.pid1 or ""
local pid2 = args.prop2 or args.pid2 or ""
if pid1 == "" or pid2 == "" then return nil end
local f = {}
f.args = args
local qid1, statements1 = parseInput(f, args[1], pid1)
-- parseInput nulls empty args[1] and returns args[1] if nothing on Wikidata
if not qid1 then return statements1 end
-- otherwise it returns the qid and a table for the statement
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] then
local out2 = propertyvalueandquals(statements2, args, qualID)
out[#out+1] = assembleoutput(out2, args, qid2, pid2)
end
end -- of test for valid property1 value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
p.getPropOfProp = function(frame)
local args= frame.args
if not args.prop1 and not args.pid1 then
args = frame:getParent().args
if not args.prop1 and not args.pid1 then return i18n.errors["No property supplied"] end
end
return p._getPropOfProp(args)
end
-------------------------------------------------------------------------------
-- getAwardCat takes most of the usual parameters. If the item has values of P166 (award received),
-- then it examines each of those awards for P2517 (category for recipients of this award).
-- If it exists, it returns the corresponding category,
-- with the item's P734 (family name) as sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getAwardCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
local pid1 = args.prop1 or "P166"
local pid2 = args.prop2 or "P2517"
if pid1 == "" or pid2 == "" then return nil end
-- locally supplied value:
local localval = mw.text.trim(args[1] or "")
local qid1, statements1 = parseInput(frame, localval, pid1)
if not qid1 then return localval end
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid1, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
local qualID = mw.text.trim(args.qual or ""):upper()
if qualID == "" then qualID = nil end
local out = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
local snak = v.mainsnak
if snak.datatype == "wikibase-item" and snak.snaktype == "value" then
local qid2 = snak.datavalue.value.id
local statements2 = {}
if args.reqranks.b then
statements2 = mw.wikibase.getBestStatements(qid2, pid2)
else
statements2 = mw.wikibase.getAllStatements(qid2, pid2)
end
if statements2[1] and statements2[1].mainsnak.snaktype == "value" then
local qid3 = statements2[1].mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qid3)
-- if there's no local sitelink, create the sitelink from English label
if not sitelink then
local lbl = mw.wikibase.getLabelByLang(qid3, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
sitelink = mw.text.nowiki(lbl)
else
sitelink = "Category:" .. mw.text.nowiki(lbl)
end
end
end
if sitelink then
if sk ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. sitelink .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. sitelink .. "]]"
end -- of check for sort keys
end -- of test for sitelink
end -- of test for category
end -- of test for wikibase item has a value
end -- of test for sourced
if maxvals > 0 and #out >= maxvals then break end
end -- of loop through values of property1
return assembleoutput(out, args, qid1, pid1)
end
-------------------------------------------------------------------------------
-- getIntersectCat takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented
-- It takes two properties, |prop1 and |prop2 (e.g. occupation and country of citizenship)
-- Each property's value is a wiki-base entity
-- For each value of the first parameter (ranks implemented) it fetches the value's main category
-- and then each value of the second parameter (possibly substituting a simpler description)
-- then it returns all of the categories representing the intersection of those properties,
-- (e.g. Category:Actors from Canada). A joining term may be supplied (e.g. |join=from).
-- The item's P734 (family name) is the sort key, or no sort key if there is no family name.
-- The sort key may be overridden by the parameter |sortkey (alias |sk).
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;
-------------------------------------------------------------------------------
p.getIntersectCat = function(frame)
frame.args.reqranks = setRanks(frame.args.rank)
frame.args.langobj = findLang(frame.args.lang)
frame.args.lang = frame.args.langobj.code
local args = frame.args
args.sep = " "
args.linked = "no"
local pid1 = args.prop1 or "P106"
local pid2 = args.prop2 or "P27"
if pid1 == "" or pid2 == "" then return nil end
local qid, statements1 = parseInput(frame, "", pid1)
if not qid then return nil end
local qid, statements2 = parseInput(frame, "", pid2)
if not qid then return nil end
-- topics like countries may have different names in categories from their label in Wikidata
local subs_exists, subs = pcall(mw.loadData, "Module:WikidataIB/subs")
local join = args.join or ""
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local maxvals = tonumber(args.maxvals) or 0
-- linkprefix (strip quotes)
local lp = (args.linkprefix or args.lp or ""):gsub('"', '')
-- sort key (strip quotes, hyphens and periods):
local sk = (args.sortkey or args.sk or ""):gsub('["-.]', '')
-- family name:
local famname = ""
if sk == "" then
local p734 = mw.wikibase.getBestStatements(qid, "P734")[1]
local p734id = p734 and p734.mainsnak.snaktype == "value" and p734.mainsnak.datavalue.value.id or ""
famname = mw.wikibase.getSitelink(p734id) or ""
-- strip namespace and disambigation
local pos = famname:find(":") or 0
famname = famname:sub(pos+1):gsub("%s%(.+%)$", "")
if famname == "" then
local lbl = mw.wikibase.getLabel(p734id)
famname = lbl and mw.text.nowiki(lbl) or ""
end
end
local cat1 = {}
for k, v in ipairs(statements1) do
if not onlysrc or sourced(v) then
-- get the ID representing the value of the property
local pvalID = (v.mainsnak.snaktype == "value") and v.mainsnak.datavalue.value.id
if pvalID then
-- get the topic's main category (P910) for that entity
local p910 = mw.wikibase.getBestStatements(pvalID, "P910")[1]
if p910 and p910.mainsnak.snaktype == "value" then
local tmcID = p910.mainsnak.datavalue.value.id
-- use sitelink or the English label for the cat
local cat = mw.wikibase.getSitelink(tmcID)
if not cat then
local lbl = mw.wikibase.getLabelByLang(tmcID, "en")
if lbl then
if lbl:sub(1,9) == "Category:" then
cat = mw.text.nowiki(lbl)
else
cat = "Category:" .. mw.text.nowiki(lbl)
end
end
end
cat1[#cat1+1] = cat
end -- of test for topic's main category exists
end -- of test for property has vaild value
end -- of test for sourced
if maxvals > 0 and #cat1 >= maxvals then break end
end
local cat2 = {}
for k, v in ipairs(statements2) do
if not onlysrc or sourced(v) then
local cat = rendersnak(v, args)
if subs[cat] then cat = subs[cat] end
cat2[#cat2+1] = cat
end
if maxvals > 0 and #cat2 >= maxvals then break end
end
local out = {}
for k1, v1 in ipairs(cat1) do
for k2, v2 in ipairs(cat2) do
if sk ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. sk .. "]]"
elseif famname ~= "" then
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "|" .. famname .. "]]"
else
out[#out+1] = "[[" .. lp .. v1 .. " " .. join .. " " .. v2 .. "]]"
end -- of check for sort keys
end
end
args.noicon = "true"
return assembleoutput(out, args, qid, pid1)
end
-------------------------------------------------------------------------------
-- qualsToTable takes most of the usual parameters.
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented.
-- A qid may be given, and the first unnamed parameter is the property ID, which is of type wikibase item.
-- It takes a list of qualifier property IDs as |quals=
-- For a given qid and property, it creates the rows of an html table,
-- each row being a value of the property (optionally only if the property matches the value in |pval= )
-- each cell being the first value of the qualifier corresponding to the list in |quals
-------------------------------------------------------------------------------
-- Dependencies: parseParam; setRanks; parseInput; sourced;
-------------------------------------------------------------------------------
p.qualsToTable = function(frame)
local args = frame.args
local quals = args.quals or ""
if quals == "" then return "" end
args.reqranks = setRanks(args.rank)
local propertyID = mw.text.trim(args[1] or "")
local f = {}
f.args = args
local entityid, props = parseInput(f, "", propertyID)
if not entityid then return "" end
args.langobj = findLang(args.lang)
args.lang = args.langobj.code
local pval = args.pval or ""
local qplist = mw.text.split(quals, "%p") -- split at punctuation and make a sequential table
for i, v in ipairs(qplist) do
qplist[i] = mw.text.trim(v):upper() -- remove whitespace and capitalise
end
local col1 = args.firstcol or ""
if col1 ~= "" then
col1 = col1 .. "</td><td>"
end
local emptycell = args.emptycell or " "
-- construct a 2-D array of qualifier values in qvals
local qvals = {}
for i, v in ipairs(props) do
local skip = false
if pval ~= "" then
local pid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if pid ~= pval then skip = true end
end
if not skip then
local qval = {}
local vqualifiers = v.qualifiers or {}
-- go through list of wanted qualifier properties
for i1, v1 in ipairs(qplist) do
-- check for that property ID in the statement's qualifiers
local qv, qtype
if vqualifiers[v1] then
qtype = vqualifiers[v1][1].datatype
if qtype == "time" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
qv = frame:expandTemplate{title="dts", args={qv}}
else
qv = "?"
end
elseif qtype == "url" then
if vqualifiers[v1][1].snaktype == "value" then
qv = mw.wikibase.renderSnak(vqualifiers[v1][1])
local display = mw.ustring.match( mw.uri.decode(qv, "WIKI"), "([%w ]+)$" )
if display then
qv = "[" .. qv .. " " .. display .. "]"
end
end
else
qv = mw.wikibase.formatValue(vqualifiers[v1][1])
end
end
-- record either the value or a placeholder
qval[i1] = qv or emptycell
end -- of loop through list of qualifiers
-- add the list of qualifier values as a "row" in the main list
qvals[#qvals+1] = qval
end
end -- of for each value loop
local out = {}
for i, v in ipairs(qvals) do
out[i] = "<tr><td>" .. col1 .. table.concat(qvals[i], "</td><td>") .. "</td></tr>"
end
return table.concat(out, "\n")
end
-------------------------------------------------------------------------------
-- getGlobe takes an optional qid of a Wikidata entity passed as |qid=
-- otherwise it uses the linked item for the current page.
-- If returns the Qid of the globe used in P625 (coordinate location),
-- or nil if there isn't one.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getGlobe = function(frame)
local qid = frame.args.qid or frame.args[1] or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
local coords = mw.wikibase.getBestStatements(qid, "P625")[1]
local globeid
if coords and coords.mainsnak.snaktype == "value" then
globeid = coords.mainsnak.datavalue.value.globe:match("(Q%d+)")
end
return globeid
end
-------------------------------------------------------------------------------
-- getCommonsLink takes an optional qid of a Wikidata entity passed as |qid=
-- It returns one of the following in order of preference:
-- the Commons sitelink of the linked Wikidata item;
-- the Commons sitelink of the topic's main category of the linked Wikidata item;
-------------------------------------------------------------------------------
-- Dependencies: _getCommonslink(); _getSitelink(); parseParam()
-------------------------------------------------------------------------------
p.getCommonsLink = function(frame)
local oc = frame.args.onlycat or frame.args.onlycategories
local fb = parseParam(frame.args.fallback or frame.args.fb, true)
return _getCommonslink(frame.args.qid, oc, fb)
end
-------------------------------------------------------------------------------
-- getSitelink takes the qid of a Wikidata entity passed as |qid=
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink
-- If the parameter is blank, then it uses the local wiki.
-- If there is a sitelink to an article available, it returns the plain text link to the article
-- If there is no sitelink, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getSiteLink = function(frame)
return _getSitelink(frame.args.qid, frame.args.wiki or mw.text.trim(frame.args[1] or ""))
end
-------------------------------------------------------------------------------
-- getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns a link to the article
-- with the Wikidata label as the displayed text.
-- If there is no sitelink, it returns the label as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLink = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local sitelink = mw.wikibase.getSitelink(itemID)
local label = labelOrId(itemID)
if sitelink then
return "[[:" .. sitelink .. "|" .. label .. "]]"
else
return label
end
end
-------------------------------------------------------------------------------
-- getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it displays the qid instead.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLabel = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label = labelOrId(itemID, lang)
return label
end
-------------------------------------------------------------------------------
-- label has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- if no qid is supplied, it uses the qid associated with the current page.
-- It returns the Wikidata label for the local language as plain text.
-- If there is no label in the local language, it returns nil.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.label = function(frame)
local qid = mw.text.trim(frame.args[1] or frame.args.qid or "")
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return end
local lang = frame.args.lang or ""
if lang == "" then lang = nil end
local label, success = labelOrId(qid, lang)
if success then return label end
end
-------------------------------------------------------------------------------
-- getAT (Article Title)
-- has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=
-- If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text.
-- If there is no sitelink or qid supplied, it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAT = function(frame)
local itemID = mw.text.trim(frame.args[1] or frame.args.qid or "")
if itemID == "" then return end
return mw.wikibase.getSitelink(itemID)
end
-------------------------------------------------------------------------------
-- getDescription has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- Any local parameter passed (other than "Wikidata" or "none") becomes the return value.
-- It returns the article description for the Wikidata entity if the local parameter is "Wikidata".
-- Nothing is returned if the description doesn't exist or "none" is passed as the local parameter.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getDescription = function(frame)
local desc = mw.text.trim(frame.args[1] or "")
local itemID = mw.text.trim(frame.args.qid or "")
if itemID == "" then itemID = nil end
if desc:lower() == 'wikidata' then
return mw.wikibase.getDescription(itemID)
elseif desc:lower() == 'none' then
return nil
else
return desc
end
end
-------------------------------------------------------------------------------
-- getAliases has the qid of a Wikidata entity passed as |qid=
-- (it defaults to the associated qid of the current article if omitted)
-- and a local parameter passed as the first unnamed parameter.
-- It implements blacklisting and whitelisting with a field name of "alias" by default.
-- Any local parameter passed becomes the return value.
-- Otherwise it returns the aliases for the Wikidata entity with the usual list options.
-- Nothing is returned if the aliases do not exist.
-------------------------------------------------------------------------------
-- Dependencies: findLang(); assembleoutput()
-------------------------------------------------------------------------------
p.getAliases = function(frame)
local args = frame.args
local fieldname = args.name or ""
if fieldname == "" then fieldname = "alias" end
local blacklist = args.suppressfields or args.spf or ""
if blacklist:find(fieldname) then return nil end
local localval = mw.text.trim(args[1] or "")
if localval ~= "" then return localval end
local whitelist = args.fetchwikidata or args.fwd or ""
if whitelist == "" then whitelist = "NONE" end
if not (whitelist == 'ALL' or whitelist:find(fieldname)) then return nil end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return nil end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return nil end
args.langobj = findLang(args.lang)
local langcode = args.langobj.code
args.lang = langcode
local out = {}
for k1, v1 in pairs(aliases) do
if v1[1].language == langcode then
for k1, v2 in ipairs(v1) do
out[#out+1] = v2.value
end
break
end
end
return assembleoutput(out, args, qid)
end
-------------------------------------------------------------------------------
-- pageId returns the page id (entity ID, Qnnn) of the current page
-- returns nothing if the page is not connected to Wikidata
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.pageId = function(frame)
return mw.wikibase.getEntityIdForCurrentPage()
end
-------------------------------------------------------------------------------
-- formatDate is a wrapper to export the private function format_Date
-------------------------------------------------------------------------------
-- Dependencies: format_Date();
-------------------------------------------------------------------------------
p.formatDate = function(frame)
return format_Date(frame.args[1], frame.args.df, frame.args.bc)
end
-------------------------------------------------------------------------------
-- location is a wrapper to export the private function _location
-- it takes the entity-id as qid or the first unnamed parameter
-- optional boolean parameter first toggles the display of the first item
-- optional boolean parameter skip toggles the display to skip to the last item
-- parameter debug=<y/n> (default 'n') adds error msg if not a location
-------------------------------------------------------------------------------
-- Dependencies: _location();
-------------------------------------------------------------------------------
p.location = function(frame)
local debug = (frame.args.debug or ""):sub(1, 1):lower()
if debug == "" then debug = "n" end
local qid = mw.text.trim(frame.args.qid or frame.args[1] or ""):upper()
if qid == "" then qid=mw.wikibase.getEntityIdForCurrentPage() end
if not qid then
if debug ~= "n" then
return i18n.errors["entity-not-found"]
else
return nil
end
end
local first = mw.text.trim(frame.args.first or "")
local skip = mw.text.trim(frame.args.skip or "")
return table.concat( _location(qid, first, skip), ", " )
end
-------------------------------------------------------------------------------
-- checkBlacklist implements a test to check whether a named field is allowed
-- returns true if the field is not blacklisted (i.e. allowed)
-- returns false if the field is blacklisted (i.e. disallowed)
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Joe |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "blacklisted"
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Jim |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}
-- displays "not blacklisted"
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkBlacklist = function(frame)
local blacklist = frame.args.suppressfields or frame.args.spf or ""
local fieldname = frame.args.name or ""
if blacklist ~= "" and fieldname ~= "" then
if blacklist:find(fieldname) then
return false
else
return true
end
else
-- one of the fields is missing: let's call that "not on the list"
return true
end
end
-------------------------------------------------------------------------------
-- emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags
-- otherwise it returns the argument unchanged (including leading/trailing space).
-- If the argument may contain "=", then it must be called explicitly:
-- |1=arg
-- (In that case, leading and trailing spaces are trimmed)
-- It finds use in infoboxes where it can replace tests like:
-- {{#if: {{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}} | <span class="xxx">{{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}}</span> | }}
-- with a form that uses just a single call to Wikidata:
-- {{#invoke |WikidataIB |emptyor |1= <span class="xxx">{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}</span> }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.emptyor = function(frame)
local s = frame.args[1] or ""
if s == "" then return nil end
local sx = s:gsub("%s", ""):gsub("<[^>]*>", ""):gsub("%p", "")
if sx == "" then
return nil
else
return s
end
end
-------------------------------------------------------------------------------
-- labelorid is a public function to expose the output of labelOrId()
-- Pass the Q-number as |qid= or as an unnamed parameter.
-- It returns the Wikidata label for that entity or the qid if no label exists.
-------------------------------------------------------------------------------
-- Dependencies: labelOrId
-------------------------------------------------------------------------------
p.labelorid = function(frame)
return (labelOrId(frame.args.qid or frame.args[1]))
end
-------------------------------------------------------------------------------
-- getLang returns the MediaWiki language code of the current content.
-- If optional parameter |style=full, it returns the language name.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getLang = function(frame)
local style = (frame.args.style or ""):lower()
local langcode = mw.language.getContentLanguage().code
if style == "full" then
return mw.language.fetchLanguageName( langcode )
end
return langcode
end
-------------------------------------------------------------------------------
-- getItemLangCode takes a qid parameter (using the current page's qid if blank)
-- If the item for that qid has property country (P17) it looks at the first preferred value
-- If the country has an official language (P37), it looks at the first preferred value
-- If that official language has a language code (P424), it returns the first preferred value
-- Otherwise it returns nothing.
-------------------------------------------------------------------------------
-- Dependencies: _getItemLangCode()
-------------------------------------------------------------------------------
p.getItemLangCode = function(frame)
return _getItemLangCode(frame.args.qid or frame.args[1])
end
-------------------------------------------------------------------------------
-- findLanguage exports the local findLang() function
-- It takes an optional language code and returns, in order of preference:
-- the code if a known language;
-- the user's language, if set;
-- the server's content language.
-------------------------------------------------------------------------------
-- Dependencies: findLang
-------------------------------------------------------------------------------
p.findLanguage = function(frame)
return findLang(frame.args.lang or frame.args[1]).code
end
-------------------------------------------------------------------------------
-- getQid returns the qid, if supplied
-- failing that, the Wikidata entity ID of the "category's main topic (P301)", if it exists
-- failing that, the Wikidata entity ID associated with the current page, if it exists
-- otherwise, nothing
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getQid = function(frame)
local qid = (frame.args.qid or ""):upper()
-- check if a qid was passed; if so, return it:
if qid ~= "" then return qid end
-- check if there's a "category's main topic (P301)":
qid = mw.wikibase.getEntityIdForCurrentPage()
if qid then
local prop301 = mw.wikibase.getBestStatements(qid, "P301")
if prop301[1] then
local mctid = prop301[1].mainsnak.datavalue.value.id
if mctid then return mctid end
end
end
-- otherwise return the page qid (if any)
return qid
end
-------------------------------------------------------------------------------
-- followQid takes four optional parameters: qid, props, list and all.
-- If qid is not given, it uses the qid for the connected page
-- or returns nil if there isn't one.
-- props is a list of properties, separated by punctuation.
-- If props is given, the Wikidata item for the qid is examined for each property in turn.
-- If that property contains a value that is another Wikibase-item, that item's qid is returned,
-- and the search terminates, unless |all=y when all of the qids are returned, separated by spaces.
-- If |list= is set to a template, the qids are passed as arguments to the template.
-- If props is not given, the qid is returned.
-------------------------------------------------------------------------------
-- Dependencies: parseParam()
-------------------------------------------------------------------------------
p._followQid = function(args)
local qid = (args.qid or ""):upper()
local all = parseParam(args.all, false)
local list = args.list or ""
if list == "" then list = nil end
if qid == "" then
qid = mw.wikibase.getEntityIdForCurrentPage()
end
if not qid then return nil end
local out = {}
local props = (args.props or ""):upper()
if props ~= "" then
for p in mw.text.gsplit(props, "%p") do -- split at punctuation and iterate
p = mw.text.trim(p)
for i, v in ipairs( mw.wikibase.getBestStatements(qid, p) ) do
local linkedid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id
if linkedid then
if all then
out[#out+1] = linkedid
else
return linkedid
end -- test for all or just the first one found
end -- test for value exists for that property
end -- loop through values of property to follow
end -- loop through list of properties to follow
end
if #out > 0 then
local ret = ""
if list then
ret = mw.getCurrentFrame():expandTemplate{title = list, args = out}
else
ret = table.concat(out, " ")
end
return ret
else
return qid
end
end
p.followQid = function(frame)
return p._followQid(frame.args)
end
-------------------------------------------------------------------------------
-- globalSiteID returns the globalSiteID for the current wiki
-- e.g. returns "enwiki" for the English Wikipedia, "enwikisource" for English Wikisource, etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.globalSiteID = function(frame)
return mw.wikibase.getGlobalSiteId()
end
-------------------------------------------------------------------------------
-- siteID returns the root of the globalSiteID
-- e.g. "en" for "enwiki", "enwikisource", etc.
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.siteID = function(frame)
local txtlang = frame:callParserFunction('int', {'lang'}) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be_x_old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- projID returns the code used to link to the reader's language's project
-- e.g "en" for [[:en:WikidataIB]]
-- treats "en-gb" as "en", etc.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.projID = function(frame)
local txtlang = frame:callParserFunction('int', {'lang'}) or ""
-- This deals with specific exceptions: be-tarask -> be-x-old
if txtlang == "be-tarask" then
return "be-x-old"
end
local pos = txtlang:find("-")
local ret = ""
if pos then
ret = txtlang:sub(1, pos-1)
else
ret = txtlang
end
return ret
end
-------------------------------------------------------------------------------
-- formatNumber formats a number according to the the supplied language code ("|lang=")
-- or the default language if not supplied.
-- The number is the first unnamed parameter or "|num="
-------------------------------------------------------------------------------
-- Dependencies: findLang()
-------------------------------------------------------------------------------
p.formatNumber = function(frame)
local lang
local num = tonumber(frame.args[1] or frame.args.num) or 0
lang = findLang(frame.args.lang)
return lang:formatNum( num )
end
-------------------------------------------------------------------------------
-- examine dumps the property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid' (or the other unnamed parameter)
-- or from the item corresponding to the current page if qid is not supplied.
-- e.g. {{#invoke:WikidataIB |examine |pid=P26 |qid=Q42}}
-- or {{#invoke:WikidataIB |examine |P26 |Q42}} or any combination of these
-- or {{#invoke:WikidataIB |examine |P26}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.examine = function( frame )
local args
if frame.args[1] or frame.args.pid or frame.args.qid then
args = frame.args
else
args = frame:getParent().args
end
local par = {}
local pid = (args.pid or ""):upper()
local qid = (args.qid or ""):upper()
par[1] = mw.text.trim( args[1] or "" ):upper()
par[2] = mw.text.trim( args[2] or "" ):upper()
table.sort(par)
if par[2]:sub(1,1) == "P" then par[1], par[2] = par[2], par[1] end
if pid == "" then pid = par[1] end
if qid == "" then qid = par[2] end
local q1 = qid:sub(1,1)
if pid:sub(1,1) ~= "P" then return "No property supplied" end
if q1 ~= "Q" and q1 ~= "M" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return "No item for this page" end
return "<pre>" .. mw.dumpObject( mw.wikibase.getAllStatements( qid, pid ) ) .. "</pre>"
end
-------------------------------------------------------------------------------
-- checkvalue looks for 'val' as a wikibase-item value of a property (the unnamed parameter or pid)
-- from the item given by the parameter 'qid'
-- or from the Wikidata item associated with the current page if qid is not supplied.
-- It only checks ranks that are requested (preferred and normal by default)
-- If property is not supplied, then P31 (instance of) is assumed.
-- It returns val if found or nothing if not found.
-- e.g. {{#invoke:WikidataIB |checkvalue |val=Q5 |pid=P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |qid=Q42}}
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31}} for the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.checkvalue = function( frame )
local args
if frame.args.val then
args = frame.args
else
args = frame:getParent().args
end
local val = args.val
if not val then return nil end
local pid = mw.text.trim(args.pid or args[1] or "P31"):upper()
local qid = (args.qid or ""):upper()
if pid:sub(1,1) ~= "P" then return nil end
if qid:sub(1,1) ~= "Q" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local ranks = setRanks(args.rank)
local stats = {}
if ranks.b then
stats = mw.wikibase.getBestStatements(qid, pid)
else
stats = mw.wikibase.getAllStatements( qid, pid )
end
if not stats[1] then return nil end
if stats[1].mainsnak.datatype == "wikibase-item" then
for k, v in pairs( stats ) do
local ms = v.mainsnak
if ranks[v.rank:sub(1,1)] and ms.snaktype == "value" and ms.datavalue.value.id == val then
return val
end
end
end
return nil
end
-------------------------------------------------------------------------------
-- url2 takes a parameter url= that is a proper url and formats it for use in an infobox.
-- If no parameter is supplied, it returns nothing.
-- This is the equivalent of Template:URL
-- but it keeps the "edit at Wikidata" pen icon out of the microformat.
-- Usually it will take its url parameter directly from a Wikidata call:
-- e.g. {{#invoke:WikidataIB |url2 |url={{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}} }}
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.url2 = function(frame)
local txt = frame.args.url or ""
if txt == "" then return nil end
-- extract any icon
local url, icon = txt:match("(.+) (.+)")
-- make sure there's at least a space at the end
url = (url or txt) .. " "
icon = icon or ""
-- extract any protocol like https://
local prot = url:match("(https*://).+[ \"\']")
-- extract address
local addr = ""
if prot then
addr = url:match("https*://(.+)[ \"\']") or " "
else
prot = "//"
addr = url:match("[^%p%s]+%.(.+)[ \"\']") or " "
end
-- strip trailing / from end of domain-only url and add <wbr/> before . and /
local disp, n = addr:gsub( "^([^/]+)/$", "%1" ):gsub("%/", "<wbr/>/"):gsub("%.", "<wbr/>.")
return '<span class="url">[' .. prot .. addr .. " " .. disp .. "]</span> " .. icon
end
-------------------------------------------------------------------------------
-- getWebsite fetches the Official website (P856) and formats it for use in an infobox.
-- This is similar to Template:Official website but with a url displayed,
-- and it adds the "edit at Wikidata" pen icon beyond the microformat if enabled.
-- A local value will override the Wikidata value. "NONE" returns nothing.
-- e.g. {{#invoke:WikidataIB |getWebsite |qid= |noicon= |lang= |url= }}
-------------------------------------------------------------------------------
-- Dependencies: findLang(); parseParam();
-------------------------------------------------------------------------------
p.getWebsite = function(frame)
local url = frame.args.url or ""
if url:upper() == "NONE" then return nil end
local urls = {}
local quals = {}
local qid = frame.args.qid or ""
if url and url ~= "" then
urls[1] = url
else
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return nil end
local prop856 = mw.wikibase.getBestStatements(qid, "P856")
for k, v in pairs(prop856) do
if v.mainsnak.snaktype == "value" then
urls[#urls+1] = v.mainsnak.datavalue.value
if v.qualifiers and v.qualifiers["P1065"] then
-- just take the first archive url (P1065)
local au = v.qualifiers["P1065"][1]
if au.snaktype == "value" then
quals[#urls] = au.datavalue.value
end -- test for archive url having a value
end -- test for qualifers
end -- test for website having a value
end -- loop through website(s)
end
if #urls == 0 then return nil end
local out = {}
for i, u in ipairs(urls) do
local link = quals[i] or u
local prot, addr = u:match("(http[s]*://)(.+)")
addr = addr or u
local disp, n = addr:gsub("%.", "<wbr/>%.")
out[#out+1] = '<span class="url">[' .. link .. " " .. disp .. "]</span>"
end
local langcode = findLang(frame.args.lang).code
local noicon = parseParam(frame.args.noicon, false)
if url == "" and not noicon then
out[#out] = out[#out] .. createicon(langcode, qid, "P856")
end
local ret = ""
if #out > 1 then
ret = mw.getCurrentFrame():expandTemplate{title = "ubl", args = out}
else
ret = out[1]
end
return ret
end
-------------------------------------------------------------------------------
-- getAllLabels fetches the set of labels and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllLabels = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local labels = mw.wikibase.getEntity(qid).labels
if not labels then return i18n["labels-not-found"] end
local out = {}
for k, v in pairs(labels) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllDescriptions fetches the set of descriptions and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllDescriptions = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local descriptions = mw.wikibase.getEntity(qid).descriptions
if not descriptions then return i18n["descriptions-not-found"] end
local out = {}
for k, v in pairs(descriptions) do
out[#out+1] = v.value .. " (" .. v.language .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- getAllAliases fetches the set of aliases and formats it for display as wikitext.
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.getAllAliases = function(frame)
local args = frame.args or frame:getParent().args or {}
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid or not mw.wikibase.entityExists(qid) then return i18n["entity-not-found"] end
local aliases = mw.wikibase.getEntity(qid).aliases
if not aliases then return i18n["aliases-not-found"] end
local out = {}
for k1, v1 in pairs(aliases) do
local lang = v1[1].language
local val = {}
for k1, v2 in ipairs(v1) do
val[#val+1] = v2.value
end
out[#out+1] = table.concat(val, ", ") .. " (" .. lang .. ")"
end
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- showNoLinks displays the article titles that should not be linked.
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
p.showNoLinks = function(frame)
local out = {}
for k, v in pairs(donotlink) do
out[#out+1] = k
end
table.sort( out )
return table.concat(out, "; ")
end
-------------------------------------------------------------------------------
-- checkValidity checks whether the first unnamed parameter represents a valid entity-id,
-- that is, something like Q1235 or P123.
-- It returns the strings "true" or "false".
-- Change false to nil to return "true" or "" (easier to test with #if:).
-------------------------------------------------------------------------------
-- Dependencies: none
-------------------------------------------------------------------------------
function p.checkValidity(frame)
local id = mw.text.trim(frame.args[1] or "")
if mw.wikibase.isValidEntityId(id) then
return true
else
return false
end
end
-------------------------------------------------------------------------------
-- getEntityFromTitle returns the Entity-ID (Q-number) for a given title.
-- Modification of Module:ResolveEntityId
-- The title is the first unnamed parameter.
-- The site parameter determines the site/language for the title. Defaults to current wiki.
-- The showdab parameter determines whether dab pages should return the Q-number or nil. Defaults to true.
-- Returns the Q-number or nil if it does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam
-------------------------------------------------------------------------------
function p.getEntityFromTitle(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
if not args[1] then return nil end
local title = mw.text.trim(args[1])
local site = args.site or ""
local showdab = parseParam(args.showdab, true)
local qid = mw.wikibase.getEntityIdForTitle(title, site)
if qid then
local prop31 = mw.wikibase.getBestStatements(qid, "P31")[1]
if not showdab and prop31 and prop31.mainsnak.datavalue.value.id == "Q4167410" then
return nil
else
return qid
end
end
end
-------------------------------------------------------------------------------
-- getDatePrecision returns the number representing the precision of the first best date value
-- for the given property.
-- It takes the qid and property ID
-- The meanings are given at https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times
-- 0 = 1 billion years .. 6 = millennium, 7 = century, 8 = decade, 9 = year, 10 = month, 11 = day
-- Returns 0 (or the second unnamed parameter) if the Wikidata does not exist.
-------------------------------------------------------------------------------
-- Dependencies: parseParam; sourced;
-------------------------------------------------------------------------------
function p.getDatePrecision(frame)
local args=frame.args
if not args[1] then args=frame:getParent().args end
local default = tonumber(args[2] or args.default) or 0
local prop = mw.text.trim(args[1] or "")
if prop == "" then return default end
local qid = args.qid or ""
if qid == "" then qid = mw.wikibase.getEntityIdForCurrentPage() end
if not qid then return default end
local onlysrc = parseParam(args.onlysourced or args.osd, true)
local stat = mw.wikibase.getBestStatements(qid, prop)
for i, v in ipairs(stat) do
local prec = (onlysrc == false or sourced(v))
and v.mainsnak.datavalue
and v.mainsnak.datavalue.value
and v.mainsnak.datavalue.value.precision
if prec then return prec end
end
return default
end
return p
-------------------------------------------------------------------------------
-- List of exported functions
-------------------------------------------------------------------------------
--[[
_getValue
getValue
getPreferredValue
getCoords
getQualifierValue
getSumOfParts
getValueByQual
getValueByLang
getValueByRefSource
getPropertyIDs
getQualifierIDs
getPropOfProp
getAwardCat
getIntersectCat
getGlobe
getCommonsLink
getSiteLink
getLink
getLabel
label
getAT
getDescription
getAliases
pageId
formatDate
location
checkBlacklist
emptyor
labelorid
getLang
getItemLangCode
findLanguage
getQID
followQid
globalSiteID
siteID
projID
formatNumber
examine
checkvalue
url2
getWebsite
getAllLabels
getAllDescriptions
getAllAliases
showNoLinks
checkValidity
getEntityFromTitle
getDatePrecision
--]]
-------------------------------------------------------------------------------
o26pvdzoveksr04pobp213ncnrqerd6
ماڈیول:I18n/complex date
828
141234
690958
2025-07-10T15:29:52Z
Abbas dhothar
361
"--[[ __ __ _ _ ___ _ ___ __ _ _ _ | \/ | ___ __| |_ _| | ___ _|_ _/ |( _ ) _ __ / /__ ___ _ __ ___ _ __ | | _____ __ __| | __ _| |_ ___ | |\/| |/ _ \ / _` | | | | |/ _ (_)| || |/ _ \| '_ \ / / __/ _ \| '_ ` _ \| '_ \| |/ _ \ \/ / / _` |/ _` | __/ _ \ | | | | (_) | (_| | |_| | | __/_ | || | (_) | | | |/ / (_| (_) | | | | | | |_) | | __/> <..." نال صفحہ بنایا گیا۔
690958
Scribunto
text/plain
--[[
__ __ _ _ ___ _ ___ __ _ _ _
| \/ | ___ __| |_ _| | ___ _|_ _/ |( _ ) _ __ / /__ ___ _ __ ___ _ __ | | _____ __ __| | __ _| |_ ___
| |\/| |/ _ \ / _` | | | | |/ _ (_)| || |/ _ \| '_ \ / / __/ _ \| '_ ` _ \| '_ \| |/ _ \ \/ / / _` |/ _` | __/ _ \
| | | | (_) | (_| | |_| | | __/_ | || | (_) | | | |/ / (_| (_) | | | | | | |_) | | __/> < | (_| | (_| | || __/
|_| |_|\___/ \__,_|\__,_|_|\___(_)___|_|\___/|_| |_/_/ \___\___/|_| |_| |_| .__/|_|\___/_/\_\ \__,_|\__,_|\__\___|
|_|
This code was copied from Commons please request changes there.
Maintainers:
*Jarekt
]]
local function Ordinal(...)
return require('Module:Ordinal-cd')._Ordinal(...)
end
local function Roman(...)
return require('Module:Roman-cd')._Numeral(...)
end
-- ==========================================================================
-- === Local Helper functions ==============================================
-- ==========================================================================
-- form of French "of" based on "precision", which is wikibase compatible date precision format:
-- 6=millennium, 7=century, 8=decade, 9=year, 10=month, 11=day
-- 1 2 3 4 5 mill cent deca year month day
local frOf = {'du','du','du','du','du', 'du', 'du', 'de', 'de', 'de', 'du'}
local function decYear(state,lang,case)
--Declension of word "year" in several languages
if state.precision == 9 then
yearCase = {
fi={xxx='vuosien', gen='vuoden', ill='vuoteen', ptv='vuotta', ela='vuodesta', ine='vuonna'},
sl={insP='letoma', ins='letom', gen='leta', loc='letu'},
hsb={insP='lětami', ins='lětom', gen='lěta', loc='lěće'}
}
return yearCase[lang][case] .. ' '
else
return ''
end
end
local function decCentury(lang,case)
--Declension of word "century" in several languages
centuryCase = {
pl={nom='wiek', gen='wieku', ins='wiekiem', loc='wieku', default = 'wiek'},
hsb={nom='lětstotk', gen='lětstotka', ins='lětstotkom', loc='lětstotku', default = 'lětstotk'}
}
return centuryCase[lang][case] or centuryCase[lang]['default']
end
local function decMillennium(lang,case)
--Declension of word "century" in several languages
millenniumCase = {
pl={nom='tysiąclecie', gen='tysiąclecia', ins='tysiącleciem', loc='tysiącleciu', default = 'tysiąclecie'},
hsb={nom='lěttysac', gen='lěttysaca', ins='lěttysacom', loc='lěttysacu', default = 'lěttysac'}
}
return millenniumCase[lang][case] or millenniumCase[lang]['default']
end
-- ==========================================================================
-- === Output data structure ===============================================
-- ==========================================================================
local p = {}
--[[
Multiple formats are possible:
1) string with key words "$date1" and "$date2" which will be replaced later by the date strings
2) function which can be used to create output string
* Function INPUTS:
- date1 and date2 string with date strings. "$date1" and "$date2" can also be used which will be replaced latter
- state is a table with full description of the phrase we are trying to construct. It includes state.precision1 (and 2)
which is wikibase compatible date precision format: 6=millennium, 7=century, 8=decade, 9=year, 10=month, 11=day
3) table with following fields:
* table[1] is either string or a function
* table.case is a 2 element table with Grammatical cases used by given language to alter
month name or other adjective related to date # 1 and 2
]]
p.Translations = {
-- ==========================================
-- === Two date phrases =====================
-- ==========================================
['from-until'] = {
nDates = 2,
ar='من $date1 إلى $date2',
['be-tarask']={'з $date1 да $date2', case={'gen','gen'}},
bn='$date1 থেকে $date2 পর্যন্ত',
ca='$date1 fins $date2',
cs='$date1 až $date2',
da='fra $date1 til $date2',
de='$date1 bis $date2',
el='από $date1 έως $date2',
en='from $date1 until $date2',
['en-gb']='from $date1 until $date2',
['en-ca']='from $date1 until $date2',
eo='de $date1 al $date2',
es='de $date1 a $date2',
et='$date1 kuni $date2',
fa='از $date1 تا $date2',
fi='$date1–$date2', -- välisenä aikana
fr=function(date1, date2, state) -- could actually be better should be "d'octobre à mars 2013' not "de octore 2013 à mars 2013"
if state.precision > 10 then -- precision > month
return 'du $date1 au $date2'
else -- "DE septebmbre" / "D'octobre"
return require("Module:Linguistic").of(date1, 'fr') .. " à $date2"
end
end,
gl='de $date1 a $date2', --Template:From until used 'desde $date1 ata $date2'
he='מ- $date1 עד $date2',
hr='od $date1 do $date2',
hsb={'wot $date1 do $date2', case={'gen','gen'}},
hu='$date1 – $date2',
it='dal $date1 al $date2',
ja='$date1から$date2まで',
mk='од $date1 до $date2',
ml='$date1 മുതൽ $date2 വരെ',
nb='fra $date1 til $date2',
nds='$date1 bet $date2',
nn='fra $date1 til $date2',
nl='$date1 tot $date2',
no='fra $date1 til $date2',
pl={'od $date1 do $date2', case={'gen','gen'}},
ro='din $date1 până în $date2',
pt='de $date1 a $date2',
qu="$date1 p'unchawmanta $date2 p\'unchawkama",
ru={'с $date1 по $date2', case={'gen','gen'}},
sk={'od $date1 do $date2', case={'gen','gen'}},
sl={'od $date1 do $date2', case={'gen','gen'}},
sv='från $date1 till $date2',
uk={'з $date1 до $date2', case={'gen','gen'}},
ur='از $date1 تا $date2',
vi='từ $date1 đến $date2',
['zh-hans']='从$date1到$date2',
['zh-hant']='從$date1到$date2',
default='<span style="color:red">$date1 - $date2</span>',
},
['between']={
nDates = 2,
ar='بين $date1 و $date2',
['be-tarask']={'між $date1 і $date2', case={'ins','ins'}},
bn='$date1 এবং $date2-এর মাঝামাঝি',
ca='entre $date1 i $date2',
cs={'mezi $date1 a $date2', case={'ins','ins'}},
da='mellem $date1 og $date2',
de='zwischen $date1 und $date2',
el='μεταξύ $date1 και $date2',
en='between $date1 and $date2',
['en-gb']='between $date1 and $date2',
['en-ca']='between $date1 and $date2',
eo='inter $date1 kaj $date2',
es='entre $date1 y $date2',
et='$date1 ja $date2 vahel',
fa='بین $date1 و $date2',
fi={function(date1, date2, state) return decYear(state,'fi','xxx') .. '$date1 ja $date2 välisenä aikana' end, case={'gen','gen'}},
fr='entre $date1 et $date2',
gl='entre $date1 e $date2',
he='בין $date1 ו- $date2',
hr='između $date1 i $date2',
hsb={'mjez $date1 a $date2', case={'ins','ins'}},
hu='$date1 és $date2 között',
hi='$date1 और $date2 के बीच',
it='tra il $date1 e il $date2',
ja='$date1と$date2の間',
mk='помеѓу $date1 и $date2',
ml='$date1, $date2 എന്നിവയ്ക്കിടയ്ക്ക്',
nb='mellom $date1 og $date2',
nds='twischen $date1 un $date2',
nn='mellom $date1 og $date2',
nl='tussen $date1 en $date2',
no='mellom $date1 og $date2',
pl={'między $date1 a $date2', case={'ins','ins'}},
ro='între $date1 și $date2',
pt='entre $date1 e $date2',
qu="$date1 p'unchawpa $date2 p'unchawpapas chawpin",
ru={'между $date1 и $date2', case={'ins','ins'}},
sk={'medzi $date1 a $date2', case={'ins','ins'}},
sl={function(date1, date2, state) return 'med ' .. decYear(state,'sl','insP') .. '$date1 in $date2' end, case={'ins','ins'}},
sv='mellan $date1 och $date2',
uk={'між $date1 та $date2', case={'ins','ins'}},
ur='بین $date1 و $date2',
vec='tra el $date1 e el $date2',
vi='giữa $date1 và $date2',
['zh-hans']='在$date1到$date2之间',
['zh-hant']='在$date1到$date2之間',
default='<span style="color:red">$date1 - $date2</span>',
},
['or'] = {
nDates = 2,
ar='$date1 أو $date2',
['be-tarask']='$date1 ці $date2',
bn='$date1 অথবা $date2',
ca='$date1 o $date2',
cs='$date1 nebo $date2',
da='$date1 eller $date2',
de='$date1 oder $date2',
el='$date1 ή $date2',
en='$date1 or $date2',
['en-gb']='$date1 or $date2',
['en-ca']='$date1 or $date2',
eo='$date1 aŭ $date2',
es='$date1 o $date2',
et='$date1 või $date2',
fa='$date1 یا $date2',
fi='$date1 tai $date2',
fr='$date1 ou $date2',
gl='$date1 ou $date2',
he='$date1 או $date2',
hr='$date1 ili $date2',
hsb='$date1 abo $date2',
hu='$date1 vagy $date2',
it='$date1 o $date2',
ja='$date1または$date2',
mk='$date1 или $date2',
ml='$date1 അഥവാ $date2',
nb='$date1 eller $date2',
nn='$date1 eller $date2',
nds='$date1 oder $date2',
nl='$date1 of $date2',
no='$date1 eller $date2',
pl='$date1 lub $date2',
pt='$date1 ou $date2',
qu='$date1 icha $date2',
ro='$date1 sau $date2',
ru='$date1 или $date2',
sk='$date1 alebo $date2',
sl='$date1 ali $date2',
sv='$date1 eller $date2',
uk='$date1 або $date2',
ur='$date1 یا $date2',
th='$date1 หรือ $date2',
vi='$date1 hoặc $date2',
['zh-hans']='$date1或$date2',
['zh-hant']='$date1或$date2',
default=function(date1, date2, state) return require("Module:linguistic").conj({date1, date2}, state.lang, 'or') end,
},
['and'] = {
nDates = 2,
ar='$date1 و $date2',
['be-tarask']='$date1 і $date2',
bn='$date1 এবং $date2',
ca='$date1 i $date2',
cs='$date1 a $date2',
da='$date1 og $date2',
de='$date1 und $date2',
el='$date1 και $date2',
en='$date1 and $date2',
['en-gb']='$date1 and $date2',
['en-ca']='$date1 and $date2',
eo='$date1 kaj $date2',
es='$date1 y $date2',
et='$date1 ja $date2',
fa='$date1 و $date2',
fi='$date1 ja $date2',
fr='$date1 et $date2',
gl='$date1 e $date2',
he='$date1 ו- $date2',
hu='$date1 és $date2',
hsb='$date1 a $date2',
it='$date1 e $date2',
ja='$date1および$date2',
mk='$date1 и $date2',
ml='$date1 ഒപ്പം $date2',
nb='$date1 og $date2',
nn='$date1 og $date2',
nds='$date1 un $date2',
nl='$date1 en $date2',
no='$date1 og $date2',
pl='$date1 i $date2',
pt='$date1 e $date2',
qu='$date1wan $date2pas',
ro='$date1 și $date2',
ru='$date1 и $date2',
sk='$date1 a $date2',
sl='$date1 in $date2',
sv='$date1 och $date2',
uk='$date1 та $date2',
ur='$date1 و $date2',
vi='$date1 và $date2',
['zh-hans']='$date1和$date2',
['zh-hant']='$date1和$date2',
default=function(date1, date2, state) return require("Module:linguistic").conj({date1, date2}, state.lang, 'and') end,
},
-- ==========================================
-- === Prepositions =========================
-- ==========================================
['by'] = {
nDates = 1,
ar='قرابة $date1',
['be-tarask']={'да $date1', case={'gen',''}},
bn='$date1 কর্তৃক',
ca='vers $date1',
cs={'kolem $date1', case={'gen',''}},
da='mod $date1',
de='spätestens $date1',
el='έως $date1',
en='by $date1',
['en-gb']='by $date1',
['en-ca']='by $date1',
eo='ne post $date1',
es='para $date1',
et='hiljemalt $date1',
fa='توسط $date1',
fi={function(date1, state) return decYear(state,'fi','ill') .. '$date1 mennessä' end, case={'ill',''}},
fr='$date1 (au plus tard)',
gl='cara a $date1',
he='עד $date1',
hr='do $date1',
hsb={'do $date1', case={'gen',''}},
it='entro il $date1',
ja='$date1まで',
mk='кон $date1',
ml='$date1-ൽ',
nb='innen $date1',
nn='innan $date1',
nds='$date1 oder vördem al',
nl='tegen $date1',
no='innen $date1',
pl={'przed $date1', case={'ins',''}},
pt='por $date1',
qu="$date1 p'unchawkama",
ro='de $date1',
ru={'к $date1', case={'dat',''}},
sk={'okolo $date1', case={'gen',''}},
sl={function(date1, state) return 'najpozneje ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='senast $date1',
uk={'до $date1', case={'dat',''}},
ur='توسط $date1',
vi='vào $date1', -- need to insert "đã" somewhere later in the sentence -->
['zh-hans']='$date1前后',
['zh-hant']='$date1前后',
default='<span style="color:red">by $date1</span>',
},
['before'] = {
nDates = 1,
ar='قبل $date1',
['be-tarask']={'перад $date1', case={'ins',''}},
bn='$date1-এর আগে',
bg='Преди $date1',
ca='abans $date1',
cs={'před $date1', case={'ins',''}},
da='før $date1',
de='vor $date1',
el='πριν από $date1',
en='before $date1',
['en-gb']='before $date1',
['en-ca']='before $date1',
eo='antaŭ $date1',
es='antes de $date1',
et='enne $date1',
fa='پیش از $date1',
fi={function(date1, state) return 'ennen ' .. decYear(state,'fi','ptv') .. '$date1' end, case={'ptv',''}},
fr='avant $date1',
gl='antes do $date1',
he='לפני $date1',
hr='prije $date1',
hsb={'do $date1', case={'gen',''}},
hu='$date1 előtt',
it='prima del $date1',
ja='$date1より前',
mk='пред $date1',
ml='$date1-നു മുമ്പ്',
nb='før $date1',
nn='før $date1',
nds='vör $date1',
nl='voor $date1',
no='før $date1',
pl={'przed $date1', case={'ins',''}},
pt='antes de $date1',
qu="$date1 p'unchaw ñawpan",
ro='înainte de $date1',
ru={'ранее $date1', case={'gen',''}},
sk={'pred $date1', case={'ins',''}},
sl={function(date1, state) return 'pred ' .. decYear(state,'sl','ins') .. ' $date1' end, case={'ins',''}},
sv='före $date1',
uk={'до $date1', case={'gen',''}},
ur='قبل $date1',
vi='trước $date1',
['zh-hans']='在$date1之前',
['zh-hant']='在$date1之前',
default='<span style="color:red">before $date1</span>',
},
['from'] = {
nDates = 1,
ar='من $date1',
['be-tarask']={'з $date1', case={'gen',''}},
bn='$date1 থেকে',
cs={'od $date1', case={'gen',''}},
de='Seit $date1',
el='από $date1',
en='from $date1',
['en-gb']='from $date1',
['en-ca']='from $date1',
eo='ekde $date1',
es='desde $date1',
et='alates $date1',
fa='از $date1',
fi={function(date1, state) return decYear(state,'fi','ela') .. '$date1 alkaen' end, case={'ela',''}},
fr= function(date1, state) return 'à partir '.. frOf[state.precision] ..' $date1' end,
gl='desde o $date1',
he='מ- $date1',
hr='od $date1',
hsb={'wot $date1', case={'gen',''}},
it='dal $date1',
ja='$date1から',
nds='vonaf $date1',
mk='од $date1',
nb='fra $date1',
nn='frå $date1',
ml='$date1 മുതൽ',
nl='vanaf $date1',
no='fra $date1',
pl={'od $date1', case={'gen',''}},
qu="$date1 p'unchawmanta",
ro='din $date1',
ru={'С $date1', case={'gen',''}},
sk={'od $date1', case={'gen',''}},
sl={function(date1, state) return 'od ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='från $date1',
uk={'з $date1', case={'gen',''}},
ur='از $date1',
vi='từ $date1',
['zh-hans']='自$date1',
['zh-hant']='自$date1',
default='<span style="color:red">from $date1</span>',
},
['until'] = {
nDates = 1,
['be-tarask']={'усутыч да $date1', case={'gen',''}},
bn='$date1 পর্যন্ত',
cs={'do $date1', case={'gen', ''}},
de='bis $date1',
en='until $date1',
['en-gb']='until $date1',
['en-ca']='until $date1',
eo='ĝis $date1',
es='hasta $date1',
fr=function(date1, state)
if state.precision > 10 then -- precision > month
return "jusqu'au $date1"
else
return "jusqu'à $date1"
end
end,
hr='do $date1',
hsb={'do $date1', case={'gen',''}},
it='al $date1',
nb='til $date1',
nl='tot $date1',
nn='til $date1',
ml='$date1 വരെ',
pl={'do $date1', case={'gen',''}},
ru={'вплоть до $date1', case={'gen',''}},
sk={'do $date1', case={'gen', ''}},
uk={'аж до $date1', case={'gen',''}},
ur='تک $date1',
['zh-hans']='直到$date1',
['zh-hant']='直到$date1',
default='<span style="color:red">until $date1</span>',
},
['after'] = {
nDates = 1,
ar='بعد $date1',
['be-tarask']={'пасьля $date1', case={'gen',''}},
bn='$date1-এর পরে',
ca='després de $date1',
cs={'po $date1', case={'loc',''}},
de='nach $date1',
da='efter $date1',
el='μετά από $date1',
en='after $date1',
['en-gb']='after $date1',
['en-ca']='after $date1',
eo='post $date1',
es='después de $date1',
et='pärast $date1',
fa='پس از $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 jälkeen' end, case={'gen',''}},
fr='après $date1',
gl='despois do $date1',
he='לאחר $date1',
hr='nakon $date1',
hu='$date1 után',
hsb={'po $date1', case={'loc',''}},
it='dopo il $date1',
ja='$date1より後',
mk='по $date1',
ml='$date1-നു ശേഷം',
nb='etter $date1',
nn='etter $date1',
nds='na $date1',
nl='na $date1',
no='etter $date1',
pl={'po $date1', case={'loc',''}},
pt='após $date1',
qu="$date1 p'unchaw qhipan",
ro='după $date1',
ru={'после $date1', case={'gen',''}},
sk={'po $date1', case={'loc',''}},
sl={function(date1, state) return 'po ' .. decYear(state,'sl','loc') .. ' $date1' end, case={'loc',''}},
sv='efter $date1',
uk={'після $date1', case={'gen',''}},
ur='بعد $date1',
vi='sau $date1',
['zh-hans']='在$date1之后',
['zh-hant']='在$date1之後',
default='<span style="color:red">after $date1</span>',
},
-- ==========================================
-- === Adjectives ===========================
-- ==========================================
['early'] = {
nDates = 1,
ar='بداية $date1',
['be-tarask']={'пачатак $date1', case={'gen',''}},
bn='$date1-এর শুরুতে',
ca='al principi de $date1',
cs={'začátek $date1', case={'gen',''}},
da='tidlig $date1',
de='Anfang $date1',
el='αρχές του $date1',
en='early $date1',
['en-gb']='early $date1',
['en-ca']='early $date1',
eo='komence de $date1',
es='a principios de $date1',
et='$date1 algus',
fa='اوایل $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 alku' end, case={'gen',''}},
fr='début $date1',
gl='a principios de $date1',
he='תחילת $date1',
hr='početak $date1',
hsb={'spočatk $date1', case={'gen',''}},
hu='$date1 elején',
it='inizio del $date1',
ja='$date1初頭',
mk='почеток на $date1',
ml='$date1 ആദ്യപാദം',
nb='tidlig $date1',
nn='tidleg $date1',
nds='Anfang $date1',
nl='begin $date1',
no='tidlig $date1',
pl={'początek $date1', case={'gen',''}},
pt='a princípios de $date1',
qu="$date1 ñawpaq p'unchawkunapi",
ro='începând cu $date1',
ru={'начало $date1', case={'gen',''}},
sk={'začiatok $date1', case={'gen',''}},
sl=function(date1, state)-- could actually be better should be "d'octobre à mars 2013' not "de octore 2013 à mars 2013"
if state.precision == 9 then -- precision > month
return 'zgodnje leto $date1'
else -- "DE septebmbre" / "D'octobre"
return 'zgodnji $date1'
end
end,
sv='början av $date1',
uk={'початок $date1', case={'gen',''}},
ur='ابتدا $date1',
vi='đầu năm $date1',
['zh-hans']='$date1早期',
['zh-hant']='$date1早期',
default='<span style="color:red">early $date1</span>',
},
['mid'] = {
nDates = 1,
ar='منتصف $date1',
['be-tarask']={'сярэдзіна $date1', case={'gen',''}},
bn='$date1-এর মাঝামাঝি',
ca='a mitjan $date1',
cs={'polovina $date1', case={'gen',''}},
da='midten af $date1',
de='Mitte $date1',
el='μέσα του $date1',
en='mid $date1',
['en-gb']='mid $date1',
['en-ca']='mid $date1',
eo='meze de $date1',
es='a mediados de $date1',
et='$date1 keskel',
fa='اواسط $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 puoliväli' end, case={'gen',''}},
fr='mi $date1',
gl='a mediados de $date1',
he='אמצע $date1',
hr='sredina $date1',
hsb={'srjedź $date1', case={'gen',''}},
hu='$date1 közepén',
it='metà del $date1',
ja='$date1半ば',
mk='средина на $date1',
ml='$date1 മദ്ധ്യം',
nb='midten av $date1',
nn='midten av $date1',
nds='Midd $date1',
nl='midden $date1',
no='midten av $date1',
pl={'środek $date1', case={'gen',''}},
pt='meados de $date1',
qu="$date1 chawpin p'unchawkunapi",
ro='mijlocul lui $date1',
ru={'середина $date1', case={'gen',''}},
sk={'polovica $date1', case={'gen',''}},
sl={function(date1, state) return 'sredina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='mitten av $date1',
uk={'середина $date1', case={'gen',''}},
ur='وسط $date1',
vi='giữa năm $date1',
['zh-hans']='$date1中期',
['zh-hant']='$date1中期',
default='<span style="color:red">mid $date1</span>',
},
['late'] = {
nDates = 1,
ar='نهاية $date1',
bn='$date1-এর শেষে',
['be-tarask']={'канец $date1', case={'gen',''}},
ca='al final de $date1',
cs='konec $date1',
da='sen $date1',
de='Ende $date1',
el='τέλη του $date1',
en='late $date1',
['en-gb']='late $date1',
['en-ca']='late $date1',
eo='fine de $date1',
es='a fines de $date1',
et='$date1 lõpp',
fa='اواخر $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 loppu' end, case={'gen',''}},
fr='fin $date1',
gl='a finais de $date1',
he='סוף $date1',
hr='kraj $date1',
hsb={'kónc $date1', case={'gen',''}},
hu='$date1 végén',
it='fine del $date1',
ja='$date1末',
mk='крајот на $date1',
ml='$date1 അന്ത്യപാദം',
nb='sent $date1',
no='seint $date1',
nds='Enn $date1',
nl='eind $date1',
no='sent $date1',
pl={'koniec $date1', case={'gen',''}},
pt='ao final de $date1',
qu="$date1 qhipaq p'unchawkunapi",
ro='sfârșitul lui $date1',
ru={'конец $date1', case={'gen',''}},
sk={'koniec $date1', case={'gen',''}},
sl={function(date1, state) return 'pozno ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='slutet av $date1',
uk={'кінець $date1', case={'gen',''}},
ur='اخیر $date1',
vi='cuối năm $date1',
['zh-hans']='$date1晚期',
['zh-hant']='$date1晚期',
default='<span style="color:red">late $date1</span>',
},
['circa'] = {
nDates = 1,
ar='قرابة $date1',
['be-tarask']={'каля $date1', case={'gen',''}},
bn='প্রায় $date1',
ca='cap a $date1',
cs='cca $date1',
da='ca. $date1',
de='etwa $date1',
el='περ. $date1',
en='circa $date1',
['en-gb']='circa $date1',
['en-ca']='circa $date1',
eo='ĉirkaŭ $date1',
es='hacia $date1', -- suggestion use "hacia"/"hacia el" or leave the latin circa or ca.
et='ca. $date1',
fa='حوالی $date1', -- template:Circa used 'حدود $date1'
fi={function(date1, state) return 'suunnilleen ' .. decYear(state,'fi','ine') .. '$date1' end, case={'ine',''}}, -- template:Circa used 'noin $date1'
fr=function(date1, state)
if state.precision >= 11 then -- precision >= day
return 'vers le $date1'
else
return 'vers $date1'
end
end,
gl='entre $date1', -- template:Circa used 'cara a $date1'
he='בסביבות $date1',
hr='oko $date1',
hsb={'wokoło $date1', case={'gen',''}},
hu='$date1 körül',
it='$date1 circa',
ja='$date1頃',
ko='$date1경',
mk='~ $date1', -- template:Circa used 'o. $date1'
ml= 'ഉദ്ദേശം $date1',
nb='ca. $date1',
nn='ca. $date1',
nds='üm un bi $date1',
nl='ca. $date1',
no='ca. $date1',
pl={'około $date1', case={'gen',''}},
pt='cerca de $date1',
qu='$date1chá',
ro='circa $date1',
ru={'около $date1', case={'gen',''}},
sk='cca $date1',
sl={function(date1, state) return 'ok. ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='c:a $date1', -- template:Circa used 'ca $date1'
uk={'близько $date1', case={'gen', ''}},
ur='قریباً $date1',
vi='vào khoảng $date1',
['zh-hans']='约$date1',
['zh-hant']='約$date1',
default='<span style="color:red">circa $date1</span>',
},
['uncertain'] = {
nDates = 1,
['zh-hans']='$date1(?)',
['zh-hant']='$date1(?)',
default='$date1 (?)',
},
probably = { -- see Q56644435
nDates = 1,
ast = 'probablemente $date1',
bn = 'সম্ভবত $date1',
ca = 'probablement $date1',
cs = 'pravděpodobně $date1',
de = 'wahrscheinlich $date1',
el = 'πιθανόν $date1',
en = 'probably $date1',
['en-gb']='probably $date1',
['en-ca']='probably $date1',
eo = 'probable $date1',
es = 'probable $date1',
fa = 'احتمالاً $date1',
fr = 'probablement $date1',
he = 'כפי הנראה $date1',
hu = 'feltehetőleg $date1',
it = 'probabile $date1',
mk = 'веројатно $date1',
ml = 'ഒരുപക്ഷേ $date1',
nl = 'waarschijnlijk $date1',
pl = 'prawdopodobnie $date1',
pt = 'provavelmente $date1',
ru = 'вероятно $date1',
sv = 'antagligen $date1',
uk = 'ймовірно $date1',
default='<span style="color:red">probably $date1</span>',
},
possibly = { -- see Q30230067
nDates = 1,
ast = 'posiblemente $date1',
bn = 'যথাসম্ভব $date1',
cs = 'možná $date1',
de = 'möglicherweise $date1',
en = 'possibly $date1',
['en-gb']='possibly $date1',
['en-ca']='possibly $date1',
eo = 'eble $date1',
el = 'πιθανόν $date1',
fa = 'احتمالاً $date1',
fr = 'peut-être $date1',
hu = 'talán $date1',
mk = 'можеби $date1',
ml = 'മിക്കവാറും $date1',
nl = 'mogelijk $date1',
pl = 'być może $date1',
pt = 'possivelmente $date1',
ro = 'poate $date1',
ru = 'возможно $date1',
sv = 'möjligen $date1',
uk = 'можливо $date1',
default='<span style="color:red">possibly $date1</span>',
},
presumably = { -- see Q18122778
nDates = 1,
ast = 'presumiblemente $date1',
de = 'vermutlich $date1',
en = 'presumably $date1',
['en-gb']='presumably $date1',
['en-ca']='presumably $date1',
fr = 'présumé $date1',
it = 'presumibilmente $date1',
ml = 'ഊഹപ്രകാരം $date1',
ru = 'предположительно $date1',
pl = 'przypuszczalnie $date1',
uk = 'здогадно $date1',
default='<span style="color:red">presumably $date1</span>',
},
['year unknown']= {
nDates = 0,
ca='Any desconegut',
['be-tarask']='Год невядомы',
bn='অজানা বছর',
cs='neznámý rok',
de='Jahr unbekannt',
el='άγνωστο έτος',
en='year unknown',
['en-gb']='year unknown',
['en-ca']='year unknown',
eo='jaro nesciata',
es='Año desconocido',
fa='سال نامعلوم',
fi='tuntematon vuosi',
fr='Année inconnue',
he='שנה לא ידועה',
hsb='lěto njeznate',
hr='nepoznata godina',
it='anno sconosciuto',
ja='年代不明',
la='Sine anno',
ml='വർഷം ലഭ്യമല്ല',
mk='непозната година',
nb='ukjent år',
nn='ukjent år',
nl='zonder jaar',
no='ukjent år',
pl='rok nieznany',
qu='Mana riqsisqa wata',
ru='Год неизвестен',
sk='neznámy rok',
sl='neznano leto',
sv='Okänt år',
uk='рік невідомий',
ur='سال نامعلوم',
vi='không rõ năm',
['zh-hans']='年份未知',
['zh-hant']='年份未知',
default='<span style="color:red">year unknown</span>',
},
-- ==========================================
-- === Parts of a whole =====================
-- ==========================================
['firsthalf'] = {
nDates = 1,
ar='النصف الأول من $date1',
['be-tarask']={'першая палова $date1', case={'gen',''}},
bn='$date1-এর প্রথমার্ধ',
ca='1a meitat de $date1',
cs={'1. polovina $date1', case={'gen',''}},
da='1. halvdel af $date1',
de='1. Hälfte $date1',
el='πρώτο μισό του $date1',
en='first half of $date1',
['en-gb']='first half of $date1',
['en-ca']='first half of $date1',
eo='unua duono de $date1',
es='primera mitad de $date1',
et='$date1 esimene pool',
fa='نیمهٔ نخست $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 alkupuolisko' end, case={'gen',''}},
fr='1<sup>re</sup> moitié de $date1',
gl='primeira metade de $date1',
he='במחצית הראשונה של $date1',
hsb={'prěnja połojca $date1', case={'gen',''}},
hu='$date1 első felében',
hr='prva polovina $date1',
it='prima metà del $date1',
ja='$date1上半期',
mk='прва половина на $date1',
ml='$date1 ആദ്യപകുതി',
nb='første halvdel av $date1',
nn='fyrste halvdelen av $date1',
nds='1. Helft $date1',
nl='eerste helft $date1',
no='første halvdel av $date1',
pl={'pierwsza połowa $date1', case={'gen',''}},
pt='primeira metade de $date1',
qu='$date1 ñawpaq kuskanpi',
ro='prima jumătate a lui $date1',
ru={'первая половина $date1', case={'gen',''}},
sk={'1. polovica $date1', case={'gen',''}},
sl={function(date1, state) return 'prva polovica ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='första halvan av $date1',
uk={'перша половина $date1', case={'gen',''}},
ur='نصف اول $date1',
vi='nửa đầu năm $date1',
['zh-hans']='$date1上半期',
['zh-hant']='$date1上半期',
default='<span style="color:red">first half of $date1</span>',
},
['secondhalf'] = {
nDates = 1,
ar='النصف الثاني من $date1',
['be-tarask']={'другая палова $date1', case={'gen',''}},
bn='$date1-এর দ্বিতীয়ার্ধ',
ca='2a meitat de $date1',
cs={'2. polovina $date1', case={'gen',''}},
da='2. halvdel af $date1',
de='2. Hälfte $date1',
el='δεύτερο μισό του $date1',
en='second half of $date1',
['en-gb']='second half of $date1',
['en-ca']='second half of $date1',
eo='dua duono de $date1',
es='segunda mitad de $date1',
et='$date1 teine pool',
fa='نیمهٔ دوم $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 loppupuolisko' end, case={'gen',''}},
fr='2<sup>e</sup> moitié de $date1',
gl='segunda metade de $date1',
he='במחצית השנייה של $date1',
hsb={'druha połojca $date1', case={'gen',''}},
hr='druga polovina $date1',
hu='$date1 második felében',
it='seconda metà del $date1',
ja='$date1下半期',
mk='втора половина на $date1',
ml='$date1 രണ്ടാം പകുതി',
nb='andre halvdel av $date1',
nn='andre halvdelen av $date1',
nds='2. Helft vun $date1',
nl='tweede helft $date1',
no='andre halvdel av $date1',
pl={'druga połowa $date1', case={'gen',''}},
pt='segunda metade de $date1',
qu='$date1 qhipaq kuskanpi',
ro='a doua jumătate a lui $date1',
ru={'вторая половина $date1', case={'gen',''}},
sk={'2. polovica $date1', case={'gen',''}},
sl={'druga polovica {{IfNum | $date0 | leta}} $date1', case={'gen',''}},
sv='andra halvan av $date1',
uk={'друга половина $date1', case={'gen',''}},
ur='نصف آخر $date1',
vi='nửa cuối năm $date1',
['zh-hans']='$date1下半期',
['zh-hant']='$date1下半期',
default='<span style="color:red">second half of $date1</span>',
},
['1quarter']= {
nDates = 1,
bn='$date1-এর প্রথম ত্রৈমাসিক',
['be-tarask']={'першая чвэрць $date1', case={'gen',''}},
cs={'1. čtvrtina $date1', case={'gen',''}},
de='erstes Viertel $date1',
en='first quarter of $date1',
['en-gb']='first quarter of $date1',
['en-ca']='first quarter of $date1',
eo='unua kvarono de $date1',
es='primer cuarto del $date1',
fa='ربع نخست $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 ensimmäinen neljännes' end, case={'gen',''}},
fr= function(date1, state) return 'premier quart '.. frOf[state.precision] ..' $date1' end,
he='רבעון ראשון של $date1',
hsb={'prěnja štwórćina $date1', case={'gen',''}},
hr='prva četvrtina $date1',
it='primo quarto del $date1',
ja='$date1第1四半期',
ml='$date1 ഒന്നാം ത്രൈമാസം',
nb='første kvartal av $date1',
nl='eerste kwart $date1',
nn='fyrste kvartalet av $date1',
no='første kvartal av $date1',
pl={'pierwsza ćwiartka $date1', case={'gen',''}},
qu='$date1 ñawpaq ñiqin tawa phatmanpi',
ru={'первая четверть $date1', case={'gen',''}},
sk={'1. štvrtina $date1', case={'gen',''}},
sl={'prva četrtina {{IfNum | $date0 | leta}} $date1', case={'gen',''}},
sl={function(date1, state) return 'prva četrtina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='första kvartalet av $date1',
uk={'1-ша чверть $date1', case={'gen',''}},
ur='پہلی سہ ماہی $date1',
vi='quý 1 năm $date1',
['zh-hans']='$date1第一季度',
['zh-hant']='$date1第一季度',
default='<span style="color:red">first quarter of $date1</span>',
},
['2quarter']= {
nDates = 1,
['be-tarask']={'другая чвэрць $date1', case={'gen',''}},
bn='$date1-এর দ্বিতীয় ত্রৈমাসিক',
cs={'2. čtvrtina $date1', case={'gen',''}},
de='zweites Viertel $date1',
en='second quarter of $date1',
['en-gb']='second quarter of $date1',
['en-ca']='second quarter of $date1',
eo='dua kvarono de $date1',
es='segundo cuarto del $date1',
fa='ربع دوم $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 toinen neljännes' end, case={'gen',''}},
fr= function(date1, state) return 'deuxième quart '.. frOf[state.precision] ..' $date1' end,
he='רבעון שני של $date1',
hsb={'druha štwórćina $date1', case={'gen',''}},
hr='druga četvrtina $date1',
it='secondo quarto del $date1',
ja='$date1第2四半期',
ml='$date1 രണ്ടാം ത്രൈമാസം',
nb='andre kvartal av $date1',
nl='tweede kwart $date1',
nn='andre kvartalet av $date1',
no='andre kvartal av $date1',
pl={'druga ćwiartka $date1', case={'gen',''}},
qu='$date1 iskay ñiqin tawa phatmanpi',
ru={'вторая четверть $date1', case={'gen',''}},
sk={'2. štvrtina $date1', case={'gen',''}},
sl={function(date1, state) return 'druga četrtina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='andra kvartalet av $date1',
uk={'2-га чверть $date1', case={'gen',''}},
ur='دوسری سہ ماہی $date1',
vi='quý 2 năm $date1',
['zh-hans']='$date1第二季度',
['zh-hant']='$date1第二季度',
default='<span style="color:red">second quarter of $date1</span>',
},
['3quarter']= {
nDates = 1,
['be-tarask']={'трэцяя чвэрць $date1', case={'gen',''}},
bn='$date1-এর তৃতীয় ত্রৈমাসিক',
cs={'3. čtvrtina $date1', case={'gen',''}},
de='drittes Viertel $date1',
en='third quarter of $date1',
['en-gb']='third quarter of $date1',
['en-ca']='third quarter of $date1',
eo='tria kvarono de $date1',
es='tercer cuarto del $date1',
fa='ربع سوم $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 kolmas neljännes' end, case={'gen',''}},
fr= function(date1, state) return 'troisième quart '.. frOf[state.precision] ..' $date1' end,
he='רבעון שלישי של $date1',
hsb={'třeća štwórćina $date1', case={'gen',''}},
hr='treća četvrtina $date1',
it='terzo quarto del $date1',
ja='$date1第3四半期',
ml='$date1 മൂന്നാം ത്രൈമാസം',
nb='tredje kvartal av $date1',
nl='derde kwart $date1',
nn='tredje kvartalet av $date1',
no='tredje kvartal av $date1',
pl={'trzecia ćwiartka $date1', case={'gen',''}},
qu='$date1 kimsa ñiqin tawa phatmanpi',
sk={'3. štvrtina $date1', case={'gen',''}},
sl={function(date1, state) return 'tretja četrtina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
ru={'третья четверть $date1', case={'gen',''}},
sv='tredje kvartalet av $date1',
uk={'3-тя чверть $date1', case={'gen',''}},
ur='تیسری سہ ماہی $date1',
vi='quý 3 năm $date1',
['zh-hans']='$date1第三季度',
['zh-hant']='$date1第三季度',
default='<span style="color:red">third quarter of $date1</span>',
},
['4quarter']= {
nDates = 1,
['be-tarask']={'чацьвёртая чвэрць $date1', case={'gen',''}},
bn='$date1-এর চতুর্থ ত্রৈমাসিক',
cs={'4. čtvrtina $date1', case={'gen',''}},
de='letztes Viertel $date1',
en='fourth quarter of $date1',
['en-gb']='fourth quarter of $date1',
['en-ca']='fourth quarter of $date1',
eo='kvara kvarono de $date1',
es='último cuarto del $date1',
fa='ربع چهارم $date1',
fi={function(date1, state) return decYear(state,'fi','gen') .. '$date1 viimeinen neljännes' end, case={'gen',''}},
fr= function(date1, state) return 'quatrième quart '.. frOf[state.precision] ..' $date1' end,
he='רבעון רביעי של $date1',
hsb={'poslednja štwórćina $date1', case={'gen',''}},
hr='četvrta četvrtina $date1',
it='quarto quarto del $date1',
ja='$date1第4四半期',
ml='$date1 നാലാം ത്രൈമാസം',
nb='fjerde kvartal av $date1',
nl='vierde kwart $date1',
nn='tredje kvartalet av $date1',
no='fjerde kvartal av $date1',
pl={'czwarta ćwiartka $date1', case={'gen',''}},
qu='$date1 qhipaq ñiqin tawa phatmanpi',
ru={'последняя четверть $date1', case={'gen',''}},
sk={'4. štvrtina $date1', case={'gen',''}},
sl={function(date1, state) return 'zadnja četrtina ' .. decYear(state,'sl','gen') .. ' $date1' end, case={'gen',''}},
sv='fjärde kvartalet av $date1',
uk={'4-та чверть $date1', case={'gen',''}},
ur='چوتھی سہ ماہی $date1',
vi='quý 4 năm $date1',
['zh-hans']='$date1第四季度',
['zh-hant']='$date1第四季度',
default='<span style="color:red">forth quarter of $date1</span>',
},
-- ==========================================
-- === Seasons ==============================
-- ==========================================
['spring'] = {
nDates = 1,
ar='ربيع $date1',
['be-tarask']='вясна $date1',
bn='বসন্তকাল $date1',
ca='primavera $date1',
cs={'jaro $date1', case={'gen', ''}},
da='Forår $date1',
de='Frühling $date1',
en='Spring $date1',
['en-gb']='Spring $date1',
['en-ca']='Spring $date1',
eo='printempo $date1',
es='primavera de $date1',
et='$date1 kevad',
fa='بهار $date1',
fi='Kevät $date1',
fr='printemps $date1',
gl='primavera $date1',
he='אביב $date1',
hr='proljeće $date1',
hsb='nalěćo $date1',
hu='$date1 tavasza',
it='primavera $date1',
ja='{{#if:$date1|$date1年}}春',
mk='пролет $date1',
ml='$date1 വസന്തം',
nb='våren $date1',
nds='Vörjohr $date1',
nn='våren $date1',
nl='voorjaar $date1',
no='våren $date1',
pl='wiosna $date1',
pt='primavera de $date1',
ro='primăvara lui $date1',
ru='весна $date1',
sk={'jar $date1', case={'gen', ''}},
sl='pomlad $date1',
sv='våren $date1',
uk='весна $date1',
ur='بہار $date1',
vi='mùa đông năm $date1',
['zh-hans']='{{#if:$date1|$date1年}}春季',
['zh-hant']='{{#if:$date1|$date1年}}春季',
default='<span style="color:red">Spring $date1</span>',
},
['summer'] = {
nDates = 1,
ar='صيف $date1',
['be-tarask']='лета $date1',
bn='গ্রীষ্মকাল $date1',
ca='estiu $date1',
cs={'léto $date1', case={'gen', ''}},
da='Sommer $date1',
de='Sommer $date1',
en='Summer $date1',
['en-gb']='Summer $date1',
['en-ca']='Summer $date1',
eo='somero $date1',
es='verano de $date1',
et='$date1 suvi',
fa='تابستان $date1',
fi='Kesä $date1',
fr='été $date1',
gl='verán $date1',
he='קיץ $date1',
hr='ljeto $date1',
hsb='lěćo $date1',
hu='$date1 nyara',
it='estate $date1',
ja='{{#if:$date1|$date1年}}夏',
mk='лето $date1',
ml='$date1 വേനൽ',
nb='sommeren $date1',
nds='Sommer $date1',
nn='sumaren $date1',
nl='zomer $date1',
no='sommeren $date1',
pl='lato $date1',
pt='verão de $date1',
ro='vara lui $date1',
ru='лето $date1',
sk={'leto $date1', case={'gen', ''}},
sl='poletje $date1',
sv='sommaren $date1',
uk='літо $date1',
ur='گرما $date1',
vi='mùa hè năm $date1',
['zh-hans']='{{#if:$date1|$date1年}}夏季',
['zh-hant']='{{#if:$date1|$date1年}}夏季',
default='<span style="color:red">Summer $date1</span>',
},
['autumn'] = {
nDates = 1,
ar='خريف $date1',
['be-tarask']='восень $date1',
bn='শরত্কাল $date1',
ca='tardor $date1',
cs={'podzim $date1', case={'gen', ''}},
da='Efterår $date1',
de='Herbst $date1',
en='Autumn $date1',
['en-gb']='Autumn $date1',
['en-ca']='Autumn $date1',
eo='aŭtuno $date1',
es='otoño de $date1',
et='$date1 sügis',
fa='پاییز $date1',
fi='Syksy $date1',
fr='automne $date1',
gl='outono $date1',
he='סתיו $date1',
hr='jesen $date1',
hsb='nazyma $date1',
hu='$date1 ősze',
it='autunno $date1',
ja='{{#if:$date1|$date1年}}秋',
mk='есен $date1',
ml='$date1 ശരത്കാലം',
nb='høsten $date1',
nds='Harvst $date1',
nn='hausten $date1',
nl='herfst $date1',
no='høsten $date1',
pl='jesień $date1',
pt='outono de $date1',
ro='toamna lui $date1',
ru='осень $date1',
sk={'jeseň $date1', case={'gen', ''}},
sl='jesen $date1',
sv='hösten $date1',
uk='осінь $date1',
ur='خزاں $date1',
vi='mùa thu năm $date1',
['zh-hans']='{{#if:$date1|$date1年}}秋季',
['zh-hant']='{{#if:$date1|$date1年}}秋季',
default='<span style="color:red">Autumn $date1</span>',
},
['winter'] = {
nDates = 1,
ar='شتاء $date1',
['be-tarask']='зіма $date1',
bn='শীতকাল $date1',
ca='hivern $date1',
cs={'zima $date1', case={'gen', ''}},
da='Vinter $date1',
de='Winter $date1',
en='Winter $date1',
['en-gb']='Winter $date1',
['en-ca']='Winter $date1',
eo='vintro $date1',
es='invierno de $date1',
et='$date1 talv',
fa='زمستان $date1',
fi='Talvi $date1',
fr='hiver $date1',
gl='inverno $date1',
he='חורף $date1',
hr='zima $date1',
hsb='zyma $date1',
hu='$date1 tele',
it='inverno $date1',
ja='{{#if:$date1|$date1年}}冬',
mk='зима $date1',
ml='$date1 ശൈത്യകാലം',
nds='Winter $date1',
nl='winter $date1',
nb='vinteren $date1',
nn='vinteren $date1',
no='vinteren $date1',
pl='zima $date1',
pt='inverno de $date1',
ro='iarna lui $date1',
ru='зима $date1',
sk={'zima $date1', case={'gen', ''}},
sl='zima $date1',
sv='vintern $date1',
uk='зима $date1',
ur='سرما $date1',
vi='mùa đông năm $date1',
['zh-hans']='{{#if:$date1|$date1年}}冬季',
['zh-hant']='{{#if:$date1|$date1年}}冬季',
default='<span style="color:red">Winter $date1</span>',
},
-- ==========================================
-- === Decade/Century/Millennium ============
-- ==========================================
['decade'] = {
nDates = 1,
ar='أعوام $date1',
['be-tarask']='$date1-я гады',
bn='$date1-এর দশক',
ca='dècada del $date1',
cs=function(date1, state) return ((date1 % 100 == 0) and 'první dekáda' or ((date1 % 100) .. '. léta')) .. ' ' .. (math.floor(date1 / 100) + 1) .. '. století' end,
da="$date1'erne",
de='$date1er-Jahre',
el='δεκαετία του $date1',
en='$date1s',
['en-gb']='$date1s',
['en-ca']='$date1s',
eo='$date1-aj jaroj',
es='años $date1',
et='$date1ndad',
fa='دههٔ $date1',
fi='$date1-luvulla',
fr='années $date1',
gl='anos $date1',
he='שנות ה-$date1',
hr='$date1-ih',
hsb='$date1te lěta',
hu='$date1-s évek',
it="{{#ifexpr: $date1 mod 100 = 0 | primo decennio del {{Roman|{{#expr: ($date1 / 100) + 1}}}} sec. | anni '{{#expr: $date1 mod 100 }} del {{رومن اعداد|{{#expr: floor($date1 / 100) + 1}}}} sec.}}",
ja='$date1年代',
mk='$date1-ти',
ml='ദശകം $date1-ൽ',
nb='$date1-årene',
nn='$date1-åra',
nds='Johren $date1',
nl='jaren $date1',
no='$date1-årene',
pl=function(date1, state)
local str = 'lata '..(date1 % 100)..'. '
if (date1 % 100 == 0) then
str = 'pierwsza dekada '
elseif (date1 % 100 == 10) then
str = 'druga dekada '
end
return str .. Roman(math.floor(date1 / 100) + 1) .. ' wieku'
end,
pt='década de $date1',
qu='$date1 watakuna',
ro='anii $date1',
ru='$date1-е годы',
sk=function(date1, state) return ((date1 % 100 == 0) and 'prvé desaťročie' or ((date1 % 100) .. '. roky')) .. ' ' .. (math.floor(date1 / 100) + 1) .. '. storočia' end,
sl='$date1-ta leta',
sv='$date1-talet{{#switch:$date1|1300|1400|1500|1600|1700|1800|1900|2000|2100= (decennium)}}',
uk='$date1-ті роки',
ur='دہائی $date1',
vi='thập niên $date1',
['zh-hans']='$date1年代',
['zh-hant']='$date1年代',
default='<span style="color:red">$date1s</span>',
},
['century'] = {
nDates = 1,
ar='القرن $date1',
['be-tarask']=function(date1, state) return Ordinal(date1, 'be-tarask') .. ' стагодзьдзе' end,
bn=function(date1, state) return Ordinal(date1, 'bn') .. ' শতাব্দী' end,
ca='segle {{small-caps|{{lc:{{Roman year|$date1}}}}}}',
cs='$date1. století',
da='$date1. århundrede',
de='$date1. Jahrhundert',
el='$date1ος αιώνας',
en=function(date1, state) return Ordinal(date1, 'en') .. ' century' end,
['en-gb']=function(date1, state) return Ordinal(date1, 'en-gb') .. ' century' end,
['en-ca']=function(date1, state) return Ordinal(date1, 'en-ca') .. ' century' end,
eo='$date1-a jarcento',
es=function(date1, state) return 'siglo ' .. Roman(date1) end,
et='$date1. sajand',
fa='سدهٔ $date1',
fi='{{#expr: ($date1 - 1) * 100}}-luvulla',
fr=function(date1, state) return Ordinal(date1, 'fr', 'roman', 'm') .. ' siècle' end,
gl=function(date1, state) return 'século ' .. Roman(date1) end,
he='המאה ה-$date1',
hr='$date1. stoljeće',
hsb='$date1. lětstotk',
hu='$date1. évszázad',
it=function(date1, state) return Roman(date1) .. ' sec.' end,
ja='$date1世紀',
la='saeculum $date1',
mk=function(date1, state) return Roman(date1) .. ' век' end,
ml='$date1-ആം നൂറ്റാണ്ട്',
nb=function(date1, state) return Ordinal(date1, 'nb') .. ' århundre' end,
nn=function(date1, state) return 'det ' .. Ordinal(date1, 'no') .. ' århundre' end,
nds='$date1. Johrhunnert',
nl='$date1e eeuw',
no=function(date1, state) return Ordinal(date1, 'no') .. ' århundre' end,
pl=function(date1, state) return Roman(date1) .. ' ' .. decCentury('pl',state.case) end,
pt=function(date1, state) return 'século ' .. Roman(date1) end,
qu='$date1 ñiqin pachakwata',
ro='secolul al $date1-lea',
ru=function(date1, state) return Roman(date1) .. ' век' end,
sk='$date1. storočie',
sl=function(date1, state) return Ordinal(date1, 'sl') .. '. stoletje' end,
sv='{{#expr:$date1 - 1}}00-talet',
tt=function(date1, state) return Roman(date1) .. ' гасыр' end,
uk=function(date1, state) return Roman(date1) .. ' ст.' end,
ur='صدی $date1',
vi='thế kỷ $date1',
['zh-hans']='$date1世纪',
['zh-hant']='$date1世紀',
default='<span style="color:red">$date1 century</span>',
},
['millennium'] = {
nDates = 1,
['be-tarask']=function(date1, state) return Ordinal(date1, 'be-tarask') .. ' тысячагодзьдзе' end,
bn=function(date1, state) return Ordinal(date1, 'bn') .. ' সহস্রাব্দ' end,
cs='$date1. tisíciletí',
de='$date1. Jahrtausend',
en=function(date1, state) return Ordinal(date1, 'en') .. ' millennium' end,
['en-gb']=function(date1, state) return Ordinal(date1, 'en-gb') .. ' millennium' end,
['en-ca']=function(date1, state) return Ordinal(date1, 'en-ca') .. ' millennium' end,
eo='$date1-a jarmilo',
es=function(date1, state) return Roman(date1) .. ' milenio' end,
fa=function(date1, state) return 'هزارهٔ ' .. Ordinal(date1, 'fa') end,
fr=function(date1, state) return Ordinal(date1, 'fr', 'roman', 'm') .. ' millénaire' end,
hr='$date1. tisućljeće',
hsb='$date1. lěttysac',
it=function(date1, state) return Roman(date1) .. ' millennio' end,
ja='$date1千年紀',
la='millennium $date1',
ml='$date1-മത്തെ സഹസ്രാബ്ദം',
nb=function(date1, state) return Ordinal(date1, 'nb') .. ' årtusen' end,
nn=function(date1, state) return Ordinal(date1, 'no') .. ' tusenår' end,
nl='$date1e millennium',
no=function(date1, state) return Ordinal(date1, 'no') .. ' årtusen' end,
pl=function(date1, state) return Roman(date1) .. ' ' .. decMillennium('pl',state.case) end,
pt=function(date1, state) return Roman(date1) .. ' milénio' end,
qu='$date1 ñiqin waranqawata',
ru=function(date1, state) return Roman(date1) .. ' тысячелетие' end,
sk='$date1. tisícročie',
sl=function(date1, state) return Ordinal(date1, 'sl') .. '. tisočletje' end,
sv=function(date1, state) return Ordinal(date1, 'sv') .. ' årtusendet' end,
uk=function(date1, state) return Roman(date1) .. ' тис.' end,
ur=function(date1, state) return 'ہزارہ ' .. Ordinal(date1, 'ur') end,
vi='thiên niên kỷ $date1',
['zh-hans']=function(date1, state) return Ordinal(date1, 'zh-hans') .. '千年' end,
['zh-hant']=function(date1, state) return Ordinal(date1, 'zh-hant') .. '千年' end,
--default='{{Please translate|$date1 millennium|Module:I18n/complex date}}',
default='<span style="color:red">$date1 millennium</span>',
},
['million'] = {
de = '$date1 Millionen Jahre',
en = '$date1 million years',
['en-gb'] = '$date1 million years',
['en-ca'] = '$date1 million years',
eo = '$date1 milionoj da jaroj',
es = '$date1 millones de años',
nl = '$date1e miljoen jaar',
fr = '$date1 millions d’années',
it = '$date1 milioni di anni',
ml = function(date1, state)
if date1 >= 10 then
return (date1 / 10) .. ' കോടി വർഷങ്ങൾ' -- 100 lakh = 1 crore
else
return (date1 * 10) .. ' ലക്ഷം വർഷങ്ങൾ'
end
end,
nb = '$date1 millioner år',
nl = '$date1 miljoen jaar',
nn = '$date1 millionar år',
pl = '$date1 milionów lat',
pt = '$date1 milhões de anos',
ru = '$date1 миллиона лет',
uk = '$date1 мільйони років',
ur = '$date1 ملین سال',
['zh-hans'] = '$date1百万年',
['zh-hant'] = '$date1百万年',
default='<span style="color:red">$date1 million years</span>',
nDates = 1,
},
['billion'] = {
de = '$date1 Milliarden Jahre',
en = '$date1 billion years',
['en-gb'] = '$date1 billion years',
['en-ca'] = '$date1 billion years',
es = '$date1 mil millones de años',
nl = '$date1e miljard jaar',
fr = '$date1 milliard d’années',
it = '$date1 miliardi di anni',
ml = function(date1, state) return (date1 * 10) .. ' കോടി വർഷങ്ങൾ' end,
nb = '$date1 milliarder år',
nl = '$date1 miljard jaar',
nn = '$date1 milliardar år',
pl = '$date1 miliardów lat',
pt = '$date1 mil milhões de anos',
ru = '$date1 миллиардов лет',
uk = '$date1 мільярдів років',
ur = '$date1 بلین سال',
['zh-hans'] = '$date1十亿年',
['zh-hant'] = '$date1十億年',
default='<span style="color:red$date1 billion years</span>',
nDates = 1,
},
-- ==========================================
-- === Complex phrases ======================
-- ==========================================
-- Phrases which for some languages can be build out of simpler phrases
-- Their "default" state, used when no translation in the requested language was found, returns a "state" like
-- table which is used to call the function again and built the phrase out of simple phrases
-- $date1 - original date - 1
-- $date2 - original date
-- if era is BC than $date1 and $date2 are swapped
['turn of the century'] = {
nDates = 2,
['be-tarask']=function(date1, date2, state) return 'канец ' .. Roman(date1) ..' — пачатак ' .. Roman(date2) ..' стагодзьдзя' end,
bn=function(date1, date2, state) return '$date1/' .. Ordinal(date2, 'bn') .. ' শতাব্দীর পালাবদলে' end,
cs='přelom $date1. a $date2. století',
de=function(date1, date2, state) return 'Jahrhundertwende $date1/' .. Ordinal(date2, 'de') end,
en=function(date1, date2, state) return 'turn of the $date1/' .. Ordinal(date2, 'en') .. ' century' end,
['en-gb']=function(date1, date2, state) return 'turn of the $date1/' .. Ordinal(date2, 'en-gb') .. ' century' end,
['en-ca']=function(date1, date2, state) return 'turn of the $date1/' .. Ordinal(date2, 'en-ca') .. ' century' end,
eo='ŝanĝo de la $date1-a al la $date2-a jarcentoj',
es=function(date1, date2, state) return 'hacia finales del siglo ' .. Roman(date1) .. ' y principios del siglo ' .. Roman(date2) .. '' end,
fi='{{#expr: $date1 * 100-100}}-luvun loppu ja {{#expr: $date2 * 100-100}}-luvun alku',
fr=function(date1, date2, state) return 'fin du ' .. Ordinal(date1, 'fr', 'roman', 'm') .. ' siècle / début du ' .. Ordinal(date2, 'fr', 'roman', 'm') end,
hr='kraj $date1. i početak $date2. stoljeća',
hsb=function(date1, date2, state) return 'přechod ' .. Roman(date1) ..' do ' .. Roman(date2) ..' lětstotka' end,
it=function(date1, date2, state) return 'fine del ' .. Roman(date1) .. ' sec. e inizio del ' .. Roman(date2) .. ' sec.' end,
ja='$date1世紀から$date2世紀への変わり目',
ml='$date1 നൂറ്റാണ്ട് അവസാനവും $date2 നൂറ്റാണ്ട് ആദ്യവും',
nb=function(date1, date2, state) return 'slutten av det ' .. Ordinal(date1, 'nb') .. ' århundre/begynnelsen av det ' .. Ordinal(date2, 'nb') .. ' århundre' end,
nl=function(date1, date2, state) return 'eind $date1e/begin $date2e eeuw' end,
nn=function(date1, date2, state) return 'slutten av det ' .. Ordinal(date1, 'nn') .. ' hundreåret/byrjinga av det ' .. Ordinal(date2, 'nn') .. ' hundreåret' end,
pl=function(date1, date2, state) return 'przełom ' .. Roman(date1) ..' i ' .. Roman(date2) ..' wieku' end,
qu="$date1 ñiqin waranqawatamanta $date2 ñiqin waranqawataman t'ikrasqanpi",
ru=function(date1, date2, state) return 'конец ' .. Roman(date1) ..' — начало ' .. Roman(date2) ..' века' end,
sk='prelom $date1. a $date2. storočia',
sl=function(date1, date2, state) return 'pozno ' .. Ordinal(date1, 'sl') .. '. in zgodnje ' .. Ordinal(date2, 'sl') .. '. stoletje' end,
sv=function(date1, date2, state) return '$date1/' .. Ordinal(date2, 'sv') .. ' årtusendets sekelskifte' end,
uk=function(date1, date2, state) return 'кін. ' .. Roman(date1) ..' ст. — поч. ' .. Roman(date2) ..' ст.' end,
vi='bước sang thế kỷ $date2',
['zh-hans']=function(date1, date2, state) return '$date1世纪末' .. Ordinal(date2, 'zh-hans') .. '世纪初' end,
['zh-hant']=function(date1, date2, state) return '$date1世紀末' .. Ordinal(date2, 'zh-hant') .. '世紀初' end,
default=function(date1, date2, state) return {conj='and', adj1 = 'late', unit1='century', era1=state.era1, adj2 = 'early', unit2='century', era2=state.era2} end,
},
-- $date1 - original date - 10
-- $date2 - original date
-- if era is BC than $date1 and $date2 are swapped
['turn of the decade']={
nDates = 2,
['be-tarask']='канец $date1-х — пачатак $date2-х гг.',
bn='$date1-এর দশকের শেষে এবং $date2-এর দশকের শুরুতে',
cs=function(date1, date2, state)
local decade1 = math.floor((date1 % 100) / 10)
local decade2 = math.floor((date2 % 100) / 10)
local century1 = math.floor( date1 / 100) + 1
local century2 = math.floor( date2 / 100) + 1
if decade1 == 0 and date1 < date2 then
return "přelom 1. a 2. dekády " .. century1 .. ". století"
elseif decade2 == 0 and date2 < date1 then
return "přelom 9. a 10. dekády " .. century1 .. ". století"
elseif (decade1 == 9 and date1 < date2) or (decade2 == 9 and date2 < date1) then
return "přelom " .. century1 .. ". a " .. century2 .. ". století"
else
return "přelom " .. decade1 .. "0. a " .. decade2 .. "0. let " .. century1 .. ". století"
end
end,
de='späte $date1er und frühe $date2er',
en='late $date1s and early $date2s',
['en-gb']='late $date1s and early $date2s',
['en-ca']='late $date1s and early $date2s',
eo='ŝanĝo de la $date1-a al la $date2-a jardekoj',
es='finales de los años $date1 y principios de los años $date2',
fa='اواخر دههٔ $date1 و اوایل دههٔ $date2',
fi='$date1-luvun loppu ja $date2-luvun alku',
fr='fin des années $date1 / début des années $date2',
hr='kraj $date1-ih i početak $date2-ih',
hsb='pózdnje $date1te a zažne $date2te lěta',
it='fine degli anni $date1 / inizio degli anni $date2',
ja='$date1年代末から$date2年代初頭',
ml='$date1കൾ അവസാനവും $date2കൾ ആദ്യവും',
nb = 'sent på $date1-tallet og tidlig på $date2-tallet',
nl = 'eind $date1e/begin $date2e decennium',
nn = 'seint på $date1-talet og tidleg på $date2-talet',
pl=function(date1, date2, state)
local decade1 = math.floor(date1 % 100)
local decade2 = math.floor(date2 % 100)
local century1 = Roman(math.floor( date1 / 100) + 1)
local century2 = Roman(math.floor( date2 / 100) + 1)
if decade1 == 0 and date1 < date2 then
return "przełom pierwszej i drugiej dekady " .. century1 .. " wieku"
elseif decade1 == 10 and date1 < date2 then
return "przełom drugiej dekady i lat 20. " .. century1 .. " wieku"
elseif decade1 == 90 and decade2 == 0 then
return "przełom ostatniej dekady " .. century1 .. " i pierwszej dekady " .. century2 .. " wieku"
else
return "przełom lat " .. decade1 .. ". i " .. decade2 .. ". " .. century1 .. " wieku"
end
end,
qu='qhipaq $date1 watakuna ñawpaq $date2 watakunapas',
ru='конец $date1-х — начало $date2-х гг.',
sv='sena $date1-talet och tidiga $date2-talet',
sk=function(date1, date2, state)
local decade1 = math.floor((date1 % 100) / 10)
local decade2 = math.floor((date2 % 100) / 10)
local century1 = math.floor( date1 / 100) + 1
local century2 = math.floor( date2 / 100) + 1
if decade1 == 0 and date1 < date2 then
return "prelom 1. a 2. desaťročia " .. century1 .. ". storočia"
elseif decade2 == 0 and date2 < date1 then
return "prelom 9. a 10. desaťročia " .. century1 .. ". storočia"
elseif (decade1 == 9 and date1 < date2) or (decade2 == 9 and date2 < date1) then
return "prelom " .. century1 .. ". a " .. century2 .. ". storočia"
else
return "prelom " .. decade1 .. "0. a " .. decade2 .. "0. rokov " .. century1 .. ". storočia"
end
end,
sl='pozna $date1-ta in zgodnja $date2-ta leta',
uk='кінець $date1-х — початок $date2-х рр.',
ur='اخیر دہائی $date1 و ابتدا دہائی $date2',
vi='bước sang thập niên $date2',
['zh-hans']='$date1年代末$date2年代初',
['zh-hant']='$date1年代末$date2年代初',
default=function(date1, date2, state) return {conj='and', adj1 = 'late', unit1='decade', era1=state.era1, adj2 = 'early', unit2='decade', era2=state.era2} end,
},
-- $date1 - original date - 1
-- $date2 - original date
-- if era is BC than $date1 and $date2 are swapped
['turn of the year']={
nDates = 2,
['be-tarask']='канец $date1 — пачатак $date2 г.',
bn='$date1-এর শেষে এবং $date2-এর শুরুতে',
cs='přelom roku $date1/$date2',
de='Jahreswechsel $date1/$date2',
en='late $date1 and early $date2',
['en-gb']='late $date1 and early $date2',
['en-ca']='late $date1 and early $date2',
eo='jarŝanĝo $date1 / $date2',
es='finales de $date1 y principios de $date2',
fa='اواخر $date1 و اوایل $date2',
fi='vuoden $date1 loppu ja vuoden $date2 alku',
fr='fin $date1 / début $date2',
hsb='kónc $date1/spočatk $date2',
ja='$date1年末から$date2年初め',
ml='$date1 അവസാനവും $date2 ആദ്യവും',
nb='årsskiftet $date1/$date2',
nl='eind $date1 en begin $date2',
nn='årsskiftet $date1/$date2',
pl='koniec $date1 i początek $date2 roku',
qu="$date1 qhipaq p'unchawkuna $date2 ñawpaq p'unchawkunapas",
ru='конец $date1 — начало $date2 г.',
sk='prelom rokov $date1/$date2',
sl='konec leta $date1 in začetek $date2',
sv='sena $date1 och tidiga $date2',
uk='кінець $date1 — початок $date2 р.',
ur='اخیر $date1 و ابتدا $date2',
vi='bước sang năm $date2',
['zh-hans']='$date1年末$date2年初',
['zh-hant']='$date1年末$date2年初',
default=function(date1, date2, state) return {conj='and', adj1 = 'late', unit1='year', era1=state.era1, adj2 = 'early', unit2='year', era2=state.era2} end,
},
['circa2'] = {
nDates = 2,
ar='قرابة $date1 – $date2',
['be-tarask']={'прыкладна з $date1 да прыкладна $date2', case={'gen','gen'}},
bn='প্রায় $date1 এবং প্রায় $date2-এর মাঝামাঝি',
ca='cap a $date1 o $date2',
cs='cca $date1 až $date2',
da='ca. mellem $date1 og $date2',
de='etwa $date1 bis $date2',
el='περίπου μεταξύ $date1 και $date2',
en='between circa $date1 and circa $date2',
['en-gb']='between circa $date1 and circa $date2',
['en-ca']='between circa $date1 and circa $date2',
eo='proksimume de $date1 ĝis $date2',
es='hacia $date1 o $date2',
et='ca. $date1 ja $date2 vahel',
fa='حدوداً بین $date1 و $date2',
fi={function(date1, date2, state) return 'suunnilleen ' .. decYear(state,'fi','xxx') .. '$date1 ja $date2 välisenä aikana' end, case={'gen','gen'}},
fr='vers $date1-$date2',
gl='entre $date1 e $date2',
he='בסביבות ה- $date1 עד $date2',
hr='oko između $date1 i $date2',
hsb={'wot něhdźe $date1 do něhdźe $date2', case={'gen','gen'}},
hu='$date1 és $date2 között',
it='tra il $date1 e il $date2 circa',
ja='$date1頃と$date2頃の間',
mk='~ помеѓу $date1 и $date2',
ml='ഉദ്ദേശം $date1-നും ഉദ്ദേശം $date2-നും ഇടയ്ക്ക്',
nb='ca. mellom $date1 og $date2',
nn='ca. mellom $date1 og $date2',
nds='üm un bi $date1 bet $date2',
nl='ca. $date1 tot $date2',
no='ca. mellom $date1 og $date2',
pl={'od około $date1 do około $date2', case={'gen','gen'}},
pt='cerca de $date1 a $date2',
qu="$date1 p'unchawmantachá $date2 p'unchawkamachá",
ro='circa $date1 – $date2',
ru={'с около $date1 до, примерно, $date2', case={'gen','gen'}},
sk='cca $date1 až $date2',
sl={function(date1, date2, state) return 'ok. ' .. decYear(state,'sl','gen') .. ' $date1 do $date2' end, case={'gen','gen'}},
sv='c:a $date1 till $date2',
uk={'з близько $date1 до, приблизно, $date2', case={'gen','gen'}},
ur='قریباً بین $date1 و $date2',
vi='giữa vào khoảng $date1 và vào khoảng $date2',
['zh-hans']='约$date1~$date2间',
['zh-hant']='約$date1~$date2間',
default=function(date1, date2, state) return {conj='between', adj1 = 'circa', unit1=state.unit1, era1=state.era1, adj2 = 'circa', unit2=state.unit2, era2=state.era2} end,
},
-- ==========================================
-- === Eras and calendars ===================
-- ==========================================
['julian'] = {
nDates = 2,
ar='$date1 ($date2 حسب [[w:ar:التقويم اليولياني|تقويم يولياني]])',
['be-tarask']='$date1 ($date2 паводле [[w:be-tarask:Юліянскі каляндар|ст. ст.]]',
bn='$date1 (জুলিয়ান ক্যালেন্ডারে $date2)',
ca='$date1 ($date2 segons el [[w:ca:Calendari julià|calendari julià]])',
cs='$date1 ($date2 podle [[w:cs:Juliánský kalendář|juliánského kalendáře]])',
da='$date1 ($date2 [[w:da:Julianske kalender|Julianske kalender]])',
de='$date1 ($date2 [[w:de:Julianischer Kalender|Julianischer Kalender]])',
el='$date1 ($date2 με το [[w:el:Ιουλιανό ημερολόγιο|Ιουλιανό ημερολόγιο]])',
en='$date1 ($date2 in [[w:Old Style and New Style dates|Julian calendar]])',
['en-gb']='$date1 ($date2 in [[w:Old Style and New Style dates|Julian calendar]])',
['en-ca']='$date1 ($date2 in [[w:Old Style and New Style dates|Julian calendar]])',
fa='$date1 ($date2 در [[w:fa:Old Style and New Style dates|تقویم جولیان]])',
eo='$date1 ($date2 laŭ la [[w:eo:Julia kalendaro|Julia Kalendaro]])',
es='$date1 ($date2 según el [[w:es:Calendario juliano|calendario juliano]])',
et='$date1 ($date2 [[w:et:Juliuse kalender|Juliuse kalendris]])',
fi='$date1 ($date2 [[w:fi:juliaaninen kalenteri|juliaanisen kalenterin]] mukaan)',
fr='$date1 ($date2 dans le [[w:fr:calendrier julien|calendrier julien]])',
gl='$date1 ($date2 segundo o [[w:gl:Calendario xuliano|calendario xuliano]])',
hu='$date1 ($date2 a [[w:hu:Julianus-naptár|Julián naptárban]])',
hr='$date1 ($date2 prema [[w:hr:Julijanski kalendar|julijanskom kalendaru]])',
he='$date1 ($date2 ב[[w:he:לוח היוליאני|הלוח היוליאני]])',
hsb='$date1 ($date2 po julianiskej protyce)',
it='$date1 ($date2 secondo il [[w:it:Calendario giuliano|calendario giuliano]])',
ja='$date1([[w:ja:ユリウス暦|ユリウス暦]] $date2)',
mk='$date1 ($date2 по [[w:mk:Јулијански календар|Јулијанскиот календар]])',
ml='$date1 ([[w:ml:ജൂലിയൻ കാലഗണനാരീതി|ജൂലിയൻ വർഷത്തിൽ]] $date2)',
ml='$date1 ([[w:Old Style and New Style dates|ജൂലിയൻ കാലഗണനാരീതിയിൽ]] $date2)',
nds='$date1 ($date2 na’n [[w:nds:Juliaansch Klenner|Juliaanschen Klenner]])',
nb='$date1 ($date2 etter [[w:no:Juliansk kalender|den julianske kalenderen]])',
nn='$date1 ($date2 etter [[w:no:Juliansk kalender|den julianske kalenderen]])',
nl='$date1 ($date2 volgens de [[w:nl:Juliaanse kalender|Juliaanse kalender]])',
no='$date1 ($date2 etter [[w:no:Juliansk kalender|den julianske kalender]])',
pl='$date1 ($date2 wedle [[w:pl:Daty nowego i starego porządku|kalendarza juliańskiego]])',
pt='$date1 ($date2 no [[w:pt:Mudança para o calendário gregoriano|calendário juliano]])',
qu='$date1 ($date2 [[w:qu:Hulyanu kalindaryu|Hulyanu kalindaryupi]])',
ro='$date1 ($date2 în [[w:ro:calendarul iulian|calendarul iulian]])',
ru='$date1 ($date2 [[w:ru:Юлианский календарь|по ст. ст.]])',
sk='$date1 ($date2 podľa [[w:sk:Juliánsky kalendár|juliánskeho kalendára]])',
sl='$date1 ($date2 po [[w:sl:Julijanski koledar|julijanskem koledarju]])',
sv='$date1 ($date2 [[w:sv:Gamla stilen|gamla stilen]])',
uk='$date1 ($date2 [[w:uk:Юліанський календар|Юліанський календар]])',
ur='$date1 ($date2 حسب [[w:ur:نئے اور پانے انداز کی تاریخ|جولین تقویم]])',
vi='$date1 ($date2 trong [[w:vi:Lịch Julius|lịch Juliêng]])',
['zh-hans']='$date1([[w:Old Style and New Style dates|格里历]]$date2)',
['zh-hant']='$date1([[w:Old Style and New Style dates|格里曆]]$date2)',
default='<span style="color:red">$date1 ($date2 in [[w:Old Style and New Style dates|Julian calendar]])</span>',
},
['ad'] = {
nDates = 1,
['be-tarask']='$date1 [[w:be-tarask:ад Нараджэньня Хрыста|пасьля Н. Х.]]',
bn ='$date1 খ্রিস্টাব্দ',
ca ='$date1 dC',
cs ='$date1 n. l.',
de ='$date1 n. Chr.',
el ='$date1 μ.Χ.',
en ='$date1 [[w:en:Anno Domini|AD]]',
['en-gb'] ='$date1 [[w:en:Anno Domini|AD]]',
['en-ca'] ='$date1 [[w:en:Anno Domini|AD]]',
eo ='$date1 pK',
es ='$date1 [[w:es:Anno Dómini|d. C.]]',
fa ='$date1 م.',
fi ='$date1 jaa.',
fr ='$date1 ap. J.-C.',
gl ='$date1 d.C.',
he ='$date1 לספירה',
hu ='i. sz. $date1',
hr ='$date1 p. Kr.',
hsb='$date1 po Chr.',
it ='$date1 d.C.',
ja ='西暦$date1',
mk ='$date1 н.е.',
ml ='ക്രി.വ. $date1',
nb ='$date1 e.Kr.',
nl ='$date1 n.Chr.',
nn ='$date1 e.Kr.',
no ='$date1 e.Kr.',
pl ='$date1 [[w:pl:naszej ery|n.e.]]',
ro ='$date1 d.Hr.',
ru ='$date1 н. э.',
sk ='$date1 po Kr.',
sl ='$date1 n. št.',
sv ='$date1 [[w:sv:Efter Kristus|e.Kr.]]',
uk ='$date1 н. е.',
ur ='$date1 ء',
vi ='$date1 [[w:vi:Công Nguyên|CN]]',
['zh-hans'] ='[[w:zh:基督纪年|公元]]$date1',
['zh-hant'] ='[[w:zh:基督纪年|公元]]$date1',
default='<span style="color:red">$date1 [[w:en:Anno Domini|AD]]</span>',
},
['ah'] = {
nDates = 1,
['be-tarask']='$date1 [[w:be-tarask:Ісламскі каляндар|хіджры]]',
bn ='$date1 [[w:bn:ইসলামি বর্ষপঞ্জি|হিজরী]]',
cs ='$date1 [[w:cs:Anno Hegirae|AH]]',
en ='$date1 [[w:en:Hijri year|AH]]',
['en-gb'] ='$date1 [[w:en:Hijri year|AH]]',
['en-ca'] ='$date1 [[w:en:Hijri year|AH]]',
eo ='$date1 post la [[w:eo:Heĝiro|Heĝiro]]',
fa ='$date1 ه.ق.',
fr ='$date1 [[w:fr:Calendrier musulman|A.H.]]',
he ="$date1 [[w:he:הלוח המוסלמי|להג'רה]]",
hr ='$date1 god. hidžre',
ja ='[[w:ja:ヒジュラ暦|ヒジュラ暦]]$date1',
ml ='$date1 [[w:ml:ഇസ്ലാമിക കലണ്ടർ|ഹിജ്റ]]',
nb ='$date1 [[w:no:Den muslimske kalenderen|A.H.]]',
nn ='$date1 [[w:nn:Den muslimske kalenderen|A.H.]]',
pl ='$date1 [[w:pl:Kalendarz muzułmański|A.H.]]',
ru ='$date1 [[w:ru:Исламский календарь|хиджры]]',
sk ='$date1 [[w:sk:A. H.|A. H.]]',
sv ='$date1 [[w:sv:Muslimska kalendern|A.H.]]',
uk ='$date1 [[w:uk:Мусульманський календар|хіджри]]',
ur ='$date1 ھ',
vi ='$date1 [[w:vi:Lịch Hồi giáo|AH]]',
['zh-hans'] ='[[w:en:Hijri year|Hijri历]]$date1',
['zh-hant'] ='[[w:en:Hijri year|Hijri曆]]$date1',
default='<span style="color:red">$date1 [[w:en:Hijri year|AH]]</span>',
},
['bc'] = {
nDates = 1,
ar ='$date1 ق.م.',
['be-tarask']='$date1 [[w:be-tarask:да Нараджэньня Хрыста|да Н. Х.]]',
bn ='খ্রিস্টপূর্ব $date1',
ca ='$date1 [[w:ca:Abans de Crist|aC]]',
cs ='$date1 [[w:cs:Př. n. l.|př. n. l.]]',
de ='$date1 [[w:de:v. Chr.|v. Chr.]]',
el ='$date1 π.Χ.',
en ='$date1 [[w:en:Ante Christum Natum|BC]]',
['en-gb'] ='$date1 [[w:en:Ante Christum Natum|BC]]',
['en-ca'] ='$date1 [[w:en:Ante Christum Natum|BC]]',
eo ='$date1 aK',
es ='$date1 [[w:es:Antes de Cristo|a. C.]]',
fa ='$date1 پ.م.',
fi ='$date1 eaa.',
fr ='$date1 av. J.-C.',
gl ='$date1 [[w:gl:Antes de Cristo|a.C.]]',
he ='$date1 לפני הספירה',
hr ='$date1 [[w:hr:Pr. Kr.|pr. Kr.]]',
hsb='$date1 do Chr.',
hu ='i. e. $date1',
it ='$date1 [[w:it:Avanti Cristo|a.C.]]',
ja ='[[w:ja:紀元前|紀元前]]$date1',
mk ='$date1 п.н.е.',
ml ='ക്രി.മു. $date1',
nds='$date1 vör uns Tied',
nb ='$date1 f.Kr.',
nl ='$date1 v.Chr.',
nn ='$date1 f.Kr.',
no ='$date1 f.Kr.',
pl ='$date1 [[w:pl:przed naszą erą|p.n.e.]]',
ro ='$date1 î.Hr.',
ru ='$date1 до н. э.',
sk ='$date1 [[w:sk:Pred Kristom|pred Kr.]]',
sl ='$date1 pr. n. št.',
sv ='$date1 [[w:sv:Före Kristus|f.Kr.]]',
uk ='$date1 до н. е.',
ur ='$date1 ق م',
vi ='$date1 [[w:vi:Trước Công Nguyên|TCN]]',
['zh-hans'] ='[[w:zh:基督纪年|公元前]]$date1',
['zh-hant'] ='[[w:zh:基督纪年|公元前]]$date1',
default='<span style="color:red">$date1 [[w:en:Ante Christum Natum|BC]]</span>',
},
['bp'] = {
nDates = 1,
ar ='$date1 [[w:ar:قبل الحاضر|قبل الحاضر]]',
be ='$date1 [[w:be-tarask:Да нашых дзён|Да нашых дзён]]',
['be-tarask']='$date1 [[w:be-tarask:Да нашых дзён|Да нашых дзён]]',
bn ='বর্তমানের আগে $date1',
ca ='$date1 [[w:ca:BP (unitat de temps)|BP]]',
cs ='$date1 [[w:cs:B. P.|B. P.]]',
de ='$date1 [[w:de:Before Present|BP]]',
el ='$date1 [[w:en:Before Present|BP]]',
en ='$date1 [[w:en:Before Present|BP]]',
['en-gb'] ='$date1 [[w:en:Before Present|BP]]',
['en-ca'] ='$date1 [[w:en:Before Present|BP]]',
eo='$date1 [[w:eo:Before Present|BP]]',
es ='$date1 [[w:es:Before Present|BP]]',
et ='$date1 [[w:et:Before Present|BP]]',
fa ='$date1 پیش از اکنون',
fi ='$date1 [[w:fi:BP (ajanlasku)|BP]]',
fr ='$date1 [[w:fr:Avant le présent|avant le présent]]',
hr ='$date1 [[w:hr:BP|prije današnjice]]',
it ='$date1 [[w:it:Before Present|BP]]',
ja ='$date1 [[w:ja:BP (年代測定)|BP]]',
lv ='$date1 [[w:lv:Pirms mūsdienām|Pirms mūsdienām]]',
mk ='$date1 [[w:mk:Пред сегашноста|п.с.]]',
ml ='[[w:en:Before Present|ഇന്നത്തെ കാലത്തിനു മുമ്പ്]] $date1',
nb ='$date1 [[w:no:Before Present|BP]]',
nn ='$date1 [[w:nn:Before Present|BP]]',
nl ='$date1 [[w:nl:Before Present|BP]]',
no ='$date1 [[w:no:Before Present|BP]]',
pl ='$date1 [[w:pl:Before Present|BP]]',
pt ='$date1 [[w:pt:Antes do Presente|Antes do Presente]]',
ru ='$date1 [[w:ru:До настоящего времени|до н. в.]]',
sk ='$date1 [[w:sk:BP (čas)|BP]]',
sl ='$date1 [[w:sl:pred sedanjostjo|p. s.]]',
sr ='$date1 [[w:sr:Прије садашњости|Прије садашњости]]',
sv ='$date1 [[w:sv:B.P.|B.P.]]',
uk ='$date1 [[w:uk:Років тому|Років тому]]',
ur ='$date1 قبل حاضر',
vi ='$date1 [[w:en:Before Present|trước ngày nay]]',
['zh-hans'] ='[[w:zh:距今|距今]]$date1',
['zh-hant'] ='[[w:zh:距今|距今]]$date1',
default='<span style="color:red">$date1 [[w:en:Before Present|BP]]</span>',
},
}
-- List of possible string inputs to "adj", "junction", "era", and "precision" fields
-- Each term is matched to its synonym and the role: a - adjective, e - era
-- p - precision, c - calendar and combos, r - certainty and j - conjunction
p.Synonyms = {
-- adjectives and prepositions
['quarter1']={'1quarter','a'},
['1stquarter']={'1quarter','a'},
['1st quarter']={'1quarter','a'},
['first quarter']={'1quarter','a'},
['1quarter']={'1quarter','a'},
['quarter2']={'2quarter','a'},
['2ndquarter']={'2quarter','a'},
['2nd quarter']={'2quarter','a'},
['second quarter']={'2quarter','a'},
['2quarter']={'2quarter','a'},
['quarter3']={'3quarter','a'},
['3rdquarter']={'3quarter','a'},
['3rd quarter']={'3quarter','a'},
['third quarter']={'3quarter','a'},
['3quarter']={'3quarter','a'},
['quarter4']={'4quarter','a'},
['4thquarter']={'4quarter','a'},
['4th quarter']={'4quarter','a'},
['fourth quarter']={'4quarter','a'},
['4quarter']={'4quarter','a'},
['spring']={'spring','a'},
['summer']={'summer','a'},
['fall']={'autumn','a'},
['autumn']={'autumn','a'},
['winter']={'winter','a'},
['beginning']={'early','a'},
['early']={'early','a'},
['1half']={'firsthalf','a'},
['1sthalf']={'firsthalf','a'},
['1st half']={'firsthalf','a'},
['firsthalf']={'firsthalf','a'},
['first half']={'firsthalf','a'},
['end']={'late','a'},
['late']={'late','a'},
['middle']={'mid','a'},
['mid']={'mid','a'},
['2half']={'secondhalf','a'},
['2ndhalf']={'secondhalf','a'},
['2nd half']={'secondhalf','a'},
['secondhalf']={'secondhalf','a'},
['second half']={'secondhalf','a'},
['<']={'before','a'},
['b']={'before','a'},
['before']={'before','a'},
['>']={'after','a'},
['a']={'after','a'},
['after']={'after','a'},
['~']={'circa','a'},
['c']={'circa','a'},
['ca']={'circa','a'},
['circa']={'circa','a'},
['by']={'by','a'},
['from']={'from','a'},
['until']={'until','a'},
['uncertain']={'uncertain','r'},
['possibly']={'possibly','r'},
['probably']={'probably','r'},
['presumably']={'presumably','r'},
-- eras
['bc']={'bc','e'},
['bce']={'bc','e'},
['before present']={'bp','e'},
['bp']={'bp','e'},
['ce']={'ad','e'},
['ad']={'ad','e'},
['ah']={'ah','e'},
-- conjunctions
['&']={'and','j'},
['and']={'and','j'},
['or']={'or','j'},
['-']={'from-until','j'},
['–']={'from-until','j'},
['from-until']={'from-until','j'},
['between']={'between','j'},
['circa2']={'circa2','a'},
-- precision
['day']={'day','p'},
['month']={'month','p'},
['year']={'year','p'},
['s']={'decade','p'},
['decade']={'decade','p'},
['century']={'century','p'},
['millennium']={'millennium','p'},
['million']={'million','p'},
['billion']={'billion','p'},
-- calendar
['julian']={'julian','c'},
['islamic']={'islamic','c'},
['hijri']={'islamic','c'},
-- "Turn of the ..." options are a combos which will be handled in similar way as calendars
['turn of the century']={'turn of the century','c'},
['century turn']={'turn of the century','c'},
['turn of the decade']={'turn of the decade','c'},
['decade turn']={'turn of the decade','c'},
['turn of the year']={'turn of the year','c'},
['year turn']={'turn of the year','c'},
-- other dates which will be handled in similar way as calendars
['?']={'unknown','c'},
['unknown']={'unknown','c'},
['unknown year']={'year unknown','c'},
['year unknown']={'year unknown','c'},
}
return p
c6fsvk80wkmtvjas472g6fpe7butw1d
ماڈیول:ISOdate
828
141235
690959
2025-07-10T15:31:13Z
Abbas dhothar
361
"--[[ This module is intended for processing of date strings. Please do not modify this code without applying the changes first at Module:ISOdate/sandbox and testing at Module:ISOdate/sandbox/testcases and Module talk:ISOdate/sandbox/testcases. Authors and maintainers: * User:Parent5446 - original version of the function mimicking template:ISOdate * User:Jarekt - original version of the functions mimicking template:Date and template:ISOyear ]]..." نال صفحہ بنایا گیا۔
690959
Scribunto
text/plain
--[[
This module is intended for processing of date strings.
Please do not modify this code without applying the changes first at Module:ISOdate/sandbox and testing
at Module:ISOdate/sandbox/testcases and Module talk:ISOdate/sandbox/testcases.
Authors and maintainers:
* User:Parent5446 - original version of the function mimicking template:ISOdate
* User:Jarekt - original version of the functions mimicking template:Date and template:ISOyear
]]
local p = {}
-- =======================================
-- === Dependencies ======================
-- =======================================
local D = require('Module:DateI18n') -- the enwp version of c:Module:Date
--[[
ISOyear
This function returns year part of date string.
Usage:
{{#invoke:ISOdate|ISOyear|target_string}}
Parameters
1: The date string
Error Handling:
If the string does not look like it contain the year than the function will not return anything.
That is the preferred treatment for the template:Creator which is the main (only?) template calling it.
]]
function p.ISOyear( frame )
return p._ISOyear( frame.args[1] )
end
function p._ISOyear( input )
if not input then
return ''
end
input = mw.text.trim( input )
-- if empty string then return it
if input == "" then
return input
end
-- if number then return it
if tonumber( input ) then
return mw.ustring.format( '%04i', input )
end
-- otherwise use regular expression match
input = mw.ustring.match( input, '^+?(-?%d%d?%d?%d?)-' )
if input and tonumber( input ) then
return mw.ustring.format( '%04i', input )
else
return ''
end
end
--[[
ISOdate
This function is the core part of the ISOdate template.
Usage:
{{#invoke:ISOdate|ISOdate|target_string|lang=}}
Parameters:
1: The date string
lang: The language to display it in
form: Language format (genitive, etc.) for some languages
class: CSS class for the <time> node
Error Handling:
If the string does not look like it contain the proper ISO date than the function will return the original string.
That is the preferred treatment for the template:Information (and similar templates) which calling it.
]]
function p.ISOdate(frame)
local datestr, succeded
local args = frame.args
if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then
args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
datestr, succeded = p._ISOdate(
mw.text.trim(args[1]),
args.lang, -- language
args.case or '', -- allows to specify grammatical case for the month for languages that use them
args.class or 'dtstart', -- allows to set the html class of the time node where the date is included.
args.trim_year or '100-999' -- by default pad one and 2 digit years to be 4 digit long, while keeping 3 digit years as is
)
return datestr
end
function p._ISOdate(datestr, lang, case, class, trim_year)
-- pattern: regexp - regular expresion to test; dlen - number of date elements; tail = which element is a "tail" if any
-- regexp hints:
-- 1) Strings starting with "^" and ending with "$" indicate whole string match
-- 2) optional tail part copied as-is and following the main parsed part of the date have to be separated from the date by a whitespace, so "(\s.+)?"
local patterns = {
-- strings starting with YYYY-MM-DD HH:MM:SS. Year 4 digits (if we know seconds than it was within the last 100 years), the rest 1-2
-- date and time can be separated by space or "T" and there could be a "Z" on the end indicating "Zulu" time zone
{dlen=6, tail=7, regexp="^+?(%d%d%d%d)-(%d%d?)-(%d%d?)[ T](%d%d?):(%d%d?):(%d%d?)Z?(%s.*)"},
{dlen=6, tail=0, regexp="^+?(%d%d%d%d)-(%d%d?)-(%d%d?)[ T](%d%d?):(%d%d?):(%d%d?)Z?$"},
-- strings starting with YYYY-MM-DD HH:MM. Year 4 digits, the rest 1-2
-- (if one knows hour and minute than it was probably after a year 1000)
{dlen=5, tail=6, regexp="^+?(%d%d%d%d)-(%d%d?)-(%d%d?)[ T](%d%d?):(%d%d?)(%s.+)"},
{dlen=5, tail=0, regexp="^+?(%d%d%d%d)-(%d%d?)-(%d%d?)[ T](%d%d?):(%d%d?)$"},
-- strings starting with YYYY-MM-DD. Year 1-4 digits, the rest 1-2
{dlen=3, tail=4, regexp="^+?(%d%d?%d?%d?)-(%d%d?)-(%d%d?)(%s.+)"},
{dlen=3, tail=0, regexp="^+?(%d%d?%d?%d?)-(%d%d?)-(%d%d?)$"},
-- strings starting with YYYY-MM. Year 3-4 digits, month 2 digits
-- (want to avoit converting to dates strings like 10-5 = 5
{dlen=2, tail=3, regexp="^+?(%d%d%d%d?)-(%d%d)(%s.+)"},
-- if whole string is in YYYY-MM form: If Year 1-4 digits, month 1-2 digits
{dlen=2, tail=0, regexp="^+?(%d%d?%d?%d?)-(%d%d?)$"},
-- string starts with a number -> it has to be 3 or 4 digit long to be a year
{dlen=1, tail=2, regexp="^+?(%d%d%d%d?)(%s.+)"},
-- if whole string is a number (1-4 digit long) than it will be interpreted as a year
{dlen=1, tail=0, regexp="^+?(%d%d?%d?%d?)$"},
}
-- create datevec based on which variables are provided
local datevec, tail, formatNum
datevec, tail, formatNum = p.test_date_formats(datestr or '', patterns)
if datevec[1]=='' or datevec[1]==nil then
-- quickly return if datestr does not look like date (it could be a template)
return datestr, false
end
-- call p._Date function to format date string
local succeded, datestr2
succeded, datestr2 = pcall( D._Date, datevec, lang, case, class, trim_year)
if succeded and datestr2~='' then
return mw.text.trim( datestr2 .. tail), true
else -- in case of errors return the original string
return datestr, false
end
end
function p.ISOdate_extended(frame)
-- pattern: regexp - regular expresion to test; dlen - number of date elements; tail = which element is a "tail" if any
-- regexp hints:
-- 1) Strings starting with "^" and ending with "$" indicate whole string match
-- 2) optional tail part copied as-is and following the main parsed part of the date have to be separated from the date by a whitespace, so "(\s.+)?"
local datestr, succeded
local args = frame.args
if not (args.lang and mw.language.isSupportedLanguage(args.lang)) then
args.lang = frame:callParserFunction( "int", "lang" ) -- get user's chosen language
end
datestr, succeded = p._ISOdate(
mw.text.trim(args[1]),
args.lang, -- language
args.case or '', -- allows to specify grammatical case for the month for languages that use them
args.class or 'dtstart', -- allows to set the html class of the time node where the date is included.
args.trim_year or '100-999' -- by default pad one and 2 digit years to be 4 digit long, while keeping 3 digit years as is
)
if succeded then
return datestr
end
local patterns = {
-- Exended set of recognized formats: like MM/DD/YYYY
{dlen=3, tail=4, regexp="^(%d%d?)[-./](%d%d?)[-./](%d%d%d%d)(%s.+)"},
{dlen=3, tail=0, regexp="^(%d%d?)[-./](%d%d?)[-./](%d%d%d%d)$"},
{dlen=3, tail=0, regexp="^(%d%d?)%s(%w+)%s(%d%d%d%d)$"},
{dlen=3, tail=0, regexp="^(%w+)%s(%d%d?),%s(%d%d%d%d)$"},
}
local datevec, tail, formatNum, category = ''
datevec, tail, formatNum = p.test_date_formats(frame.args[1], patterns)
if formatNum==1 or formatNum==2 then
vec = datevec;
if tonumber(datevec[1])>12 then
frame.args[1] = string.format('%04i-%02i-%02i', datevec[3], datevec[2], datevec[1] )
category = '[[Category:Date in DD/MM/YYYY format]]'
return mw.text.trim( p.ISOdate(frame) .. tail);
elseif tonumber(datevec[2])>12 then
frame.args[1] = string.format('%04i-%02i-%02i', datevec[3], datevec[1], datevec[2] )
category = '[[Category:Date in MM/DD/YYYY format]]'
return mw.text.trim( p.ISOdate(frame) .. tail);
end
elseif (formatNum==3 or formatNum==4) and (datevec[3]=='' or datevec[3]~=nil) then
local str = mw.getCurrentFrame():callParserFunction( "#time", { 'Y-m-d', datestr} )
local vec = {str:match( "^(%d%d?%d?%d?)-(%d%d?)-(%d%d?)$" )}
if vec and vec[1]~=nil then
frame.args[1] = string.format('%04i-%02i-%02i', vec[1], vec[2], vec[3] )
category = '[[Category:Date in word format]]'
return p.ISOdate(frame);
end
end
return datestr
end
function p.test_date_formats(datestr, patterns)
-- pattern: regexp - regular expresion to test; dlen - number of date elements; tail = which element is a "tail" if any
local datevec = {'','','','','',''}
local tail = ''
local vec, pat
local formatNum = 0
for i, pat in ipairs( patterns ) do
vec = {datestr:match( pat.regexp )}
if vec and vec[1]~=nil then
for j=1,pat.dlen do
datevec[j] = vec[j]
end
if pat.tail>0 and vec[pat.tail]~=nil then
tail = mw.ustring.gsub(' ' .. vec[pat.tail], ' +', ' ')
end
formatNum = i
break
end
end
return datevec, tail, formatNum
end
return p
dpdrvoipfynkz2frmnp4t2jmegv6mwr
ماڈیول:DateI18n
828
141236
690960
2025-07-10T15:32:52Z
Abbas dhothar
361
"--[[ __ __ _ _ ____ _ ___ _ ___ | \/ | ___ __| |_ _| | ___ _| _ \ __ _| |_ ___|_ _/ |( _ ) _ __ | |\/| |/ _ \ / _` | | | | |/ _ (_) | | |/ _` | __/ _ \| || |/ _ \| '_ \ | | | | (_) | (_| | |_| | | __/_| |_| | (_| | || __/| || | (_) | | | | |_| |_|\___/ \__,_|\__,_|_|\___(_)____/ \__,_|\__\___|___|_|\___/|_| |_| This module is intended for processing of date strings. Please do not..." نال صفحہ بنایا گیا۔
690960
Scribunto
text/plain
--[[
__ __ _ _ ____ _ ___ _ ___
| \/ | ___ __| |_ _| | ___ _| _ \ __ _| |_ ___|_ _/ |( _ ) _ __
| |\/| |/ _ \ / _` | | | | |/ _ (_) | | |/ _` | __/ _ \| || |/ _ \| '_ \
| | | | (_) | (_| | |_| | | __/_| |_| | (_| | || __/| || | (_) | | | |
|_| |_|\___/ \__,_|\__,_|_|\___(_)____/ \__,_|\__\___|___|_|\___/|_| |_|
This module is intended for processing of date strings.
Please do not modify this code without applying the changes first at Module:Date/sandbox and testing
at Module:Date/sandbox/testcases and Module talk:Date/sandbox/testcases.
Authors and maintainers:
* User:Parent5446 - original version of the function mimicking template:ISOdate
* User:Jarekt - original version of the functions mimicking template:Date
]]
require('strict')
-- ==================================================
-- === Internal functions ===========================
-- ==================================================
-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to Module:Yesno
local function yesno(val, default)
if type(val) == 'boolean' then
return val
elseif type(val) == 'number' then
if val==1 then
return true
elseif val==0 then
return false
end
elseif type(val) == 'string' then
val = mw.ustring.lower(val) -- put in lower case
if val == 'no' or val == 'n' or val == 'false' or tonumber(val) == 0 then
return false
elseif val == 'yes' or val == 'y' or val == 'true' or tonumber(val) == 1 then
return true
end
end
return default
end
---------------------------------------------------------------------------------------
-- String replacement that ignores part of the string in "..."
local function strReplace(String, old, new)
if String:find('"') then
local T={}
for i, str in ipairs(mw.text.split( String, '"', true )) do
if i%2==1 then
str = str:gsub(old, new)
end
table.insert(T, str)
end
return table.concat(T,'"')
else
return String:gsub(old, new)
end
end
---------------------------------------------------------------------------------------
-- process datevec
-- INPUT:
-- * datevec - Array of {year,month,day,hour,minute,second, tzhour, tzmin} containing broken
-- down date-time component strings or numbers
-- OUTPUT:
-- * datecode - a code specifying content of the array where Y' is year, 'M' is month,
-- 'D' is day, 'H' is hour, 'M' minute, 'S' is second. output has to be one of YMDHMS, YMDHM, YMD, YM, MD, Y
-- * datenum - same array but holding only numbers or nuls
local function parserDatevec(datevec)
-- if month is not a number than check if it is a month name in project's language
local month = datevec[2]
if month and month~='' and not tonumber(month) then
datevec[2] = mw.getContentLanguage():formatDate( "n", month)
end
-- create datecode based on which variables are provided and check for out-of-bound values
local maxval = {nil, 12, 31, 23, 59, 59, 23, 59} -- max values for year, month, ...
local minval = {nil, 1, 1, 0, 0, 0, -23, 0} -- min values for year, month, ...
local c = {'Y', 'M', 'D', 'H', 'M', 'S', '', ''}
local datecode = '' -- a string signifying which combination of variables was provided
local datenum = {} -- date-time encoded as a vector = [year, month, ... , second]
for i = 1,8 do
datenum[i] = tonumber(datevec[i])
if datenum[i] and (i==1 or (datenum[i]>=minval[i] and datenum[i]<=maxval[i])) then
datecode = datecode .. c[i]
end
end
return datecode, datenum
end
---------------------------------------------------------------------------------------
-- process datevec
-- INPUT:
-- * datecode - a code specifying content of the array where Y' is year, 'M' is month,
-- 'D' is day, 'H' is hour, 'M' minute, 'S' is second. output has to be one of YMDHMS, YMDHM, YMD, YM, MD, Y
-- * datenum - Array of {year,month,day,hour,minute,second, tzhour, tzmin} as numbers or nuls
-- OUTPUT:
-- * timeStamp - date string in the format taken by mw.language:formatDate lua function and {{#time}} perser function
-- https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.language:formatDate
-- https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23time
-- * datecode - with possible corrections
local function getTimestamp(datecode, datenum)
-- create time stamp string (for example 2000-02-20 02:20:20) based on which variables were provided
local timeStamp
if datecode == 'YMDHMS' then
timeStamp = string.format('%04i-%02i-%02i %02i:%02i:%02i', datenum[1], datenum[2], datenum[3], datenum[4], datenum[5], datenum[6] )
elseif datecode == 'YMDHM' then
timeStamp = string.format('%04i-%02i-%02i %02i:%02i', datenum[1], datenum[2], datenum[3], datenum[4], datenum[5] )
elseif datecode:sub(1,3)=='YMD' then
timeStamp = string.format('%04i-%02i-%02i', datenum[1], datenum[2], datenum[3] )
datecode = 'YMD' -- 'YMD', 'YMDHMS' and 'YMDHM' are the only supported format starting with 'YMD'. All others will be converted to 'YMD'
elseif datecode == 'YM' then
timeStamp = string.format('%04i-%02i', datenum[1], datenum[2] )
elseif datecode:sub(1,1)=='Y' then
timeStamp = string.format('%04i', datenum[1] )
datecode = 'Y'
elseif datecode == 'M' then
timeStamp = string.format('%04i-%02i-%02i', 2000, datenum[2], 1 )
elseif datecode == 'MD' then
timeStamp = string.format('%04i-%02i-%02i', 2000, datenum[2], datenum[3] )
else
timeStamp = nil -- format not supported
end
return timeStamp, datecode
end
---------------------------------------------------------------------------------------
-- trim leading zeros in years prior to year 1000
-- INPUT:
-- * datestr - translated date string
-- * lang - language of translation
-- OUTPUT:
-- * datestr - updated date string
local function trimYear(datestr, year, lang)
local yearStr0, yearStr1, yearStr2, zeroStr
yearStr0 = string.format('%04i', year ) -- 4 digit year in standard form "0123"
yearStr1 = mw.language.new(lang):formatDate( 'Y', yearStr0) -- same as calling {{#time}} parser function
--yearStr1 = mw.getCurrentFrame():callParserFunction( "#time", { 'Y', yearStr0, lang } ) -- translate to a language
if yearStr0==yearStr1 then -- most of languages use standard form of year
yearStr2 = tostring(year)
else -- some languages use different characters for numbers
yearStr2 = yearStr1
zeroStr = mw.ustring.sub(yearStr1,1,1) -- get "0" in whatever language
for i=1,3 do -- trim leading zeros
if mw.ustring.sub(yearStr2,1,1)==zeroStr then
yearStr2 = mw.ustring.sub(yearStr2, 2, 5-i)
else
break
end
end
end
return string.gsub(datestr, yearStr1, yearStr2 ) -- in datestr replace long year with trimmed one
end
---------------------------------------------------------------------------------------
-- Look up proper format string to be passed to {{#time}} parser function
-- INPUTS:
-- * datecode: YMDHMS, YMDHM, YMD, YM, MD, Y, or M
-- * day : Number between 1 and 31 (not needed for most languages)
-- * lang : language
-- OUTPUT:
-- * dFormat : input to {{#time}} function
local function getDateFormat(datecode, day, lang)
local function parseFormat(dFormat, day)
if dFormat:find('default') and #dFormat>10 then
-- special (and messy) case of dFormat code depending on a day number
-- then json contains a string with more json containing "default" field and 2 digit day keys
-- if desired day is not in that json than use "default" case
dFormat = dFormat:gsub('”','"') -- change fancy double quote to a straight one, used for json marking
local D = mw.text.jsonDecode( dFormat ) --com = mw.dumpObject(D)
day = string.format('d%02i',day) -- create day key
dFormat = D[day] or D.default
dFormat = dFormat:gsub("'", '"') -- change single quote to a double quote, used for {{#time}} marking
end
return dFormat
end
local T = {}
local tab = mw.ext.data.get('DateI18n.tab', lang)
for _, row in pairs(tab.data) do -- convert the output into a dictionary table
local id, _, msg = unpack(row)
T[id] = msg
end
local dFormat = T[datecode]
if dFormat=='default' and (datecode=='YMDHMS' or datecode=='YMDHM') then
-- for most languages adding hour:minute:second is done by adding ", HH:MM:SS to the
-- day precission date, those languages are skipped in DateI18n.tab and default to
-- English which stores word "default"
dFormat = parseFormat(T['YMD'], day).. ', H:i'
if datecode=='YMDHMS' then
dFormat = dFormat .. ':s'
end
else
dFormat = parseFormat(dFormat, day)
end
return dFormat
end
---------------------------------------------------------------------------------------
-- Look up proper format string to be passed to {{#time}} parser function
-- INPUTS:
-- * month : month number
-- * case : gramatic case abbriviation, like "ins", "loc"
-- * lang : language
-- OUTPUT:
-- * dFormat : input to {{#time}} function
local function MonthCase(month, case, lang)
local T = {{},{},{},{},{},{},{},{},{},{},{},{}}
local tab = mw.ext.data.get('I18n/MonthCases.tab', lang)
for _, row in pairs(tab.data) do
local mth, cs, msg = unpack(row)
T[mth][cs] = msg
end
return T[month][case]
end
-- ==================================================
-- === External functions ===========================
-- ==================================================
local p = {}
--[[ ========================================================================================
Date
This function is the core part of the ISOdate template.
Usage:
local Date = require('Module:DateI18n')._Date
local dateStr = Date({2020, 12, 30, 12, 20, 11}, lang)
Parameters:
* {year,month,day,hour,minute,second, tzhour, tzmin}: broken down date-time component strings or numbers
tzhour, tzmin are timezone offsets from UTC, hours and minutes
* lang: The language to display it in
* case: Language format (genitive, etc.) for some languages
* class: CSS class for the <time> node, use "" for no metadata at all
]]
function p._Date(datevec, lang, case, class, trim_year)
-- make sure inputs are in the right format
if not lang or not mw.language.isValidCode( lang ) then
lang = mw.getCurrentFrame():callParserFunction( "int", "lang" ) -- get user's chosen language
end
if lang == 'be-tarsk' then
lang = 'be-x-old'
end
-- process datevec and extract timeStamp and datecode strings as well as numeric datenum array
local datecode, datenum = parserDatevec(datevec)
local year, month, day = datenum[1], datenum[2], datenum[3]
local timeStamp, datecode = getTimestamp(datecode, datenum)
if not timeStamp then -- something went wrong in parserDatevec
return ''
end
-- Commons [[Data:DateI18n.tab]] page stores prefered formats for diferent
-- languages and datecodes (specifying year-month-day or just year of month-day, etc)
-- Look up country specific format input to {{#time}} function
local dFormat = getDateFormat(datecode, day, lang)
-- By default the gramatical case is not specified (case=='') allowing the format to be specified
-- in [[Data:DateI18n.tab]]. You can overwrite the default grammatical case of the month by
-- specifying "case" variable. This is needed mostly by Slavic languages to create more complex
-- phrases as it is done in [[c:Module:Complex date]]
case = case or ''
if (lang=='qu' or lang=='qug') and (case=='nom') then
-- Special case related to Quechua and Kichwa languages. The form in the I18n is
-- Genitive case with suffix "pi" added to month names provided by {#time}}
-- in Nominative case that "pi" should be removed
-- see https://commons.wikimedia.org/wiki/Template_talk:Date#Quechua from 2014
dFormat = dFormat:gsub('F"pi"', 'F')
elseif (case=='gen') then
dFormat = strReplace(dFormat, "F", "xg")
elseif (case=='nom') then
dFormat = strReplace(dFormat, "xg", "F")
elseif (case ~= '') then
-- see is page [[Data:I18n/MonthCases.tab]] on Commons have name of the month
-- in specific gramatic case in desired language. If we have it than replace
-- "F" and xg" in dFormat
local monthMsg = MonthCase(month, case, lang)
if monthMsg and monthMsg ~= '' then -- make sure it exists
dFormat = strReplace(dFormat, 'F', '"'..monthMsg..'"') -- replace default month with month name we already looked up
dFormat = strReplace(dFormat, 'xg', '"'..monthMsg..'"')
end
end
-- Translate the date using specified format
-- See https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#mw.language:formatDate and
-- https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions##time for explanation of the format
local datestr = mw.language.new(lang):formatDate( dFormat, timeStamp) -- same as using {{#time}} parser function
-- Special case related to Thai solar calendar: prior to 1940 new-year was at different
-- time of year, so just year (datecode=='Y') is ambiguous and is replaced by "YYYY or YYYY" phrase
if lang=='th' and datecode=='Y' and year<=1940 then
datestr = string.format('%04i หรือ %04i', year+542, year+543 )
end
-- If year<1000 than either keep the date padded to the length of 4 digits or trim it
-- decide if the year will stay padded with zeros (for years in 0-999 range)
if year and year<1000 then
if type(trim_year)=='nil' then
trim_year = '100-999'
end
local trim = yesno(trim_year,nil) -- convert to boolean
if trim==nil and type(trim_year)=='string' then
-- if "trim_year" not a simple True/False than it is range of dates
-- for example '100-999' means to pad one and 2 digit years to be 4 digit long, while keeping 3 digit years as is
local YMin, YMax = trim_year:match( '(%d+)-(%d+)' )
trim = (YMin~=nil and year>=tonumber(YMin) and year<=tonumber(YMax))
end
if trim==true then
datestr = trimYear(datestr, year, lang) -- in datestr replace long year with trimmed one
end
end
-- append timezone if present
if datenum[7] and (datecode == 'YMDHMS' or datecode == 'YMDHM') then
-- use {{#time}} parser function to create timezone string, so that we use correct character set
local sign = (datenum[7]<0) and '−' or '+'
timeStamp = string.format("2000-01-01 %02i:%02i:00", math.abs(datenum[7]), datenum[8] or 0)
local timezone = mw.language.new(lang):formatDate( 'H:i', timeStamp) -- same as using {{#time}} parser function
datestr = string.format("%s %s%s", datestr, sign, timezone )
end
-- html formating and tagging of date string
if class and class ~= '' and datecode~='M' and datecode~='MD'then
local DateHtmlTags = '<span style="white-space:nowrap"><time class="%s" datetime="%s">%s</time></span>'
datestr = DateHtmlTags:format(class, timeStamp, datestr)
end
return datestr
end
--[[ ========================================================================================
Date
This function is the core part of the ISOdate template.
Usage:
{{#invoke:DateI18n|Date|year=|month=|day=|hour=|minute=|second=|tzhour=|tzmin=|lang=en}}
Parameters:
* year, month, day, hour, minute, second: broken down date-time component strings
* tzhour, tzmin: timezone offset from UTC, hours and minutes
* lang: The language to display it in
* case: Language format (genitive, etc.) for some languages
* class: CSS class for the <time> node, use "" for no metadata at all
]]
function p.Date(frame)
local args = {}
for name, value in pairs( frame.args ) do
name = string.gsub( string.lower(name), ' ', '_')
args[name] = value
end
return p._Date(
{ args.year, args.month, args.day, args.hour, args.minute, args.second, args.tzhour, args.tzmin },
args.lang, -- language
args.case, -- allows to specify grammatical case for the month for languages that use them
args.class or 'dtstart', -- allows to set the html class of the time node where the date is included. This is useful for microformats.
args.trim_year or '100-999' -- by default pad one and 2 digit years to be 4 digit long, while keeping 3 digit years as is
)
end
return p
lcwmkh5p6iicle9dw7qzn6d8j6xkduv
ماڈیول:Calendar
828
141237
690961
2025-07-10T15:33:50Z
Abbas dhothar
361
"-- This module renders the calendar seen on [[Portal:Current events]]. local p = {} local function makeWikilink(link, display) if display then return string.format('[[%s|%s]]', link, display) else return string.format('[[%s]]', link) end end function p.main() local dateStuff = p.getDateStuff() local dayStrings = p.makeDayStrings(dateStuff) return p.export(dayStrings, dateStuff) end function p.getDateStuff() -- Gets date data. local dat..." نال صفحہ بنایا گیا۔
690961
Scribunto
text/plain
-- This module renders the calendar seen on [[Portal:Current events]].
local p = {}
local function makeWikilink(link, display)
if display then
return string.format('[[%s|%s]]', link, display)
else
return string.format('[[%s]]', link)
end
end
function p.main()
local dateStuff = p.getDateStuff()
local dayStrings = p.makeDayStrings(dateStuff)
return p.export(dayStrings, dateStuff)
end
function p.getDateStuff()
-- Gets date data.
local dateStuff = {}
local lang = mw.language.getContentLanguage()
--Year
local year = lang:formatDate('Y')
year = tonumber(year)
dateStuff.year = year
-- Month
local month = lang:formatDate('F')
dateStuff.month = month
-- Month and year
local monthAndYear = lang:formatDate('F Y')
local firstOfMonth = lang:formatDate('01-m-Y')
dateStuff.monthAndYear = monthAndYear
-- Previous month and year
dateStuff.previousMonthAndYear = lang:formatDate('F Y', firstOfMonth .. ' -1 month')
-- Next month and year
dateStuff.nextMonthAndYear = lang:formatDate('F Y', firstOfMonth .. ' +1 month')
-- Day
local day = lang:formatDate('j')
day = tonumber(day)
dateStuff.day = day
-- Days in month
local daysInMonth = lang:formatDate('j', firstOfMonth .. ' +1 month -1 day')
daysInMonth = tonumber(daysInMonth)
dateStuff.daysInMonth = daysInMonth
-- Weekday of the first day of the month
local firstWeekday = lang:formatDate('w', firstOfMonth) -- Sunday = 0, Saturday = 6
firstWeekday = tonumber(firstWeekday)
firstWeekday = firstWeekday + 1 -- Make compatible with Lua tables. Sunday = 1, Saturday = 7.
dateStuff.firstWeekday = firstWeekday
return dateStuff
end
function p.makeDayStrings(dateStuff)
local calStrings = {}
local currentDay = dateStuff.day
local isLinkworthy = p.isLinkworthy
local currentMonth = dateStuff.month
local currentYear = dateStuff.year
local makeDayLink = p.makeDayLink
for day = 1, dateStuff.daysInMonth do
if isLinkworthy(day, currentDay) then
calStrings[#calStrings + 1] = makeDayLink(day, currentMonth, currentYear)
else
calStrings[#calStrings + 1] = tostring(day)
end
end
return calStrings
end
function p.isLinkworthy(day, currentDay)
-- Returns true if the calendar day should be linked, and false if not.
-- Days should be linked if they are the current day or if they are within the six
-- preceding days, as that is the number of items on the current events page.
if currentDay - 6 <= day and day <= currentDay then
return true
else
return false
end
end
function p.makeDayLink(day, month, year)
return string.format("'''[[#%d %s %d| %d ]]'''", year, month, day, day)
end
function p.export(dayStrings, dateStuff)
-- Generates the calendar HTML.
local monthAndYear = dateStuff.monthAndYear
local root = mw.html.create('table')
root
:addClass('infobox')
:css{
display = 'table',
width = '100%',
float = 'initial',
['max-width'] = '350px',
margin = 'auto !important',
['text-align'] = 'center',
['background-color'] = '#f5faff',
border = '1px solid #cedff2'
}
-- Headings
:tag('tr')
:css('background-color', '#cedff2')
:tag('th')
:css{['text-align'] = 'center'}
:wikitext(makeWikilink('Portal:Current events/' .. dateStuff.previousMonthAndYear, '◀'))
:done()
:tag('th')
:attr('colspan', '5')
:css{['text-align'] = 'center'}
:wikitext(makeWikilink('Portal:Current events/' .. monthAndYear, monthAndYear))
:done()
:tag('th')
:css{['text-align'] = 'center'}
:wikitext(makeWikilink('Portal:Current events/' .. dateStuff.nextMonthAndYear, '▶'))
-- Day of week headings
local dayHeadingRow = root:tag('tr')
local weekdays = {'S', 'M', 'T', 'W', 'T', 'F', 'S'}
for i, weekday in ipairs(weekdays) do
dayHeadingRow:tag('th')
:css{['width'] = '14%', ['text-align'] = 'center'}
:wikitext(weekday)
end
-- Days
local colspan = dateStuff.firstWeekday - 1
local cellCount = 0 -- Tracks the number of day cells.
local firstDayRow = root:tag('tr')
if colspan > 1 then
firstDayRow:tag('td')
:attr('colspan', tostring(colspan))
elseif colspan == 1 then
firstDayRow:tag('td')
end
for i = colspan + 1, 7 do -- Finish the first row
cellCount = cellCount + 1
firstDayRow:tag('td')
:css{['text-align'] = 'center'}
:wikitext(dayStrings[cellCount])
end
while cellCount < #dayStrings do -- Second day row onwards
local otherDayRow = root:tag('tr')
for i = 1, 7 do
cellCount = cellCount + 1
local dayString = dayStrings[cellCount]
if not dayString then
dayString = " "
end
otherDayRow:tag('td')
:css{['text-align'] = 'center'}
:wikitext(dayString)
end
end
-- Footer
root:tag('tr')
:tag('td')
:attr('colspan', '7')
:css{['padding-top'] = '3px', ['padding-bottom'] = '5px', ['font-size'] = '78%', ['text-align'] = 'right'}
:wikitext(' ' .. makeWikilink('Portal:Current events/' .. monthAndYear, 'More ' .. monthAndYear .. ' events... '))
return tostring(root)
end
return p
dkg5em989dfopn43g89mdcuxes6hfmo
سانچہ:WDP
10
141238
690962
2025-07-10T15:36:16Z
Abbas dhothar
361
"<noinclude>{{دستاویز}}</noinclude><includeonly>[[d:Property:{{ {{{|safesubst:}}}#ifeq: {{ {{{|safesubst:}}}str left|{{{1|}}}|1}}|P||P}}{{{1|}}}|{{ {{{|safesubst:}}}label|{{ {{{|safesubst:}}}#ifeq: {{ {{{|safesubst:}}}str left|{{{1|}}}|1}}|P||P}}{{{1|}}}}}{{ {{{|safesubst:}}}#ifeq:{{{show_p|}}}|no|| <small>({{ {{{|safesubst:}}}#ifeq: {{ {{{|safesubst:}}}str left|{{{1|}}}|1}}|P||P}}{{{1|}}})</small>}}]]</includeonly>" نال صفحہ بنایا گیا۔
690962
wikitext
text/x-wiki
<noinclude>{{دستاویز}}</noinclude><includeonly>[[d:Property:{{ {{{|safesubst:}}}#ifeq: {{ {{{|safesubst:}}}str left|{{{1|}}}|1}}|P||P}}{{{1|}}}|{{ {{{|safesubst:}}}label|{{ {{{|safesubst:}}}#ifeq: {{ {{{|safesubst:}}}str left|{{{1|}}}|1}}|P||P}}{{{1|}}}}}{{ {{{|safesubst:}}}#ifeq:{{{show_p|}}}|no|| <small>({{ {{{|safesubst:}}}#ifeq: {{ {{{|safesubst:}}}str left|{{{1|}}}|1}}|P||P}}{{{1|}}})</small>}}]]</includeonly>
3873g958cxprtak6f4v9mzclv8i9sbn
سانچہ:Label
10
141239
690963
2025-07-10T15:36:58Z
Abbas dhothar
361
"{{ {{{|safesubst:}}}#invoke:Wikibase|label|{{{1}}}}}<noinclude> {{دستاویز}} </noinclude>" نال صفحہ بنایا گیا۔
690963
wikitext
text/x-wiki
{{ {{{|safesubst:}}}#invoke:Wikibase|label|{{{1}}}}}<noinclude>
{{دستاویز}}
</noinclude>
ohhocurptxqhbojmitovprgq28ss256
ماڈیول:Wikibase
828
141240
690964
2025-07-10T15:37:38Z
Abbas dhothar
361
"---------- Module:Wikibase ---------------- require('strict') local p = {} -- Return the entity ID of the item linked to the current page. function p.id(frame) if not mw.wikibase then return "no mw.wikibase" end return mw.wikibase.getEntityIdForCurrentPage() or "no entity" end -- Return the URL of an entity given its entity ID -- or the item linked to the current page if no argument is provided. function p.wdurl(frame) return mw.wikibase.getEn..." نال صفحہ بنایا گیا۔
690964
Scribunto
text/plain
---------- Module:Wikibase ----------------
require('strict')
local p = {}
-- Return the entity ID of the item linked to the current page.
function p.id(frame)
if not mw.wikibase then
return "no mw.wikibase"
end
return mw.wikibase.getEntityIdForCurrentPage() or "no entity"
end
-- Return the URL of an entity given its entity ID
-- or the item linked to the current page if no argument is provided.
function p.wdurl(frame)
return mw.wikibase.getEntityUrl(frame.args[1] and mw.text.trim(frame.args[1])) -- defaults to entity URL of the item linked to the current page
end
-- Return the label of an entity given its entity ID
-- or the item linked to the current page if no argument is provided.
function p.label(frame)
return mw.wikibase.getLabel(frame.args[1] and mw.text.trim(frame.args[1])) -- defaults to label of the item linked to the current page
end
-- Return the description of an entity given its entity ID
-- or the item linked to the current page if no argument is provided.
function p.description(frame)
return mw.wikibase.getDescription(frame.args[1] and mw.text.trim(frame.args[1])) -- defaults to description of the item linked to the current page
end
-- Return the local title of an item given its entity ID
-- or the item linked to the current page if no argument is provided.
function p.page(frame)
local qid = frame.args[1] and mw.text.trim(frame.args[1])
if not qid or qid == '' then
qid = mw.wikibase.getEntityIdForCurrentPage() -- default the item connected to the current page
end
return mw.wikibase.getSitelink(qid or '') -- requires one string arg
end
-- Return the data type of a property given its entity ID.
function p.datatype(frame)
local prop = mw.wikibase.getEntity(frame.args[1] and mw.text.trim(frame.args[1]):upper():gsub('PROPERTY:P', 'P')) -- trim and remove any "Property:" prefix
return prop and prop.datatype
end
return p
8y9vxlwc9zc3ajhmjw2av1llzhbmbee
سانچہ:Columns-start
10
141241
690965
2025-07-10T15:38:31Z
Abbas dhothar
361
"<templatestyles src="Column/styles.css"/><div class="columns-start columns-{{{num|2}}} {{{class|}}}" {{#if:{{{bgcolor|}}}{{{width|}}}|style="{{#if:{{{bgcolor|}}}|background-color: {{{bgcolor}}};}} {{#if:{{{width|}}}|width: {{{width}}}}}"}}><div class="column"><noinclude> </div></div> {{دستاویز}} <!-- Add categories to the /doc subpage, interwikis to Wikidata, not here --> </noinclude>" نال صفحہ بنایا گیا۔
690965
wikitext
text/x-wiki
<templatestyles src="Column/styles.css"/><div class="columns-start columns-{{{num|2}}} {{{class|}}}" {{#if:{{{bgcolor|}}}{{{width|}}}|style="{{#if:{{{bgcolor|}}}|background-color: {{{bgcolor}}};}} {{#if:{{{width|}}}|width: {{{width}}}}}"}}><div class="column"><noinclude>
</div></div>
{{دستاویز}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
e5anlwoe0m9dwrxp19piipn7jeyhsau
سانچہ:Column/styles.css
10
141242
690966
2025-07-10T15:39:08Z
Abbas dhothar
361
"/* {{Pp-template}} */ @media (min-width: 720px) { .columns-start { width: 100%; } .columns-start div.column { /* @noflip */ float: right; min-width: 20em; } .columns-2 div.column { width: 50%; } .columns-3 div.column { width: 33.3%; } .columns-4 div.column { width: 25%; } .columns-5 div.column { width: 20%; } }" نال صفحہ بنایا گیا۔
690966
sanitized-css
text/css
/* {{Pp-template}} */
@media (min-width: 720px) {
.columns-start {
width: 100%;
}
.columns-start div.column {
/* @noflip */
float: right;
min-width: 20em;
}
.columns-2 div.column {
width: 50%;
}
.columns-3 div.column {
width: 33.3%;
}
.columns-4 div.column {
width: 25%;
}
.columns-5 div.column {
width: 20%;
}
}
a4ac0ep38vscsfcmpiqe5rj8jrafxre
سانچہ:Column
10
141243
690967
2025-07-10T15:40:10Z
Abbas dhothar
361
"<templatestyles src = "Column/styles.css" />{{#if:{{{1|}}}|<div class="columns-start columns-{{{num|2}}} {{{class|}}}" {{#if:{{{bgcolor|}}}{{{width|}}}|style="{{#if:{{{bgcolor|}}}|background-color: {{{bgcolor}}};}} {{#if:{{{width|}}}|width: {{{width}}}}}"}}><div class="column"> {{#invoke:separated entries|main|separator= </div><div class="column"> }}</div><div style="clear: both"></div></div>|<noinclude><div></noinclude></div><div class="colum..." نال صفحہ بنایا گیا۔
690967
wikitext
text/x-wiki
<templatestyles src = "Column/styles.css" />{{#if:{{{1|}}}|<div class="columns-start columns-{{{num|2}}} {{{class|}}}" {{#if:{{{bgcolor|}}}{{{width|}}}|style="{{#if:{{{bgcolor|}}}|background-color: {{{bgcolor}}};}} {{#if:{{{width|}}}|width: {{{width}}}}}"}}><div class="column">
{{#invoke:separated entries|main|separator= </div><div class="column"> }}</div><div style="clear: both"></div></div>|<noinclude><div></noinclude></div><div class="column">}}<noinclude></div>
{{دستاویز|Template:Columns-start/doc}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
ndchb5iqmhrvv50ul1trou6yclzlnhw
وپ:لوا
0
141244
690970
2025-07-10T15:52:18Z
Abbas dhothar
361
"[[لوا (پروگرامنگ زبان)|لوا]] ایک پروگرامنگ زبان ہے۔ {{ویکیپیڈیا تکنیکی معاونت|collapsed}} [[زمرہ:ویکیپیڈیا صفحات معلومات]] [[زمرہ:خصوصیات ویکیپیڈیا]] [[زمرہ:ویکیپیڈیا ماڈیول]]" نال صفحہ بنایا گیا۔
690970
wikitext
text/x-wiki
[[لوا (پروگرامنگ زبان)|لوا]] ایک پروگرامنگ زبان ہے۔
{{ویکیپیڈیا تکنیکی معاونت|collapsed}}
[[زمرہ:ویکیپیڈیا صفحات معلومات]]
[[زمرہ:خصوصیات ویکیپیڈیا]]
[[زمرہ:ویکیپیڈیا ماڈیول]]
66eyyv364vuotzg04i9bls7r6ne2k0h
690971
690970
2025-07-10T15:52:32Z
Abbas dhothar
361
690971
wikitext
text/x-wiki
[[لوا (پروگرامنگ زبان)|لوا]] اک پروگرامنگ بولی اے۔
{{ویکیپیڈیا تکنیکی معاونت|collapsed}}
[[گٹھ:ویکیپیڈیا صفحات معلومات]]
[[گٹھ:خصوصیات ویکیپیڈیا]]
[[گٹھ:ویکیپیڈیا ماڈیول]]
9yowvjc5pthhkqdsn4agmklfibyeq5a
سانچہ:Columns-end
10
141245
690973
2025-07-10T16:00:41Z
Abbas dhothar
361
"<includeonly></div><div style="clear: both"></div></div></includeonly><noinclude> {{دستاویز|Template:Columns-start/doc}} <!-- Add categories to the /doc subpage, interwikis to Wikidata, not here --> </noinclude>" نال صفحہ بنایا گیا۔
690973
wikitext
text/x-wiki
<includeonly></div><div style="clear: both"></div></div></includeonly><noinclude>
{{دستاویز|Template:Columns-start/doc}}
<!-- Add categories to the /doc subpage, interwikis to Wikidata, not here -->
</noinclude>
qmdubnnz7zj0ksl8uonp18ug99dv2y5
سانچہ:Wikidata entity link
10
141246
690980
2025-07-10T16:14:44Z
Abbas dhothar
361
"<includeonly>{{#if:{{{1|}}} | {{#switch:{{padleft:|1|{{uc:{{{1}}}}}}} | Q | P = [[d:Special:EntityPage/{{uc:{{{1}}}}}|{{#invoke:wd|label|{{uc:{{{1}}}}}}} <small>({{uc:{{{1}}}}})</small>]] | #default = [[d:Special:EntityPage/Q{{uc:{{{1}}}}}|{{#invoke:wd|label|Q{{uc:{{{1}}}}}}} <small>(Q{{uc:{{{1|}}}}})</small>]] }} | {{#if:{{#invoke:wd|label|raw}} | d:Special:EntityPage/{{#invoke:wd|label|raw}}|{{#invoke:wd|label}} <small>({{#invoke:wd|label|..." نال صفحہ بنایا گیا۔
690980
wikitext
text/x-wiki
<includeonly>{{#if:{{{1|}}}
| {{#switch:{{padleft:|1|{{uc:{{{1}}}}}}}
| Q | P = [[d:Special:EntityPage/{{uc:{{{1}}}}}|{{#invoke:wd|label|{{uc:{{{1}}}}}}} <small>({{uc:{{{1}}}}})</small>]]
| #default = [[d:Special:EntityPage/Q{{uc:{{{1}}}}}|{{#invoke:wd|label|Q{{uc:{{{1}}}}}}} <small>(Q{{uc:{{{1|}}}}})</small>]]
}}
| {{#if:{{#invoke:wd|label|raw}}
| [[d:Special:EntityPage/{{#invoke:wd|label|raw}}|{{#invoke:wd|label}} <small>({{#invoke:wd|label|raw}})</small>]]
| <small>(no entity)</small>
}}
}}</includeonly><noinclude>{{Documentation}}</noinclude>
7blupfawedlkav9rkt891x7ri892zm0
سانچہ:Q
10
141247
690990
2025-07-10T16:35:27Z
Abbas dhothar
361
"{{#switch:{{str left|{{{1|}}}|1}} | Q = [[d:{{{1|}}}|{{لیبل|{{{1|}}}}} <small>({{{1|}}})</small>]] | P = [[d:Property:{{{1|}}}|{{لیبل|{{{1|}}}}} <small>({{{1|}}})</small>]] | [[d:Q{{{1|}}}|{{لیبل|Q{{{1|}}}}} <small>(Q{{{1|}}})</small>]] }}<noinclude> {{دستاویز}} </noinclude>" نال صفحہ بنایا گیا۔
690990
wikitext
text/x-wiki
{{#switch:{{str left|{{{1|}}}|1}}
| Q = [[d:{{{1|}}}|{{لیبل|{{{1|}}}}} <small>({{{1|}}})</small>]]
| P = [[d:Property:{{{1|}}}|{{لیبل|{{{1|}}}}} <small>({{{1|}}})</small>]]
| [[d:Q{{{1|}}}|{{لیبل|Q{{{1|}}}}} <small>(Q{{{1|}}})</small>]]
}}<noinclude>
{{دستاویز}}
</noinclude>
sus8mp9hssze045yy5lfzi8s2d6n0ih
سانچہ:لیبل
10
141248
690991
2025-07-10T16:35:50Z
Abbas dhothar
361
"{{ {{{|safesubst:}}}#invoke:Wikibase|label|{{{1}}}}}<noinclude> {{دستاویز}} </noinclude>" نال صفحہ بنایا گیا۔
690991
wikitext
text/x-wiki
{{ {{{|safesubst:}}}#invoke:Wikibase|label|{{{1}}}}}<noinclude>
{{دستاویز}}
</noinclude>
ohhocurptxqhbojmitovprgq28ss256
سانچہ:ویکی ڈیٹا2 قدر/ربط
10
141249
690996
2025-07-10T16:47:22Z
Abbas dhothar
361
"<includeonly>{{#switch:{{{1|}}}|لا=|no= |#default={{#switch:{{{ويكي بيانات|}}}|لا=|no= |#default={{#iferror:{{#invoke:Wikidata2{{#if:{{{ملعب|}}}|/{{{ملعب|}}}}} |formatStatements |entityId={{{صفحة|{{{معرف ويكي بيانات|}}}}}} |property={{{خاصية|}}} |numberofreferences={{{numberofreferences|{{{عدد المراجع|}}}}}} |otherproperty={{{خاصية أخرى|{{{otherproperty|}}} }}} |addTrackingCat ={{{addTrac..." نال صفحہ بنایا گیا۔
690996
wikitext
text/x-wiki
<includeonly>{{#switch:{{{1|}}}|لا=|no=
|#default={{#switch:{{{ويكي بيانات|}}}|لا=|no=
|#default={{#iferror:{{#invoke:Wikidata2{{#if:{{{ملعب|}}}|/{{{ملعب|}}}}}
|formatStatements
|entityId={{{صفحة|{{{معرف ويكي بيانات|}}}}}}
|property={{{خاصية|}}}
|numberofreferences={{{numberofreferences|{{{عدد المراجع|}}}}}}
|otherproperty={{{خاصية أخرى|{{{otherproperty|}}} }}}
|addTrackingCat ={{{addTrackingCat|yes}}}
|category={{{تصنيف|}}}
|noicon={{{رمز|{{{إيقونة|}}}}}}
|nocate={{{دون تصنيف|}}}
|icon2={{{icon2|}}}
|value= {{#if:{{{1|}}}
|{{#if:{{{قيمة موجودة|}}}|{{{قيمة موجودة|}}}|{{{1|}}} }}
|}}|mainprefix = {{#if:{{{قائمة شريطية|}}}|<div style="max-height:180px; overflow: auto; padding: 2px 0 2px 5px; background-color:transparent;vertical-align:top;font-size:100%">}}{{{سابقة|{{{بادئة|}}}}}}
|mainsuffix = {{{لاحقة|}}}
|mainsuffixAfterIcon = {{{لاحقة2|}}}{{#if:{{{قائمة شريطية|}}}|</div>}}
|property1pref ={{{سابقة خاصية قيمة|}}}
|property1suff ={{{لاحقة خاصية قيمة|}}}
|formatting ={{#if:{{{formatting|}}}|
{{{formatting|}}}|{{#switch:{{{خاصية|}}}
|P1811|P1881=sitelink
}}}}
|illwd2={{{illwd2|}}}
|pattern={{#if:{{{رقم|}}}|
|{{#if:{{{وصلة كاملة|}}}|
|{{#if:{{{وصلة|}}}|[{{{وصلة|}}} {{#if:{{{تسمية وصلة|}}}|{{{تسمية وصلة|}}}|$1}}]
|autourl2}}}}}}
|NoPropValue={{{تصنيف 3|{{{تصنيف3|{{{بديل|}}} }}} }}}
|noref=t
|qual1how={{{تصفية فقط|}}}
|modifytime = |{{{modifytime|}}}
|rank=best
|bothdates ={{{بداية ونهاية|}}}
|withdate ={{{نقطة|}}}
|separator={{#if:{{{قائمة|}}}{{{نقطة|}}}{{{بداية ونهاية|}}}{{{فاصل سطر|}}} {{#switch:{{lc:{{{خاصية|{{{property|}}} }}}}}|p27|p1532|p17|p495=y}}
|br|{{#if:{{{separator|}}}|{{{separator|}}}|، }}}}
|conjunction={{#if:{{{قائمة|}}}{{{نقطة|}}}{{{بداية ونهاية|}}}{{{فاصل سطر|}}} {{#switch:{{lc:{{{خاصية|{{{property|}}} }}}}}|p27|p1532|p17|p495=y}}
|br|{{#if:{{{separator|}}}|{{{separator|}}}|، }}}}
}}{{#if:{{{1|}}}|{{#if:{{{تصنيف2|}}}|{{#if:{{{خاصية|}}}|{{#if:{{#property:{{{خاصية|}}} }}||{{{تصنيف2|}}}}} }} }} }}|[[گٹھ:ویکی ڈیٹا سانچے وچ خرابی|{{{خاصية|}}}]]}}}}
}}</includeonly><noinclude>{{دستاویز}}</noinclude>
knpttgu43q71s0bj2guxfd6floruz43
سانچہ:Cite Q
10
141250
691000
2025-07-10T16:54:27Z
Abbas dhothar
361
"<includeonly>{{#invoke:Cite Q|cite_q|qid={{{1|{{{qid|}}}}}} }}</includeonly><noinclude> {{documentation}} </noinclude>" نال صفحہ بنایا گیا۔
691000
wikitext
text/x-wiki
<includeonly>{{#invoke:Cite Q|cite_q|qid={{{1|{{{qid|}}}}}} }}</includeonly><noinclude>
{{documentation}}
</noinclude>
31r8c6dbxzs4zvgqeap88a2j8vlm85g
ماڈیول:Cite Q/ملعب
828
141251
691005
2025-07-10T17:00:16Z
Abbas dhothar
361
"-- Version: 2021-10-19 -- معدلة محليًّا بكثافة local p = {} require('strict') local wdib = require('Module:WikidataIB/ملعب') local getValue = wdib._getValue local getValueFromSnaks = wdib._getValueFromSnaks local getPropOfProp = wdib._getPropOfProp local followQid = wdib._followQid local getPropertyIDs = wdib._getPropertyIDs local rtl_lang = {ar = true, fa = true, ur = true, ku = true, he = true, arc = true, dv = true, ha..." نال صفحہ بنایا گیا۔
691005
Scribunto
text/plain
-- Version: 2021-10-19 -- معدلة محليًّا بكثافة
local p = {}
require('strict')
local wdib = require('Module:WikidataIB/ملعب')
local getValue = wdib._getValue
local getValueFromSnaks = wdib._getValueFromSnaks
local getPropOfProp = wdib._getPropOfProp
local followQid = wdib._followQid
local getPropertyIDs = wdib._getPropertyIDs
local rtl_lang = {ar = true, fa = true, ur = true, ku = true,
he = true, arc = true, dv = true, ha = true, khw = true,
ks = true, ps = true, yi = true, ota = true }
local ref_cash = {}
local i18n = {
["unknown-author"] = mw.wikibase.getLabel("Q4233718"):gsub("^%l", mw.ustring.upper),
-- Next Line Edited
["unknown-author-trackingcat"] = "", -- [[Category:Cite Q - author unknown]]
["ordinal"] = {
[1] = "st",
[2] = "nd",
[3] = "rd",
["default"] = "th"
},
["months"] = {
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
},
["ar"] = {
illustrator = "رسم",
composer = "تلحين",
animator = "رسم الرسوم المتحركة",
director = "إخراج",
screenwriter = "سيناريو",
signatory = "توقيع",
presenter = "تقديم",
performer = "أداء",
annotator = "تحقيق",
reviewer = "مراجعة",
unknown = "مجهول",
["unknown-publication-date"] = '<abbr class="abbr" title="دون تاريخ">د.ت.</abbr>',
wikidata = "ويكي بيانات"
}
}
local rejected = {
sources = {
Q465 = true,
Q15241312 = true,
Q52 = true
},
properties = { "P1800", "P1566", "P21"},
instances = {
Q5 = true, -- Human is not a direct reference
Q184188 = true,
Q1250464 = true,
-- inatance of refference DBs
Q8513 = true,
Q17152639 = true,
Q7094076 = true,
Q5535082 = true,
Q856638= true,
Q1982918 = true,
Q36524 = true,
Q36218176 = true,
Q526334 = true,
Q5227411 = true
}
}
-------------------------------------------------------------------------------
-- makeOrdinal needs to be internationalised along with the above i18n
-- takes cardinal number as a numeric and returns the ordinal as a string
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.
-------------------------------------------------------------------------------
p.makeOrdinal = function(cardinal)
local card = tonumber(cardinal)
if not card then return cardinal end
local ordsuffix = i18n.ordinal.default
if card % 10 == 1 then
ordsuffix = i18n.ordinal[1]
elseif card % 10 == 2 then
ordsuffix = i18n.ordinal[2]
elseif card % 10 == 3 then
ordsuffix = i18n.ordinal[3]
end
-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'
-- similarly for 12 and 13, etc.
if (card % 100 == 11) or (card % 100 == 12) or (card % 100 == 13) then
ordsuffix = i18n.ordinal.default
end
return card .. ordsuffix
end
-- Table of simple properties that can be fetched in roughly the same way:
-- id = PXXX
-- maxvals = maximum number of multiple values (0 for all)
-- linked = "no" suppresses linking
-- populate_from_journal = true/false determines whether to look in a journal where the source is published
-- rank = "best", "preferred", normal, etc. determines how Wikidata ranks are treated
-- others = true - the value for the property goes to "others" section
local simple_properties = {
-- Next Line Edited
publisher = {id = "P123", maxvals = 3},
oclc = {id = "P243", maxvals = 1},
['publication-place'] = {id = "P291", maxvals = 0, linked = 'no'}, -- publication place (don't put into |place=; is treated specially in {{citation}} if both are given)
doi = {id = "P356", maxvals = 1}, -- take care of |doi-broken-date= (WD "reason for deprecation"/"stated as") and |doi-access= (WD "access status")?
issue = {id = "P433", maxvals = 0, populate_from_journal = true}, -- distinguish from |number= ("P1545"?) if both are given (still blocked by {{citation}}, but will be supported in the future)
pmid = {id = "P698", maxvals = 1},
-- gbooks = {id = "P675", maxvals = 1}, -- to be added to {{citation}}
-- ia = {id = "P724", maxvals = 1}, -- to be added to {{citation}}
arxiv = {id = "P818", maxvals = 1},
bibcode = {id = "P819", maxvals = 1}, -- take care of |bibcode-access=?
jstor = {id = "P888", maxvals = 1}, -- take care of |jstor-access=?
mr = {id = "P889", maxvals = 1},
rfc = {id = "P892", maxvals = 1},
zbl = {id = "P894", maxvals = 1},
ssrn = {id = "P893", maxvals = 1},
place = {id = "P1071", maxvals = 0, linked = 'no'}, -- written-at place
-- ['total-pages'] = {id = "P1104", maxvals = 0, linked = 'no'}, -- to be added to {{citation}} / COinS &rft.tpages=
-- coden = {id = "P1159", maxvals = 1}, -- to be added to {{citation}} / COinS &rft.coden=
s2cid = {id = "P8299", maxvals = 1}, -- take care of |s2cid-access=?
pmc = {id = "P932", maxvals = 1}, -- take care of |pmc-embargo-date= (WD "reason for deprecation")?
lccn = {id = "P1144", maxvals = 1},
hdl = {id = "P1184", maxvals = 1}, -- take care of |hdl-access=?
ismn = {id = "P1208", maxvals = 1},
journal = {id = "P1433", maxvals = 1},
citeseerx = {id = "P3784", maxvals = 1},
osti = {id = "P3894", maxvals = 1}, -- take care of |osti-access=?
biorxiv = {id = "P3951", maxvals = 1},
asin = {id = "P5749", maxvals = 1}, -- What about |asin-tld=? (WD examples resolve to .com at present, but may change)
-- ['catalog-number'] = {id = "P528", maxvals = 0}, -- to be added to {{citation}} / COinS &rft.artnum=
isbn = {id = "P212", maxvals = 1, populate_from_journal = true}, -- ISBN 13
issn = {id = "P236", maxvals = 1, populate_from_journal = true}, -- distinguish from |eissn= for electronic issues?
-- jfm = {id = "P?", maxvals = 1}, -- Jahrbuch über die Fortschritte der Mathematik (not Zbl)
-- sbn = {id = "P?", maxvals = 1}, -- Standard Book Number (predecessor of ISBN, not ICCU)
-- message-id = {id = "P?", maxvals = 1}, -- Usenet message ID
chapter = {id = "P792", maxvals = 1},
['publication-date'] = {id = "P577", maxvals = 1, populate_from_journal = true}, -- publication date (don't use |date=; is treated specially in {{citation}} if both are given.)
series = {id = "P179", maxvals = 1, populate_from_journal = true, qual = "P1545"},
version = {id = "P348", maxvals = 0},
edition = {id = "P393", maxvals = 0},
volume = {id = "P478", maxvals = 0, populate_from_journal = true},
-- part = {id = "P1545"?, maxvals = 0}, -- to be added to {{citation}} / COinS &rft.part=
title = {id = "P1476", rank="p n"},
-- url = {id = "P953", maxvals = 1}, -- deal with this along with archive-url
pages = {id = "P304", maxvals = 0, populate_from_journal = true},
at = {id = "P958", maxvals = 0, populate_from_journal = true}, -- also incorporate lines (P7421) and columns (P3903) into this (cite map also supports |section=)
-- sheets = {id = "P7416", maxvals = 0, populate_from_journal = true},
-- interviewer = {id = "P?", maxvals = 0}, -- does **not** go to "others" section! Multiple interviewers should be n-enumerated
illustrator = {id = "P110", maxvals = 10, others = true}, -- goes to "others" section
-- foreword and afterword, when contributions to another author's work, are contributions so belong in |contribution=;
-- the writer's name goes in |contributor=; requires |title= and |author=
-- However, this might need to add support for multiple contributors and their roles to {{citation}}, see Help_talk:Citation_Style_1#Others
-- foreword = {id = "P2679", maxvals = 10, others = true}, -- goes to "others" section
-- afterword = {id = "P2680", maxvals = 10, others = true}, -- goes to "others" section
composer = {id = "P86", maxvals = 10, others = true}, -- goes to "others" section
animator = {id = "P6942", maxvals = 10, others = true}, -- goes to "others" section
director = {id = "P57", maxvals = 10, others = true}, -- goes to "others" section
screenwriter = {id = "P58", maxvals = 10, others = true}, -- goes to "others" section
signatory = {id = "P1891", maxvals = 10, others = true}, -- goes to "others" section
presenter = {id = "P371", maxvals = 10, others = true}, -- goes to "others" section
performer = {id = "P175", maxvals = 10, others = true}, -- goes to "others" section
-- next 2 lines added for Arabic Wikipedia
annotator = {id ="P11105", maxvals = 10, others = true}, -- goes to "others" section
reviewer = {id ="P4032", maxvals = 10, others = true}, -- goes to "others" section
}
-- all_used_properties
local used_properties = {
P1071 = {arg= "place", maxvals = 0, linked = 'no'}, -- written-at place
P110 = {arg= "illustrator", maxvals = 10, others = true}, -- goes to "others" section
P11105 = {arg= "annotator", maxvals = 10, others = true}, -- goes to "others" section
P1144 = {arg= "lccn", maxvals = 1},
P1184 = {arg= "hdl", maxvals = 1}, -- take care of |hdl-access=?
P1208 = {arg= "ismn", maxvals = 1},
P123 = {arg= "publisher", maxvals = 3},
P1433 = {arg= "journal", maxvals = 1},
P1476 = {arg= "title", rank="p n"},
P1680 = true,
P175 = {arg= "performer", maxvals = 10, others = true}, -- goes to "others" section
P179 = {arg= "series", maxvals = 1, populate_from_journal = true},
P1891 = {arg= "signatory", maxvals = 10, others = true}, -- goes to "others" section
P1932 = true,
P2093 = true, -- author string
P212 = {arg= "isbn", maxvals = 1, populate_from_journal = true}, -- ISBN 13
P236 = {arg= "issn", maxvals = 1, populate_from_journal = true}, -- distinguish from |eissn= for electronic issues?
P243 = {arg= "oclc", maxvals = 1},
P2699 = true,
P291 = {arg= "publication-place", maxvals = 0, linked = 'no'}, -- publication place (don't put into |place=; is treated specially in {{citation}} if both are given)
P304 = {arg= "pages", maxvals = 0, populate_from_journal = true},
P348 = {arg= "version", maxvals = 0},
P356 = {arg= "doi", maxvals = 1}, -- take care of |doi-broken-date= (WD "reason for deprecation"/"stated as") and |doi-access= (WD "access status")?
P371 = {arg= "presenter", maxvals = 10, others = true}, -- goes to "others" section
P3784 = {arg= "citeseerx", maxvals = 1},
P3894 = {arg= "osti", maxvals = 1}, -- take care of |osti-access=?
P393 = {arg= "edition", maxvals = 0},
P3951 = {arg= "biorxiv", maxvals = 1},
P4032 = {arg= "reviewer", maxvals = 10, others = true}, -- goes to "others" section
P407 = true,
P433 = {arg= "issue", maxvals = 0, populate_from_journal = true}, -- distinguish from |number= ("P1545"?) if both are given (still blocked by {{citation}}, but will be supported in the future)
P478 = {arg= "volume", maxvals = 0, populate_from_journal = true},
P50 = true, -- author
P57 = {arg= "director", maxvals = 10, others = true}, -- goes to "others" section
P5749 = {arg= "asin", maxvals = 1}, -- What about |asin-tld=? (WD examples resolve to .com at present, but may change)
P5769 = true, --editor
P577 = {arg= "publication-date", maxvals = 1, populate_from_journal = true}, -- publication date (don't use |date=; is treated specially in {{citation}} if both are given.)
P58 = {arg= "screenwriter", maxvals = 10, others = true}, -- goes to "others" section
P655 = true,
P6942 = {arg= "animator", maxvals = 10, others = true}, -- goes to "others" section
P698 = {arg= "pmid", maxvals = 1},
P792 = {arg= "chapter", maxvals = 1},
P818 = {arg= "arxiv", maxvals = 1},
P819 = {arg= "bibcode", maxvals = 1}, -- take care of |bibcode-access=?
P8299 = {arg= "s2cid", maxvals = 1}, -- take care of |s2cid-access=?
P856 = true,
P86 = {arg= "composer", maxvals = 10, others = true}, -- goes to "others" section
P888 = {arg= "jstor", maxvals = 1}, -- take care of |jstor-access=?
P889 = {arg= "mr", maxvals = 1},
P892 = {arg= "rfc", maxvals = 1},
P893 = {arg= "ssrn", maxvals = 1},
P894 = {arg= "zbl", maxvals = 1},
P932 = {arg= "pmc", maxvals = 1}, -- take care of |pmc-embargo-date= (WD "reason for deprecation")?
P953 = true,
P958 = {arg= "at", maxvals = 0, populate_from_journal = true}, -- also incorporate lines (P7421) and columns (P3903) into this (cite map also supports |section=)
P98 = true,
P854 = true,
}
--[[--------------------------< I S _ S E T >--------------------------------------------------------------
Returns true if argument is set; false otherwise. Argument is 'set' when it exists (not nil) or when it is not an empty string.
]]
local function is_set( var )
return not (var == nil or var == '')
end
--[[--------------------------< I N _ A R R A Y >--------------------------------------------------------------
Whether needle is in haystack (taken from Module:Citation/CS1/Utilities)
]]
local function in_array( needle, haystack )
if needle == nil then
return false
end
for n, v in ipairs( haystack ) do
if v == needle then
return n
end
end
return false
end
--[[--------------------------< A C C E P T _ V A L U E >-------------------------------------------------------
Accept WD value by framing in ((...)) if param_val is equal to keyword; else pass-through WD value as is.
]]
local function accept_value( param_val, wd_val )
local val = param_val
if val then
if in_array (val, {'accept', '))((', ':d:'}) then
val = '((' .. wd_val .. '))'
elseif '((accept))' == val then
val = 'accept'
elseif '(())(())' == val then
val = '))(('
elseif '((:d:))' == val then
val = ':d:'
else
val = wd_val
end
end
return val
end
-- function to fetch a value to display
local function makelink(v, out, link, maxpos, wdl, lang)
local label
if v.mainsnak.snaktype == "value" then
if v.mainsnak.datatype == "wikibase-item" then
local qnumber = v.mainsnak.datavalue.value.id
local sitelink = mw.wikibase.getSitelink(qnumber)
if qnumber == "Q2818964" then sitelink = nil end -- suppress link to "Various authors"
-- من المهم التحقق من وجود datavalue
if v.qualifiers and v.qualifiers.P1932 and v.qualifiers.P1932[1].datavalue then
label = v.qualifiers.P1932[1].datavalue.value
else
label = mw.wikibase.getLabelByLang(qnumber, lang) or mw.wikibase.getLabel(qnumber)
if label then
label = mw.text.nowiki(label)
else
label = qnumber -- should add tracking category
end
end
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
if sitelink then
-- just the plain name,
-- but keep a record of the links, using the same index
out[position] = label
link[position] = sitelink
else
if wdl then
-- show that there's a Wikidata entry available
out[position] = "[[:d:Q" .. v.mainsnak.datavalue.value["numeric-id"] .. "|" .. label .. "]] <span title='" .. i18n["errors"]["local-article-not-found"] .. "'>[[File:Wikidata-logo.svg|16px|alt=|link=]]</span>"
else
-- no Wikidata links wanted, so just give the plain label
out[position] = label
end
end
elseif v.mainsnak.datatype == "string" then
local position = maxpos + 1 -- Default to 'next' author.
-- use P1545 (series ordinal) instead of default position.
if v["qualifiers"] and v.qualifiers["P1545"] and v.qualifiers["P1545"][1] then
position = tonumber(v.qualifiers["P1545"][1].datavalue.value)
end
maxpos = math.max(maxpos, position)
out[position] = v.mainsnak.datavalue.value
else
-- not a wikibase-item or a string!
end
else
-- code here if we want to return something when author is "unknown"
-- من المهم التحقق من وجود datavalue
if v.qualifiers and v.qualifiers.P1932 and v.qualifiers.P1932[1].datavalue then
label = v.qualifiers.P1932[1].datavalue.value
else
label = i18n["unknown-author"] .. (i18n["unknown-author-trackingcat"] or "")
end
maxpos = maxpos + 1
out[maxpos] = label
end
return maxpos
end
--[=[-------------------------< G E T _ N A M E _ L I S T >----------------------------------------------------
get_name_list -- adapted from getAuthors code taken from Module:RexxS
arguments:
nl_type - type of name list to fetch: nl_type = 'author' for authors; 'editor' for editors; 'translator' for translators
args - pointer to the parameter arguments table from the template call
qid - value from |qid= parameter; the Q-id of the source (book, etc.) in qid
wdl - value from the |wdl= parameter; a Boolean passed to enable links to Wikidata when no article exists
returns nothing; modifies the args table
]=]
local function get_name_list (nl_type, args, qid, wdl, lang, refsnak)
local propertyID = "P50"
local fallbackID = "P2093" -- author name string
if nl_type =="author" then
propertyID = 'P50' -- for authors
fallbackID = 'P2093' -- author-string
elseif nl_type =="editor" then
propertyID = 'P5769' -- "editor-in-chief"
fallbackID = 'P98' -- for editors - So-called "fallbacks" are actually a second set of properties processed
-- TBD. Take book series editors into account as well (if they have a separate P code as well)?
elseif nl_type == "translator" then
propertyID = 'P655' -- for translators
fallbackID = nil
-- elseif 'contributor' == nl_type then
-- f.e. author of forewords (P2679) and afterwords (P2680); requires |contribution=, |title= and |author=
-- propertyID = 'P' -- for contributors
-- fallbackID = nil
else
return -- not specified so return
end
-- wdl is a Boolean passed to enable links to Wikidata when no article exists
-- if "false" or "no" or "0" is passed set it false
-- if nothing or an empty string is passed set it false
if wdl and (#wdl > 0) then
wdl = wdl:lower()
wdl = in_array (wdl, {"false", "no", "0"})
else
-- wdl is empty, so
wdl = false
end
local props = nil
local fallback = nil
if qid then
if mw.wikibase.entityExists(qid) then
props = mw.wikibase.getAllStatements(qid, propertyID)
if #props == 0 and fallbackID then
fallback = mw.wikibase.getAllStatements(qid, fallbackID)
end
end
elseif refsnak then
props = refsnak[propertyID]
if not props and fallbackID then
fallback = refsnak[fallbackID]
end
end
-- Make sure it actually has at least one of the properties requested
if not (props and props[1]) and not (fallback and fallback[1]) then
return nil
end
-- So now we have something to return:
-- table 'out' is going to store the names(s):
-- and table 'link' will store any links to the name's article
local out = {}
local link = {}
local maxpos = 0
if props and props[1] then
for k, v in pairs(props) do
maxpos = makelink(v, out, link, maxpos, wdl, lang)
end
end
if fallback and fallback[1] then
-- second properties
for k, v in pairs(fallback) do
maxpos = makelink(v, out, link, maxpos, wdl, lang)
end
end
-- if there's anything to return, then insert the additions in the template arguments table
-- in the form |author1=firstname secondname |author2= ...
-- Renumber, in case we have inconsistent numbering
local keys = {}
for k, v in pairs(out) do
keys[#keys + 1] = k
end
table.sort(keys) -- as they might be out of order
for i, k in ipairs(keys) do
out[k] = out[k]:gsub (''', '\''); -- prevent cs1|2 multiple names categorization; replace html entity with the actual character
if args[nl_type .. i] then -- name gets overwritten
-- pull corresponding -link only if overwritten name is same as WD name
if link[k] and (args[nl_type .. i] == out[k]) then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
else -- name does not get overwritten, so pull name from WD
args[nl_type .. i] = out[k]
if link[k] then
args[nl_type .. '-link' .. i] = args[nl_type .. '-link' .. i] or link[k] -- author-linkn or editor-linkn
end
end
end
end
-- gets language codes used for a monolingual text property as a table
function p._getLangOfProp(qid, pid)
if not pid or not qid then return {} end
local out = {}
local props = mw.wikibase.getAllStatements(qid, pid)
for i, v in ipairs(props) do
if v.mainsnak.datatype == "monolingualtext" and v.mainsnak.datavalue then
out[#out + 1] = v.mainsnak.datavalue.value.language
end
end
return out
end
function p._getLangOfSnakProp(snak, pid)
if not pid or not snak then return {} end
local out = {}
local props = snak[pid]
for i, v in ipairs(props) do
if v.datatype == "monolingualtext" and v.datavalue then
out[#out + 1] = v.datavalue.value.language
end
end
return out
end
function p.getLangOfProp(frame)
local pid = frame.args.pid or mw.text.trim(frame.args[1] or "")
if pid == "" then return end
local qid = frame.args.qid
if qid == "" then qid = nil end
return table.concat(p._getLangOfProp(qid, pid), ", ")
end
-- gets the language codes of a Wikidata entry as a table
local function _lang_code(qid)
local lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P424", ps = 1} )
if lc then return mw.text.split( lc, "[,، ]+" ) end --modified
lc = getPropOfProp( {qid = qid, prop1 = "P407", prop2 = "P218", ps = 1} )
if lc then return mw.text.split( lc, "[,، ]+" ) end --modified
return p._getLangOfProp(qid, "P1476")
end
function p.lang_code(frame)
return table.concat(_lang_code(frame.args.qid or mw.text.trim(frame.args[1] or "")), ", ")
end
-- export for debug
function p.getPropOfProp(frame)
return getPropOfProp(frame.args)
end
-- wraps a string in nowiki unless disable flag is set
local function wrap_nowiki(str, disable)
if disable then return str or '' end
return mw.text.nowiki(str or '')
end
-- sort sequence table whose values are key-value pairs by key
local function comp_key(a, b)
return a[1] < b[1]
end
-- sort sequence table whose values are key-value pairs by value
local function comp_val(a, b)
return a[2] < b[2]
end
-- ref filtering for citing from wikidata
local function is_rejected(item)
-- rejected Q
if rejected.sources[item]==true then
return true;
end
-- rejected Properties
local item_entity = mw.wikibase.getEntity(item);
for _, v in pairs(rejected.properties) do
if (#item_entity:getAllStatements( v )>0 ) then
return true;
end
end
-- Rejected InatanceOf
local instance = item_entity:getAllStatements( "P31" )
for _,v in pairs(instance) do
if rejected.instances[v.mainsnak.datavalue.value.id] then
return true;
end
end
--No used Properties
local has_properties = false
for k, _ in pairs(used_properties) do
if (#item_entity:getAllStatements( k )>0 ) then
has_properties = true;
break;
end
end
return not has_properties;
end
function p._cite_web(citeq_args)
local refsnak= citeq_args.snak
citeq_args.snak = nil
-- retrieve all the parameters
local pqid = citeq_args.pqid
citeq_args.pqid = nil
local wdl = false
local qid = nil
local multi_args = {
P50 = "author",
P2093 = "author",
P5769 = "editor",
P98 = "editor",
P655 = "translator",
}
-- find language
local langcodes = {}
if refsnak["P1476"] then
langcodes = p._getLangOfSnakProp(refsnak, "P1476")
citeq_args.language = citeq_args.language or langcodes[1]
end
langcodes[#langcodes+1] = 'ur'
langcodes[#langcodes+1] = 'en'
local labellang = langcodes[1]
local oth={}
for i in pairs(refsnak) do
local label = ""
-- multiple authors may be given
if refsnak[i][1].snaktype ~= 'novalue' then
if multi_args[i] then
get_name_list (multi_args[i], citeq_args, qid, wdl, labellang)
elseif used_properties[i] and type(used_properties[i]) == "table" then
local data = used_properties[i]
local langidx = 1
while citeq_args[data.arg] == nil and langidx<=#langcodes do
citeq_args[data.arg] = getValueFromSnaks( {i, fwd = "ALL", osd = "no", noicon = "true", maxvals = data.maxvals, linked = data.linked, rank = data.rank or "best", lang=langcodes[langidx], snak = refsnak } )
if citeq_args[data.arg] == nil then
break
elseif citeq_args[data.arg]:find('[[Category:Articles with missing Wikidata information]]', 1, true) then
citeq_args[data.arg] = nil
langidx = langidx + 1
else
break
end
end
if not citeq_args[data.arg] then
citeq_args[data.arg] = getValueFromSnaks( {i, ps = 1, qid = qid, maxvals = data.maxvals, linked = data.linked, snak = refsnak} )
if citeq_args[data.arg]:find('^Q%d+$') then -- qid was returned
-- try fallback to qid's native language
local qid_languages = _lang_code(citeq_args[data.arg])
citeq_args[data.arg] = getValueFromSnaks( {i, ps = 1, qid = qid, maxvals = data.maxvals, linked = data.linked, lang = qid_languages[1], snak = refsnak} )
if citeq_args[data.arg]:find('^Q%d+$') then -- qid was returned again
citeq_args[data.arg] = nil
else
-- record the language found if no lang specified
citeq_args.language = citeq_args.language or qid_languages[1]
end
end
end
--- translate unknown value
if citeq_args[data.arg] == "Unknown" then
citeq_args[data.arg] = i18n.ur["unknown-" .. data.arg] or i18n.ur["unknown"]
end
-----------------
if data.others then
oth[#oth + 1] = citeq_args[data.arg] and ((i18n.ur[data.arg] or data.arg:gsub("^%l", string.upper)) .. ": " .. citeq_args[data.arg])
citeq_args[data.arg] = nil
end
elseif used_properties[i] then
if i == "P648" then
citeq_args.ol = (getValueFromSnaks( {"P648", ps = 1, maxvals = 1, snak = refsnak, citeq_args.ol } ) or ''):gsub("^OL(.+)$", "%1")
if citeq_args.ol == "" then
citeq_args.ol = nil
end
elseif i == "P957" then
citeq_args.isbn = getValueFromSnaks( {"P957", ps = 1, maxvals = 1, rank="best", snak = refsnak } )
elseif in_array(i,{"P854", "P953", "P856", "P2699"}) then
local url;
for _, pr in ipairs( {"P854", "P953", "P856", "P2699"} ) do
url = getValueFromSnaks( {pr, ps = 1,osd = "no", noicon = "true", maxvals = 1, snak = refsnak } )
if url then
citeq_args.url = mw.text.split( url, " (", true )[1]
local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present
if arcurl then
local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)")
if arcy and arcm and arcd then
citeq_args["archive-url"] = arcurl
citeq_args["archive-date"] = tonumber(arcd) .. " " .. i18n.months[tonumber(arcm)] .. " " .. arcy
end
end
break
end
end
end
end
end
end
if citeq_args.url then
if refsnak["P813"] then
citeq_args.accessdate = getValueFromSnaks( {"P813", ps = 1,osd = "no", noicon = "true", maxvals = 1, snak = refsnak } )
end
if refsnak["P1065"] and refsnak["P2960"] then
citeq_args["archive-url"] = getValueFromSnaks( {"P1065", ps = 1,osd = "no", noicon = "true", maxvals = 1, snak = refsnak } )
citeq_args["archive-date"]= getValueFromSnaks( {"P2960", ps = 1,osd = "no", noicon = "true", maxvals = 1, snak = refsnak } )
end
end
citeq_args.others = citeq_args.others or table.concat(oth, ". ")
if citeq_args.others == "" then
citeq_args.others = nil
end
citeq_args.biorxiv = citeq_args.biorxiv and ("10.1101/" .. citeq_args.biorxiv)
-- if url then see if there's an archive: citeq_args.url
local url
if citeq_args.publisher == "Unknown" then -- look for "stated as" (P1932)
local stated_as = getValue( {"P123", ps = 1, qid = qid, maxvals = 1, qual="P1932", qo="y"} )
if stated_as then citeq_args.publisher = stated_as end
end
local title_display = citeq_args.title
if citeq_args.url then
citeq_args.title = wrap_nowiki(title_display)
end
-- TBD: incorporate |at, |sheets= and |sheet= here as well
-- Sort out what should happen if several of them are given at the same time
if citeq_args.page or citeq_args.p then -- let single take precedence over multiple
citeq_args.pages = nil
citeq_args.pp = nil
end
if citeq_args.pages then
local _, count = string.gsub(citeq_args.pages, "[,;%s]%d+", "")
if count == 1 then
citeq_args.page = citeq_args.pages
citeq_args.pages = nil
end
end
for k, v in pairs(citeq_args) do
if in_array (v, {'(())', 'unset', 'ignore'}) or 'string' ~= type(k) then -- empty accept-as-is-written (()) markup to indicate an empty/unused parameter value, other ((...)) markups are deliberately passed down to {{citation}}
citeq_args[k] = nil
elseif in_array (v, {'((unset))', '((ignore))'}) then -- strip off markup for free-text values clashing with local keywords
citeq_args[k] = 'unset'
end
end
local author_count = 0
for k, v in pairs(citeq_args) do
if k:find("^author%d+$") then
author_count = author_count + 1
end
end
if author_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-authors'] then
citeq_args['display-authors'] = nil; -- unset because no longer needed
else
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names
end
end
local editor_count = 0
for k, v in pairs(citeq_args) do
if k:find("^editor%d+$") then
editor_count = editor_count + 1
end
end
if editor_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-editors'] then
citeq_args['display-editors'] = nil; -- unset because no longer needed
else
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names
end
end
-- code to make a guess what template to use from the supplied parameters
-- (first draft for proof-of-concept)
local template = "ويب"
-- |id= could hold more than one identifier pulled from Wikidata not supported by {{citation}}, right now only add our qid to the list
local list_sep = '. '
if citeq_args.mode ~= 'cs1' then
list_sep = ', '
end
-- clean up any blank parameters
for k, v in pairs(citeq_args) do
if v == "" then citeq_args[k] = nil end
end
if template then
-- citeq_args.mode = citeq_args.mode or "cs1" -- a cs1 template already knows that it is cs1 so this line is superfluous
template = "استشهاد " .. template
else
-- citeq_args.mode = citeq_args.mode or "cs2" -- a cs2 template already knows that it is cs2 so this line is superfluous
template = "استشهاد"
end
citeq_args['no-tracking'] = 'true' -- لإيقاف ظهور تصانيف التتبع
-- if |expand=<anything>, write a nowiki'd version to see what the {{citation}} template call looks like
return mw.getCurrentFrame():expandTemplate{title = template, args = citeq_args} -- render the template
end
--[[-------------------------< C I T E _ Q >------------------------------------------------------------------
Takes standard CS1|2 template parameters and passes all to {{citation}}. If neither of |author= and |author1=
are set, calls get_authors() to try to get an author name-list from Wikidata. The result is passed to
{{citation}} for rendering.
--]]
function p._cite_q (citeq_args)
local frame = mw.getCurrentFrame()
-- parameters that don't get passed to Citation
local expand = citeq_args.expand -- when set to anything, causes {{cite q}} to render <code><nowiki>{{citation|...}}</nowiki></code>
local qid = citeq_args.qid or citeq_args[1]
local wdl = citeq_args.wdl
local template = citeq_args.template
local rtl = true
local snak = citeq_args.snak or {}
local pqid = citeq_args.pqid
citeq_args.expand = nil
citeq_args[1] = nil
citeq_args.qid = nil
citeq_args.wdl = nil
citeq_args.template = nil
citeq_args.snak = nil
citeq_args.pqid = nil
local labellang = 'ar'
-- if title supplied, flag to not read html title
local titleforced = (citeq_args.title ~= nil)
local oth = {}
-- put the language codes into a sequential table langcodes[]
local langcodes = {}
if citeq_args.language then
-- check these are a supported language codes
for lc in mw.text.gsplit( citeq_args.language, "[,، ]+", false ) do --modified
langcodes[#langcodes+1] = mw.language.isSupportedLanguage(citeq_args.language) and citeq_args.language
end
end
if not langcodes[1] then
-- try to find language of work
langcodes = _lang_code(qid)
end
if not langcodes[1] then
-- try fallback to journal's language
local journal_qid = followQid({qid = qid, props = "P1433"})
langcodes = journal_qid and _lang_code(journal_qid)
end
citeq_args.language = citeq_args.language or table.concat(langcodes, ", ")
labellang = langcodes[1] or labellang
rtl = rtl_lang[langcodes[1]] or false
-- loop through list of simple properties and get their values in citeq_args
for name, data in pairs(simple_properties) do
citeq_args[name] = getValue( {data.id, fwd = "ALL", osd = "no", noicon = "true", qid = qid, maxvals = data.maxvals, linked = data.linked, rank = data.rank or "best", lang = labellang, snak = snak, citeq_args[name], qual=data.qual } )
if data.populate_from_journal then
local publishedin = getValue( {"P1433", ps = 1, qid = qid, maxvals = 0, lang = labellang, citeq_args[name], qual = data.id, qualsonly = 'yes'} )
citeq_args[name] = publishedin or getPropOfProp({qid = qid, prop1 = "P1433", prop2 = data.id, lang = labellang, maxvals = data.maxvals, ps = 1})
end
if citeq_args[name] and citeq_args[name]:find('[[Category:Articles with missing Wikidata information]]', 1, true) then
-- try fallback to work's native language
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = data.linked, lang = labellang, snak = snak} )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned
-- try fallback to qid's native language
local qid_languages = _lang_code(citeq_args[name])
citeq_args[name] = getValue( {data.id, ps = 1, qid = qid, maxvals = data.maxvals, linked = data.linked, lang = qid_languages[1], snak = snak} )
if citeq_args[name]:find('^Q%d+$') then -- qid was returned again
citeq_args[name] = nil
else
-- record the language found if no lang specified
citeq_args.language = citeq_args.language or qid_languages[1]
end
end
end
if citeq_args[name] and snak[data.id] then
snak[data.id] = nil
end
--- translate unknown value
if citeq_args[name] == "Unknown" and rtl then
citeq_args[name] = i18n.ur["unknown-" .. name] or i18n.ur["unknown"]
end
-----------------
if data.others then
oth[#oth + 1] = citeq_args[name] and ((rtl and i18n.ur[name] or name:gsub("^%l", string.upper)) .. ": " .. citeq_args[name])
citeq_args[name] = nil
end
end
citeq_args.others = citeq_args.others or table.concat(oth, ". ")
if citeq_args.others == "" then
citeq_args.others = nil
end
citeq_args.journal = citeq_args.journal and citeq_args.journal:gsub("^''", ""):gsub("''$", ""):gsub("|''", "|"):gsub("'']]", "]]")
citeq_args.ol = (getValue( {"P648", ps = 1, qid = qid, maxvals = 1, snak = snak, citeq_args.ol } ) or ''):gsub("^OL(.+)$", "%1")
if citeq_args.ol == "" then
citeq_args.ol = nil
end
-- TBD. Take care of |ol-access=?
citeq_args.biorxiv = citeq_args.biorxiv and ("10.1101/" .. citeq_args.biorxiv)
citeq_args.isbn = getValue( {"P957", ps = 1, qid = qid, maxvals = 1, rank="best", snak = snak, citeq_args.isbn } ) -- try ISBN 10 (only one value accepted)
-- if url then see if there's an archive: citeq_args.url
local url
--find formatted url
if snak ~= {} then
for k, v in pairs(snak) do
if (v[1].datatype == "external-id") then
local furl = mw.wikibase.getBestStatements( k, "P1630" )
if 0 ~= #furl then
furl = furl[1]["mainsnak"]["datavalue"]["value"]
citeq_args.url = mw.message.newRawMessage(furl, {v[1]["datavalue"]["value"]}):plain()
snak[k] = nil
break;
end
end
end
if citeq_args.url == nil and pqid and qid then
local refproperty = mw.wikibase.getBestStatements(qid , "P1687" )
if 0 ~= #refproperty then
refproperty=refproperty[1]["mainsnak"]["datavalue"]["value"]["id"]
local furl = mw.wikibase.getBestStatements( refproperty, "P1630" )
if 0 ~= #furl then
furl = furl[1]["mainsnak"]["datavalue"]["value"]
local refval = mw.wikibase.getBestStatements( pqid, refproperty )
refval = (0 ~= #refval) and refval[1]["mainsnak"]["datavalue"]["value"]
if refval then
citeq_args.url = mw.message.newRawMessage(furl, {refval}):plain()
end
end
end
end
end
if not citeq_args.url then
for i, pr in ipairs( {"P953", "P856", "P2699"} ) do
url = getValue( {pr, ps = 1, qid = qid, maxvals = 1, snak = snak, qual="P1065" } )
if url then
citeq_args.url = mw.text.split( url, " (", true )[1]
local arcurl = mw.ustring.match( url, " %((.*)%)" ) -- when there is an archive url, <url> holds: url<space>(archive url); here extract the archive url if present
if arcurl then
local arcy, arcm, arcd = arcurl:match("(20%d%d)%p?(%d%d)%p?(%d%d)")
if arcy and arcm and arcd then
citeq_args["archive-url"] = arcurl
citeq_args["archive-date"] = tonumber(arcd) .. " " .. i18n.months[tonumber(arcm)] .. " " .. arcy
end
end
break
end
end
end
if citeq_args.publisher == "Unknown" then -- look for "stated as" (P1932)
local stated_as = getValue( {"P123", ps = 1, qid = qid, maxvals = 1, qual="P1932", qo="y"} )
if stated_as then citeq_args.publisher = stated_as end
end
if not titleforced then
-- Handle subtitle.
if citeq_args.title then
local subtitle = mw.wikibase.getBestStatements (qid, 'P1680');
if 0 ~= #subtitle then
subtitle = subtitle[1].mainsnak.datavalue.value.text;
citeq_args.title = citeq_args.title .. ": " .. subtitle
end
end
local htmltitle = getValue( {"P1476", qual = "P6833", ps = 1, qid = qid, snak = snak, maxvals = 1, qo = "y"} )
if htmltitle then
citeq_args.title = htmltitle:gsub("</?i>", "''")
else
local title_display = citeq_args.title
or (langcodes[1] and mw.wikibase.getLabelByLang(qid, langcodes[1]))
or mw.wikibase.getLabel(qid)
if title_display and snak and snak.P1810 then
title_display=title_display .. " | " .. snak.P1810[1].datavalue.value
snak.P1810 = nil
end
title_display = title_display or ("No label or title -- debug: " .. qid)
if citeq_args.url then
citeq_args.title = wrap_nowiki(title_display)
else
local slink = mw.wikibase.getSitelink(qid)
local slink_flag = false
local wrap_title = ''
local wslink = false
if not slink then
-- See if we have wikisource
if not citeq_args.url then
local wikisource_sitelink = mw.wikibase.getSitelink(qid, "enwikisource") or nil
if wikisource_sitelink then
slink = ':s:'..wikisource_sitelink
wslink = true
end
end
end
if citeq_args.title then
if slink then
wrap_title = wrap_nowiki(citeq_args.title)
slink_flag = true
else
citeq_args.title = wrap_nowiki(citeq_args.title)
end
else
if slink and not wslink then
if slink:lower() == title_display:lower() then
citeq_args.title = '[[' .. slink .. ']]'
else
wrap_title = wrap_nowiki(slink:gsub("%s%(.+%)$", ""):gsub(",.+$", ""))
slink_flag = true
end
elseif wslink then
wrap_title = wrap_nowiki(title_display)
slink_flag = true
else
citeq_args.title = wrap_nowiki(title_display)
end
end
if slink_flag then
if slink == wrap_title and not wslink then -- direct link
citeq_args.title = '[[' .. slink .. ']]'
else -- piped link
citeq_args.title = '[[' .. slink .. '|' .. wrap_title .. ']]'
end
end
end
end
end
-- fetch other snak properties for debugging
-- if snak and snak ~= {} then
-- mw.logObject(snak)
-- for k,v in pairs(snak) do
-- if not used_properties[k] then
-- end
-- end
-- end
-- TBD: incorporate |at, |sheets= and |sheet= here as well
-- Sort out what should happen if several of them are given at the same time
if citeq_args.page or citeq_args.p then -- let single take precedence over multiple
citeq_args.pages = nil
citeq_args.pp = nil
end
if citeq_args.pages then
local _, count = string.gsub(citeq_args.pages, "[,;%s]%d+", "")
if count == 1 then
citeq_args.page = citeq_args.pages
citeq_args.pages = nil
end
end
if is_set (qid) then
if not is_set (citeq_args.author) and not is_set (citeq_args.author1)
and not is_set (citeq_args.subject) and not is_set (citeq_args.subject1)
and not is_set (citeq_args.host) and not is_set (citeq_args.host1)
and not is_set (citeq_args.last) and not is_set (citeq_args.last1)
and not is_set (citeq_args.surname) and not is_set (citeq_args.surname1)
and not is_set (citeq_args['author-last']) and not is_set (citeq_args['author-last1']) and not is_set (citeq_args['author1-last'])
and not is_set (citeq_args['author-surname']) and not is_set (citeq_args['author-surname1']) and not is_set (citeq_args['author1-surname1']) then -- if neither are set, try to get authors from Wikidata
get_name_list ('author', citeq_args, qid, wdl, labellang) -- modify citeq_args table with authors from Wikidata
end
if not is_set (citeq_args.editor) and not is_set (citeq_args.editor1)
and not is_set (citeq_args['editor-last']) and not is_set (citeq_args['editor-last1']) and not is_set (citeq_args['editor1-last'])
and not is_set (citeq_args['editor-surname']) and not is_set (citeq_args['editor-surname1']) and not is_set (citeq_args['editor1-surname']) then -- if neither are set, try to get editors from Wikidata
get_name_list ('editor', citeq_args, qid, wdl, labellang) -- modify citeq_args table with editors from Wikidata
end
if not is_set (citeq_args.translator) and not is_set (citeq_args.translator1)
and not is_set (citeq_args['translator-last']) and not is_set (citeq_args['translator-last1']) and not is_set (citeq_args['translator1-last'])
and not is_set (citeq_args['translator-surname']) and not is_set (citeq_args['translator-surname1']) and not is_set (citeq_args['translator1-surname']) then -- if neither are set, try to get translators from Wikidata
get_name_list ('translator', citeq_args, qid, wdl, labellang) -- modify citeq_args table with translators from Wikidata
end
end
for k, v in pairs(citeq_args) do
if in_array (v, {'(())', 'unset', 'ignore'}) or 'string' ~= type(k) then -- empty accept-as-is-written (()) markup to indicate an empty/unused parameter value, other ((...)) markups are deliberately passed down to {{citation}}
citeq_args[k] = nil
elseif in_array (v, {'((unset))', '((ignore))'}) then -- strip off markup for free-text values clashing with local keywords
citeq_args[k] = 'unset'
end
end
local author_count = 0
for k, v in pairs(citeq_args) do
if k:find("^author%d+$") then
author_count = author_count + 1
end
end
if author_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-authors'] then
citeq_args['display-authors'] = nil; -- unset because no longer needed
else
citeq_args['display-authors'] = citeq_args['display-authors'] or 3 -- limit to three displayed names
end
end
local editor_count = 0
for k, v in pairs(citeq_args) do
if k:find("^editor%d+$") then
editor_count = editor_count + 1
end
end
if editor_count > 8 then -- convention in astronomy journals, optional mode for this?
if 'all' == citeq_args['display-editors'] then
citeq_args['display-editors'] = nil; -- unset because no longer needed
else
citeq_args['display-editors'] = citeq_args['display-editors'] or 3 -- limit to three displayed names
end
end
-- change edition to ordinal if it's set and numeric
if (rtl == false) then citeq_args.edition = citeq_args.edition and p.makeOrdinal(citeq_args.edition) end
-- code to make a guess what template to use from the supplied parameters
-- (first draft for proof-of-concept)
if citeq_args.journal then
template = template or "بدورية محكمة"
elseif citeq_args.isbn then
template = template or "بكتاب"
citeq_args.asin = nil -- suppress ASIN if ISBN exists
elseif citeq_args.website then
template = template or "ويب"
end
-- template is CS1 designator: journal, web, news, etc.
if template then
-- citeq_args.mode = citeq_args.mode or "cs1" -- a cs1 template already knows that it is cs1 so this line is superfluous
template = "استشهاد " .. template
else
-- citeq_args.mode = citeq_args.mode or "cs2" -- a cs2 template already knows that it is cs2 so this line is superfluous
template = "استشهاد"
end
-- |id= could hold more than one identifier pulled from Wikidata not supported by {{citation}}, right now only add our qid to the list
local list_sep = '. '
if citeq_args.mode ~= 'cs1' then
list_sep = ', '
end
local id = '[[ويكي بيانات|QID]]:[[:d:' .. qid .. '|' .. qid .. ']]' -- go through "WDQ (identifier)" redirect to reduce clutter in "What links here" and improve reverse lookup. Keep in sync with {{QID}}.
local old_id = citeq_args.id
if wdl then -- show WD logo
id = id .. '[[File:Wikidata-logo.svg|16px|alt=|link=]]' -- possibly replace by WD edit icon?
end
if is_set (old_id) then
citeq_args.id = old_id .. list_sep .. id -- append to user-specified contents
else
citeq_args.id = id
end
-- clean up any blank parameters
for k, v in pairs(citeq_args) do
if v == "" then citeq_args[k] = nil end
end
-- if |expand=<anything>, write a nowiki'd version to see what the {{citation}} template call looks like
if expand then
local expand_args = { "{{" .. template .. "\n" } -- init with citation template
if expand == "self" then
citeq_args.id = old_id -- restore original |id= parameter
expand_args = { "{{cite Q|" .. qid } -- expand to itself
end
-- make a sortable table and sort it by param name
local sorttable = {}
for param, val in pairs (citeq_args) do
table.insert(sorttable, {param, val})
end
table.sort(sorttable, comp_key)
-- add contents to expand_args
for idx, val in ipairs(sorttable) do
table.insert(expand_args, val[1] .. '=' .. val[2] .. "\n")
end
-- make the nowiki'd string and done
return table.concat (expand_args, '| ') .. "\n}}"
end
local erratumid = getPropertyIDs( { "P2507", qid = qid, fwd = "ALL", osd = "no", rank = "best", maxvals = 1 } )
if erratumid then
erratumid = " [[d:" .. erratumid .. "|(erratum)]]" .. "[[Category:Cite Q - cites a work with an erratum]]"
else
erratumid = ""
end
local opt_cat = ''
if getValue( {"P5824", ps = 1, qid = qid} ) then
opt_cat = '[[Category:Cite Q - cites a retracted work]]<!-- retracted -->'
end
if getValue( {"P1366", ps = 1, qid = qid} ) then
opt_cat = opt_cat .. '[[Category:Cite Q - cites a replaced work]]<!-- replaced -->'
end
citeq_args['no-tracking'] = 'true' -- لإيقاف ظهور تصانيف التتبع
return frame:expandTemplate{title = template, args = citeq_args} .. erratumid .. opt_cat -- render the template
end
--[[-------------------------< C I T E _ Q >------------------------------------------------------------------
Takes standard CS1|2 template parameters and passes all to {{citation}}. If neither of |author= and |author1=
are set, calls get_authors() to try to get an author name-list from Wikidata. The result is passed to
{{citation}} for rendering.
--]]
function p._cite_wikidata (ref, pqid)
-- early exit
if not ref then
return nil
end
local snak = ref.snaks
-- مراجع غير مقبولة
if snak.P143 or snak.P3452 then
return nil
end
local hash = ref.hash
if hash and hash ~= "" and ref_cash[hash] then
return ref_cash[hash]
end
local citeq_args = {}
local frame = mw.getCurrentFrame()
if snak.P248 then
for _, prop in pairs(snak.P248) do
if prop.snaktype == "value" then
citeq_args.qid = "Q" .. prop.datavalue.value["numeric-id"]
end
end
snak.P248 = nil;
end
if citeq_args.qid and is_rejected(citeq_args.qid) == true then
return nil
end
local reference
citeq_args.snak = snak
citeq_args.pqid = pqid
if citeq_args.qid then
reference = p._cite_q(citeq_args)
else
local has_properties = false
for k, _ in pairs(used_properties) do
if snak[k] then
has_properties = true;
break;
end
end
reference = (has_properties and p._cite_web(citeq_args) or nil)
end
if reference and reference ~= "" then
reference = frame:extensionTag("ref", reference, {name = 'wikidata-' .. hash})
end
if hash and hash ~= "" then
ref_cash[hash] = reference
end
return reference
end
function p.cite_q (frame)
local args = {}
for k, v in pairs(frame:getParent().args) do
if v ~= "" then args[k] = v end
end
for k, v in pairs(frame.args) do
if v ~= "" then args[k] = v end
end
args.qid = args.qid or args[1] or ""
if args.qid == "" then return nil end
args[1] = nil
local citesep = (args.citesep or "")
if citesep == "" then citesep = ", " end
citesep = citesep:gsub('"', '') -- strip double quotes after setting default to allow |citesep="" as a blank separator
args.citesep = nil
local tag = args.tag or ""
if tag == "" then tag = nil end
args.tag = nil
local list = args.list or ""
if list == "" then list = nil end
args.list = nil
args.language = args.language or args.lang
args.lang = nil
local cites = {}
for q in args.qid:gmatch("Q%d+") do
-- make a new copy of the arguments
local newargs = {}
for k, v in pairs(args) do
if k ~= "qid" then
newargs[k] = v
end
end
newargs.qid = q
if tag == "ref" then
cites[#cites + 1] = frame:callParserFunction{ name = "#tag:ref", args = { p._cite_q(newargs), name = q } }
-- expand like this: args = { p._cite_q(newargs), name = 'foo', group = 'bar' }
else
cites[#cites + 1] = p._cite_q(newargs)
end
end
if list then
return frame:expandTemplate{ title = list, args = cites }
else
return table.concat(cites, citesep)
end
end
return p
h218v1r9dq4imiavpkexn0pctqcxene
گٹھ:مری کےعلما
14
141252
691013
2025-07-10T20:13:05Z
203.101.186.87
"مولانامحمودالرشیدحدوٹی عباسی خاندان کےچشم وچراغ ہیں،ان کےوالد گرامی کانام حاجی محمدارشادعباسی ہے،ان کےداداکانام حاجی محمدسلیمان عباسی ہے، ان کےپرداداکانام گلاب خان ہے،مولانامحمودالرشیدحدوٹی ۱۵نومبر۱۹۶۹میں ملکہ کوہسارمری کےایک گاؤں حدوٹ یونین..." نال صفحہ بنایا گیا۔
691013
wikitext
text/x-wiki
مولانامحمودالرشیدحدوٹی عباسی خاندان کےچشم وچراغ ہیں،ان کےوالد گرامی کانام حاجی محمدارشادعباسی ہے،ان کےداداکانام حاجی محمدسلیمان عباسی ہے، ان کےپرداداکانام گلاب خان ہے،مولانامحمودالرشیدحدوٹی ۱۵نومبر۱۹۶۹میں ملکہ کوہسارمری کےایک گاؤں حدوٹ یونین کونسل سہربگلہ میں پیدا ہوئے، مولانامحمودالرشیدحدوٹی کوان کی والدہ ماجدہ نے اپنےگاؤں کےایسےسکول میں داخل کروایا جہاں بچوں اوربچیوں کی مشترکہ تعلیم تھی،۱۹۷۵ءمیں پرائمری اسکول حدوٹ میں داخلہ لیا،اسی دوران انہوں نے ناظرہ قرآن کریم مولانامولوی داؤدمرحوم سے پڑھا،۱۹۸۰ءمیں اچھے نمبروں میں پرائمری پاس کی،۱۹۸۰ء میں ان کےداداحاجی محمدسلیمان عباسی نےانہیں نیومری کےمقام پرجامعہ اشاعت اسلام میں داخل کروایا،جہاں رہ کرانہوں نے چھٹی،ساتویں،آٹھویں اوردسویں جماعت پڑھی اور۱۹۸۴ء میں مری شہرکےگورنمنٹ ہائی سکول مری سےمیٹرک کاامتحان فرسٹ پوزیشن میں پاس کیا۔جامعہ اشاعت اسلام نیومری وہ تعلیمی ادارہ ہے جس میں اس زمانے میں دینی اورعصری دونوں تعلیموں کاانتظام ہواکرتا تھا،جوکچھ عرصہ تک جاری رہا پھرموقوف ہوگیا۔
۱۹۸۴ءمیں میٹرک پاس کرنےکےبعدپاکستان کےصوبہ پنجاب پوٹھواری ضلع جہلم میں تشریف لائے،جہاں جامعہ حنفیہ تعلیم الاسلام مدنی محلہ میں داخلہ لیا، یہاں رہ کرچارسال میں ابتدائی فنونی درجات کی تعلیم حاصل کی، ۱۹۸۸ء میں جہلم دے لاہور پہنچے جہاں انہوں نےجامعہ عثمانیہ ماڈل ٹاؤن میں مشکوٰۃ شریف کادرجہ پڑھااوراگلے ہی سال ۱۹۸۹میں ایشیاء کی عظیم دینی واسلامی یونیورسٹی جامعہ اشرفیہ میں داخلہ لےلیا،جہاں ایک سال آخری درجہ دورہ حدیث کی تعلیم حاصل کی۔
۱۹۹۰ء میں جامعہ اشرفیہ سے فراغت کےبعدجامع مسجدابوذرغفاری (نزدشالیمارباغ) امامت شروع کردی۔
rrn4yrp40ehh8h02vfttzfdu82dx850
گٹھ:مری كی شخصیتاں
14
141253
691014
2025-07-10T20:30:59Z
203.101.186.87
"ملکہ کوہسارمری میں اللہ تعالیٰ نے بہت سے علماء کرام اورعلمی شخصیات کوپیدافرمایا ہے،ان میں مولانامحمودالرشیدحدوٹی کواللہ تعالیٰ نے یہ اعزازبخشا ہے کہ انہوں نے ایک غریب خاندان میں پیدا ہونےکےباوجوداپنی تعلیمی ،تدریسی،تبلیغی اورتصنیف وتالیف کےمیدان..." نال صفحہ بنایا گیا۔
691014
wikitext
text/x-wiki
ملکہ کوہسارمری میں اللہ تعالیٰ نے بہت سے علماء کرام اورعلمی شخصیات کوپیدافرمایا ہے،ان میں مولانامحمودالرشیدحدوٹی کواللہ تعالیٰ نے یہ اعزازبخشا ہے کہ انہوں نے ایک غریب خاندان میں پیدا ہونےکےباوجوداپنی تعلیمی ،تدریسی،تبلیغی اورتصنیف وتالیف کےمیدان میں نمایاں کام کیاہے، ۱۵نومبر۱۹۶۹ء کوملکہ کوہسار مری کےایک گمنام سے گاؤں حدوٹ میں پیدا ہونےوالے مولانامحمودالرشیدحدوٹی نے۱۹۷۵سےلےکر۱۹۹۰تک مسلسل دینی مدارس اورعصری اسکولوں میں تعلیم حاصل کی، وہ ۲۰سال کی عمر میں اپنی تعلیم کےوہ سال مکمل کرنےمیں کامیاب ہوئےجوانہیں مدارس وسکولزمیں گزارناتھے،ازیں بعد ۱۹۹۰میں انہیں ایشیاء کی عظیم یونیورسٹی جامعہ اشرفیہ لاہورسےسندفراغت ملی،ازیں بعدوہ جامع مسجدابوذرغفاری میں امامت کےفرائض سرانجام دینےلگے،۱۹۹۰سےلےکر۲۰۲۵تک مسلسل تصنیفی وتالیفی ،دعوتی وتبلیغی،تدریسی امورسرانجام دینےمیں مگن رہے اورہنوزسلسلہ جاری ہے۔
سنہ ۲۰۰۰عیسوی میں انہوں نے ماہ نامہ آب حیات لاہورکےنام سے ایک دینی رسالہ جاری کیا،ازیں بعد۲۰۰۹میں تحفہ خواتین کےنام سے ایک ماہواررسالہ جاری کیا، کچھ عرصہ بعدہفت روزہ شاندارکےنام سے اخبارنکالا،جوکچھ عرصہ بعد ماہواررسالہ میں بدل دیاتھا،پھرکچھ سالوں بعد ماہنامہ صدائےجمعیت نامی رسالہ جاری کیا، لیکن کچھ سالوں بعد ماہنامہ آب حیات کےعلاوہ سارے رسائل بندش کاشکارہوگئے۔ماہ نامہ آب حیات کی اجلی،ستھری،بےباک اورجرأت مندانہ تحریروں کاایک زمانہ معترف ہے،۲۰۰۵ءمیں ماہنامہ آب حیات کےمدیراعلیٰ مولانامحمودالرشیدحدوٹی کوحکومت پاکستان نےسیرت النبی صلی اللہ علیہ وسلم پرقومی ایوارڈپیش کیاتھا۔
مولانامحمودالرشیدحدوٹی کی تصنیفات وتالیفات کی تعداد۲۰۰سےمتجاوزہے،ان میں چھوٹی اوربڑی سبھی کتابیں شامل ہیں،ہنوزیہ سلسلہ جاری ہے، مولانا محمودالرشیدحدوٹی نے قرآن کریم کی سوالاجواباتفسیربھی تحریر کی ہے،جوسولہ جلدوں پرمشتمل ہے،جواپنی طرزکی منفردتفسیر ہے،یہ اسلوب اردو،عربی،فارسی،انگریزی کسی زبان میں اس سے پہلے اختیارنہیں کیاگیا۔
chppp1hhppgmpgg1m97wg8fiw40vu53
گٹھ:ڈهونڈ عباسی
14
141254
691015
2025-07-10T20:37:25Z
203.101.186.87
"ڈھونڈعباسی قبیلےسےتعلق رکھنے والے لوگ ملکہ کوہسارمری میں آبادہیں،ان لوگوں میں علماء،طلباء،قرا،حفاظ،تاجروں کی ایک بڑی تعداد ہے، اسی قبیلہ سے تعلق رکھنے والے شاہدخاقان عباسی ہیں جوملکہ کوہسارمری کےوہ پہلے شخص ہیں جنہیں وزیراعظم پاکستان بننے کااعزا..." نال صفحہ بنایا گیا۔
691015
wikitext
text/x-wiki
ڈھونڈعباسی قبیلےسےتعلق رکھنے والے لوگ ملکہ کوہسارمری میں آبادہیں،ان لوگوں میں علماء،طلباء،قرا،حفاظ،تاجروں کی ایک بڑی تعداد ہے، اسی قبیلہ سے تعلق رکھنے والے شاہدخاقان عباسی ہیں جوملکہ کوہسارمری کےوہ پہلے شخص ہیں جنہیں وزیراعظم پاکستان بننے کااعزازحاصل ہے، اسی قبیلہ سے تعلق رکھنے والے مفتی خالدحسین عباسی ہیں جوملکہ کوہسارمری کےدارالافتاء کی مسندپرفائز ہیں،اس قبیلہ کےایک عظیم شخص مولانامحمدسفارش عباسی ہیں جنہوں نے ملکہ کوہسار مری میں سب سے پہلے عصری اوردینی تعلیم کےحسین امتزاج سے مزین تعلیمی نظام جاری کیا،اسی قبیلہ سے تعلق رکھنے والے ملکہ کوہسار مری کےعظیم فرزند مولانامحمودالرشیدحدوٹی ہیں،جنہوں نے دوسوسے زیادہ دینی اورعلمی کتابیں تحریر کی ہیں،انہوں نے قرآن کریم کی تفسیرمعارف الفرقان کےنام سے بھی تحریر کی ہے،جواس قبیلہ کےلیے کسی اعزازوافتخارسے کم نہیں ہے۔
jc47gdygusc3acskvqml1os6sme6bxl
گٹھ:فاضل جامعہجامعه اشرفیه لاهور
14
141255
691016
2025-07-10T20:44:01Z
203.101.186.87
"جامعہ اشرفیہ لاہورکواللہ تعالیٰ نے یہ اعزازبخشا ہے کہ اس کےفضلاء نے بڑے بڑے علمی معرکے سرکیے ہیں،جامعہ اشرفیہ کےفضلاء ہزاروں کی تعداد میں ہیں،جواس وقت دنیا بھرمیں قرآن وسنت کی روشنی پھیلانےمیں مصروف ہیں،جامعہ اشرفیہ کےفضلاء میں شیخ التفاسیر،شیخ ال..." نال صفحہ بنایا گیا۔
691016
wikitext
text/x-wiki
جامعہ اشرفیہ لاہورکواللہ تعالیٰ نے یہ اعزازبخشا ہے کہ اس کےفضلاء نے بڑے بڑے علمی معرکے سرکیے ہیں،جامعہ اشرفیہ کےفضلاء ہزاروں کی تعداد میں ہیں،جواس وقت دنیا بھرمیں قرآن وسنت کی روشنی پھیلانےمیں مصروف ہیں،جامعہ اشرفیہ کےفضلاء میں شیخ التفاسیر،شیخ الحدیث،شیخ الفقہ،جیسے عظٰیم مناصب پرلوگ فائز ہیں،جامعہ کےفضلاء میں بہت سے لوگ ایوانہائےعدل وانصاف میں موجودہیں،حکومتی عہدوں پربھی براجمان ہیں،آرمی،کالجز،یونیورسٹیزمیں بھی جامعہ کےفضلاء اپنی خدمات سے لوگوں کی علمی پیاس بجھارہے ہیں۔جامعہ کےفضلاء میں بہت سے ایسے ہیں جوتحریری ،تصنیفی اورصحافتی میدان میں مصروف عمل ہیں، جامعہ اشرفیہ لاہورکےبہت سے فضلاء نے پی ایچ ڈیزکی ڈگریاں حاصل کی ہیں،جامعہ اشرفیہ نے اپنے ہونہارطلباء کی علمی خدمات پرسندامتیازپیش کی ، ان سعادت مندوں میں جامعہ اشرفیہ لاہور کے ایک فرزندمولانامحمودالرشیدحدوٹی بھی ہیں جنہیں اس وقت تک جامعہ اشرفیہ کےفضلاء میں سب سے زیادہ کتابیں لکھنے کااعزازحاصل ہے،مولانامحمودالرشیدحدوٹی کوان کی تصنیفی خدمات پرشیخ الاسلام مولانامفتی محمدتقی عثمانی نےانہیں سندامتیازپیش کی تھی، انہیں دارالعلوم دیوبندسے بھی اعزازی سندملی ،انہیں اساطین علم کےہاتھوں سے سندحدیث کی اجازت بھی دی گئی۔
tgb4xlnhlk5wtp87p6jqbdfyh63caxk
جامعہ رشیدیہ
0
141256
691017
2025-07-10T20:49:25Z
203.101.186.87
"جامعہ رشیدیہ مناواں لاہورکی بنیاد شیخ الحدیث والتفسیرحضرت مولانامحمودالرشیدحدوٹی صاحب نے رکھی ہے،جامعہ رشیدیہ مناواں لاہور جرنیلی روڈ پرواقع ہے، واہگہ بارڈرسے صرف چودہ کلومیٹرکےفاصلے پرہے،یہ پندرہ مرلےکی عمارت میں موجود ہے،جوتین منزلہ عمارت ہے،..." نال صفحہ بنایا گیا۔
691017
wikitext
text/x-wiki
جامعہ رشیدیہ مناواں لاہورکی بنیاد شیخ الحدیث والتفسیرحضرت مولانامحمودالرشیدحدوٹی صاحب نے رکھی ہے،جامعہ رشیدیہ مناواں لاہور جرنیلی روڈ پرواقع ہے، واہگہ بارڈرسے صرف چودہ کلومیٹرکےفاصلے پرہے،یہ پندرہ مرلےکی عمارت میں موجود ہے،جوتین منزلہ عمارت ہے،جہاں ابتدائی درجے کی تعلیم کاسلسلہ جاری ہے، حفظ قرآن کریم ،درس نظامی،شعبہ تصنیف وتالیف،پرکام جاری ہے۔اس میں رہائشی اورغیررہائشی بچوں کاانتظام کیاگیا ہے،جامعہ رشیدیہ میں تعلیم وتربیت کابہترین ماحول ہے۔جامعہ رشیدیہ مناواں لاہور۲۰۱۵میں قائم کیاگیا،جامعہ رشیدیہ مناواں لاہورکےپرنسپل اورمہتمم مولانامحمودالرشیدحدوٹٰی ہیں،جب کہ قاری اسامہ محمودحدوٹی ناظم اعلیٰ ہیں۔
fbpurwfydrhrlm25kylogxosdhc6vnn
ورتن گل بات:Mohsen1355
3
141257
691019
2025-07-11T04:45:28Z
KaleemBot
24393
جی آیاں نوں!
691019
wikitext
text/x-wiki
==جی آیاں نوں!==
<font size="4">
السلام و علیکم! {{صفحہ}}، تے پنجابی وکیپیڈیا تے جی آیاں نوں ــ تہاڈے کَماں دا شکریہ ــ اسیں امید کردے آں کہ تہانوں اے جگہ پسند آئی ہوئے گی، تے تسی ایتھے رُکن دا فیصلہ کیتا ہوئے گا ــ ایتھے کچھ صفحے نیں جِتھے تُسی نظر مار لؤ تے (شاید) تہاڈے واسطے وکیپیڈیا چ بہتر ثابت ہوݨ:
* '''[[وکیپیڈیا:پنج تھم|وکیپیڈیا دے پنج تھم]]'''
* '''[[وکیپیڈیا:صفحے نوں کیویں بدلیئے|صفحے نوں کیویں بدلیئے]]'''
* '''[[وکیپیڈیا:مددآلے صفحے|مددآلے صفحے]]'''
* '''[[وکیپیڈیا:سبق|سبق]]'''
* '''[[وکیپیڈیا:چنگا مضمون کیویں لکھیئے|چنگا مضمون کیویں لکھیئے]]'''
* '''[[وکیپیڈیا:کم کرن دا وَل|کم کرن دا وَل]]'''<br>
* تے اگر تسی وکیپیڈیا تے نیا صفحہ لکھنا چوندے او تے جاؤ '''[[وکیپیڈیا:صفحہ لکھاری|صفحہ لکھاری]]''' تےــ<br>
میربانی کر کے گلاں دے صفحے چ اے نشان پاؤ: (~~~~)، اے اپنے آپ ای تہاڈا ناں تے کم دی تریخ پاء دیوے گا۔<br>
جے تہانوں کسی مدد دی لوڑ ہووے تے میری گلاں دے صفحے تے میرے کولوں پوچھ لو یا فیر اپنی گلاں دے صفحے تے '''<code>{{مدد کرو}}</code>''' لکھ کے چھڈ دیؤ۔ کوئی وی تہاڈے سوال دا جواب دے سکتا وا۔
اک واری فیر، جی آیاں نوں!</font>
--[[ورتنوالا:KaleemBot|KaleemBot]] ([[ورتن گل بات:KaleemBot|گل بات]] • [[خاص:Contributions/KaleemBot|کم]]) ۰۹:۴۵, ۱۱ جولائی ۲۰۲۵ (PKT)
7yx2tna6a6aldw4px4ahbf5sgi6pj0y
ورتن گل بات:Squidfam
3
141258
691020
2025-07-11T04:45:38Z
KaleemBot
24393
جی آیاں نوں!
691020
wikitext
text/x-wiki
==جی آیاں نوں!==
<font size="4">
السلام و علیکم! {{صفحہ}}، تے پنجابی وکیپیڈیا تے جی آیاں نوں ــ تہاڈے کَماں دا شکریہ ــ اسیں امید کردے آں کہ تہانوں اے جگہ پسند آئی ہوئے گی، تے تسی ایتھے رُکن دا فیصلہ کیتا ہوئے گا ــ ایتھے کچھ صفحے نیں جِتھے تُسی نظر مار لؤ تے (شاید) تہاڈے واسطے وکیپیڈیا چ بہتر ثابت ہوݨ:
* '''[[وکیپیڈیا:پنج تھم|وکیپیڈیا دے پنج تھم]]'''
* '''[[وکیپیڈیا:صفحے نوں کیویں بدلیئے|صفحے نوں کیویں بدلیئے]]'''
* '''[[وکیپیڈیا:مددآلے صفحے|مددآلے صفحے]]'''
* '''[[وکیپیڈیا:سبق|سبق]]'''
* '''[[وکیپیڈیا:چنگا مضمون کیویں لکھیئے|چنگا مضمون کیویں لکھیئے]]'''
* '''[[وکیپیڈیا:کم کرن دا وَل|کم کرن دا وَل]]'''<br>
* تے اگر تسی وکیپیڈیا تے نیا صفحہ لکھنا چوندے او تے جاؤ '''[[وکیپیڈیا:صفحہ لکھاری|صفحہ لکھاری]]''' تےــ<br>
میربانی کر کے گلاں دے صفحے چ اے نشان پاؤ: (~~~~)، اے اپنے آپ ای تہاڈا ناں تے کم دی تریخ پاء دیوے گا۔<br>
جے تہانوں کسی مدد دی لوڑ ہووے تے میری گلاں دے صفحے تے میرے کولوں پوچھ لو یا فیر اپنی گلاں دے صفحے تے '''<code>{{مدد کرو}}</code>''' لکھ کے چھڈ دیؤ۔ کوئی وی تہاڈے سوال دا جواب دے سکتا وا۔
اک واری فیر، جی آیاں نوں!</font>
--[[ورتنوالا:KaleemBot|KaleemBot]] ([[ورتن گل بات:KaleemBot|گل بات]] • [[خاص:Contributions/KaleemBot|کم]]) ۰۹:۴۵, ۱۱ جولائی ۲۰۲۵ (PKT)
7yx2tna6a6aldw4px4ahbf5sgi6pj0y
ورتن گل بات:Einstein198
3
141259
691021
2025-07-11T04:45:48Z
KaleemBot
24393
جی آیاں نوں!
691021
wikitext
text/x-wiki
==جی آیاں نوں!==
<font size="4">
السلام و علیکم! {{صفحہ}}، تے پنجابی وکیپیڈیا تے جی آیاں نوں ــ تہاڈے کَماں دا شکریہ ــ اسیں امید کردے آں کہ تہانوں اے جگہ پسند آئی ہوئے گی، تے تسی ایتھے رُکن دا فیصلہ کیتا ہوئے گا ــ ایتھے کچھ صفحے نیں جِتھے تُسی نظر مار لؤ تے (شاید) تہاڈے واسطے وکیپیڈیا چ بہتر ثابت ہوݨ:
* '''[[وکیپیڈیا:پنج تھم|وکیپیڈیا دے پنج تھم]]'''
* '''[[وکیپیڈیا:صفحے نوں کیویں بدلیئے|صفحے نوں کیویں بدلیئے]]'''
* '''[[وکیپیڈیا:مددآلے صفحے|مددآلے صفحے]]'''
* '''[[وکیپیڈیا:سبق|سبق]]'''
* '''[[وکیپیڈیا:چنگا مضمون کیویں لکھیئے|چنگا مضمون کیویں لکھیئے]]'''
* '''[[وکیپیڈیا:کم کرن دا وَل|کم کرن دا وَل]]'''<br>
* تے اگر تسی وکیپیڈیا تے نیا صفحہ لکھنا چوندے او تے جاؤ '''[[وکیپیڈیا:صفحہ لکھاری|صفحہ لکھاری]]''' تےــ<br>
میربانی کر کے گلاں دے صفحے چ اے نشان پاؤ: (~~~~)، اے اپنے آپ ای تہاڈا ناں تے کم دی تریخ پاء دیوے گا۔<br>
جے تہانوں کسی مدد دی لوڑ ہووے تے میری گلاں دے صفحے تے میرے کولوں پوچھ لو یا فیر اپنی گلاں دے صفحے تے '''<code>{{مدد کرو}}</code>''' لکھ کے چھڈ دیؤ۔ کوئی وی تہاڈے سوال دا جواب دے سکتا وا۔
اک واری فیر، جی آیاں نوں!</font>
--[[ورتنوالا:KaleemBot|KaleemBot]] ([[ورتن گل بات:KaleemBot|گل بات]] • [[خاص:Contributions/KaleemBot|کم]]) ۰۹:۴۵, ۱۱ جولائی ۲۰۲۵ (PKT)
7yx2tna6a6aldw4px4ahbf5sgi6pj0y
ورتن گل بات:Հասմիկ Խասիկյան08
3
141260
691022
2025-07-11T04:45:58Z
KaleemBot
24393
جی آیاں نوں!
691022
wikitext
text/x-wiki
==جی آیاں نوں!==
<font size="4">
السلام و علیکم! {{صفحہ}}، تے پنجابی وکیپیڈیا تے جی آیاں نوں ــ تہاڈے کَماں دا شکریہ ــ اسیں امید کردے آں کہ تہانوں اے جگہ پسند آئی ہوئے گی، تے تسی ایتھے رُکن دا فیصلہ کیتا ہوئے گا ــ ایتھے کچھ صفحے نیں جِتھے تُسی نظر مار لؤ تے (شاید) تہاڈے واسطے وکیپیڈیا چ بہتر ثابت ہوݨ:
* '''[[وکیپیڈیا:پنج تھم|وکیپیڈیا دے پنج تھم]]'''
* '''[[وکیپیڈیا:صفحے نوں کیویں بدلیئے|صفحے نوں کیویں بدلیئے]]'''
* '''[[وکیپیڈیا:مددآلے صفحے|مددآلے صفحے]]'''
* '''[[وکیپیڈیا:سبق|سبق]]'''
* '''[[وکیپیڈیا:چنگا مضمون کیویں لکھیئے|چنگا مضمون کیویں لکھیئے]]'''
* '''[[وکیپیڈیا:کم کرن دا وَل|کم کرن دا وَل]]'''<br>
* تے اگر تسی وکیپیڈیا تے نیا صفحہ لکھنا چوندے او تے جاؤ '''[[وکیپیڈیا:صفحہ لکھاری|صفحہ لکھاری]]''' تےــ<br>
میربانی کر کے گلاں دے صفحے چ اے نشان پاؤ: (~~~~)، اے اپنے آپ ای تہاڈا ناں تے کم دی تریخ پاء دیوے گا۔<br>
جے تہانوں کسی مدد دی لوڑ ہووے تے میری گلاں دے صفحے تے میرے کولوں پوچھ لو یا فیر اپنی گلاں دے صفحے تے '''<code>{{مدد کرو}}</code>''' لکھ کے چھڈ دیؤ۔ کوئی وی تہاڈے سوال دا جواب دے سکتا وا۔
اک واری فیر، جی آیاں نوں!</font>
--[[ورتنوالا:KaleemBot|KaleemBot]] ([[ورتن گل بات:KaleemBot|گل بات]] • [[خاص:Contributions/KaleemBot|کم]]) ۰۹:۴۵, ۱۱ جولائی ۲۰۲۵ (PKT)
7yx2tna6a6aldw4px4ahbf5sgi6pj0y
ورتن گل بات:Thanawat Hongkao
3
141261
691027
2025-07-11T10:16:44Z
KaleemBot
24393
جی آیاں نوں!
691027
wikitext
text/x-wiki
==جی آیاں نوں!==
<font size="4">
السلام و علیکم! {{صفحہ}}، تے پنجابی وکیپیڈیا تے جی آیاں نوں ــ تہاڈے کَماں دا شکریہ ــ اسیں امید کردے آں کہ تہانوں اے جگہ پسند آئی ہوئے گی، تے تسی ایتھے رُکن دا فیصلہ کیتا ہوئے گا ــ ایتھے کچھ صفحے نیں جِتھے تُسی نظر مار لؤ تے (شاید) تہاڈے واسطے وکیپیڈیا چ بہتر ثابت ہوݨ:
* '''[[وکیپیڈیا:پنج تھم|وکیپیڈیا دے پنج تھم]]'''
* '''[[وکیپیڈیا:صفحے نوں کیویں بدلیئے|صفحے نوں کیویں بدلیئے]]'''
* '''[[وکیپیڈیا:مددآلے صفحے|مددآلے صفحے]]'''
* '''[[وکیپیڈیا:سبق|سبق]]'''
* '''[[وکیپیڈیا:چنگا مضمون کیویں لکھیئے|چنگا مضمون کیویں لکھیئے]]'''
* '''[[وکیپیڈیا:کم کرن دا وَل|کم کرن دا وَل]]'''<br>
* تے اگر تسی وکیپیڈیا تے نیا صفحہ لکھنا چوندے او تے جاؤ '''[[وکیپیڈیا:صفحہ لکھاری|صفحہ لکھاری]]''' تےــ<br>
میربانی کر کے گلاں دے صفحے چ اے نشان پاؤ: (~~~~)، اے اپنے آپ ای تہاڈا ناں تے کم دی تریخ پاء دیوے گا۔<br>
جے تہانوں کسی مدد دی لوڑ ہووے تے میری گلاں دے صفحے تے میرے کولوں پوچھ لو یا فیر اپنی گلاں دے صفحے تے '''<code>{{مدد کرو}}</code>''' لکھ کے چھڈ دیؤ۔ کوئی وی تہاڈے سوال دا جواب دے سکتا وا۔
اک واری فیر، جی آیاں نوں!</font>
--[[ورتنوالا:KaleemBot|KaleemBot]] ([[ورتن گل بات:KaleemBot|گل بات]] • [[خاص:Contributions/KaleemBot|کم]]) ۱۵:۱۶, ۱۱ جولائی ۲۰۲۵ (PKT)
72wzxe0nctizjfn7ni4xf17l5tvkljw
ورتن گل بات:منتقم ((س.ش.ح.ق.س))
3
141262
691028
2025-07-11T11:26:05Z
KaleemBot
24393
جی آیاں نوں!
691028
wikitext
text/x-wiki
==جی آیاں نوں!==
<font size="4">
السلام و علیکم! {{صفحہ}}، تے پنجابی وکیپیڈیا تے جی آیاں نوں ــ تہاڈے کَماں دا شکریہ ــ اسیں امید کردے آں کہ تہانوں اے جگہ پسند آئی ہوئے گی، تے تسی ایتھے رُکن دا فیصلہ کیتا ہوئے گا ــ ایتھے کچھ صفحے نیں جِتھے تُسی نظر مار لؤ تے (شاید) تہاڈے واسطے وکیپیڈیا چ بہتر ثابت ہوݨ:
* '''[[وکیپیڈیا:پنج تھم|وکیپیڈیا دے پنج تھم]]'''
* '''[[وکیپیڈیا:صفحے نوں کیویں بدلیئے|صفحے نوں کیویں بدلیئے]]'''
* '''[[وکیپیڈیا:مددآلے صفحے|مددآلے صفحے]]'''
* '''[[وکیپیڈیا:سبق|سبق]]'''
* '''[[وکیپیڈیا:چنگا مضمون کیویں لکھیئے|چنگا مضمون کیویں لکھیئے]]'''
* '''[[وکیپیڈیا:کم کرن دا وَل|کم کرن دا وَل]]'''<br>
* تے اگر تسی وکیپیڈیا تے نیا صفحہ لکھنا چوندے او تے جاؤ '''[[وکیپیڈیا:صفحہ لکھاری|صفحہ لکھاری]]''' تےــ<br>
میربانی کر کے گلاں دے صفحے چ اے نشان پاؤ: (~~~~)، اے اپنے آپ ای تہاڈا ناں تے کم دی تریخ پاء دیوے گا۔<br>
جے تہانوں کسی مدد دی لوڑ ہووے تے میری گلاں دے صفحے تے میرے کولوں پوچھ لو یا فیر اپنی گلاں دے صفحے تے '''<code>{{مدد کرو}}</code>''' لکھ کے چھڈ دیؤ۔ کوئی وی تہاڈے سوال دا جواب دے سکتا وا۔
اک واری فیر، جی آیاں نوں!</font>
--[[ورتنوالا:KaleemBot|KaleemBot]] ([[ورتن گل بات:KaleemBot|گل بات]] • [[خاص:Contributions/KaleemBot|کم]]) ۱۶:۲۶, ۱۱ جولائی ۲۰۲۵ (PKT)
iq0k9acc83yjeaqsvvcyvdfne5om7y4