diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index b6929a48cc16b4b0bc2c088238635c1c2fe70faf..c9dee101ef0511539a2c8e384844a27850db86db 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -4450,24 +4450,20 @@ window.originPronounReplace = function(slave) { case "She was the private slave of a con artist cult leader before he had to abandon her and flee.": case "You helped her give birth, leaving her deeply indebted to you.": case "You purchased her from a King after she expressed knowledge of the prince's affair with another servant.": - /* - r = r.replace(/(?<=\s)herself(?=\s|,|\.|;|\?|!)/g, slave.objectReflexive); - r = r.replace(/(?<=\s|^)Herself(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.objectReflexive)); - r = r.replace(/(?<=\s)she(?=\s|,|\.|;|\?|!)/g, slave.pronoun); - r = r.replace(/(?<=\s|^)She(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.pronoun)); - r = r.replace(/(?<=\s)her(?=\s|,|\.|;|\?|!)/g, slave.object); - r = r.replace(/(?<=\s|^)Her(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.object)); - */ + r = r.replace(/\bherself\b/g, slave.objectReflexive); + r = r.replace(/\bHerself\b/g, capFirstChar(slave.objectReflexive)); + r = r.replace(/\bshe\b/g, slave.pronoun); + r = r.replace(/\bShe\b/g, capFirstChar(slave.pronoun)); + r = r.replace(/\bher\b/g, slave.object); + r = r.replace(/\bHer\b/g, capFirstChar(slave.object)); return r; default: - /* - r = r.replace(/(?<=\s)herself(?=\s|,|\.|;|\?|!)/g, slave.objectReflexive); - r = r.replace(/(?<=\s|^)Herself(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.objectReflexive)); - r = r.replace(/(?<=\s)she(?=\s|,|\.|;|\?|!)/g, slave.pronoun); - r = r.replace(/(?<=\s|^)She(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.pronoun)); - r = r.replace(/(?<=\s)her(?=\s|,|\.|;|\?|!)/g, slave.possessive); - r = r.replace(/(?<=\s|^)Her(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.possessive)); - */ + r = r.replace(/\bherself\b/g, slave.objectReflexive); + r = r.replace(/\bHerself\b/g, capFirstChar(slave.objectReflexive)); + r = r.replace(/\bshe\b/g, slave.pronoun); + r = r.replace(/\bShe\b/g, capFirstChar(slave.pronoun)); + r = r.replace(/\bher\b/g, slave.possessive); + r = r.replace(/\bHer\b/g, capFirstChar(slave.possessive)); return r; } }; diff --git a/src/js/utilJS.tw b/src/js/utilJS.tw index a8f4d647cc0faf766f4550fac3d6dea94235df25..e06e9ff130c6de307669d2e68d7dd52c0149729c 100644 --- a/src/js/utilJS.tw +++ b/src/js/utilJS.tw @@ -1219,24 +1219,20 @@ window.originPronounReplace = function(slave) { case "She was the private slave of a con artist cult leader before he had to abandon her and flee.": case "You helped her give birth, leaving her deeply indebted to you.": case "You purchased her from a King after she expressed knowledge of the prince's affair with another servant.": - /* - r = r.replace(/(?<=\s)herself(?=\s|,|\.|;|\?|!)/g, slave.objectReflexive); - r = r.replace(/(?<=\s|^)Herself(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.objectReflexive)); - r = r.replace(/(?<=\s)she(?=\s|,|\.|;|\?|!)/g, slave.pronoun); - r = r.replace(/(?<=\s|^)She(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.pronoun)); - r = r.replace(/(?<=\s)her(?=\s|,|\.|;|\?|!)/g, slave.object); - r = r.replace(/(?<=\s|^)Her(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.object)); - */ + r = r.replace(/\bherself\b/g, slave.objectReflexive); + r = r.replace(/\bHerself\b/g, capFirstChar(slave.objectReflexive)); + r = r.replace(/\bshe\b/g, slave.pronoun); + r = r.replace(/\bShe\b/g, capFirstChar(slave.pronoun)); + r = r.replace(/\bher\b/g, slave.object); + r = r.replace(/\bHer\b/g, capFirstChar(slave.object)); return r; default: - /* - r = r.replace(/(?<=\s)herself(?=\s|,|\.|;|\?|!)/g, slave.objectReflexive); - r = r.replace(/(?<=\s|^)Herself(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.objectReflexive)); - r = r.replace(/(?<=\s)she(?=\s|,|\.|;|\?|!)/g, slave.pronoun); - r = r.replace(/(?<=\s|^)She(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.pronoun)); - r = r.replace(/(?<=\s)her(?=\s|,|\.|;|\?|!)/g, slave.possessive); - r = r.replace(/(?<=\s|^)Her(?=\s|,|\.|;|\?|!)/g, capFirstChar(slave.possessive)); - */ + r = r.replace(/\bherself\b/g, slave.objectReflexive); + r = r.replace(/\bHerself\b/g, capFirstChar(slave.objectReflexive)); + r = r.replace(/\bshe\b/g, slave.pronoun); + r = r.replace(/\bShe\b/g, capFirstChar(slave.pronoun)); + r = r.replace(/\bher\b/g, slave.possessive); + r = r.replace(/\bHer\b/g, capFirstChar(slave.possessive)); return r; } };