Module:IPA/tracking

Hello, you have come here looking for the meaning of the word Module:IPA/tracking. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:IPA/tracking, but we will also tell you about its etymology, its characteristics and you will know how to say Module:IPA/tracking in singular and plural. Everything you need to know about the word Module:IPA/tracking you have here. The definition of the word Module:IPA/tracking will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:IPA/tracking, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

This module allows characters used in {{IPA}} to be tracked. The tracking is language-dependent.

For example, {{IPA|en|/wɜrd/}}IPA(key): /wɜrd/ will add the tracking template IPA/en/plain r.

Below is the list of tracking templates (from which the Wiktionary:Tracking/IPA part has been cut off) with their "WhatLinksHere" link and the pattern or patterns that they track. For an explanation of patterns, see Extension:Scribunto/Lua reference manual § Patterns on MediaWiki.


local export = {}

--[[
	symb is what is tracked. It can be a literal symbol or a Lua pattern.
	If it is a table, tracking is added for any of the symbols in the list.
	
	cat is the subtemplate that is added to the default path "IPA/" + language code + "/".
]]

local U = require("Module:string/char")

local syllabic = U(0x329)

-- The validity of this table is checked by documentation function
-- in ].
export.tracking = {
	en = {
		{
			symb = "iə",
			cat = "ambig",
		},
		{
			symb = { "ɪi", "ʊu", "ɪj", "ʊw" },
			cat = "eeoo",
		},
		{
			symb = { "r" },
			cat = "plain r",
		},
	},
	cs = {
		{
			symb = "" .. syllabic,
			cat = "syllabic-consonant",
		},
	},
	ps = {
		{
			symb = "ɤ",
			cat = "Pashto",
		},
	},
	fa = {
		{
			symb = "ʔ",
			cat = "glottal-stop",
		},
	},
	{
		{
			symb = "",
			cat = "",
		},
	},
}

function export.run_tracking(IPA, lang)
	if not IPA or IPA == "" then
		return
	end
	
	lang = lang:getCode()
	
	if not export.tracking then
		return
	end
	
	for i, arguments in ipairs(export.tracking) do
		local symbols = arguments.symb
		local category = arguments.cat
		
		if type(symbols) == "string" then
			symbols = { symbols }
		end
		
		for _, symbol in pairs(symbols) do
			if mw.ustring.find(IPA, symbol) then
				require("Module:debug/track")("IPA/" .. lang .. "/" .. category)
			end
		end
	end
end

return export