Skip to content

Commit

Permalink
update regexp format in wadegiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tventimi committed Oct 23, 2024
1 parent 00de86c commit 390818a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloudapp/src/app/wadegiles.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class WadegilesService {
}

WGLookup(wgstr: string) : string {
wgstr = wgstr.replace(/[\p{Pf}\p{Pi}\u02BB]/gu, "'");
wgstr = wgstr.replace(new RegExp("[\p{Pf}\p{Pi}\u02BB]","gu"), "'");
wgstr = wgstr.replace(/ü/g,"ü");
let startpunct = ""
let endpunct = ""
Expand All @@ -67,7 +67,7 @@ export class WadegilesService {

WGtoPY(wgstr: string) : string {
wgstr = wgstr.toLowerCase();
let wgs: string[] = wgstr.split(/([^\s\p{Pd}\p{Pc}\p{Ps}\p{Pe}]+)/u);
let wgs: string[] = wgstr.split(new RegExp("([^\s\p{Pd}\p{Pc}\p{Ps}\p{Pe}]+)","u"));
for (let i = 0; i < wgs.length; i++) {
if (wgs[i].match(/[a-z]/)) {
let lookup = this.WGLookup(wgs[i]);
Expand Down
42 changes: 42 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 390818a

Please sign in to comment.