Modul:affix: Perbezaan antara semakan

Kandungan dihapus Kandungan ditambah
Hakimi97 (bincang | sumb.)
Menukar "of" menjadi "bagi"
Hakimi97 (bincang | sumb.)
Menyalin kod dari Wikikamus bahasa Inggeris (jika ada ralat akan batalkan suntingan)
Teg: Dibalikkan
Baris 4:
 
local m_links = require("Module:links")
local m_str_utils = require("Module:string utilities")
local m_utilities = require("Module:utilities")
local m_table = require("Module:table")
Baris 9 ⟶ 10:
export.affix_lang_data_module_prefix = "Module:affix/lang-data/"
 
local ursub = mwm_str_utils.ustring.chargsub
local rsubusub = mwm_str_utils.ustring.gsubsub
local usubulen = mwm_str_utils.ustring.sublen
local ulenrfind = mwm_str_utils.ustring.lenfind
local rfindrmatch = mwm_str_utils.ustring.findmatch
local rmatchpluralize = mwm_str_utils.ustring.matchpluralize
local u = m_str_utils.char
 
local ucfirst = m_str_utils.ucfirst
 
-- Export this so the category code in [[Module:category tree/poscatboiler/data/terms by etymology]] can access it.
Baris 21 ⟶ 23:
["az"] = true,
["fi"] = true,
["izh"] = true,
["la"] = true,
["tr"] = true,
}
 
local default_pos = "Perkataanterm"
 
--[=[
Baris 76 ⟶ 79:
piped links, as described above under "display affix".
(2) For certain languages, certain affixes are mapped to canonical form using language-specific mappings. For example,
in Finnish, the adjective-forming suffix [[-kas]] appears as [[-käs]] after front vowels, but logically both
forms are the same suffix and should be linked and categorized the same. Similarly, in Latin, the negative and
intensive prefixes spelled [[in-]] (etymologically two distinct prefixes) appear variously as [[il-]], [[im-]] or
Baris 93 ⟶ 96:
under link affixes. There are actually two lookup stages:
(1) First, the affix is looked up in a modified display form (specifically, the same as the display affix but using
lookup hyphens). Note that this lookup does not occur if an explicit display form is given using |altN= or an
<alt:...> inline modifier, or if the template affix contains a piped or embedded link.
(2) If no entry is found, the affix is then looked up in a modified link form (specifically, the modified display
form passed through the language's makeEntryName() function, which strips out certain diacritics, but with the
lookup hyphen re-added if it was stripped out, as in the case of tatweel in many Arabic-script languages).
The reason for this double lookup procedure is to allow for mappings that are sensitive to the extra diacritics, but
Baris 134 ⟶ 137:
local ZWNJ = u(0x200C) -- zero-width non-joiner
local template_hyphens = {
["Arab"] = "ـ" .. ZWNJ .. "-", -- tatweel + zero-width non-joiner + regular hyphen
["Hebr"] = "־", -- Hebrew-specific hyphen termed "maqqef"
-- This covers all Arabic scripts. See above.
["Mong"] = "᠊",
["Arab"] = "ـ" .. ZWNJ .. "-", -- tatweel + zero-width non-joiner + regular hyphen
["mnc-Mong"] = "᠊",
["sjo-Mong"] = "᠊",
["xwo-Mong"] = "᠊",
-- FIXME! What about the following right-to-left scripts?
-- Adlm (Adlam)
Baris 202 ⟶ 209:
-- This covers all Arabic scripts. See above.
["Arab"] = arab_get_display_hyphen,
["Bopo"] = no_display_hyphen,
["Hani"] = no_display_hyphen,
["Hans"] = no_display_hyphen,
["Hant"] = no_display_hyphen,
-- The following is a mixture of several scripts. Hopefully the specs here are correct!
["Jpan"] = no_display_hyphen,
["Jurc"] = no_display_hyphen,
["Kitl"] = no_display_hyphen,
["Kits"] = no_display_hyphen,
["Laoo"] = no_display_hyphen,
["Nshu"] = no_display_hyphen,
["Shui"] = no_display_hyphen,
["Tang"] = no_display_hyphen,
["Thaa"] = no_display_hyphen,
["Thai"] = no_display_hyphen,
Baris 239 ⟶ 254:
local function make_compound_type(typ, alttext)
return {
text = glossary_link(typ, alttext) .. " majmukcompound",
cat = typ .. "Kata majmukcompounds",
}
end
Baris 251 ⟶ 266:
local link = alttext and "[[" .. typ .. "|" .. alttext .. "]]" or "[[" .. typ .. "]]"
return {
text = link .. " majmukcompound",
cat = typ .. "Kata majmukcompounds",
}
end
 
 
local function make_raw_compound_type(typ, alttext)
return {
text = glossary_link(typ, alttext),
cat = pluralize(typ),
}
end
Baris 277 ⟶ 300:
["exocentric"] = make_compound_type("exocentric"),
["exo"] = "exocentric",
["izafet I"] = make_compound_type("izafet I"),
["iz1"] = "izafet I",
["izafet II"] = make_compound_type("izafet II"),
["iz2"] = "izafet II",
["izafet III"] = make_compound_type("izafet III"),
["iz3"] = "izafet III",
["karmadharaya"] = make_compound_type("karmadharaya", "karmadhāraya"),
["karma"] = "karmadharaya",
["kd"] = "karmadharaya",
["kenning"] = make_raw_compound_type("kenning"),
["ken"] = "kenning",
["rhyming"] = make_non_glossary_compound_type("rhyming"),
["rhy"] = "rhyming",
Baris 304 ⟶ 335:
local text = typdata.text
if not nocap then
text = require("Module:string utilities").ucfirst(text)
end
local cat = typdata.cat
local oftext = typdata.oftext or " bagiof"
 
if not notext then
Baris 326 ⟶ 357:
-- Utility functions --
-----------------------------------------------------------------------------------------
 
local function glossary_link(entry, text)
text = text or entry
return "[[Lampiran:Glosari#" .. entry .. "|" .. text .. "]]"
end
 
 
local function track(page)
if type(page) == "table" then
for i, pg in ipairs(page) do
page[i] = "affix/" .. pg
end
else
page = "affix/" .. page
end
require("Module:debug/track")(page)
end
 
 
-- Iterate an array up to the greatest integer index found.
Baris 375 ⟶ 388:
for i, cat in ipairs(categories) do
if type(cat) == "table" then
categories[i] = m_utilities.format_categories({cat.catlang:getFullName() .. " bahasa " .. lang:getNonEtymologicalName()cat.cat}, lang,
cat.sort_key, cat.sort_base, force_cat or debug_force_cat)
else
categories[i] = m_utilities.format_categories({catlang:getFullName() .. " bahasa " .. lang:getNonEtymologicalName()cat}, lang,
sort_key, nil, force_cat or debug_force_cat)
end
Baris 384 ⟶ 397:
cattext = table.concat(categories)
end
return table.concat(parts_formatted, " +&lrm; ") .. (lit and ", secara harafiahliterally " .. m_links.mark(lit, "gloss") or "") ..
cattext
end
 
 
local function pluralize(pos)
if pos ~= "nouns" and usub(pos, -5) ~= "verbs" and usub(pos, -4) ~= "ives" then
if pos:find("[sx]$") then
pos = pos .. "es"
else
pos = pos .. "s"
end
end
return pos
end
 
 
-- Remove links and call lang:makeEntryName(term).
Baris 411 ⟶ 437:
part.lang = part.lang or lang
part.sc = part.sc or sc
iflocal term = part.term then
if not term then
local fragment
return
part.term, fragment = m_links.get_fragment(part.term)
part.fragment elseif =not part.fragment or fragmentthen
part.term, part.fragment = m_links.get_fragment(term)
else
part.term = m_links.get_fragment(term)
end
end
Baris 434 ⟶ 463:
data.force_cat or debug_force_cat)
else
-- `allow_self_link` should be true in case of a term in one language derived from the same term in a different
-- language (e.g. in a pseudo-loan).
result = m_links.full_link(part, "term", true)
end
 
Baris 477 ⟶ 505:
-- This shouldn't happen; if the language has no script codes,
-- the list {"None"} should be returned.
error("Something is majorly wrong! Language " .. lang:getNonEtymologicalNamegetCanonicalName() .. " has no script codes.")
end
if num_possible_script_codes == 1 then
Baris 528 ⟶ 556:
if not affix_type then
return term
elseif affix_type == "apitancircumfix" then
local before, before_hyphen, after_hyphen, after = rmatch(term, "^(.*)" .. thyph_re .. " " .. thyph_re
.. "(.*)$")
Baris 537 ⟶ 565:
end
return before .. get_hyphen(before_hyphen) .. " " .. get_hyphen(after_hyphen) .. after
elseif affix_type == "sisipaninfix" or affix_type == "interfiksinterfix" then
local before_hyphen, middle, after_hyphen = rmatch(term, "^" .. thyph_re .. "(.*)" .. thyph_re .. "$")
if before_hyphen and ulen(term) <= 1 then
Baris 544 ⟶ 572:
end
return get_hyphen(before_hyphen) .. (middle or term) .. get_hyphen(after_hyphen)
elseif affix_type == "awalanprefix" then
local middle, after_hyphen = rmatch(term, "^(.*)" .. thyph_re .. "$")
if middle and ulen(term) <= 1 then
Baris 551 ⟶ 579:
end
return (middle or term) .. get_hyphen(after_hyphen)
elseif affix_type == "akhiransuffix" then
local before_hyphen, middle = rmatch(term, "^" .. thyph_re .. "(.*)$")
if before_hyphen and ulen(term) <= 1 then
Baris 564 ⟶ 592:
 
 
--[=[
local function lookup_affix_mapping(affix, affix_type, lang, scode, thyph_re, lookup_hyph)
Look up a mapping from a given affix variant to the canonical form used in categories and links. The lookup tables are
language-specific according to `lang`, and may be ID-specific according to `affix_id`. The affixes as they appear in the
lookup tables (both the variant and the canonical form) are in "lookup affix" format (approximately speaking, they use a
regular hyphen for most scripts, but a tatweel for Arabic-script entries and a maqqef for Hebrew-script entries), but
the passed-in `affix` param is in "template affix" format (which differs from the lookup affix for Arabic-script
entries, because more types of hyphens are allowed in template affixes; see the comments at the top of the file). The
remaining parameters to this function are used to convert from template affixes to lookup affixes; see the
reconstruct_term_per_hyphens() function above.
 
If the affix contains brackets, no lookup is done. Otherwise, a two-stage process is used, first looking up the affix
directly and then stripping diacritics and looking it up again. The reason for this is documented above in the comments
at the top of the file (specifically, the comments describing lookup affixes).
 
The value of a mapping can either be a string (do the mapping regardless of affix ID) or a table indexed by affix ID
(where the special value `false` indicates no affix ID). The values of entries in this table can also be strings, or
tables with keys `affix` and `id` (again, use `false` to indicate no ID). This allows an affix mapping to map from one
ID to another (for example, this is used in English to map the [[an-]] prefix with no ID to the [[a-]] prefix with the
ID 'not').
 
The Given a template affix `term` and an affix type `affix_type`, change the relevant template hyphen(s) in the affix to
the display or lookup hyphen specified in `new_hyphen`, or add them if they are missing. `new_hyphen` can be a string,
specifying a fixed hyphen, or a function of two arguments (the script code `scode` and the discovered template hyphen,
or nil of no relevant template hyphen is present). `thyph_re` is a Lua pattern (which must be enclosed in parens) that
matches the possible template hyphens. Note that not all template hyphens present in the affix are changed, but only
the "relevant" ones (e.g. for a prefix, a relevant template hyphen is one coming at the end of the affix).
]=]
local function lookup_affix_mapping(affix, affix_type, lang, scode, thyph_re, lookup_hyph, affix_id)
local function do_lookup(affix)
local langcode = lang:getCode()
-- Ensure that the affix uses lookup hyphens regardless of whether it used a different type of hyphens before
-- or no hyphens.
local lookup_affix = reconstruct_term_per_hyphens(affix, affix_type, scode, thyph_re, lookup_hyph)
local function do_lookup_for_langcode(langcode)
if export.langs_with_lang_specific_data[langcode] then
if export.langs_with_lang_specific_data[langcode] then
local langdata = mw.loadData(export.affix_lang_data_module_prefix .. langcode)
local langdata = mw.loadData(export.affix_lang_data_module_prefix .. langcode)
if langdata.affix_mappings then
if langdata.affix_mappings then
local mapping = langdata.affix_mappings[lookup_affix]
if mapping then
return if type(mapping) == "table" then
mapping = mapping[affix_id or false]
if mapping then
return mapping
end
else
return mapping
end
end
end
end
end
 
-- If `lang` is an etymology-only language, look for a mapping both for it and its full parent.
local langcode = lang:getCode()
local mapping = do_lookup_for_langcode(langcode)
if mapping then
return mapping
end
local full_langcode = lang:getFullCode()
if full_langcode ~= langcode then
mapping = do_lookup_for_langcode(full_langcode)
if mapping then
return mapping
end
end
return nil
end
Baris 594 ⟶ 670:
--[=[
For a given template term in a given language (see the definition of "template affix" near the top of the file),
possibly in an explicitly specified script `sc` (but usually nil), return the term's affix type ("awalanprefix", "sisipaninfix",
"akhiransuffix", "apitancircumfix" or nil for non-affix) along with the corresponding link and display affixes (see definitions
near the top of the file); also the corresponding lookup affix (if `return_lookup_affix` is specified). The term passed
in should already have any fragment (after the # sign) parsed off of it. Four values are returned: `affix_type`,
Baris 608 ⟶ 684:
can be looked up in the affix mapping tables.)
]=]
function export.parse_term_for_affixes(term, lang, sc, affix_type, do_affix_mapping, return_lookup_affix, affix_id)
if not term then
return nil, nil, nil, nil
Baris 621 ⟶ 697:
-- Remove an asterisk if the morpheme is reconstructed and add it back at the end.
local reconstructed = ""
if term:find("^%*") then
reconstructed = "*"
term = term:gsub("^%*", "")
Baris 631 ⟶ 707:
if affix_type == nil then
if rfind(term, thyph .. " " .. thyph) then
affix_type = "apitancircumfix"
else
local has_beginning_hyphen = rfind(term, "^" .. thyph)
local has_ending_hyphen = rfind(term, thyph .. "$")
if has_beginning_hyphen and has_ending_hyphen then
affix_type = "sisipaninfix"
elseif has_ending_hyphen then
affix_type = "awalanprefix"
elseif has_beginning_hyphen then
affix_type = "akhiransuffix"
end
end
Baris 649 ⟶ 725:
display_term = reconstruct_term_per_hyphens(term, affix_type, scode, thyph, dhyph)
if do_affix_mapping then
link_term = lookup_affix_mapping(term, affix_type, lang, scode, thyph, lhyph, affix_id)
-- The return value of lookup_affix_mapping() may be an affix mapping with lookup hyphens if a mapping
-- was found, otherwise nil if a mapping was not found. We need to convert to display hyphens in
Baris 685 ⟶ 761:
--[=[
Add a hyphen to a term in the appropriate place, based on the specified affix type, stripping off any existing hyphens
in that place. For example, if `affix_type` == "awalanprefix", we'll add a hyphen onto the end if it's not already there (or
is of the wrong type). Three values are returned: the link term, display term and lookup term. This function is a thin
wrapper around `parse_term_for_affixes`; see the comments above that function for more information.
]=]
function export.make_affix(term, lang, sc, affix_type, do_affix_mapping, return_lookup_affix, affix_id)
if not (affix_type == "awalanprefix" or affix_type == "akhiransuffix" or affix_type == "apitancircumfix" or affix_type == "sisipaninfix" or
affix_type == "interfiksinterfix") then
error("Internal error: Invalid affix type " .. (affix_type or "(nil)"))
end
 
local _, link_term, display_term, lookup_term = export.parse_term_for_affixes(term, lang, sc, affix_type,
do_affix_mapping, return_lookup_affix, affix_id)
return link_term, display_term, lookup_term
end
Baris 731 ⟶ 807:
function export.show_affix(data)
data.pos = data.pos or default_pos
data.pos = pluralize(data.pos)
 
local text_sections, categories = process_compound_type(data.type, data.surface_analysis or data.nocap, data.notext,
Baris 753 ⟶ 830:
-- Determine affix type and get link and display terms (see text at top of file).
local affix_type, link_term, display_term = export.parse_term_for_affixes(part.term, part.lang, part.sc, nil,
not part.alt, nil, part.id)
 
-- If link_term is an empty string, either a bare ^ was specified or an empty term was used along with inline
-- modifiers. The intention in either case is not to link the term.
part.term = link_term ~= "" and link_term or nil
-- If part.alt would be the same as part.term, make it nil, so that it isn't erroneously tracked as being
part.alt = part.alt or display_term
-- redundant alt text.
part.alt = part.alt or (display_term ~= link_term and display_term) or nil
 
-- Make a link for the part.
Baris 767 ⟶ 846:
-- We cannot distinguish interfixes from infixes by appearance. Prefer interfixes; infixes will need to
-- use {{infix}}.
if affix_type == "sisipaninfix" then affix_type = "interfiksinterfix" end
 
-- Make a sort key. For the first part, use the second part as the sort key; the intention is that if the
Baris 778 ⟶ 857:
local part2 = data.parts[2]
local part2_affix_type, part2_link_term, part2_display_term = export.parse_term_for_affixes(
part2.term, part2.lang, part2.sc, nil, not part2.alt, nil, part.id)
part_sort_base = make_entry_name_no_links(part2.lang, part2_link_term)
end
 
if part.pos and rfind(part.pos, "patronym") then
table.insert(categories, {cat = "patroni,patronymics", sort_key = part_sort, sort_base = part_sort_base})
end
 
if data.pos ~= "Perkataanterms" and part.pos and rfind(part.pos, "diminutive") then
table.insert(categories, {cat = data.pos"diminutive " .. " diminutif "data.pos, sort_key = part_sort,
sort_base = part_sort_base})
end
Baris 793 ⟶ 872:
-- Don't add a '*fixed with' category if the link term is empty or is in a different language.
if link_term and link_term ~= "" and not part.part_lang then
table.insert(categories, {cat = data.pos .. " dengan " .. affix_type .. "ed with " ..
make_entry_name_no_links(part.lang, link_term) .. (part.id and " (" .. part.id .. ")" or ""),
sort_key = part_sort, sort_base = part_sort_base})
Baris 802 ⟶ 881:
if whole_words == 2 then
is_affix_or_compound = true
table.insert(categories, "Kata majmukcompound " .. data.pos)
end
end
Baris 815 ⟶ 894:
local text = "by " .. glossary_link("surface analysis") .. ", "
if not data.nocap then
text = require("Module:string utilities").ucfirst(text)
end
 
Baris 840 ⟶ 919:
function export.show_compound(data)
data.pos = data.pos or default_pos
data.pos = pluralize(data.pos)
 
local text_sections, categories = process_compound_type(data.type, data.nocap, data.notext, #data.parts > 0)
 
local parts_formatted = {}
table.insert(categories, "Kata majmukcompound " .. data.pos)
 
-- Make links out of all the parts
Baris 852 ⟶ 932:
-- Determine affix type and get link and display terms (see text at top of file).
local affix_type, link_term, display_term = export.parse_term_for_affixes(part.term, part.lang, part.sc,
nil, not part.alt, nil, part.id)
 
-- If the term is an infix, recognize it as such (which means e.g. that we will display the term without
-- hyphens for East Asian languages). Otherwise, ignore the fact that it looks like an affix and display as
-- specified in the template (but pay attention to the detected affix type for certain tracking purposes).
if affix_type == "sisipaninfix" then
-- If link_term is an empty string, either a bare ^ was specified or an empty term was used along with
-- inline modifiers. The intention in either case is not to link the term. Don't add a '*fixed with'
-- category in this case, or if the term is in a different language.
-- If part.alt would be the same as part.term, make it nil, so that it isn't erroneously tracked as being
-- redundant alt text.
if link_term and link_term ~= "" and not part.part_lang then
table.insert(categories, {cat = data.pos .. " denganinterfixed interfikswith " .. make_entry_name_no_links(part.lang,
link_term), sort_key = part.sort or data.sort_key})
end
part.term = link_term ~= "" and link_term or nil
part.alt = part.alt or (display_term ~= link_term and display_term) or nil
else
if affix_type then
tracklocal {langcode affix_type, affix_type .. "/lang/" ..= data.lang:getNonEtymologicalCodegetCode() }
-- If `data.lang` is an etymology-only language, track both using its code and its full parent's code.
track { affix_type, affix_type .. "/lang/" .. langcode }
local full_langcode = data.lang:getFullCode()
if langcode ~= full_langcode then
track(affix_type .. "/lang/" .. full_langcode)
end
else
whole_words = whole_words + 1
Baris 925 ⟶ 1,013:
--[=[
Make `part` (a structure holding information on an affix part) into an affix of type `affix_type`, and apply any
relevant affix mappings. For example, if the desired affix type is "akhiransuffix", this will (in general) add a hyphen onto
the beginning of the term, alt, tr and ts components of the part if not already present. The hyphen that's added is the
"display hyphen" (see above) and may be script-specific. (In the case of East Asian scripts, the display hyphen is an
Baris 943 ⟶ 1,031:
local function make_part_into_affix(part, lang, sc, affix_type)
canonicalize_part(part, lang, sc)
local link_term, display_term = export.make_affix(part.term, part.lang, part.sc, affix_type, not part.alt, nil, part.id)
part.term = link_term
-- When we don't specify `do_affix_mapping` to make_affix(), link and display terms (first and second retvals of
-- make_affix()) are the same.
-- If part.alt would be the same as part.term, make it nil, so that it isn't erroneously tracked as being
part.alt = part.alt and export.make_affix(part.alt, part.lang, part.sc, affix_type) or display_term
-- redundant alt text.
part.alt = part.alt and export.make_affix(part.alt, part.lang, part.sc, affix_type) or (display_term ~= link_term and display_term) or nil
local Latn = require("Module:scripts").getByCode("Latn")
part.tr = export.make_affix(part.tr, part.lang, Latn, affix_type)
Baris 959 ⟶ 1,049:
if affix_type ~= expected_affix_type then
local part_name = expected_affix_type or "base"
local langcode = part.lang:getCode()
local full_langcode = part.lang:getFullCode()
require("Module:debug/track") {
template,
template .. "/" .. part_name,
template .. "/" .. part_name .. "/" .. (affix_type or "none"),
template .. "/" .. part_name .. "/" .. (affix_type or "none") .. "/lang/" .. langcode
part.lang:getNonEtymologicalCode()
}
-- If `part.lang` is an etymology-only language, track both using its code and its full parent's code.
if full_langcode ~= langcode then
require("Module:debug/track")(
template .. "/" .. part_name .. "/" .. (affix_type or "none") .. "/lang/" .. full_langcode
)
end
end
end
Baris 974 ⟶ 1,071:
-- Don't add a '*fixed with' category if the link term is empty or is in a different language.
if part.term and not part.part_lang then
local cat = pos .. " dengan " .. affix_type .. "ed with " .. make_entry_name_no_links(part.lang, part.term) ..
(part.id and " (" .. part.id .. ")" or "")
if sort_key or sort_base then
Baris 992 ⟶ 1,089:
function export.show_circumfix(data)
data.pos = data.pos or default_pos
data.pos = pluralize(data.pos)
 
canonicalize_part(data.base, data.lang, data.sc)
-- Hyphenate the affixes and apply any affix mappings.
make_part_into_affix(data.prefix, data.lang, data.sc, "awalanprefix")
make_part_into_affix(data.suffix, data.lang, data.sc, "akhiransuffix")
 
track_wrong_affix_type("apitancircumfix", data.prefix, "awalanprefix")
track_wrong_affix_type("apitancircumfix", data.base, nil)
track_wrong_affix_type("apitancircumfix", data.suffix, "akhiransuffix")
 
-- Create circumfix term.
Baris 1,027 ⟶ 1,125:
-- Insert the categories, but don't add a '*fixed with' category if the link term is in a different language.
if not data.prefix.part_lang then
table.insert(categories, {cat=data.pos .. " dengancircumfixed apitanwith " .. make_entry_name_no_links(data.prefix.lang,
circumfix), sort_key=data.sort_key, sort_base=sort_base})
end
Baris 1,043 ⟶ 1,141:
function export.show_confix(data)
data.pos = data.pos or default_pos
data.pos = pluralize(data.pos)
 
canonicalize_part(data.base, data.lang, data.sc)
-- Hyphenate the affixes and apply any affix mappings.
make_part_into_affix(data.prefix, data.lang, data.sc, "awalanprefix")
make_part_into_affix(data.suffix, data.lang, data.sc, "akhiransuffix")
 
track_wrong_affix_type("confix", data.prefix, "awalanprefix")
track_wrong_affix_type("confix", data.base, nil)
track_wrong_affix_type("confix", data.suffix, "akhiransuffix")
 
-- Make links out of all the parts.
Baris 1,066 ⟶ 1,165:
 
table.insert(parts_formatted, export.link_term(data.prefix, data))
insert_affix_category(categories, data.pos, "awalanprefix", data.prefix, data.sort_key, prefix_sort_base)
 
if data.base then
Baris 1,074 ⟶ 1,173:
table.insert(parts_formatted, export.link_term(data.suffix, data))
-- FIXME, should we be specifying a sort base here?
insert_affix_category(categories, data.pos, "akhiransuffix", data.suffix)
 
return export.concat_parts(data.lang, parts_formatted, categories, data.nocat, data.sort_key, data.lit,
Baris 1,088 ⟶ 1,187:
function export.show_infix(data)
data.pos = data.pos or default_pos
data.pos = pluralize(data.pos)
 
canonicalize_part(data.base, data.lang, data.sc)
-- Hyphenate the affixes and apply any affix mappings.
make_part_into_affix(data.infix, data.lang, data.sc, "sisipaninfix")
 
track_wrong_affix_type("sisipaninfix", data.base, nil)
track_wrong_affix_type("sisipaninfix", data.infix, "sisipaninfix")
 
-- Make links out of all the parts.
Baris 1,105 ⟶ 1,205:
-- Insert the categories.
-- FIXME, should we be specifying a sort base here?
insert_affix_category(categories, data.pos, "sisipaninfix", data.infix)
 
return export.concat_parts(data.lang, parts_formatted, categories, data.nocat, data.sort_key, data.lit,
Baris 1,119 ⟶ 1,219:
function export.show_prefix(data)
data.pos = data.pos or default_pos
data.pos = pluralize(data.pos)
 
canonicalize_part(data.base, data.lang, data.sc)
-- Hyphenate the affixes and apply any affix mappings.
for i, prefix in ipairs(data.prefixes) do
make_part_into_affix(prefix, data.lang, data.sc, "awalanprefix")
end
 
for i, prefix in ipairs(data.prefixes) do
track_wrong_affix_type("awalanprefix", prefix, "awalanprefix")
end
 
track_wrong_affix_type("awalanprefix", data.base, nil)
 
-- Make links out of all the parts.
Baris 1,145 ⟶ 1,246:
for i, prefix in ipairs(data.prefixes) do
table.insert(parts_formatted, export.link_term(prefix, data))
insert_affix_category(categories, data.pos, "awalanprefix", prefix, data.sort_key, i == 1 and first_sort_base or nil)
end
 
Baris 1,168 ⟶ 1,269:
 
data.pos = data.pos or default_pos
data.pos = pluralize(data.pos)
 
canonicalize_part(data.base, data.lang, data.sc)
-- Hyphenate the affixes and apply any affix mappings.
for i, suffix in ipairs(data.suffixes) do
make_part_into_affix(suffix, data.lang, data.sc, "akhiransuffix")
end
 
track_wrong_affix_type("akhiransuffix", data.base, nil)
for i, suffix in ipairs(data.suffixes) do
track_wrong_affix_type("akhiransuffix", suffix, "akhiransuffix")
end
 
Baris 1,196 ⟶ 1,298:
for i, suffix in ipairs(data.suffixes) do
-- FIXME, should we be specifying a sort base here?
insert_affix_category(categories, data.pos, "akhiransuffix", suffix)
 
if suffix.pos and rfind(suffix.pos, "patronym") then
table.insert(categories, "patronimpatronymics")
end
end