cldf-clts / pyclts

Apache License 2.0
10 stars 2 forks source link

Started support for IPA charts for BIPA inventories #14

Closed xrotwang closed 4 years ago

xrotwang commented 4 years ago

I failed to turn this into a PR, so here's an issue for code review.

So here's initial support for displaying IPA charts for sets of BIPA sounds. The code is in ipachart.py and the idea is as follows:

  1. The various parts of the IPA charts are designed as Diagram subclasses.
  2. These have an associated HTML template (SVG in the case of the vowel trapezoid), which specifies "slots" via lists of CLTS features in attributes of container elements.
  3. The Diagram class knows how to match segments from an inventory to slots in the template, and thus can render the template.

Since slots are defined in terms of CLTS features and not as white-list of individual BIPA graphemes, a lot more segments match each slot. But as far as I understand, that is what we want, right? E.g. there is not really a need for multiple vowel diagrams, when most vowels in an inventory fit into one?

I'll attach a couple of examples of APiCS inventories (as HTML pages) below:

apics3.txt

apics10.txt

Regarding the other standard IPA tables, I'm not sure. They seem to just list stuff in a way that doesn't seem to convey any semantics - so I'd be tempted to replace them with tables for CLTS Sound subclasses, à la

(I don't know, why Implosives are not included in the table of pulmonic consonants, though. They seem to fit as additional "manner".)

xrotwang commented 4 years ago

@LinguList I could try to use this machinery to include IPA charts in lsi. This could be done at db import time, using sets of segments per language as inventory.

LinguList commented 4 years ago

Sounds good. Let me know if help is needed!

xrotwang commented 4 years ago

@LinguList I'd need input regarding

LinguList commented 4 years ago

Okay, implosives as manner is good. And yes, the others as list is also sufficient!

xrotwang commented 4 years ago

first implementation done and released in v2.1