-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Better word matching regex (#110)
feat: word matching regex and add substitute API Problem: The old implementation of word finding RegExp also matches communiqu of the word communiqué, which can lead to mis-hyphenation. One-step RegExp to correctly match words is not possible. (For details see issue #109.) Solution: First find all words using a transpiled form of RegExp `/[\p{Letter}]{n,}/gui`. This RegExp is quite large. It is minimized by collecting all characters used by patterns. Then in replacer-function test if all characters are in `lo.alphabet`. With this words containing a char not in lo.alphabet are not hyphenated at all. By substituting foreign characters such words can be hyphenated. So also add an API to substitute characters and document this API. Notes: This commit requires all .wasm files to be regenerated. Fixes #109
- Loading branch information
Showing
306 changed files
with
2,270 additions
and
755 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export const to: i32 = 5060952; | ||
export const po: i32 = 5061114; | ||
export const to: i32 = 5061208; | ||
export const po: i32 = 5061370; | ||
export const pl: i32 = 55096; | ||
export const vs: i32 = 1280; | ||
export const pt: i32 = 48904; | ||
export const wo: i32 = 5059884; | ||
export const tw: i32 = 5060012; | ||
export const hp: i32 = 5060076; | ||
export const hw: i32 = 5060140; | ||
export const vs: i32 = 1536; | ||
export const pt: i32 = 49160; | ||
export const wo: i32 = 5060140; | ||
export const tw: i32 = 5060268; | ||
export const hp: i32 = 5060332; | ||
export const hw: i32 = 5060396; | ||
export const lm: i32 = 1; | ||
export const rm: i32 = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
export const to: i32 = 3052; | ||
export const po: i32 = 3346; | ||
export const to: i32 = 3308; | ||
export const po: i32 = 3602; | ||
export const pl: i32 = 228; | ||
export const vs: i32 = 1280; | ||
export const pt: i32 = 1464; | ||
export const wo: i32 = 2048; | ||
export const tw: i32 = 2176; | ||
export const hp: i32 = 2240; | ||
export const hw: i32 = 2304; | ||
export const vs: i32 = 1536; | ||
export const pt: i32 = 1720; | ||
export const wo: i32 = 2304; | ||
export const tw: i32 = 2432; | ||
export const hp: i32 = 2496; | ||
export const hw: i32 = 2560; | ||
export const lm: i32 = 1; | ||
export const rm: i32 = 1; |
Oops, something went wrong.