Skip to content

Commit

Permalink
pron
Browse files Browse the repository at this point in the history
  • Loading branch information
lancejpollard committed May 17, 2023
1 parent 6244e5d commit db86b5e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions form.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const CONSONANTS = [
{ i: 'nh!', o: 'n%9', name: 'Voiceless n sound' },
{ i: 'nG~', o: 'n4', name: 'Velarized n sound' },
{ i: 'nh~', o: 'n%', name: 'Aspirated n sound' },
{ i: 'ny~h!', o: 'n%93', name: 'Voiceless palatalized n sound' },
{ i: 'ny~', o: 'n3', name: 'Palatalized n sound' },
{ i: 'n~', o: 'n7', name: 'Dental n sound' },
{ i: 'n', o: 'n', name: 'N sound' },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@drumwork/tone",
"version": "4.3.2",
"version": "4.3.4",
"main": "form.js",
"dependencies": {
"@lancejpollard/script-tree": "^1.1.0"
Expand Down
35 changes: 33 additions & 2 deletions pronunciation.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ function convertIPAToCall(ipa, options = { tones: true }) {
while (i < parts.length) {
const part = parts[i++]
switch (part) {
case '\u200c': // non-width joiner
break
case 'ʰ':
addFeature('aspiration')
break
Expand Down Expand Up @@ -281,7 +283,7 @@ function convertIPAToCall(ipa, options = { tones: true }) {
addConsonant('p*')
break
case 'r':
addConsonant('rr')
addConsonant('r')
break
case 'ɾ':
addConsonant('r')
Expand Down Expand Up @@ -367,7 +369,7 @@ function convertIPAToCall(ipa, options = { tones: true }) {
}
break
case 'ʕ':
addConsonant('Q~')
addConsonant('Q')
break
case 'ʱ':
addConsonant('hh~')
Expand All @@ -390,9 +392,24 @@ function convertIPAToCall(ipa, options = { tones: true }) {
case 'ĕ':
addVowel('e')
break
case 'ḛ':
addVowel('e')
addFeature('nasalization')
break
case '\u030a':
addFeature('voiceless')
break
case `${m.d.tilde}`:
addFeature(`nasalization`)
break
case 'ṵ':
addVowel('u')
addFeature('nasalization')
break
case 'ḭ':
addVowel('i')
addFeature('nasalization')
break
case '̚':
addFeature('stop')
break
Expand Down Expand Up @@ -461,6 +478,8 @@ function convertIPAToCall(ipa, options = { tones: true }) {
case '\u0329': // syllabic
case '\u02FD': // apical
case '\u033A': // apical
case '+':
case "'":
break
case '(':
case ')':
Expand Down Expand Up @@ -579,6 +598,11 @@ function convertIPAToCall(ipa, options = { tones: true }) {
case '\u032F': // non-syllabic
addFeature('non-syllabic')
break
case '\u031f':
break
case 'ï':
addVowel('i')
break
case 'è':
addVowel('e')
captureAllTones('˨')
Expand Down Expand Up @@ -662,6 +686,10 @@ function convertIPAToCall(ipa, options = { tones: true }) {
case '\u0361': // tie
case '\u035C': // bottom tie
break
case '\u0300':
captureAllTones('˨')
result.last.vowels = []
break
default:
throw new Error(part)
}
Expand Down Expand Up @@ -884,6 +912,9 @@ function serialize(result) {
if (node.dental) {
out.push('~')
}
if (node.pharyngealization) {
out.push('Q~')
}
if (node.palatalization) {
out.push('y~')
}
Expand Down

0 comments on commit db86b5e

Please sign in to comment.