mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-26 14:32:04 -04:00
[de][pronouns] make slashes work
This commit is contained in:
parent
af1d94dc36
commit
2f48f4ca8b
@ -15,7 +15,7 @@ pronouns:
|
||||
examples: ['er&sie', 'er&dey', 'sie&xier']
|
||||
null: false
|
||||
emoji: false
|
||||
slashes: true
|
||||
slashes: ['pronoun_n', 'possessive', 'pronoun_d', 'pronoun_a']
|
||||
avoiding: false
|
||||
others: 'Andere Pronomen'
|
||||
|
||||
|
@ -72,23 +72,28 @@ export const buildPronoun = (pronouns, path) => {
|
||||
}
|
||||
|
||||
const p = path.split('/').filter(s => !!s);
|
||||
if (!pronoun && process.env.CONFIG.pronouns.slashes !== false && p.length === MORPHEMES.length) {
|
||||
pronoun = new Pronoun(
|
||||
`${p[0]}/${p[1]}`,
|
||||
'',
|
||||
false,
|
||||
buildDict(function*() {
|
||||
let i = 0;
|
||||
for (let m of MORPHEMES) {
|
||||
yield [m, p[i++]];
|
||||
}
|
||||
}),
|
||||
[ p[p.length - 1].endsWith('selves') ], // TODO English specific, extract somewhere
|
||||
[ false ],
|
||||
[],
|
||||
'__generator__',
|
||||
false,
|
||||
)
|
||||
if (!pronoun && process.env.CONFIG.pronouns.slashes !== false) {
|
||||
const slashMorphemes = process.env.CONFIG.pronouns.slashes === true
|
||||
? MORPHEMES
|
||||
: process.env.CONFIG.pronouns.slashes;
|
||||
if (p.length === slashMorphemes.length) {
|
||||
pronoun = new Pronoun(
|
||||
`${p[0]}/${p[1]}`,
|
||||
'',
|
||||
false,
|
||||
buildDict(function*() {
|
||||
for (let m of MORPHEMES) {
|
||||
const index = slashMorphemes.indexOf(m)
|
||||
yield [m, index === -1 ? '' : p[index]];
|
||||
}
|
||||
}),
|
||||
[ p[p.length - 1].endsWith('selves') ], // TODO English specific, extract somewhere
|
||||
[ false ],
|
||||
[],
|
||||
'__generator__',
|
||||
false,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return pronoun;
|
||||
|
Loading…
x
Reference in New Issue
Block a user