Wiktionary talk:About Marshallese

From Wiktionary, the free dictionary
Latest comment: 4 years ago by Gilgamesh~enwiki in topic Pronunciation template overhaul
Jump to navigation Jump to search

Pronunciation template overhaul[edit]

I'm well aware the entire Marshallese dictionary section on Wiktionary needs some serious updates, but maintenance has been difficult.

The pronunciation templates alone are a mess and difficult to learn and remember. Since the writing system, even reformed, isn't one-to-one phonemic, I've already been experimenting with designing a simpler phonemic code for pronunciation templates. I've made good progress with a working demo in JavaScript, but the problem is that I don't know enough Lua, the scripting language MediaWiki actually uses for templates. For example, for the word M̧ajeļ, instead of using a messy pronunciation tokens like mh|hah|(h)|J|yeh|lh, the idea is to use a simpler code which scripts can automatically parse and convert to appropriate IPA presentation forms, so we could use mhahjelh instead. The syntax would be simple yet strict:

  • Labial obstruents: p b
  • Coronal obstruents: j t
  • Dorsal obstruents: k kw
  • Labial nasals: m mh
  • Coronal nasals: n nh nw
  • Dorsal nasals: ng ngw
  • Coronal trills: d r rw
  • Coronal laterals: l lh lw
  • Consonantal i: i
    • Special consideration is given only for asyllabic i, as this is the only vowel the dictionary specifically distinguishes when reduced to a glide, and the newer orthography gives them special consonant-like consideration in spelling.
  • Glides: y h w
  • Vowels: a e o u

Any number of apostrophes could be used between letter combinations to disambiguate them, for example jal'woj for Jālwōj. Dashes and spaces could also be inserted for clarity where appropriate. The scripts (similar to the JS ones I've already written) would have a function to convert the code to an internal orthogonal format; this function would generate an error for malformed code. Other functions could convert the internal format into separate phonemic IPA and phonetic IPA. The phonetic IPA function automatically generates diphthong allophones, detects consonant cluster assimilations, and inserts epenthetic vowels in parentheses. It would drastically reduce the work editors have to do so that pronunciation doesn't have to be so carefully micromanaged allophone-by-allophone.

The internal format is made up entirely of the same spaces, dashes and no apostrophes (those are stripped out during parsing), with two-character consonants and one-character vowels. This makes it very easy to parse with regular expressions. The format is more or less IPA, but does not represent any final presentation form, as the two-letter consonant format directly represents primary and secondary articulation.

  • pʲ pˠ tʲ tˠ kˠ kʷ mʲ mˠ nʲ nˠ nʷ ŋˠ ŋʷ rʲ rˠ rʷ lʲ lˠ lʷ ĭʲ ɦʲ ɦˠ ɦʷ ɐ ɜ ɘ ɨ

The conversion of this format to phonemic IPA is most straightforward, as it only changes the sequences kˠ ŋˠ ĭʲ ɦʲ ɦˠ ɦʷ to k ŋ jɨ̯j j ɰ w respectively. Conversion to Bender's format used in the Marshallese-English Dictionary's pronunciation guide is not complicated to do. But since the IPA has never traditionally been friendly to vertical vowel systems because of the large amount of phonemic underspecification involved, conversion to phonetic IPA is a more complicated algorithm, yet I still wrote one that works as expected.

Normally, all words should begin and end with consonant phonemes. Where they don't, the script and templates could infer they are affixes, like ru- (for ri-) or -un (for -in), whose dangling vowels take on three different vowel allophones depending on the consonants they are fused to. This would necessitate three different phonetic pronunciations for these affixes. There has got to be a better way of handling a pronunciation section than what is currently being used for ri-, which was the moment I realized just how inadequate the current pronunciation templates are. But whether one pronunciation or three (with internal sequences ɦʲ ɦˠ ɦʷ attached to dangling vowels before conversion), each is fed through a series of conversions from the internal format:

  1. Strip out dashes and spaces.
  2. Progressive assimilation of labialized secondary articulation of certain consonant clusters. For each four-character-long regular expressions (regex) sequence of /[kŋ]ʷ[kŋ]ˠ|[nrl]ʷ[nrl][ʲˠ]|nʷtʲ/, the fourth character is replaced with a labialization symbol (ʷ).
  3. Since there is no /tʷ/ in Marshallese, each regex sequence of /tʷ/ is replaced with .
  4. Regressive assimilation of palatalized and velarized secondary articulation of certain consonant clusters. For each four-character-long regex sequence of /(?:[pm][ʲˠ]){2}|[tn][ʲˠʷ]t[ʲˠ]|(?:[kŋ][ˠʷ]){2}|(?:[nrl][ʲˠʷ]){2}/, the second character is replaced with the fourth character.
  5. Regressive assimilation of primary articulation of certain consonant clusters. For each three-character-long regex sequence of /p[ʲˠ]m|[rl][ʲˠʷ]n|k[ˠʷ]ŋ/, the first character is replaced with the third character.
  6. Optionally (based on an argument to the function), the four phonemes may be reduced to three, as has become commonplace in modern speech per Choi. If so, then each regex sequence of /[ɜɘ]/ is replaced with ə.
  7. Insertion of epenthetic vowels within consonant clusters. For each six-character-long regex sequence of /[ɐɜəɘɨ](?:r.t.|l.tʲ|[ptkmŋ].[nrl].|[pm].[tkŋ].|[tnrl].[pkmŋ].|[kŋ].[ptm].)[ɐɜəɘɨ]/ (evaluated twice because instances can overlap), an epenthetic vowel in parentheses is inserted between the third and fourth character. The epenthetic vowel's height is irrelevant, but it is commonly transitional between the vowels represented by the first and sixth characters.
  8. Conversion of vowels to their diphthong allophones. For each five-capture-long regex sequence of /([ʲˠʷ])(\(?)([ɐɜəɘɨ])(\)?.)([ʲˠʷ])/ (evaluated twice), the vowel represented by the third capture is replaced by a tied diphthong influenced by the secondary articulations represented by the first and fifth captures, and the complete string represented by the captures is otherwise returned with the replaced third capture. The vowel replacement format I use is V_V, with two vowel characters separated by an underscore—this will be replaced with a proper tie diacritic in the final presentation form. In three-vowel mode, each of the vowels ɐəɨ results in the vowel allophones ɛei (palatalized), ɑʌɯ (velarized) and ɔou (labialized). In four-vowel mode, each of ɐɜɘɨ becomes one of æɛei, ɑʌɤɯ or ɒɔou.
  9. Conversion of tied monophthong allophones to simple monophthongs. For each three-character regex sequence of /[æɛeiɑʌɤɯɒɔou]_[æɛeiɑʌɤɯɒɔou]/, if the first and third characters are the same, only that character is returned, otherwise the original regex match is returned.
  10. Eliminate clusters of glide consonants. Each regex sequence of /ɦ.ɦ./ is replaced with a hard syllable break (.) to indicate the presence of one extra mora than there would otherwise be.
  11. Eliminate glide consonants from clusters where the first consonant is not a glide. For each three-character regex sequence of /[ʲˠʷ]ɦ./, the second and third characters are replaced with a hard syllable break.
  12. Eliminate glide consonants from clusters where the second consonant is not a glide. For each four-character regex sequence of /ɦ..[ʲˠʷ]/, the first and second characters are replaced with a hard syllable break.
  13. Delete remaining glide consonants. Each regex sequence of /ɦ./ is removed with no replacement.
  14. Represent double consonants as geminates. For each four-character regex sequence of /(?:[ptkmnŋrlĭ].){2}/, if the substring represented by the first and second characters is the same as the substring represented by the third and fourth characters, then the third and fourth characters are replaced with a one gemination symbol (ː).
  15. Replace certain obstruent consonants with partially voiced allophones. For each three-capture regex sequence of /([mnŋĭ].|[æɛeiɑʌɤɯɒɔou]\)?|\.)([ptk].)(\(?[æɛeiɑʌɤɯɒɔou\.])/ (evaluated twice), the second capture is replaced by the appropriate allophone sequence, and returned sandwiched between the first and third captures. Each second capture match pʲ pˠ tʲ tˠ kˠ kʷ becomes one of bʲ bˠ zʲ dˠ ɡˠ ɡʷ respectively. This step could be considered unnecessary, as all styles of obstruent pronunciation can occur in free variation.
  16. Represent double vowels as geminated. For each regex sequence of /ææ|ɛɛ|ee|ii|ɑɑ|ʌʌ|ɤɤ|ɯɯ|ɒɒ|ɔɔ|oo|uu/, the second character is replaced with a gemination symbol.
  17. Replace certain sequences with final presentation forms. For each regex sequence of /[kɡnŋl][ˠʷ]|[rĭ]ʲ|[bdz_]/, each match b z d kˠ ɡˠ kʷ ɡʷ nˠ nʷ ŋˠ ŋʷ lˠ lʷ rʲ ĭʲ becomes one of b̥ z̥ d̥ k̠ ɡ̠̊ k̠ʷ ɡ̠̊ʷ ɳˠ ɳʷ ŋ̠ ŋ̠ʷ ɫ ɫʷ r̪ʲ i̯ respectively, and each underscore character (_) becomes an IPA tie bar. Some of these conversions may be considered unnecessary, but they fit with the general trend of highly detailed pronunciation templates on Wiktionary for languages like Spanish, Japanese, etc.

Four-vowel mode represents Bender's vowels, and three-vowel mode represents Choi's vowels. For Willson's vowels, write a function that takes the result of the four-vowel conversion and replaces each of the vowel symbols æɛeɒɔo with one of ɛeɪɔoʊ respectively.

I'm a decent programmer, but I may need help with the Lua required, as I'm not very used to its syntax or data types or the style of its array indexing. - Gilgamesh~enwiki (talk) 03:59, 20 October 2019 (UTC)Reply

I never expected to pick up a new programming language this rapidly, this usefully. But so far I've done very well writing Module:mh-pronunc. Some invocation examples:

  • IPA(key): mGahGtjElG replace G with ɢ, invalid IPA characters (GGEG) ({{#invoke:mh-pronunc|parse|mhahjelh}})
  • m̧ahjeļ ({{#invoke:mh-pronunc|bender|mhahjelh}})
  • IPA(key): mˠæɰtʲɛlˠ ({{#invoke:mh-pronunc|phonemic|mhahjelh}})
  • IPA(key): Module error: The function "phoneticMED" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TMED</g>) ({{#invoke:mh-pronunc|phoneticMED|mhahjelh}})
  • IPA(key): Module error: The function "phoneticChoi" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TC</g>) ({{#invoke:mh-pronunc|phoneticChoi|mhahjelh}})
  • IPA(key): Module error: The function "phoneticMED" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TMED</g>) ({{#invoke:mh-pronunc|phoneticMED|jal'woj}})
  • IPA(key): Module error: The function "phoneticChoi" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TC</g>) ({{#invoke:mh-pronunc|phoneticChoi|jal'woj}})
  • IPA(key): Module error: The function "phoneticWillson" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TW</g>) ({{#invoke:mh-pronunc|phoneticWillson|jal'woj}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'yej yot hamh mowur' contains unsupported characters: oou replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402::</g>) ({{#invoke:mh-pronunc|phonemic|yej yot hamh mowur}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'yej yot hamh mowur' contains unsupported characters: oou replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402::</g>) ({{#invoke:mh-pronunc|phonetic|yej yot hamh mowur}})
  • IPA(key): kʷɔmmˠɔːltˠɑːdˠɑ ({{#invoke:mh-pronunc|phonetic|kwemhmhewel tahtah}})
  • IPA(key): Module error: The function "phoneticChoi" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TC</g>) ({{#invoke:mh-pronunc|phoneticChoi|yepjay}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'ru-' contains unsupported characters: u replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402::</g>) ({{#invoke:mh-pronunc|phonemic|ru-}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'ru-' contains unsupported characters: u replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402::</g>) ({{#invoke:mh-pronunc|phonetic|ru-}})
  • IPA(key): -ænʲ ({{#invoke:mh-pronunc|phonemic|-an}})
  • IPA(key): ʲ‿ænʲ, ˠ‿ænʲ, ˠ‿ɑnʲ, ʷ‿ænʲ, ʷ‿ɒnʲ ({{#invoke:mh-pronunc|phonetic|-an}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'iakwey yokw' contains unsupported characters: o replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402::</g>) ({{#invoke:mh-pronunc|phonemic|iakwey yokw}})
  • IPA(key): Module error: The function "phoneticWillson" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TW</g>) ({{#invoke:mh-pronunc|phoneticWillson|iakwey yokw}})
  • IPA(key): Module error: The function "phoneticChoi" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TC</g>) ({{#invoke:mh-pronunc|phoneticChoi|hayolonglhaplhap}})

Now that this is in good working order, there's test case scripts I still don't have a good idea how to write, as well as documentation which will probably be easier to roughly write, and then transitional deployment to Template:mh-ipa-rows, etc. My thinking is, to minimize disruption to articles as the template syntax is updated, that the old-fashioned token-based templates will display if there are two or more arguments, but a new script-driven template will display if there is only one argument. - Gilgamesh~enwiki (talk) 14:00, 21 October 2019 (UTC)Reply

Trying something else, for dangling vowels only meant to be attached to certain consonants.

  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'rucw-' contains unsupported characters: uc replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402::</g>) ({{#invoke:mh-pronunc|phonemic|rucw-}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'rucw-' contains unsupported characters: uc replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402::</g>) ({{#invoke:mh-pronunc|phonetic|rucw-}})

Affixes like ru- are used only without a hyphen before labialized consonants. With this addition to the code syntax, the pronunciation can be tailored to reflect only that vowel contour in the phonetic transcription without adding a glide phoneme to the phonemic transcription. For this, I added pseudo-glide sequences c ch cw for palatalized, velarized and labialized affixes respectively. If the code ends with a dangling vowel, the script with show all three possible vowel contours. - Gilgamesh~enwiki (talk) 06:03, 22 October 2019 (UTC)Reply

I realized only after the fact just how counterintuitive c ch cw syntax is. I chose "c" to represent a consonant on the other side that isn't there... Yeah, a little oblique considering how it actually renders.

  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'ru_w-' contains unsupported characters: u replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402:'_':</g>) ({{#invoke:mh-pronunc|phonemic|ru_w-}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'ru_w-' contains unsupported characters: u replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402:'_':</g>) ({{#invoke:mh-pronunc|phonetic|ru_w-}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: '-w_un' contains unsupported characters: u replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402:'_':</g>) ({{#invoke:mh-pronunc|phonemic|-w_un}})
  • IPA(key): Lua error in Module:mh-pronunc at line 402: '-w_un' contains unsupported characters: u replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402:'_':</g>) ({{#invoke:mh-pronunc|phonetic|-w_un}})

I changed the syntax to h_ w_ y_ or _h _w _y, basically any one of the letters h w y surrounded by any number of at least one underscore on either side. Now that is much more readable. - Gilgamesh~enwiki (talk) 06:21, 22 October 2019 (UTC)Reply

Trying something new with comma syntax.

  • IPA(key): Lua error in Module:mh-pronunc at line 402: 'kowkow, kewkew' contains unsupported characters: oo replace ' with ˈ, : with ː, L with ʟ and g with ɡ, invalid IPA characters (<g="">LM:402::</g>) ({{#invoke:mh-pronunc|phonemic|kowkow, kewkew}})
  • IPA(key): Module error: The function "phoneticMED" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TMED</g>) ({{#invoke:mh-pronunc|phonemic|kowkow, kewkew}})
  • IPA(key): Module error: The function "phoneticChoi" does not exist. obsolete or nonstandard characters (T), replace : with ː and g with ɡ, invalid IPA characters (<g="">M:TC</g>) ({{#invoke:mh-pronunc|phonemic|kowkow, kewkew}})

And it works! It is not possible to enter more than one code into the templates, separated by commas. The scripts will convert all of them, and weed out duplicate results. This helps cut down on redundant repetition in Choi's three-vowel mode. - Gilgamesh~enwiki (talk) 13:38, 23 October 2019 (UTC)Reply

Trying something new.

  • IPA(key): mˠmˠænʲ ({{#invoke:mh-pronunc|phonemic|mhmhan}})
  • IPA(key): ɛmmˠɑnʲ, mˠʌmˠɑnʲ ({{#invoke:mh-pronunc|phonetic|mhmhan}})

- Gilgamesh~enwiki (talk) 20:24, 27 October 2019 (UTC)Reply