Created
January 6, 2023 16:30
-
-
Save paceaux/87f615415a6850d32fa1fbd03fbe600f to your computer and use it in GitHub Desktop.
Pronoun Regexes
This file contains hidden or 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
const masculinePronouns = new RegExp('\b(she|(her(s(elf|\b)|\b))|s(on|a|u(a|\b))|el{1,2}(a|e)(-même|\b))\b((\W(m(i|e)sma)|\b))', 'gi'); | |
const femininePronouns = new RegExp('\b(she|(her(s(elf|\b)|\b))|s(on|a|u(a|\b))|el{1,2}(a|e)(-même|\b))\b((\W(m(i|e)sma)|\b))','gi'); | |
/* | |
English: she, her, hers, herself | |
French: elle, elle-même, son, sa | |
Spanish: ella, su, ella misma | |
Portuguese: ela, sua, ela mesma | |
English: he, him, his, himself | |
French: il, lui, son, lui-même | |
Spanish: él, él mismo el mismo | |
Portuguese: ele, ele mesmo | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment