|
4 | 4 | <meta charset="UTF-8"> |
5 | 5 | <title>Online French Liaison Inspection Tool</title> |
6 | 6 | <meta content="An interactive tool for inserting liaison markers into French text." name="description"> |
7 | | - |
| 7 | + |
| 8 | + <link rel="apple-touch-icon" sizes="180x180" href="../../icons/misc/french/liaison/apple-touch-icon.png"> |
| 9 | + <link rel="icon" type="image/png" sizes="32x32" href="../../icons/misc/french/liaison/favicon-32x32.png"> |
| 10 | + <link rel="icon" type="image/png" sizes="16x16" href="../../icons/misc/french/liaison/favicon-16x16.png"> |
| 11 | + <link rel="icon" href="../../icons/misc/french/liaison/favicon.ico"> |
| 12 | + |
| 13 | + <script src="https://unpkg.com/fr-compromise"></script> |
8 | 14 |
|
9 | 15 | <script src="./liaison.js"></script> |
10 | 16 | <link as="style" href="../../wiktionary_pron/css/tacit-css-1.7.1.min.css" |
@@ -203,10 +209,7 @@ <h1>French Liaison Tool</h1> |
203 | 209 | <div id="result" class="result"></div> |
204 | 210 | </div> |
205 | 211 |
|
206 | | -<div id="mocha"></div> |
207 | 212 |
|
208 | | -<script src="https://unpkg.com/mocha/mocha.js"></script> |
209 | | -<script src="https://unpkg.com/fr-compromise"></script> |
210 | 213 |
|
211 | 214 | <script> |
212 | 215 | // Your insertLiaisonMarkers function (from test.html) |
@@ -411,22 +414,23 @@ <h1>French Liaison Tool</h1> |
411 | 414 |
|
412 | 415 | let start = end; |
413 | 416 | // Walk back until we hit a non-word character |
414 | | - // Note: We include accented chars in the regex range |
415 | | - while (start >= 0 && /[a-zA-Z0-9À-ÿ]/.test(text[start])) { |
| 417 | + // FIX: Added ' and ’ to the regex character class |
| 418 | + while (start >= 0 && /[a-zA-Z0-9À-ÿ'’]/.test(text[start])) { |
416 | 419 | start--; |
417 | 420 | } |
418 | 421 | return text.slice(start + 1, end + 1); |
419 | 422 | } |
420 | 423 |
|
421 | | - // Get the word immediately following a specific index |
| 424 | + // Helper to get the word immediately following a specific index |
422 | 425 | function getWordAfterIndex(text, index) { |
423 | 426 | let start = index + 1; |
424 | 427 | // Skip whitespace immediately after |
425 | 428 | while (start < text.length && /\s/.test(text[start])) start++; |
426 | 429 |
|
427 | 430 | let end = start; |
428 | 431 | // Walk forward until we hit a non-word character |
429 | | - while (end < text.length && /[a-zA-Z0-9À-ÿ]/.test(text[end])) { |
| 432 | + // FIX: Added ' and ’ to the regex character class |
| 433 | + while (end < text.length && /[a-zA-Z0-9À-ÿ'’]/.test(text[end])) { |
430 | 434 | end++; |
431 | 435 | } |
432 | 436 | return text.slice(start, end); |
|
0 commit comments