mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-15 13:19:23 +00:00
feat(core,developer): simplify markers 🙀
- maybe don't need NFD table #10317
This commit is contained in:
parent
687e50557f
commit
32d2e6ea2c
2 changed files with 10 additions and 0 deletions
|
|
@ -145,6 +145,10 @@ export class MarkerParser {
|
|||
* @returns the normalized string
|
||||
*/
|
||||
public static nfd_markers(s: string, forMatch?: boolean) : string {
|
||||
if(true) {
|
||||
const m : MarkerMap = [];
|
||||
return this.nfd_markers_segment(s, m, forMatch);
|
||||
}
|
||||
// Note: parallel to ldml::normalize_nfd_markers()
|
||||
if(!s) return s;
|
||||
/** Accumulate output normalized string */
|
||||
|
|
|
|||
|
|
@ -219,6 +219,11 @@ bool normalize_nfd_markers(std::u32string &str, marker_encoding encoding) {
|
|||
// quick check - don't bother if the string is empty
|
||||
if(str.empty()) return true;
|
||||
|
||||
#if 1
|
||||
marker_map m;
|
||||
return normalize_nfd_markers_segment(str, m, encoding);
|
||||
#else
|
||||
|
||||
// we're going to need an NFD normalizer
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
const icu::Normalizer2 *nfd = icu::Normalizer2::getNFDInstance(status);
|
||||
|
|
@ -297,6 +302,7 @@ bool normalize_nfd_markers(std::u32string &str, marker_encoding encoding) {
|
|||
// update output string
|
||||
str = out;
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// TODO-LDML: cleanup
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue