question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve IPA transcriber for OE

See original GitHub issue

The current IPA transcriber for OE largely ignores the phonological environment, relying mostly on unconditioned mappings of letters to IPA symbols.

To give a basic example, currently c yields /k/, so that first person singular ic is mapped to /ik/. But according to this resource on OE phonology:

When followed by a front vowel (æ, e, i) or the diphthongs ea or eo, or when preceded by the letter i AND not followed by a back vowel, c is pronounced /ʧ/.

The proposal is to improve the IPA transcriber by encoding conditional phonological rules. This process is a nearly ideal use case for test-driven development. A basic set of tests will be put in place as a target for the initial implementation of the rules. More demanding tests may then be constructed as drivers of iterative improvement.

There are downstream uses for IPA transcription, so I’d like to address this issue sooner rather than later.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
free-variationcommented, Mar 14, 2019

@clemsciences you’re right, for simple rules, as in item-specific ones with simple specifications of environmental features, the mechanism is wordy. The more complex rules I think benefit from this format.

I have therefore added a simplified mechanism on top of the existing one, roughly similar to the rules in your system:

# /h/ is velarized after a back vowel
oe.add_rule(SimplePhonologicalRule(h, x, before = [Backness.back]))

# /h/ is palatized after a front vowel
oe.add_rule(SimplePhonologicalRule(h, ch, before = [Backness.front]))

Enabled by this:

def check_features(phoneme, feature_values):
	return reduce(lambda a, b: a or b, [phoneme[type(f)] == f for f in feature_values])

def SimplePhonologicalRule(target, replacement, before=None, after=None):
	if before is not None and after is None:
		cond = lambda b, t, _: t == target and check_features(b, before) 
	if before is not None and after is not None:
		cond = lambda b, t, a: t == target and check_features(b, before) and check_features(a, after)
	if before is None and after is not None:
		cond = lambda _, t, b: t == target and check_features(a, after) 
	if before is None and after is None:
		cond = lambda _, t, __: t == target

	return PhonologicalRule(cond, lambda _ : replacement)
1reaction
clemsciencescommented, Mar 13, 2019

Wow, it does a much better work, but it’s really verbose (higher complexity leads to more code?). I’m going to read your code tomorrow with more attention.

Read more comments on GitHub >

github_iconTop Results From Across the Web

English Phonetic Spelling and IPA Transcription
Convert English text to IPA transcription or phonetic spelling (for native speakers). Audio/video recordings of 20000 words. Free pronunciation trainer.
Read more >
Phonetic transcription - Convert text to IPA transcription free
This tool helps you convert your English text into standard IPA phonetic or phonetic spelling. You can practice listening and speaking skills with...
Read more >
Automatic Phonemic Transcriber
An automated phonetic/phonemic transcriber supporting English, German, and Danish. Outputs transcriptions in the International Phonetic Alphabet IPA or the ...
Read more >
toPhonetics
This online converter of English text to IPA phonetic transcription will translate your English text into its phonetic transcription using the International ...
Read more >
About Our IPA Converter | Phonetic Transcription - IPANow!
IPANow! Online by PhoneticSoft is a one-of-a-kind web application that transcribes English, Latin, Italian, German, Spanish and French texts into ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found