Add any/all pronouns special case

This commit is contained in:
nachtjasmin 2023-07-13 22:20:30 +02:00
parent 431dcd4bc6
commit f51b2e71fe
No known key found for this signature in database
2 changed files with 6 additions and 0 deletions

View file

@ -227,6 +227,10 @@ function extractFromBio(bio) {
for (const match of followedByColon) { for (const match of followedByColon) {
return match.pop(); // first group is last entry in array return match.pop(); // first group is last entry in array
} }
const anyAllPronouns = bio.match(/(any|all) +pronouns/gi);
if (anyAllPronouns) {
return anyAllPronouns[0];
}
return null; return null;
} }

View file

@ -79,6 +79,8 @@ const bioExtractTests = [
["pronouns: uwu/owo", "uwu/owo"], // followed by pronoun pattern ["pronouns: uwu/owo", "uwu/owo"], // followed by pronoun pattern
["pronouns: any", "any"], // followed by pronoun pattern ["pronouns: any", "any"], // followed by pronoun pattern
["I'm cute af (she / they)", "she/they"], // with whitespace between pronouns ["I'm cute af (she / they)", "she/they"], // with whitespace between pronouns
["pronouns: any/all", "any/all"], // any pronouns
["any pronouns", "any pronouns"], // any pronouns
]; ];
for (const [input, expects] of bioExtractTests) { for (const [input, expects] of bioExtractTests) {
bioExtractSuite(input, async () => { bioExtractSuite(input, async () => {