48,406
edits
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
local m_t = require('Module:table') | local m_t = require('Module:table') | ||
local m_pron = require('Module:pine-pron') | local m_pron = require('Module:pine-pron') | ||
local m_data = require('Module:pine-noun/data') | |||
local lang = require('Module:languages').getByCode("pine") | local lang = require('Module:languages').getByCode("pine") | ||
| Line 59: | Line 60: | ||
end | end | ||
local function detect_decl(word) | local function detect_decl(word, args) | ||
local syllabified = m_pron.syllabify_from_spelling(word) | local syllabified = m_pron.syllabify_from_spelling(word) | ||
--syllabified = gsub(syllabified, "·(" .. consonants .. ")%1", "%1·%1") | --syllabified = gsub(syllabified, "·(" .. consonants .. ")%1", "%1·%1") | ||
| Line 65: | Line 66: | ||
local syllables = split(syllabified, "·") | local syllables = split(syllabified, "·") | ||
local | local syll_count = #syllables | ||
local stressed_syllable = syllables[1] | local stressed_syllable = syllables[1] | ||
local last_syllable = syllables[syll_count] | |||
if | local nucleus = match(stressed_syllable, "^" .. consonants .. "*(" .. vowels .. "+)") | ||
-- monosyllabic | local last_vowel = match(last_syllable, "(" .. vowels .. "+)$") -- nil if consonant-final | ||
if syll_count == 1 then | |||
nucleus = sub(nucleus, 1, 1) | |||
if last_vowel then | |||
last_vowel = sub(last_vowel, -1, -1) | |||
end | |||
end | |||
local polarity = {front, back} | |||
local pol_nucleus = quality_lookup(nucleus, polarity) | |||
local pol_last = quality_lookup(last_vowel, polarity) | |||
local phonicity = not last_vowel and "consonantal" or pol_nucleus == pol_last and "symphonic" or "antiphonic" | |||
if m_data.teleutophonic_ending(word) then | |||
return "teleutophonic-" .. teleuphonic_ending | |||
elseif syll_count == 1 then | |||
-- "There is unfortunately no way to tell whether a monosyllabic noun ending in a consonant belongs to | |||
-- the consonantal declension group of the schizaphonic declension group" (p. 119) | |||
if phoniticy == "consonantal" then | |||
if args.schiz ~= nil then | |||
return "monosyllabic-" .. (args.schiz .. "schizophonic" or "consonantal") | |||
else | |||
error(word .. " is a monosyllabic noun ending in a consonant. Disambiguation needed between consonantal and schizophonic declensions.") | |||
end | |||
end | |||
else | else | ||
local onset = match(stressed_syllable, "^" .. consonants .. "+") -- nil if vowel-initial | local onset = match(stressed_syllable, "^" .. consonants .. "+") -- nil if vowel-initial | ||
local coda = match(stressed_syllable, consonants .. "$") or match(syllables[2], "^" .. consonants .. "+") | local coda = match(stressed_syllable, consonants .. "$") or match(syllables[2], "^" .. consonants .. "+") | ||
| Line 82: | Line 107: | ||
local organicity = poa_onset and (poa_onset == poa_coda and "homorganic" or "heterorganic") or nil | local organicity = poa_onset and (poa_onset == poa_coda and "homorganic" or "heterorganic") or nil | ||