|
10 | 10 | <link rel="icon" type="image/png" sizes="16x16" href="../icons/help/favicon-16x16.png"> |
11 | 11 | <link rel="icon" href="../icons/help/favicon.ico"> |
12 | 12 | <link href="help.css" rel="stylesheet"> |
| 13 | + <script src="https://unpkg.com/fr-compromise"></script> |
| 14 | + |
| 15 | + <script> |
| 16 | + function insertLiaisonMarkers(text) { |
| 17 | + const doc = nlp(text); // Parse once for POS |
| 18 | + const terms = doc.terms(); // Get all terms with tags |
| 19 | + const result = []; |
| 20 | + const silentConsonants = new Set(['s', 'x', 'z', 'd', 't', 'p', 'r', 'g', 'f', 'n']); |
| 21 | + const vowels = new Set(['a', 'e', 'i', 'o', 'u', 'y', 'A', 'E', 'I', 'O', 'U', 'Y']); |
| 22 | + const aspiratedHWords = new Set([ |
| 23 | + 'hache', 'hachette', 'hachis', 'hachoir', 'hachure', 'haddock', 'haine', 'hair', 'haleine', 'hall', 'halo', 'hamac', |
| 24 | + 'hamburger', 'hamster', 'handball', 'handicap', 'hangar', 'harangue', 'harceler', 'hard', 'hardware', 'hareng', |
| 25 | + 'harem', 'haricot', 'harpe', 'hasard', 'hase', 'haste', 'hausse', 'haut', 'hauteur', 'havre', 'hayon', 'hélicoptère', |
| 26 | + 'héros', 'hérisson', 'hérissonner', 'héron', 'hésiter', 'hibou', 'hiérarchie', 'hilarant', 'hippie', 'hissage', 'hisser', |
| 27 | + 'hobby', 'hockey', 'holding', 'hollandais', 'hollande', 'home', 'homicide', 'hongrois', 'honte', 'hooligan', 'hoquet', |
| 28 | + 'horaire', 'horizon', 'horloge', 'hormone', 'horreur', 'hors', 'hostie', 'hostile', 'hotte', 'housse', 'houx', 'huche', |
| 29 | + 'hue', 'huer', 'huile', 'huis', 'huit', 'hulotte', 'hululement', 'humer', 'humus', 'hurlement', 'hussard', 'hutte', 'hyène' |
| 30 | + ]); // Compiled from reliable sources; expand as needed |
| 31 | + |
| 32 | + const obligatoryTriggers = new Set([ |
| 33 | + // Determiners and articles |
| 34 | + 'un', 'une', 'des', 'les', 'le', 'la', 'du', 'de', 'au', 'aux', 'ce', 'cet', 'cette', |
| 35 | + // Pronouns |
| 36 | + 'nous', 'vous', 'ils', 'elles', 'on', 'en', 'y', 'je', 'tu', 'il', 'elle', |
| 37 | + // Numbers (basic) |
| 38 | + 'deux', 'trois', 'quatre', 'cinq', 'six', 'sept', 'huit', 'neuf', 'dix', |
| 39 | + // Adverbs and prepositions |
| 40 | + 'bien', 'très', 'trop', 'plus', 'moins', 'tout', 'sans', 'dans', 'chez', 'quand' |
| 41 | + ]); |
| 42 | + const nasalPreserveGroup = new Set(['un', 'on', 'en', 'mon', 'ton', 'son', 'bien', 'rien']); // Preserve nasal + consonant |
| 43 | + const nasalDenasalGroup = new Set(['bon', 'certain']); // Denasalize for oral vowel + n |
| 44 | + for (let i = 0; i < terms.length; i++) { |
| 45 | + const current = terms[i].text; |
| 46 | + result.push(current); |
| 47 | + |
| 48 | + if (i < terms.length - 1) { |
| 49 | + const next = terms[i + 1].text.toLowerCase(); |
| 50 | + const lastChar = current[current.length - 1].toLowerCase(); |
| 51 | + const firstChar = next[0]; |
| 52 | + |
| 53 | + // Phonetic condition |
| 54 | + if (silentConsonants.has(lastChar) && (vowels.has(firstChar) || (firstChar === 'h' && !aspiratedHWords.has(next)))) { |
| 55 | + const currentTags = terms[i].tags; |
| 56 | + |
| 57 | + // Dynamic trigger using POS |
| 58 | + if (currentTags.has('Determiner') || currentTags.has('Pronoun') || currentTags.has('Adverb') || obligatoryTriggers.has(current.toLowerCase())) { |
| 59 | + // Handle nasals as before |
| 60 | + if (lastChar === 'n') { |
| 61 | + // ... (your nasal logic) |
| 62 | + } |
| 63 | + result.push('‿'); |
| 64 | + } |
| 65 | + } else { |
| 66 | + result.push(' '); // Preserve spaces |
| 67 | + } |
| 68 | + } |
| 69 | + } |
| 70 | + return result.join(''); |
| 71 | + } |
| 72 | + |
| 73 | + |
| 74 | + </script> |
13 | 75 | </head> |
14 | 76 | <body> |
15 | 77 | <div id="content"> |
16 | 78 | <h1>French IPA Transcription - Help</h1> |
17 | 79 |
|
18 | 80 | <p style="display: flex; justify-content: space-between; align-items: center;"> |
19 | | - <span><a href="../index.html?lang=French">← Back to French transcription</a></span> |
| 81 | + <span><a href="../?lang=French">← Back to French transcription</a></span> |
20 | 82 | <span><a href="index.html">↑ All Languages</a></span> |
21 | 83 | </p> |
22 | 84 |
|
23 | 85 | <h2>About This Implementation</h2> |
24 | 86 |
|
25 | | - <p>This <a href="../index.html?lang=French">French transcription app</a> uses the <a |
| 87 | + <p>This <a href="../?lang=French">French transcription app</a> uses the <a |
26 | 88 | href="https://en.wiktionary.org/wiki/Module:fr-pron" target="_blank" rel="noopener noreferrer">Wiktionary |
27 | 89 | French Pronunciation |
28 | 90 | Module</a> to generate phonemic transcriptions for French text.</p> |
@@ -553,34 +615,151 @@ <h3>11.2 The Nasal Bridge</h3> |
553 | 615 | </ul> |
554 | 616 | </div> |
555 | 617 | <div class="step-container"> |
556 | | - <h3>12. Reference: IPA Symbol Map</h3> |
557 | | - <p>A quick reference for the symbols generated by this script.</p> |
| 618 | + <h2>12. Reference: Complete IPA Symbol Map</h2> |
| 619 | + <p>This table lists every phonetic symbol generated by the script, mapping the French orthography to the |
| 620 | + specific IPA character output.</p> |
| 621 | + |
558 | 622 | <table> |
| 623 | + <thead> |
| 624 | + <tr> |
| 625 | + <th>Category</th> |
| 626 | + <th>IPA Symbol</th> |
| 627 | + <th>Description</th> |
| 628 | + <th>Typical Orthography</th> |
| 629 | + </tr> |
| 630 | + </thead> |
| 631 | + <tbody> |
| 632 | + <!-- Oral Vowels --> |
| 633 | + <tr> |
| 634 | + <td rowspan="9"><strong>Oral Vowels</strong></td> |
| 635 | + <td><span class="ipa">/a/</span></td> |
| 636 | + <td>Anterior A</td> |
| 637 | + <td>a, à (standard)</td> |
| 638 | + </tr> |
| 639 | + <tr> |
| 640 | + <td><span class="ipa">/ɑ/</span></td> |
| 641 | + <td>Posterior A</td> |
| 642 | + <td>â, as, az</td> |
| 643 | + </tr> |
| 644 | + <tr> |
| 645 | + <td><span class="ipa">/e/</span></td> |
| 646 | + <td>Closed E</td> |
| 647 | + <td>é, er, ez, ai (final verb)</td> |
| 648 | + </tr> |
| 649 | + <tr> |
| 650 | + <td><span class="ipa">/ɛ/</span></td> |
| 651 | + <td>Open E</td> |
| 652 | + <td>è, ê, ai, ei, e (+consonant)</td> |
| 653 | + </tr> |
559 | 654 | <tr> |
560 | | - <th>Sound Class</th> |
561 | | - <th>Representation</th> |
562 | | - <th>IPA</th> |
| 655 | + <td><span class="ipa">/ə/</span></td> |
| 656 | + <td>Schwa (Mute E)</td> |
| 657 | + <td>e (unaccented)</td> |
563 | 658 | </tr> |
564 | 659 | <tr> |
565 | | - <td><strong>Oral Vowels</strong></td> |
566 | | - <td>a, â, é, è, i, o, ou, u, eu</td> |
567 | | - <td><span class="ipa">/a/, /ɑ/, /e/, /ɛ/, /i/, /ɔ/, /u/, /y/, /œ/</span></td> |
| 660 | + <td><span class="ipa">/i/</span></td> |
| 661 | + <td>High Front Vowel</td> |
| 662 | + <td>i, î, y</td> |
| 663 | + </tr> |
| 664 | + <tr> |
| 665 | + <td><span class="ipa">/y/</span></td> |
| 666 | + <td>High Front Rounded</td> |
| 667 | + <td>u, û</td> |
| 668 | + </tr> |
| 669 | + <tr> |
| 670 | + <td><span class="ipa">/o/</span> vs <span class="ipa">/ɔ/</span></td> |
| 671 | + <td>Closed O vs Open O</td> |
| 672 | + <td><strong>/o/:</strong> ô, au, eau, o (+z)<br><strong>/ɔ/:</strong> o (standard)</td> |
| 673 | + </tr> |
| 674 | + <tr> |
| 675 | + <td><span class="ipa">/ø/</span> vs <span class="ipa">/œ/</span></td> |
| 676 | + <td>Closed EU vs Open EU</td> |
| 677 | + <td><strong>/ø/:</strong> eu, œu (final/z/t)<br><strong>/œ/:</strong> eu, œu (standard)</td> |
| 678 | + </tr> |
| 679 | + <tr> |
| 680 | + <td></td> |
| 681 | + <td><span class="ipa">/u/</span></td> |
| 682 | + <td>High Back Vowel</td> |
| 683 | + <td>ou, où</td> |
| 684 | + </tr> |
| 685 | + |
| 686 | + <!-- Nasal Vowels --> |
| 687 | + <tr> |
| 688 | + <td rowspan="4"><strong>Nasal Vowels</strong></td> |
| 689 | + <td><span class="ipa">/ɑ̃/</span></td> |
| 690 | + <td>Nasal A</td> |
| 691 | + <td>an, en, am, em</td> |
568 | 692 | </tr> |
569 | 693 | <tr> |
570 | | - <td><strong>Nasal Vowels</strong></td> |
571 | | - <td>an, on, in, un</td> |
572 | | - <td><span class="ipa">/ɑ̃/, /ɔ̃/, /ɛ̃/, /œ̃/</span></td> |
| 694 | + <td><span class="ipa">/ɛ̃/</span></td> |
| 695 | + <td>Nasal I</td> |
| 696 | + <td>in, ain, ein, yn</td> |
573 | 697 | </tr> |
574 | 698 | <tr> |
575 | | - <td><strong>Semi-Vowels</strong></td> |
576 | | - <td>y, w, ɥ</td> |
577 | | - <td><span class="ipa">/j/, /w/, /ɥ/</span></td> |
| 699 | + <td><span class="ipa">/ɔ̃/</span></td> |
| 700 | + <td>Nasal O</td> |
| 701 | + <td>on, om</td> |
578 | 702 | </tr> |
579 | 703 | <tr> |
580 | | - <td><strong>Consonants</strong></td> |
581 | | - <td>ch, gn, r</td> |
582 | | - <td><span class="ipa">/ʃ/, /ɲ/, /ʁ/</span></td> |
| 704 | + <td><span class="ipa">/œ̃/</span></td> |
| 705 | + <td>Nasal U</td> |
| 706 | + <td>un, um (often merges with /ɛ̃/)</td> |
| 707 | + </tr> |
| 708 | + |
| 709 | + <!-- Semi-Vowels --> |
| 710 | + <tr> |
| 711 | + <td rowspan="3"><strong>Semi-Vowels</strong></td> |
| 712 | + <td><span class="ipa">/j/</span></td> |
| 713 | + <td>Yod glide</td> |
| 714 | + <td>y, il, ill, i (+vowel)</td> |
| 715 | + </tr> |
| 716 | + <tr> |
| 717 | + <td><span class="ipa">/w/</span></td> |
| 718 | + <td>W glide</td> |
| 719 | + <td>oi (/wa/), ou (+vowel)</td> |
| 720 | + </tr> |
| 721 | + <tr> |
| 722 | + <td><span class="ipa">/ɥ/</span></td> |
| 723 | + <td>U glide</td> |
| 724 | + <td>u (+vowel)</td> |
| 725 | + </tr> |
| 726 | + |
| 727 | + <!-- Consonants --> |
| 728 | + <tr> |
| 729 | + <td rowspan="5"><strong>Complex Consonants</strong></td> |
| 730 | + <td><span class="ipa">/ʃ/</span></td> |
| 731 | + <td>Sh sound</td> |
| 732 | + <td>ch, sh</td> |
| 733 | + </tr> |
| 734 | + <tr> |
| 735 | + <td><span class="ipa">/ʒ/</span></td> |
| 736 | + <td>Soft J</td> |
| 737 | + <td>j, g (+e/i/y)</td> |
| 738 | + </tr> |
| 739 | + <tr> |
| 740 | + <td><span class="ipa">/ɲ/</span></td> |
| 741 | + <td>Palatal N</td> |
| 742 | + <td>gn</td> |
| 743 | + </tr> |
| 744 | + <tr> |
| 745 | + <td><span class="ipa">/ŋ/</span></td> |
| 746 | + <td>Velar Nasal</td> |
| 747 | + <td>ng (in -ing)</td> |
| 748 | + </tr> |
| 749 | + <tr> |
| 750 | + <td><span class="ipa">/ʁ/</span></td> |
| 751 | + <td>Uvular R</td> |
| 752 | + <td>r, rr, rh</td> |
| 753 | + </tr> |
| 754 | + |
| 755 | + <!-- Standard Consonants --> |
| 756 | + <tr> |
| 757 | + <td><strong>Standard Consonants</strong></td> |
| 758 | + <td><span class="ipa">/b/ /d/ /f/ /ɡ/ /k/ /l/ /m/ /n/ /p/ /s/ /t/ /v/ /z/</span></td> |
| 759 | + <td>Invariant Mapping</td> |
| 760 | + <td>b, d, f, g (hard), c (hard)/k/qu, l, m, n, p, s/ç, t, v, z/s(voiced)</td> |
583 | 761 | </tr> |
| 762 | + </tbody> |
584 | 763 | </table> |
585 | 764 | </div> |
586 | 765 |
|
|
0 commit comments