<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Agender_and_number_utilities</id>
	<title>Module:gender and number utilities - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Agender_and_number_utilities"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:gender_and_number_utilities&amp;action=history"/>
	<updated>2026-04-10T04:10:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:gender_and_number_utilities&amp;diff=475288&amp;oldid=prev</id>
		<title>Sware: Created page with &quot;local export = {}  local parameter_utilities_module = &quot;Module:parameter utilities&quot; local parse_interface_module = &quot;Module:parse interface&quot;  --[==[ Parse a gender and number spec, possibly with multiple comma-separated gender/number specs and potentially with inline modifiers. Used by Module:parameters. `data` is an object with the following fields: * `spec`: The unparsed gender/number spec. * `paramname`: The name of the parameter where the gender/number spec was ret...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:gender_and_number_utilities&amp;diff=475288&amp;oldid=prev"/>
		<updated>2025-11-04T21:22:40Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local export = {}  local parameter_utilities_module = &amp;quot;Module:parameter utilities&amp;quot; local parse_interface_module = &amp;quot;Module:parse interface&amp;quot;  --[==[ Parse a gender and number spec, possibly with multiple comma-separated gender/number specs and potentially with inline modifiers. Used by &lt;a href=&quot;/wiki/Module:parameters&quot; title=&quot;Module:parameters&quot;&gt;Module:parameters&lt;/a&gt;. `data` is an object with the following fields: * `spec`: The unparsed gender/number spec. * `paramname`: The name of the parameter where the gender/number spec was ret...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local export = {}&lt;br /&gt;
&lt;br /&gt;
local parameter_utilities_module = &amp;quot;Module:parameter utilities&amp;quot;&lt;br /&gt;
local parse_interface_module = &amp;quot;Module:parse interface&amp;quot;&lt;br /&gt;
&lt;br /&gt;
--[==[&lt;br /&gt;
Parse a gender and number spec, possibly with multiple comma-separated gender/number specs and potentially with&lt;br /&gt;
inline modifiers. Used by [[Module:parameters]]. `data` is an object with the following fields:&lt;br /&gt;
* `spec`: The unparsed gender/number spec.&lt;br /&gt;
* `paramname`: The name of the parameter where the gender/number spec was retrieved from, for error messages. Optional.&lt;br /&gt;
* `parse_err`: Optional function to display a parse error message, in the format required for&lt;br /&gt;
  `parse_inline_modifiers` in [[Module:parse utilities]].&lt;br /&gt;
* `allow_multiple`: If true, allow multiple comma-separated gender/number specs. If given, the return value will be a&lt;br /&gt;
  list of parsed gender/number specs instead of a single such object.&lt;br /&gt;
* `allow_space_around_comma`: If true, spaces can be placed around the comma separating multiple gender/number specs.&lt;br /&gt;
  It&amp;#039;s not generally recommended to set this.&lt;br /&gt;
&lt;br /&gt;
The return value is a gender/number spec of the sort accepted by [[Module:gender and number]]; or, if `allow_multiple`&lt;br /&gt;
is given, a list of such specs. In each spec, the field `spec` contains the gender/number spec itself (e.g. `m-in-p`)&lt;br /&gt;
and other fields contain parsed inline modifiers. The following modifiers are supported:&lt;br /&gt;
* `q`: Left qualifier.&lt;br /&gt;
* `qq`: Right qualifier.&lt;br /&gt;
* `l`: Left label(s).&lt;br /&gt;
* `ll`: Right label(s).&lt;br /&gt;
* `ref`: Reference(s).&lt;br /&gt;
]==]&lt;br /&gt;
function export.parse_gender_and_number_spec(data)&lt;br /&gt;
	local spec = data.spec&lt;br /&gt;
	if not spec:find(&amp;quot;[,&amp;lt;]&amp;quot;) then&lt;br /&gt;
		return data.allow_multiple and {{spec = spec}} or {spec = spec}&lt;br /&gt;
	end&lt;br /&gt;
    local param_mods = require(parameter_utilities_module).construct_param_mods {&lt;br /&gt;
        {group = {&amp;quot;q&amp;quot;, &amp;quot;l&amp;quot;, &amp;quot;ref&amp;quot;}},&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
	local function generate_obj(term, parse_err)&lt;br /&gt;
		return {&lt;br /&gt;
			spec = term&lt;br /&gt;
		}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return require(parse_interface_module).parse_inline_modifiers(spec, {&lt;br /&gt;
		paramname = data.paramname,&lt;br /&gt;
		param_mods = param_mods,&lt;br /&gt;
		generate_obj = generate_obj,&lt;br /&gt;
		parse_err = data.parse_err,&lt;br /&gt;
		escape_fun = false,&lt;br /&gt;
		unescape_fun = false,&lt;br /&gt;
		splitchar = data.allow_multiple and (data.allow_space_around_comma and &amp;quot;%s*,%s*&amp;quot; or &amp;quot;,&amp;quot;) or nil,&lt;br /&gt;
	})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return export&lt;/div&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
</feed>