<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>https://bukvica.org/w/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3APlural_switch</id>
	<title>Модуль:Plural switch - История изменений</title>
	<link rel="self" type="application/atom+xml" href="https://bukvica.org/w/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3APlural_switch"/>
	<link rel="alternate" type="text/html" href="https://bukvica.org/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Plural_switch&amp;action=history"/>
	<updated>2026-04-20T19:59:49Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://bukvica.org/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Plural_switch&amp;diff=238679&amp;oldid=prev</id>
		<title>Karaby: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="https://bukvica.org/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Plural_switch&amp;diff=238679&amp;oldid=prev"/>
		<updated>2025-07-27T15:37:39Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 15:37, 27 июля 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Karaby</name></author>
	</entry>
	<entry>
		<id>https://bukvica.org/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Plural_switch&amp;diff=238678&amp;oldid=prev</id>
		<title>Буквица&gt;Wikisaurus: из Модуль:Песочница/CupIvan/plural/песочница</title>
		<link rel="alternate" type="text/html" href="https://bukvica.org/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Plural_switch&amp;diff=238678&amp;oldid=prev"/>
		<updated>2023-12-27T15:48:19Z</updated>

		<summary type="html">&lt;p&gt;из &lt;a href=&quot;/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:%D0%9F%D0%B5%D1%81%D0%BE%D1%87%D0%BD%D0%B8%D1%86%D0%B0/CupIvan/plural/%D0%BF%D0%B5%D1%81%D0%BE%D1%87%D0%BD%D0%B8%D1%86%D0%B0&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Модуль:Песочница/CupIvan/plural/песочница (страница не существует)&quot;&gt;Модуль:Песочница/CupIvan/plural/песочница&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.plural(frame)&lt;br /&gt;
	local text          = frame.args[1]&lt;br /&gt;
	local text_singular = frame.args[2]&lt;br /&gt;
	local text_plural   = frame.args[3]&lt;br /&gt;
&lt;br /&gt;
	local is_ident = false&lt;br /&gt;
	local is_plural = false&lt;br /&gt;
&lt;br /&gt;
	-- принудительная установка&lt;br /&gt;
	if not is_ident then&lt;br /&gt;
		if string.find(text, &amp;#039;data%-plural=&amp;quot;0&amp;quot;&amp;#039;) then is_plural = false; is_ident = true; end&lt;br /&gt;
		if string.find(text, &amp;#039;data%-plural=&amp;quot;1&amp;quot;&amp;#039;) then is_plural = true;  is_ident = true; end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- проверка по тегам&lt;br /&gt;
	if not is_ident and string.find(text, &amp;quot;&amp;lt;br&amp;quot;) then is_plural = true; is_ident = true; end&lt;br /&gt;
	if not is_ident then&lt;br /&gt;
		_, count = string.gsub(text, &amp;quot;&amp;lt;li&amp;quot;, &amp;quot;&amp;lt;li&amp;quot;)&lt;br /&gt;
		if count &amp;gt; 1 then is_plural = true; is_ident = true; end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- анализ текста&lt;br /&gt;
	if not is_ident then&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%[%[.-%]%] &amp;lt;span lang=.-&amp;lt;/span&amp;gt;&amp;#039;, &amp;#039;&amp;#039;) -- убираем расшифровки с других языков&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%]&amp;lt;span.-&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;#039;, &amp;#039;&amp;#039;)         -- убираем шаблон нп3&lt;br /&gt;
		text = string.gsub(text, &amp;#039;&amp;lt;sup.-&amp;lt;/sup&amp;gt;&amp;#039;, &amp;#039;&amp;#039;)   -- убираем верхние индексы&lt;br /&gt;
		text = string.gsub(text, &amp;#039;&amp;lt;.-&amp;gt;&amp;#039;, &amp;#039;&amp;#039;)           -- убираем все теги&lt;br /&gt;
		text = string.gsub(text, &amp;#039;&amp;amp;[^&amp;amp;]-;&amp;#039;, &amp;#039; &amp;#039;)       -- заменяем спец. символы пробелами&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%[%[Category.-%]%]&amp;#039;, &amp;#039;&amp;#039;) -- вырезаем ссылки на категории&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%[%[File.-%]%]&amp;#039;, &amp;#039;img&amp;#039;)  -- заменяем шаблоны-картинки (флаги)&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%[%[Файл.-%]%]&amp;#039;, &amp;#039;img&amp;#039;)&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%]%][а-я-]+%[%[&amp;#039;, &amp;#039;&amp;#039;)   -- склеиваем элементы рядом&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%]%] +%[%[&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%[%[.-%]%]&amp;#039;, &amp;#039;x &amp;#039;)   -- считаем [[...]] одним элементом&lt;br /&gt;
		text = string.gsub(text, &amp;#039;%[.-%]&amp;#039;, &amp;#039;x &amp;#039;)       -- считаем [...] одним элементом&lt;br /&gt;
		text = string.gsub(text, &amp;#039;..&amp;quot;`UNIQ.-QINU`&amp;quot;..&amp;#039;, &amp;#039;&amp;#039;)     -- убираем специальные коды викиразметки + возможные замены [[...]]&lt;br /&gt;
		text = string.gsub(text, &amp;#039;[a-z]x&amp;#039;, &amp;#039;a&amp;#039;)        -- сокращаем английские слова &lt;br /&gt;
		text = string.gsub(text, &amp;#039;\n%*&amp;#039;, &amp;#039;,&amp;#039;)          -- звёздочка в начале - элемент списка&lt;br /&gt;
		text = string.gsub(text, &amp;#039;x,%-x&amp;#039;, &amp;#039;x&amp;#039;)         -- элементы-слова через дефис считаем одним&lt;br /&gt;
		text = string.gsub(text, &amp;#039;^ *,&amp;#039;, &amp;#039;&amp;#039;)           -- убираем первую запятую&lt;br /&gt;
		text = string.gsub(text, &amp;#039;x.-x&amp;#039;, &amp;#039;x,x&amp;#039;)        -- добавляем разделитель между x: x .. , .. x&lt;br /&gt;
		text = string.gsub(text, &amp;#039;[ \n]+$&amp;#039;, &amp;#039;&amp;#039;)        -- trim&lt;br /&gt;
&lt;br /&gt;
		delimiters = {&amp;quot;,&amp;quot;, &amp;quot;;&amp;quot;, &amp;quot;·&amp;quot;, &amp;quot;•&amp;quot;, &amp;quot;/&amp;quot;, &amp;quot; и &amp;quot;, &amp;quot;\n&amp;quot;}&lt;br /&gt;
		for i,d in pairs(delimiters) do&lt;br /&gt;
			if not is_plural and string.find(text, d) then is_plural = true; is_ident = true; end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- формируем результат&lt;br /&gt;
	local result = text_singular&lt;br /&gt;
	if is_plural then result = text_plural end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Буквица&gt;Wikisaurus</name></author>
	</entry>
</feed>