MCPcopy Create free account
hub / github.com/PABannier/bark.cpp / strip_accents

Function strip_accents

bark.cpp:493–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491}
492
493static std::string strip_accents(const std::string& in_str) {
494 std::string out_str;
495 std::map<std::string, char> accent_map = {
496 {"À", 'A'},
497 {"Á", 'A'},
498 {"Â", 'A'},
499 {"Ã", 'A'},
500 {"Ä", 'A'},
501 {"Å", 'A'},
502 {"à", 'a'},
503 {"á", 'a'},
504 {"â", 'a'},
505 {"ã", 'a'},
506 {"ä", 'a'},
507 {"å", 'a'},
508 {"È", 'E'},
509 {"É", 'E'},
510 {"Ê", 'E'},
511 {"Ë", 'E'},
512 {"è", 'e'},
513 {"é", 'e'},
514 {"ê", 'e'},
515 {"ë", 'e'},
516 {"Ì", 'I'},
517 {"Í", 'I'},
518 {"Î", 'I'},
519 {"Ï", 'I'},
520 {"ì", 'i'},
521 {"í", 'i'},
522 {"î", 'i'},
523 {"ï", 'i'},
524 {"Ò", 'O'},
525 {"Ó", 'O'},
526 {"Ô", 'O'},
527 {"Õ", 'O'},
528 {"Ö", 'O'},
529 {"ò", 'o'},
530 {"ó", 'o'},
531 {"ô", 'o'},
532 {"õ", 'o'},
533 {"ö", 'o'},
534 {"Ù", 'U'},
535 {"Ú", 'U'},
536 {"Û", 'U'},
537 {"Ü", 'U'},
538 {"ù", 'u'},
539 {"ú", 'u'},
540 {"û", 'u'},
541 {"ü", 'u'},
542 {"Ý", 'Y'},
543 {"ý", 'y'},
544 {"Ç", 'C'},
545 {"ç", 'c'},
546 {"Ñ", 'N'},
547 {"ñ", 'n'},
548 };
549
550 for (size_t i = 0; i < in_str.length();) {

Callers 1

bert_tokenizeFunction · 0.70

Calls 2

endMethod · 0.80
utf8_lenFunction · 0.70

Tested by

no test coverage detected