1.0.3 • Published 5 years ago

ipa-parser v1.0.3

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

Internationl Phonetic Alphabet Parser

A parser for International Phonetic Alphabet (IPA) string as described in IPA chart.

Return a list of semantic units either segmental (vowel or consonant) or suprasegmental (tone, prosody, ...). These semantic units are simply called hereafter unit.

Install and Use

npm install ipa-parser --save
const parser = require("ipa-parser").parser;
let result = parser.parse("/hɛˈləʊ/");

Result format :

{
  'type': string // the transcription type
  'units': [] // an array of IPA unit 
}

Transcription type

IPA can be used for phonetic and phonemic transcription. The context is indicated by bracket around the sequence. This indication is optional. If define, fisrt and last character should match. Transcription type can be phonetic, phonemic, prosodic, indistinguishable, obscured or none if not define.

inputtype
anone
[a]phonetic
/a/phonemic
(a)indistinguishable
⸨a⸩obscured
{a}prosodic

Nota : (( and )) are not accepted, and should be used

IPA units

The parser return a list of "IPA-unit". These units can be either "segment" or "supra-segmental". Segment represent the finest sound decomposition and can be either vowel or consonant. Supra-segmental represent information applying on more than one segment like tone or prosody.

Unit properties :

nametype
segmentbooleantrue if the unit is a segment, false if supra-segmental
categorystring(see Category below)

List of Category for unit :

categorysegmentaldescription
voweltrue/1
consonanttrue/2
tonefalse/3
tone-stepfalse/4
intonationfalse/4
stressfalse/4
separatorfalse/4

Nota : Quantity (also called length) information is not a separate unit but contain in segmental unit (vowel or consonnat)

Segment : Vowel and Consonant

Vowel and consonant have common properties :

nametype
quantityStringextra-short, short, half-long, long or extra-long
syllabicboolean
voicingobjectsee below
nasalboolean

Vowel specifics properties :

nametype
heightnumber-3 (open) ... 3 (close)
backnessnumber-2 (back) ... 2 (front)
roundedboolean
roundednessModifierStringnone, more or less
rhotacizedboolean
tongueRootStringneutral, advanced or retracted

Consonant specifics properties :

nametype
mannerStringstop, fricative, approximant, flap, tapped-fricative, trill, trilled-fricative or vowel
secondaryStringnone, bilabial, palatal, velar or pharyngeal
placesArrays of Stringbilabial, labiodental, dental, alveolar, postalveolar, retroflex, alveopalatal, palatal, velar, uvular, pharyngal, epiglottal and glottal
coronalTypeStringunspecified,laminal or apical
lateralboolean
ejectiveboolean
releaseStringunaspirated, aspirated, nasal-release, lateral-release or no-audible-release

Voicing

namevalues
voicedboolean
phonationvoiceless, modal, breathy or creaky

Diphtong, Triphtong

Not define in IPA chart, not supported by this parser. Combinaison with a tie bar (a͡ɪ) or a with a superscript (aᶦ) will be reject.

Tone

IPA define two way to describe tones :

  • One tone mark on a segmental letter, like é. The tone-unit wll be returned just after the segmental-unit (warning : tone-unit may not be at the end of the syllabe or word).
  • One or many tone letters, describing visually the tone : like e˦˨˥. One tone-unit will be returned for the group of tone letters. Warning :

In both way, the unit will contain two informations :

  • name : the name of the accent. If a tone letters group do not matches a tone define by IPA, the name will be other.
  • heights : an array of number describing the differents highs of the accent. 1 is the lowest and 5 the highest tone. If a mark and tones letters describe the same accent, they will arrive return the same unit (same name and same highs).
MarkLettersnameheightsMarkLettersnameheights
˥extra-high[5]˩˥rising[1,5]
˦high[4]˥˩falling[5,1]
˧mid[3]e᷄˦˥high-rising[4,5]
˨low[2]e᷅˩˨low-rising[1,2]
˩extra-low[1]e᷇˥˦high-falling[5,4]
e᷆˧˨low-falling[2,1]
e᷈˧˦˧rising-falling[3,4,3]
e᷉˧˨˧falling-rising[3,2,3]

Examples

Example 1 : ̌ or ˩˥

{
    "category": "tone",
    "segment": false,
    "name":"rising",
    "highs":[1,5]
}

Example 2 : ˧˦˩

{
    "category": "tone",
    "segment": false,
    "name":"other",
    "highs":[3,4,1]
}

Intonation, Tone-Step, Stress and Separator

Execpt tone and quantity, all other supra-segmental information will be returned with the same format :

  • category: identifie the category of the supra-segmental
  • value : a string describing the information in the category
characterIPAcategoryvalue
.Syllable breakseparatorsyllable-break
Linking (absence of a break)separatorlinking
|Minor (foot) groupseparatorminor-group
Major (intonation) groupseparatormajor-group
ˈPrimary stressstressprimary-stress
ˌSecondary stressstresssecondary-stress
Downsteptone-stepdownstep
Upsteptone-stepupstep
Global riseintonationglobal-rise
Global fallintonationglobal-fall

Nota : "Extra-stress", sometimes write with double line (ˈˈ), is not supported and will be return as two primary stress.

Example

{
    "category": "separator",
    "segment": false,
    "value": "syllable"
}

Invalid input

If the input is not a valid IPA string, throw an error.

  • IpaCharacterError
  • IpaSyntaxError

Discussion

Segment, Phone, Phoneme

Phone represent a speech decomposition and are used in phonetic transcription. Phoneme represent a disctinctive sound for a given language and are used for phonemic transcription.

The same symbol are used in IPA for phonetic and phonemic trancription. This parser will return the narrower description for one symbole as described in unicode

ex: n could represent a dental, alveolar or postalveolar. The parser will return a description with alveolar

Source

IPA chart : chart IPA symbol encoding : unicode

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.1

6 years ago