<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Modul:Check bibcode - Oʻzgarishlar tarixi</title>
		<link>https://ziyosfera.uz/index.php?title=Modul:Check_bibcode&amp;action=history</link>
		<description>Ziyosferadagi mazkur sahifaning oʻzgarishlar tarixi</description>
		<language>uz</language>
		<generator>MediaWiki 1.45.1</generator>
		<lastBuildDate>Sun, 22 Nov 2026 20:13:52 GMT</lastBuildDate>
		<item>
			<title>Programmer: Oʻzbekcha Vikipediyadan import qilindi.</title>
			<link>https://ziyosfera.uz/index.php?title=Modul:Check_bibcode&amp;diff=98995&amp;oldid=prev</link>
			<guid isPermaLink="false">https://ziyosfera.uz/index.php?title=Modul:Check_bibcode&amp;diff=98995&amp;oldid=prev</guid>
			<description>&lt;p&gt;Oʻzbekcha Vikipediyadan import qilindi.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Yangi sahifa&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; B I B C O D E &amp;gt;--------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Validates (sort of) a bibcode id.&lt;br /&gt;
&lt;br /&gt;
Format for bibcodes is specified here: http://adsabs.harvard.edu/abs_doc/help_pages/data.html#bibcodes&lt;br /&gt;
&lt;br /&gt;
But, this: 2015arXiv151206696F is apparently valid so apparently, the only things that really matter are length, 19 characters&lt;br /&gt;
and first four digits must be a year.  This function makes these tests:&lt;br /&gt;
	length must be 19 characters&lt;br /&gt;
	characters in position&lt;br /&gt;
		1–4 must be digits and must represent a year in the range of 1000 – next year&lt;br /&gt;
		5 must be a letter&lt;br /&gt;
		6–8 must be letter, digit, ampersand, or dot (ampersand cannot directly precede a dot; &amp;amp;. )&lt;br /&gt;
		9–18 must be letter, digit, or dot&lt;br /&gt;
		19 must be a letter or dot&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function bibcode (id)&lt;br /&gt;
	local err_type;&lt;br /&gt;
	local year;&lt;br /&gt;
&lt;br /&gt;
	if 19 ~= id:len() then&lt;br /&gt;
		err_type = &amp;#039;length&amp;#039;;&lt;br /&gt;
	else&lt;br /&gt;
		year = id:match (&amp;quot;^(%d%d%d%d)[%a][%w&amp;amp;%.][%w&amp;amp;%.][%w&amp;amp;%.][%w.]+[%a%.]$&amp;quot;)	-- &lt;br /&gt;
		if not year then														-- if nil then no pattern match&lt;br /&gt;
			err_type = &amp;#039;value&amp;#039;;													-- so value error&lt;br /&gt;
		else&lt;br /&gt;
			local next_year = tonumber(os.date (&amp;#039;%Y&amp;#039;))+1;						-- get the current year as a number and add one for next year&lt;br /&gt;
			year = tonumber (year);												-- convert year portion of bibcode to a number&lt;br /&gt;
			if (1000 &amp;gt; year) or (year &amp;gt; next_year) then&lt;br /&gt;
				err_type = &amp;#039;year&amp;#039;;												-- year out of bounds&lt;br /&gt;
			end&lt;br /&gt;
			if id:find(&amp;#039;&amp;amp;%.&amp;#039;) then&lt;br /&gt;
				err_type = &amp;#039;journal&amp;#039;;											-- journal abbreviation must not have &amp;#039;&amp;amp;.&amp;#039; (if it does its missing a letter)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return err_type;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[=[-------------------------&amp;lt; E N T R Y   P O I N T S &amp;gt;------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
This module is mostly a copy of the bibcode validation used in [[Module:Citation/CS1]]&lt;br /&gt;
&lt;br /&gt;
call this module with:&lt;br /&gt;
	{{#invoke:check bibcode|check_bibcode|{{{1|}}}}}&lt;br /&gt;
where {{{1|}}} is the bibcode&lt;br /&gt;
&lt;br /&gt;
]=]&lt;br /&gt;
&lt;br /&gt;
local function check_bibcode (frame)&lt;br /&gt;
	local err_type = bibcode (mw.text.trim (frame.args[1]));					-- trim leading and trailing white space before evaluation&lt;br /&gt;
	if err_type then&lt;br /&gt;
		return &amp;#039;&amp;lt;span style=&amp;quot;font-size:100%&amp;quot; class=&amp;quot;error citation-comment&amp;quot;&amp;gt;Check bibcode: &amp;#039; .. err_type .. &amp;#039; ([[Template:Bibcode#Error_messages|help]])&amp;lt;/span&amp;gt;&amp;#039;;&lt;br /&gt;
	end&lt;br /&gt;
	return &amp;#039;&amp;#039;;																	-- return empty string when bibcode appears to be valid&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[--------------------------&amp;lt; E X P O R T E D   F U N C T I O N S &amp;gt;------------------------------------------&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	check_bibcode = check_bibcode,&lt;br /&gt;
	}&lt;/div&gt;</description>
			<pubDate>Thu, 06 Aug 2026 12:00:10 GMT</pubDate>
			<dc:creator>Programmer</dc:creator>
			<comments>https://ziyosfera.uz/ziyo/Modul_munozarasi:Check_bibcode</comments>
		</item>
</channel></rss>