From a707924dd7283b98b07ac4878ea85b702551ca8d Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Tue, 21 May 2024 18:35:55 +0200 Subject: [PATCH 1/7] (test) check that pronouns/examples.tsv contains examples for plurals and honorifics if the locale is configured accordingly --- test/locales/data.test.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/test/locales/data.test.ts b/test/locales/data.test.ts index 9959bd0c0..753956640 100644 --- a/test/locales/data.test.ts +++ b/test/locales/data.test.ts @@ -4,6 +4,8 @@ import allLocales from '../../locale/locales.ts'; import { loadTsv } from '../../src/tsv.js'; import { Example } from '../../src/classes.ts'; import type { ExpectationResult } from 'expect'; +import { loadSumlFromBase } from '../../server/loader.ts'; +import type { Config } from '../../locale/config.ts'; const __dirname = new URL('.', import.meta.url).pathname; @@ -34,6 +36,10 @@ declare module 'expect' { expect.extend({ toHaveValidMorphemes }); describe.each(allLocales)('data files of $code', ({ code }) => { + const config = loadSumlFromBase(`locale/${code}/config`) as Config; + + const examples = loadTsv(`${__dirname}/../../locale/${code}/pronouns/examples.tsv`); + test('pronouns/pronouns.tsv match schema', async () => { const { default: MORPHEMES } = await import(`../../locale/${code}/pronouns/morphemes.js`); const pronouns = loadTsv(`${__dirname}/../../locale/${code}/pronouns/pronouns.tsv`); @@ -56,7 +62,6 @@ describe.each(allLocales)('data files of $code', ({ code }) => { }); test('pronouns/examples.tsv contain valid morphemes', async () => { const { default: MORPHEMES } = await import(`../../locale/${code}/pronouns/morphemes.js`); - const examples = loadTsv(`${__dirname}/../../locale/${code}/pronouns/examples.tsv`); for (const example of examples) { expect(example.singular).toHaveValidMorphemes(MORPHEMES); if (example.plural) { @@ -64,4 +69,14 @@ describe.each(allLocales)('data files of $code', ({ code }) => { } } }); + test('pronouns/examples.tsv contains plural examples when language has plurals', () => { + const hasExamplesWithPlurals = examples.some((example) => { + return example.plural && example.plural !== example.singular; + }); + expect(hasExamplesWithPlurals).toBe(!!config.pronouns.plurals); + }); + test('pronouns/examples.tsv contains honorific examples when language has honorifics', () => { + const hasExamplesWithHonorifics = examples.some((example) => example.isHonorific); + expect(hasExamplesWithHonorifics).toBe(!!config.pronouns.honorifics); + }); }); From d157146166a744fd7306a48b0728fa3dc17ead10 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Tue, 21 May 2024 18:36:52 +0200 Subject: [PATCH 2/7] (test) add schema check for pronouns/examples.tsv --- test/locales/data.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/locales/data.test.ts b/test/locales/data.test.ts index 753956640..817dd7786 100644 --- a/test/locales/data.test.ts +++ b/test/locales/data.test.ts @@ -60,6 +60,22 @@ describe.each(allLocales)('data files of $code', ({ code }) => { expect(actual).toEqual(expect.arrayContaining(required)); expect([...required, ...optional]).toEqual(expect.arrayContaining(actual)); }); + test('pronouns/examples.tsv match schema', () => { + if (examples.length === 0) { + return; + } + const required = [ + 'singular', + ]; + if (config.pronouns.plurals) { + required.push('plural'); + } + if (config.pronouns.honorifics) { + required.push('isHonorific'); + } + const actual = Object.keys(examples[0]); + expect(actual).toEqual(required); + }); test('pronouns/examples.tsv contain valid morphemes', async () => { const { default: MORPHEMES } = await import(`../../locale/${code}/pronouns/morphemes.js`); for (const example of examples) { From b8231214f9cba5ead355e23ef6a6b2a4849bdae0 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Thu, 30 May 2024 12:11:07 +0200 Subject: [PATCH 3/7] (format) add missing tabs to pronouns/pronouns.tsv and replace simple quotes " with nice quotes --- locale/ko/pronouns/pronouns.tsv | 6 +++--- locale/sv/pronouns/pronouns.tsv | 14 +++++++------- locale/zh/pronouns/pronouns.tsv | 32 ++++++++++++++++---------------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/locale/ko/pronouns/pronouns.tsv b/locale/ko/pronouns/pronouns.tsv index 5fc9b82cd..4eca3f88c 100644 --- a/locale/ko/pronouns/pronouns.tsv +++ b/locale/ko/pronouns/pronouns.tsv @@ -1,4 +1,4 @@ key description normative pronoun plural pluralHonorific pronounceable history thirdForm smallForm sourcesInfo -그 표준 "그" TRUE 그 FALSE FALSE TRUE -그녀 표준 "그녀" TRUE 그녀 FALSE FALSE TRUE -그이 표준 "그이" TRUE 그이 FALSE FALSE TRUE +그 표준 “그” TRUE 그 FALSE FALSE TRUE +그녀 표준 “그녀” TRUE 그녀 FALSE FALSE TRUE +그이 표준 “그이” TRUE 그이 FALSE FALSE TRUE diff --git a/locale/sv/pronouns/pronouns.tsv b/locale/sv/pronouns/pronouns.tsv index 1f1d0b0da..a82c4e24e 100644 --- a/locale/sv/pronouns/pronouns.tsv +++ b/locale/sv/pronouns/pronouns.tsv @@ -1,8 +1,8 @@ key description normative pronoun_nominative pronoun_object possessive plural pluralHonorific pronounceable history thirdForm smallForm sourcesInfo -han,han/honom Normative “han/honom” TRUE han honom hans FALSE FALSE TRUE -hon,hon/henne Normative “hon/henne" TRUE hon henne hennes FALSE FALSE TRUE -de,de/dem Singular “de/dem" TRUE de dem deras TRUE TRUE TRUE -den,den/den Personal “den" TRUE den den dess FALSE FALSE TRUE -det,det/det Personal “det" TRUE det det dess FALSE FALSE TRUE -hen/hen "Normative ""hen/hen""" TRUE hen hen hens FALSE FALSE TRUE "Baserat på det Finska könsneutrala pronomenet “hän”. Ordet föreslogs av Rolf Dunås 1966 men kom inte med i Svenska Akademins ordlista förens april 2015. ”hen/hen” föredras över ”hen/henom"", enligt Svenska Akademien." -hen,hen/henom "Normative ""hen/henom""" TRUE hen henom hens FALSE FALSE TRUE Baserat på det Finska könsneutrala pronomenet “hän”. Ordet föreslogs av Rolf Dunås 1966 men kom inte med i Svenska Akademins ordlista förens april 2015. +han,han/honom Normative ”han/honom” TRUE han honom hans FALSE FALSE TRUE +hon,hon/henne Normative ”hon/henne” TRUE hon henne hennes FALSE FALSE TRUE +de,de/dem Singular ”de/dem” TRUE de dem deras TRUE TRUE TRUE +den,den/den Personal ”den” TRUE den den dess FALSE FALSE TRUE +det,det/det Personal ”det” TRUE det det dess FALSE FALSE TRUE +hen/hen Normative ”hen/hen” TRUE hen hen hens FALSE FALSE TRUE "Baserat på det Finska könsneutrala pronomenet “hän”. Ordet föreslogs av Rolf Dunås 1966 men kom inte med i Svenska Akademins ordlista förens april 2015. ”hen/hen” föredras över ”hen/henom"", enligt Svenska Akademien." +hen,hen/henom Normative ”hen/henom” TRUE hen henom hens FALSE FALSE TRUE Baserat på det Finska könsneutrala pronomenet “hän”. Ordet föreslogs av Rolf Dunås 1966 men kom inte med i Svenska Akademins ordlista förens april 2015. diff --git a/locale/zh/pronouns/pronouns.tsv b/locale/zh/pronouns/pronouns.tsv index 52e664e6f..233039a30 100644 --- a/locale/zh/pronouns/pronouns.tsv +++ b/locale/zh/pronouns/pronouns.tsv @@ -1,17 +1,17 @@ key description normative 3rd_person 2nd_person plural pluralHonorific pronounceable history thirdForm smallForm sourcesInfo -他,他/你 陽剛/中立 TRUE 他 你 FALSE FALSE TRUE “他”傳統上是性別中立的代詞,但是在西方的影響下推出了“她”這一個字來區分,所以“他/你”就有了男性之意。 -她,她/你 陰柔 TRUE 她 你 FALSE FALSE TRUE “她”的發音與“他”相同,受西方影響才有書面的區分。 -她/妳 陰柔 TRUE 她 妳 FALSE FALSE TRUE “她”的發音與“他”相同,並在西方的影響下才開始使用。 另外,同理的女性第二人稱代詞“妳”主要在台灣使用。 -伊,伊/你 陰柔/中立 FALSE 伊 你 FALSE FALSE TRUE “伊”曾經是性別中立代詞,在福建話裏也是被當作中立代詞。 歷史上在1870 -1930年,它被用作唯一的女性代詞。 -tā,tā/你,ta,ta/你 中立 FALSE tā|=他 你 FALSE FALSE TRUE 漢語拼音的"tā"、 "ta"是性別中立代詞。與“他”同音。 -X也,X也/你,x也,x也/你 中立 FALSE X也|=他 你 FALSE FALSE TRUE 2015年由雙性人{https://www.facebook.com/intersex0.972=The Missing Gender 0.972}團體所創造。與“他”同音。 -无也,无也/你,无也,无也/你 中立 FALSE 无也|=他 你 FALSE FALSE TRUE 由{https://www.genderinlanguage.com/mandarin/zipengzhu=朱子蓬}創建。 -佢,佢/你 中立 FALSE 佢 你 FALSE FALSE TRUE “佢“是粵語借詞,被一些香港人當作性別中立代詞使用。 -祂,祂/你 神 TRUE 祂 你 FALSE FALSE TRUE -祂/祢 神 TRUE 祂 祢 FALSE FALSE TRUE “祢”作為第二人稱代詞主要是台灣的用法。 -它,它/你 無生 TRUE 它 你 FALSE FALSE TRUE -牠,牠/你 獸 TRUE 牠 你 FALSE FALSE TRUE “牠”主要在台灣使用,中國大陸“它”一樣用在動物身上。 -其,其/你 中立 FALSE 其 你 FALSE FALSE TRUE -彼,彼/你 中立 FALSE 彼 你 FALSE FALSE TRUE -渠,渠/你 中立 FALSE 渠 你 FALSE FALSE TRUE -ㄊㄚ,ㄊㄚ/你 中立 FALSE ㄊㄚ|=他 你 FALSE FALSE TRUE 注音符號ㄊㄚ作為性別中立代詞。與“他”同音。 +他,他/你 陽剛/中立 TRUE 他 你 FALSE FALSE TRUE “他”傳統上是性別中立的代詞,但是在西方的影響下推出了“她”這一個字來區分,所以“他/你”就有了男性之意。 +她,她/你 陰柔 TRUE 她 你 FALSE FALSE TRUE “她”的發音與“他”相同,受西方影響才有書面的區分。 +她/妳 陰柔 TRUE 她 妳 FALSE FALSE TRUE “她”的發音與“他”相同,並在西方的影響下才開始使用。 另外,同理的女性第二人稱代詞“妳”主要在台灣使用。 +伊,伊/你 陰柔/中立 FALSE 伊 你 FALSE FALSE TRUE “伊”曾經是性別中立代詞,在福建話裏也是被當作中立代詞。 歷史上在1870 -1930年,它被用作唯一的女性代詞。 +tā,tā/你,ta,ta/你 中立 FALSE tā|=他 你 FALSE FALSE TRUE 漢語拼音的“tā”、 “ta”是性別中立代詞。與“他”同音。 +X也,X也/你,x也,x也/你 中立 FALSE X也|=他 你 FALSE FALSE TRUE 2015年由雙性人{https://www.facebook.com/intersex0.972=The Missing Gender 0.972}團體所創造。與“他”同音。 +无也,无也/你,无也,无也/你 中立 FALSE 无也|=他 你 FALSE FALSE TRUE 由{https://www.genderinlanguage.com/mandarin/zipengzhu=朱子蓬}創建。 +佢,佢/你 中立 FALSE 佢 你 FALSE FALSE TRUE “佢“是粵語借詞,被一些香港人當作性別中立代詞使用。 +祂,祂/你 神 TRUE 祂 你 FALSE FALSE TRUE +祂/祢 神 TRUE 祂 祢 FALSE FALSE TRUE “祢”作為第二人稱代詞主要是台灣的用法。 +它,它/你 無生 TRUE 它 你 FALSE FALSE TRUE +牠,牠/你 獸 TRUE 牠 你 FALSE FALSE TRUE “牠”主要在台灣使用,中國大陸“它”一樣用在動物身上。 +其,其/你 中立 FALSE 其 你 FALSE FALSE TRUE +彼,彼/你 中立 FALSE 彼 你 FALSE FALSE TRUE +渠,渠/你 中立 FALSE 渠 你 FALSE FALSE TRUE +ㄊㄚ,ㄊㄚ/你 中立 FALSE ㄊㄚ|=他 你 FALSE FALSE TRUE 注音符號ㄊㄚ作為性別中立代詞。與“他”同音。 From bc662ff584aa8746e4e9a9c40583a84f77e082e3 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Tue, 21 May 2024 21:48:07 +0200 Subject: [PATCH 4/7] (pronouns) disable config.pronouns.plurals for locales having no (used) plural conjugation --- locale/ja/config.suml | 2 +- locale/ja/pronouns/pronouns.tsv | 16 ++++++++-------- locale/nl/config.suml | 2 +- locale/no/config.suml | 2 +- locale/sv/config.suml | 2 +- locale/sv/pronouns/pronouns.tsv | 2 +- locale/vi/config.suml | 2 +- locale/vi/pronouns/pronouns.tsv | 2 +- locale/zh/config.suml | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/locale/ja/config.suml b/locale/ja/config.suml index a70352bfd..d04b43113 100644 --- a/locale/ja/config.suml +++ b/locale/ja/config.suml @@ -7,7 +7,7 @@ pronouns: route: '三人称代名詞' default: '彼' any: 'いずれ' - plurals: true + plurals: false honorifics: false generator: enabled: true diff --git a/locale/ja/pronouns/pronouns.tsv b/locale/ja/pronouns/pronouns.tsv index 268e30e91..069b012fc 100644 --- a/locale/ja/pronouns/pronouns.tsv +++ b/locale/ja/pronouns/pronouns.tsv @@ -3,13 +3,13 @@ key description normative base_pronoun plural pluralHonorific pronounceable sour 彼女 女性的 TRUE 彼女 FALSE FALSE TRUE あの人 中性的 TRUE あの人 FALSE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。 あの方 中性的(敬語) TRUE あの方 FALSE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。 -彼達 男性的と複数形(敬語) TRUE 彼達 TRUE FALSE TRUE -彼女達 女性的と複数形(敬語) TRUE 彼女達 TRUE FALSE TRUE -彼ら 男性的と複数形 TRUE 彼ら TRUE FALSE TRUE -彼女ら 女性的と複数形 TRUE 彼女ら TRUE FALSE TRUE -あの人達 中性的と複数形 TRUE あの人達 TRUE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。 -あの方達 中性的と複数形(敬語) TRUE あの方達 TRUE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。 +彼達 男性的と複数形(敬語) TRUE 彼達 FALSE FALSE TRUE +彼女達 女性的と複数形(敬語) TRUE 彼女達 FALSE FALSE TRUE +彼ら 男性的と複数形 TRUE 彼ら FALSE FALSE TRUE +彼女ら 女性的と複数形 TRUE 彼女ら FALSE FALSE TRUE +あの人達 中性的と複数形 TRUE あの人達 FALSE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。 +あの方達 中性的と複数形(敬語) TRUE あの方達 FALSE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。 あいつ 中性的(友達) TRUE あいつ FALSE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。状況に応じて、失礼なことかもしれない。 -あいつら 中性的と複数形(友達) TRUE あいつら TRUE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。状況に応じて、失礼なことかもしれない。 +あいつら 中性的と複数形(友達) TRUE あいつら FALSE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。状況に応じて、失礼なことかもしれない。 あやつ 中性的(友達) TRUE あやつ FALSE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。状況に応じて、失礼なことかもしれない。 -あやつら 中性的と複数形(友達) TRUE あやつら TRUE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。状況に応じて、失礼なことかもしれない。 +あやつら 中性的と複数形(友達) TRUE あやつら FALSE FALSE TRUE 文の主題は話し手の近くにいれば、「あ」を「こ」に置き換える。文の主題は話し手の遠く、聞き手の近くにいれば、「あ」を「そ」に置き換える。状況に応じて、失礼なことかもしれない。 diff --git a/locale/nl/config.suml b/locale/nl/config.suml index ed15d27ee..11991d0d0 100644 --- a/locale/nl/config.suml +++ b/locale/nl/config.suml @@ -7,7 +7,7 @@ pronouns: route: 'voornaamwoorden' default: 'hij' any: 'elk' - plurals: true + plurals: false honorifics: false generator: enabled: true diff --git a/locale/no/config.suml b/locale/no/config.suml index eb55aeeb0..83edb6ec2 100644 --- a/locale/no/config.suml +++ b/locale/no/config.suml @@ -7,7 +7,7 @@ pronouns: route: 'pronomen' default: 'han' any: 'alle' - plurals: true + plurals: false honorifics: false generator: enabled: true diff --git a/locale/sv/config.suml b/locale/sv/config.suml index 71df9a28b..e4a3db08a 100644 --- a/locale/sv/config.suml +++ b/locale/sv/config.suml @@ -7,7 +7,7 @@ pronouns: route: 'pronomen' default: 'han' any: 'alla' - plurals: true + plurals: false honorifics: false generator: enabled: true diff --git a/locale/sv/pronouns/pronouns.tsv b/locale/sv/pronouns/pronouns.tsv index a82c4e24e..a267b3b11 100644 --- a/locale/sv/pronouns/pronouns.tsv +++ b/locale/sv/pronouns/pronouns.tsv @@ -1,7 +1,7 @@ key description normative pronoun_nominative pronoun_object possessive plural pluralHonorific pronounceable history thirdForm smallForm sourcesInfo han,han/honom Normative ”han/honom” TRUE han honom hans FALSE FALSE TRUE hon,hon/henne Normative ”hon/henne” TRUE hon henne hennes FALSE FALSE TRUE -de,de/dem Singular ”de/dem” TRUE de dem deras TRUE TRUE TRUE +de,de/dem Singular ”de/dem” TRUE de dem deras FALSE FALSE TRUE den,den/den Personal ”den” TRUE den den dess FALSE FALSE TRUE det,det/det Personal ”det” TRUE det det dess FALSE FALSE TRUE hen/hen Normative ”hen/hen” TRUE hen hen hens FALSE FALSE TRUE "Baserat på det Finska könsneutrala pronomenet “hän”. Ordet föreslogs av Rolf Dunås 1966 men kom inte med i Svenska Akademins ordlista förens april 2015. ”hen/hen” föredras över ”hen/henom"", enligt Svenska Akademien." diff --git a/locale/vi/config.suml b/locale/vi/config.suml index 86fe150d4..3ea00cecc 100644 --- a/locale/vi/config.suml +++ b/locale/vi/config.suml @@ -7,7 +7,7 @@ pronouns: route: 'danh-xưng' default: 'anh' any: 'bất-kì' - plurals: true + plurals: false honorifics: false generator: enabled: true diff --git a/locale/vi/pronouns/pronouns.tsv b/locale/vi/pronouns/pronouns.tsv index 095b831bf..eae4fb7cc 100644 --- a/locale/vi/pronouns/pronouns.tsv +++ b/locale/vi/pronouns/pronouns.tsv @@ -15,5 +15,5 @@ cháu,cháu ấy trung tính TRUE cháu ấy cháu FALSE FALSE TRUE đồng chí,đồng chí ấy trung tính FALSE đồng chí ấy đồng chí FALSE FALSE TRUE họ trung tính TRUE họ bạn|=cậu FALSE FALSE TRUE bro trung tính FALSE bro bro FALSE FALSE TRUE -họ trung tính TRUE họ họ TRUE FALSE TRUE +họ trung tính TRUE họ họ FALSE FALSE TRUE sis trung tính FALSE sis sis FALSE FALSE TRUE diff --git a/locale/zh/config.suml b/locale/zh/config.suml index e3b73795f..ff947fab8 100644 --- a/locale/zh/config.suml +++ b/locale/zh/config.suml @@ -7,7 +7,7 @@ pronouns: route: 'pronouns' default: '他' any: '任何' - plurals: true + plurals: false honorifics: false generator: enabled: true From ea5669052fbf38abe2c72b2cfb487fb5f386876e Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Thu, 30 May 2024 12:17:53 +0200 Subject: [PATCH 5/7] (ko)(pronouns) set config.pronouns.honorifics as there are examples with honorifics --- locale/ko/config.suml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/ko/config.suml b/locale/ko/config.suml index 11d5ad62c..06cdf8459 100644 --- a/locale/ko/config.suml +++ b/locale/ko/config.suml @@ -8,7 +8,7 @@ pronouns: default: '그' any: 'any' plurals: true - honorifics: false + honorifics: true generator: enabled: true slashes: true From 08e1f3cff37112c98c82fb1f3ca75bcd33d562d4 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Thu, 30 May 2024 12:23:44 +0200 Subject: [PATCH 6/7] (pronouns) remove unnecessary columns from prononus/examples.tsv --- locale/eo/pronouns/examples.tsv | 10 +++++----- locale/es/pronouns/examples.tsv | 18 +++++++++--------- locale/et/config.suml | 2 +- locale/et/pronouns/examples.tsv | 6 +----- locale/fr/pronouns/examples.tsv | 10 +++++----- locale/gl/pronouns/examples.tsv | 16 ++++++++-------- locale/he/config.suml | 2 +- locale/he/pronouns/examples.tsv | 6 +----- locale/it/pronouns/examples.tsv | 18 +++++++++--------- locale/ja/pronouns/examples.tsv | 10 +++++----- locale/lad/pronouns/examples.tsv | 16 ++++++++-------- locale/nl/pronouns/examples.tsv | 10 +++++----- locale/no/pronouns/examples.tsv | 8 ++++---- locale/pt/pronouns/examples.tsv | 20 ++++++++++---------- locale/ro/pronouns/examples.tsv | 10 +++++----- locale/ru/pronouns/examples.tsv | 30 +++++++++++++++--------------- locale/sv/pronouns/examples.tsv | 10 +++++----- locale/tok/pronouns/examples.tsv | 4 ++-- locale/ua/pronouns/examples.tsv | 28 ++++++++++++++-------------- locale/vi/pronouns/examples.tsv | 10 +++++----- locale/yi/pronouns/examples.tsv | 12 ++++++------ locale/zh/pronouns/examples.tsv | 8 ++++---- 22 files changed, 128 insertions(+), 136 deletions(-) diff --git a/locale/eo/pronouns/examples.tsv b/locale/eo/pronouns/examples.tsv index 798fd383d..1d823f370 100644 --- a/locale/eo/pronouns/examples.tsv +++ b/locale/eo/pronouns/examples.tsv @@ -1,5 +1,5 @@ -singular plural isHonorific -Mi pensas, ke {pronoun_subject} estas tre afabla. FALSE -Mi demandis {pronoun_subject}n, ĉu mi povas prunti {pronoun_subject}an skribilon. FALSE -{'pronoun_subject} diris, ke la libroj estas {pronoun_subject}aj. FALSE -{'pronoun_subject} diris, ke {pronoun_subject} preferas mem fari tion. FALSE +singular +Mi pensas, ke {pronoun_subject} estas tre afabla. +Mi demandis {pronoun_subject}n, ĉu mi povas prunti {pronoun_subject}an skribilon. +{'pronoun_subject} diris, ke la libroj estas {pronoun_subject}aj. +{'pronoun_subject} diris, ke {pronoun_subject} preferas mem fari tion. diff --git a/locale/es/pronouns/examples.tsv b/locale/es/pronouns/examples.tsv index 6a51b038c..14aa6a5c0 100644 --- a/locale/es/pronouns/examples.tsv +++ b/locale/es/pronouns/examples.tsv @@ -1,9 +1,9 @@ -singular plural isHonorific -Creo que {pronoun} es muy querid{inflection}. FALSE -Llamé a mi herman{inflection} esta mañana y me dijo que estará ocupad{inflection} esta tarde. FALSE -A mi amiga la quiero, pero a mi novi{inflection} {direct_object_pronoun} amo mucho. FALSE -{'plural_definite_article} activistas progresiv{inflection}s están presionando para la aceptación de los pronombres neutros. FALSE -Se acerca la navidad y no sé qué regalos comprar para {plural_pronoun}. FALSE -{'definite_article} dueñ{inflection} de esta tienda es una persona amable. FALSE -{'plural_direct_object_pronoun} vi anoche pero no me reconocieron. FALSE -Es {indefinite_article} estudiante muy list{inflection}. FALSE +singular +Creo que {pronoun} es muy querid{inflection}. +Llamé a mi herman{inflection} esta mañana y me dijo que estará ocupad{inflection} esta tarde. +A mi amiga la quiero, pero a mi novi{inflection} {direct_object_pronoun} amo mucho. +{'plural_definite_article} activistas progresiv{inflection}s están presionando para la aceptación de los pronombres neutros. +Se acerca la navidad y no sé qué regalos comprar para {plural_pronoun}. +{'definite_article} dueñ{inflection} de esta tienda es una persona amable. +{'plural_direct_object_pronoun} vi anoche pero no me reconocieron. +Es {indefinite_article} estudiante muy list{inflection}. diff --git a/locale/et/config.suml b/locale/et/config.suml index 0289107fa..6bb787804 100644 --- a/locale/et/config.suml +++ b/locale/et/config.suml @@ -7,7 +7,7 @@ pronouns: route: 'pronouns' default: 'tema' any: 'mistahes' - plurals: true + plurals: false honorifics: false generator: enabled: true diff --git a/locale/et/pronouns/examples.tsv b/locale/et/pronouns/examples.tsv index c593097e4..5f0dc0195 100644 --- a/locale/et/pronouns/examples.tsv +++ b/locale/et/pronouns/examples.tsv @@ -1,5 +1 @@ -singular plural isHonorific -I think {pronoun_subject} is very nice. I think {pronoun_subject} are very nice. FALSE -I asked {pronoun_object} if I can borrow {possessive_determiner} pencil. FALSE -{'pronoun_subject} told me that the house is {possessive_pronoun}. FALSE -{'pronoun_subject} said {pronoun_subject} would rather do it {reflexive}. FALSE +singular diff --git a/locale/fr/pronouns/examples.tsv b/locale/fr/pronouns/examples.tsv index 267aba0bb..8c38bf87e 100644 --- a/locale/fr/pronouns/examples.tsv +++ b/locale/fr/pronouns/examples.tsv @@ -1,5 +1,5 @@ -singular plural isHonorific -Je pense qu'{pronoun_subject} est très genti{inflection_l}. Je pense qu'{pronoun_subject} sont très genti{inflection_l}. FALSE -{'pronoun_subject} est {pronoun_possessive} voisi{inflection_n}. {'pronoun_subject} sont {pronoun_possessive} voisi{inflection_n}. FALSE -Je vais {pronoun_object} rencontrer bientôt. FALSE -Je me fie à {pronoun_disjunctive}. FALSE +singular plural +Je pense qu'{pronoun_subject} est très genti{inflection_l}. Je pense qu'{pronoun_subject} sont très genti{inflection_l}. +{'pronoun_subject} est {pronoun_possessive} voisi{inflection_n}. {'pronoun_subject} sont {pronoun_possessive} voisi{inflection_n}. +Je vais {pronoun_object} rencontrer bientôt. +Je me fie à {pronoun_disjunctive}. diff --git a/locale/gl/pronouns/examples.tsv b/locale/gl/pronouns/examples.tsv index 983af92b9..83e262f8a 100644 --- a/locale/gl/pronouns/examples.tsv +++ b/locale/gl/pronouns/examples.tsv @@ -1,8 +1,8 @@ -singular plural isHonorific -Eu acho que {pronoun} é muito simpáti{inflection_c}. FALSE -Liguei para {possessive} sobrinh{inflection} esta manhã e {pronoun} disse que estará ocupad{inflection} esta tarde. FALSE -O Natal está chegando e não sei que presentes comprar para {plural_pronoun}. FALSE -{'definite_article} don{inflection} desta loja é uma pessoa gentil. FALSE -Eu {plural_definite_article} vi ontem à noite, mas {plural_pronoun} não me reconheceram. FALSE -{'pronoun} é {indefinite_article} alun{inflection} muito espert{inflection}. FALSE -{'pronoun} me disse que esta é a casa {de_pronoun}. FALSE +singular +Eu acho que {pronoun} é muito simpáti{inflection_c}. +Liguei para {possessive} sobrinh{inflection} esta manhã e {pronoun} disse que estará ocupad{inflection} esta tarde. +O Natal está chegando e não sei que presentes comprar para {plural_pronoun}. +{'definite_article} don{inflection} desta loja é uma pessoa gentil. +Eu {plural_definite_article} vi ontem à noite, mas {plural_pronoun} não me reconheceram. +{'pronoun} é {indefinite_article} alun{inflection} muito espert{inflection}. +{'pronoun} me disse que esta é a casa {de_pronoun}. diff --git a/locale/he/config.suml b/locale/he/config.suml index 2f2df9f48..e9ab41eae 100644 --- a/locale/he/config.suml +++ b/locale/he/config.suml @@ -7,7 +7,7 @@ pronouns: route: 'pronouns' default: 'he' any: 'any' - plurals: true + plurals: false honorifics: false generator: enabled: true diff --git a/locale/he/pronouns/examples.tsv b/locale/he/pronouns/examples.tsv index c593097e4..5f0dc0195 100644 --- a/locale/he/pronouns/examples.tsv +++ b/locale/he/pronouns/examples.tsv @@ -1,5 +1 @@ -singular plural isHonorific -I think {pronoun_subject} is very nice. I think {pronoun_subject} are very nice. FALSE -I asked {pronoun_object} if I can borrow {possessive_determiner} pencil. FALSE -{'pronoun_subject} told me that the house is {possessive_pronoun}. FALSE -{'pronoun_subject} said {pronoun_subject} would rather do it {reflexive}. FALSE +singular diff --git a/locale/it/pronouns/examples.tsv b/locale/it/pronouns/examples.tsv index 69e168ae6..0bebe3047 100644 --- a/locale/it/pronouns/examples.tsv +++ b/locale/it/pronouns/examples.tsv @@ -1,9 +1,9 @@ -singular plural isHonorific -{'article} volontar{noun_i} è molto vantaggios{adjective}. {'article} volontar{noun_i} sono molto vantaggios{adjective}. FALSE -Sono stanc{h}{adjective}, ma molto felice. Siamo stanc{h}{adjective}, ma molto felice. FALSE -{'pronoun_n} è arrivat{past_participle}. {'pronoun_n} sono arrivat{past_participle} FALSE -Sei stat{past_participle} a casa? Siete stat{past_participle} a casa? FALSE -Ho visto {article_indefinite} ragazz{noun} bell{adjective}. FALSE -{'pronoun_n} canta a {possessive} amic{h}{noun}. {'pronoun_n} cantano a {possessive} amic{h}{noun}. FALSE -{'pronoun_d} parlai per un'ora intera. FALSE -{'pronoun_a} vedo. FALSE +singular plural +{'article} volontar{noun_i} è molto vantaggios{adjective}. {'article} volontar{noun_i} sono molto vantaggios{adjective}. +Sono stanc{h}{adjective}, ma molto felice. Siamo stanc{h}{adjective}, ma molto felice. +{'pronoun_n} è arrivat{past_participle}. {'pronoun_n} sono arrivat{past_participle} +Sei stat{past_participle} a casa? Siete stat{past_participle} a casa? +Ho visto {article_indefinite} ragazz{noun} bell{adjective}. +{'pronoun_n} canta a {possessive} amic{h}{noun}. {'pronoun_n} cantano a {possessive} amic{h}{noun}. +{'pronoun_d} parlai per un'ora intera. +{'pronoun_a} vedo. diff --git a/locale/ja/pronouns/examples.tsv b/locale/ja/pronouns/examples.tsv index f175167ec..ba2f5fcb2 100644 --- a/locale/ja/pronouns/examples.tsv +++ b/locale/ja/pronouns/examples.tsv @@ -1,5 +1,5 @@ -singular plural isHonorific -思うに{base_pronoun}はめちゃくちゃ優しいですよ。 FALSE -私は{base_pronoun}に{base_pronoun}のペンを借りてもいいかと尋ねました。 FALSE -{base_pronoun}は家は{base_pronoun}のものと言いました。 FALSE -後で{base_pronoun}に教えてください。 FALSE +singular +思うに{base_pronoun}はめちゃくちゃ優しいですよ。 +私は{base_pronoun}に{base_pronoun}のペンを借りてもいいかと尋ねました。 +{base_pronoun}は家は{base_pronoun}のものと言いました。 +後で{base_pronoun}に教えてください。 diff --git a/locale/lad/pronouns/examples.tsv b/locale/lad/pronouns/examples.tsv index 0bf9ace92..ab3fff309 100644 --- a/locale/lad/pronouns/examples.tsv +++ b/locale/lad/pronouns/examples.tsv @@ -1,8 +1,8 @@ -singular plural isHonorific -Penso ke {pronoun} es muy kerid{inflection}. FALSE -Mi erman{inflection} esta muy okupad{inflection} en el mupak. FALSE -Es {indefinite_article} elev{inflection} muy meoyud{inflection}. FALSE -{'direct_object_pronoun} visitare amanyana. FALSE -Es vedra ke {plural_pronoun} son tus amig{inflection}s? FALSE -{'plural_definite_article} pomper{inflection}s son muy brav{inflection}s. FALSE -Sos {definite_article} maestr{inflection} de esta orkestra? FALSE +singular +Penso ke {pronoun} es muy kerid{inflection}. +Mi erman{inflection} esta muy okupad{inflection} en el mupak. +Es {indefinite_article} elev{inflection} muy meoyud{inflection}. +{'direct_object_pronoun} visitare amanyana. +Es vedra ke {plural_pronoun} son tus amig{inflection}s? +{'plural_definite_article} pomper{inflection}s son muy brav{inflection}s. +Sos {definite_article} maestr{inflection} de esta orkestra? diff --git a/locale/nl/pronouns/examples.tsv b/locale/nl/pronouns/examples.tsv index 3f8911c24..089da384b 100644 --- a/locale/nl/pronouns/examples.tsv +++ b/locale/nl/pronouns/examples.tsv @@ -1,5 +1,5 @@ -singular plural isHonorific -{'nominative} zou er nu ongeveer moeten zijn. FALSE -Ik vind {accusative} er mooi uitzien. FALSE -Jij zei {dative} dat {pronominal_poss} veter los zat. FALSE -Dat deel is het {predicative_poss}. FALSE +singular +{'nominative} zou er nu ongeveer moeten zijn. +Ik vind {accusative} er mooi uitzien. +Jij zei {dative} dat {pronominal_poss} veter los zat. +Dat deel is het {predicative_poss}. diff --git a/locale/no/pronouns/examples.tsv b/locale/no/pronouns/examples.tsv index 067e5ff04..09c5a7f7b 100644 --- a/locale/no/pronouns/examples.tsv +++ b/locale/no/pronouns/examples.tsv @@ -1,4 +1,4 @@ -singular plural isHonorific -Jeg synes {pronoun_subject} er veldig snill. FALSE -Jeg spurte {pronoun_object} om jeg kunne låne blyanten {possessive}. FALSE -{'pronoun_subject} fortalte meg at huset er {possessive}. FALSE +singular +Jeg synes {pronoun_subject} er veldig snill. +Jeg spurte {pronoun_object} om jeg kunne låne blyanten {possessive}. +{'pronoun_subject} fortalte meg at huset er {possessive}. diff --git a/locale/pt/pronouns/examples.tsv b/locale/pt/pronouns/examples.tsv index f8a6fc0ef..552e2f193 100644 --- a/locale/pt/pronouns/examples.tsv +++ b/locale/pt/pronouns/examples.tsv @@ -1,10 +1,10 @@ -singular plural isHonorific -Eu acho que {pronoun} é muito simpáti{inflection_c}. FALSE -Liguei para {possessive} sobrinh{inflection} esta manhã e {pronoun} disse que estará ocupad{inflection} esta tarde. FALSE -O Natal está chegando e não sei que presentes comprar para {plural_pronoun}. FALSE -{'definite_article} don{inflection} desta loja é uma pessoa gentil. FALSE -Eu {plural_definite_article} vi ontem à noite, mas {plural_pronoun} não me reconheceram. FALSE -{'pronoun} é {indefinite_article} alun{inflection} muito espert{inflection}. FALSE -{'pronoun} me disse que esta é a casa {de_pronoun}. FALSE -Valorizo muito {demonstrative_ss} ami{inflection_g} que tenho. FALSE -Você me faz lembrar daqu{pronoun} funcionári{inflection} que conheci noutro dia. FALSE +singular +Eu acho que {pronoun} é muito simpáti{inflection_c}. +Liguei para {possessive} sobrinh{inflection} esta manhã e {pronoun} disse que estará ocupad{inflection} esta tarde. +O Natal está chegando e não sei que presentes comprar para {plural_pronoun}. +{'definite_article} don{inflection} desta loja é uma pessoa gentil. +Eu {plural_definite_article} vi ontem à noite, mas {plural_pronoun} não me reconheceram. +{'pronoun} é {indefinite_article} alun{inflection} muito espert{inflection}. +{'pronoun} me disse que esta é a casa {de_pronoun}. +Valorizo muito {demonstrative_ss} ami{inflection_g} que tenho. +Você me faz lembrar daqu{pronoun} funcionári{inflection} que conheci noutro dia. diff --git a/locale/ro/pronouns/examples.tsv b/locale/ro/pronouns/examples.tsv index f35b152bd..8fc1252ce 100644 --- a/locale/ro/pronouns/examples.tsv +++ b/locale/ro/pronouns/examples.tsv @@ -1,5 +1,5 @@ -singular plural isHonorific -Cred că {pronoun_n} este de treabă. Cred că {pronoun_n} sunt de treabă. FALSE -{'first_article} întrebat{second_article} pe {pronoun_n} dacă îi pot împrumuta creionul său. {'first_article}am întrebat pe {pronoun_n} dacă le pot împrumuta creionul lor. FALSE -{'pronoun_n} mi-a spus că această casă este a {pronoun_dg}. {'pronoun_n} mi-au spus că această casă este a {pronoun_dg}. FALSE -{'pronoun_n} {strengthening} și-a dorit să devină erou. {'pronoun_n} {strengthening} și-au dorit să devină eroi. FALSE +singular plural +Cred că {pronoun_n} este de treabă. Cred că {pronoun_n} sunt de treabă. +{'first_article} întrebat{second_article} pe {pronoun_n} dacă îi pot împrumuta creionul său. {'first_article}am întrebat pe {pronoun_n} dacă le pot împrumuta creionul lor. +{'pronoun_n} mi-a spus că această casă este a {pronoun_dg}. {'pronoun_n} mi-au spus că această casă este a {pronoun_dg}. +{'pronoun_n} {strengthening} și-a dorit să devină erou. {'pronoun_n} {strengthening} și-au dorit să devină eroi. diff --git a/locale/ru/pronouns/examples.tsv b/locale/ru/pronouns/examples.tsv index 5a6d84a03..fbfed4c6b 100644 --- a/locale/ru/pronouns/examples.tsv +++ b/locale/ru/pronouns/examples.tsv @@ -1,15 +1,15 @@ -singular plural isHonorific -Я слышал, что {nominative} замечательно танцует. Я слышал, что {nominative} замечательно танцуют. FALSE -Я {genitive} сегодня ещё не видела. Я {genitive} сегодня ещё не видела. FALSE -Дай {dative} время. Дай {dative} время. FALSE -Не нужно {accusative} осуждать. Не нужно {accusative} осуждать. FALSE -Я горжусь {instrumental}. Я горжусь {instrumental}. FALSE -Расскажи мне о {prepositional}! Расскажи мне о {prepositional}! FALSE -Тебе стоит познакомиться с {instrumental_with_preposition}. Тебе стоит познакомиться с {instrumental_with_preposition}. FALSE -У {genitive_with_preposition} есть кот. У {genitive_with_preposition} есть кот. FALSE -{'nominative} очень талантли{short_adjective}. {'nominative} очень талантли{short_adjective}. FALSE -{'nominative} замечательн{adjective}. {'nominative} замечательн{adjective}. FALSE -{'possessive} знаком{adjective} умеет играть на гитаре. {'possessive} знаком{adjective} умеют играть на гитаре. FALSE -{'nominative} собра{reflexive_verb_past} на работу. {'nominative} собра{reflexive_verb_past} на работу. FALSE -{'nominative} сказа{nonreflexive_verb_past}, что пойдёт с нами! {'nominative} сказа{nonreflexive_verb_past}, что пойдут с нами! FALSE -{'nominative} сделает это {definitive}. {'nominative} сделают это {definitive}. FALSE +singular plural +Я слышал, что {nominative} замечательно танцует. Я слышал, что {nominative} замечательно танцуют. +Я {genitive} сегодня ещё не видела. Я {genitive} сегодня ещё не видела. +Дай {dative} время. Дай {dative} время. +Не нужно {accusative} осуждать. Не нужно {accusative} осуждать. +Я горжусь {instrumental}. Я горжусь {instrumental}. +Расскажи мне о {prepositional}! Расскажи мне о {prepositional}! +Тебе стоит познакомиться с {instrumental_with_preposition}. Тебе стоит познакомиться с {instrumental_with_preposition}. +У {genitive_with_preposition} есть кот. У {genitive_with_preposition} есть кот. +{'nominative} очень талантли{short_adjective}. {'nominative} очень талантли{short_adjective}. +{'nominative} замечательн{adjective}. {'nominative} замечательн{adjective}. +{'possessive} знаком{adjective} умеет играть на гитаре. {'possessive} знаком{adjective} умеют играть на гитаре. +{'nominative} собра{reflexive_verb_past} на работу. {'nominative} собра{reflexive_verb_past} на работу. +{'nominative} сказа{nonreflexive_verb_past}, что пойдёт с нами! {'nominative} сказа{nonreflexive_verb_past}, что пойдут с нами! +{'nominative} сделает это {definitive}. {'nominative} сделают это {definitive}. diff --git a/locale/sv/pronouns/examples.tsv b/locale/sv/pronouns/examples.tsv index 43699ee83..59b5459b9 100644 --- a/locale/sv/pronouns/examples.tsv +++ b/locale/sv/pronouns/examples.tsv @@ -1,5 +1,5 @@ -singular plural isHonorific -Jag tycker att {pronoun_nominative} är väldigt snäll. FALSE -Jag frågade {pronoun_object} om jag fick låna {possessive} penna. FALSE -{'pronoun_nominative} sa att huset är {possessive}. FALSE -{'pronoun_nominative} sa att {pronoun_nominative} hellre ville göra det själv. FALSE +singular +Jag tycker att {pronoun_nominative} är väldigt snäll. +Jag frågade {pronoun_object} om jag fick låna {possessive} penna. +{'pronoun_nominative} sa att huset är {possessive}. +{'pronoun_nominative} sa att {pronoun_nominative} hellre ville göra det själv. diff --git a/locale/tok/pronouns/examples.tsv b/locale/tok/pronouns/examples.tsv index beb109250..9ab3c78cc 100644 --- a/locale/tok/pronouns/examples.tsv +++ b/locale/tok/pronouns/examples.tsv @@ -1,2 +1,2 @@ -singular plural isHonorific -pilin mi la {pronoun} li pona mute. FALSE +singular +pilin mi la {pronoun} li pona mute. diff --git a/locale/ua/pronouns/examples.tsv b/locale/ua/pronouns/examples.tsv index 92464c54a..0f64034a9 100644 --- a/locale/ua/pronouns/examples.tsv +++ b/locale/ua/pronouns/examples.tsv @@ -1,14 +1,14 @@ -singular plural isHonorific -Я чув, що {nominative} чудово танцює. Я чув, що {nominative} чудово танцює. FALSE -Я {genitive} сьогодні ще не бачив. Я {genitive} сьогодні ще не бачив. FALSE -Дай {dative} час. Дай {dative} час. FALSE -Не треба {accusative} засуджувати. Не треба {accusative} засуджувати. FALSE -Я пишаюся {instrumental}. Я пишаюся {instrumental}. FALSE -Розповіси мені про {prepositional}! Розповіси мені про {prepositional}! FALSE -Тобі варто познайомитися з {instrumental_with_preposition}. Тобі варто познайомитися з {instrumental_with_preposition}. FALSE -У {genitive_with_preposition} є кіт. У {genitive_with_preposition} є кіт. FALSE -{'nominative} чудов{adjective}. {'nominative} чудов{adjective}. FALSE -{'possessive} знайом{adjective} вміє грати на гітарі. {'possessive} знайом{adjective} вміють грати на гітарі. FALSE -{'nominative} зібра{reflexive_verb_past} на роботу. {'nominative} зібра{reflexive_verb_past} на роботу. FALSE -{'nominative} сказа{nonreflexive_verb_past}, що піде з нами! {'nominative} сказа{nonreflexive_verb_past}, що підуть з нами! FALSE -{'nominative} зробить це {definitive}. {'nominative} зроблять це {definitive}. FALSE +singular plural +Я чув, що {nominative} чудово танцює. Я чув, що {nominative} чудово танцює. +Я {genitive} сьогодні ще не бачив. Я {genitive} сьогодні ще не бачив. +Дай {dative} час. Дай {dative} час. +Не треба {accusative} засуджувати. Не треба {accusative} засуджувати. +Я пишаюся {instrumental}. Я пишаюся {instrumental}. +Розповіси мені про {prepositional}! Розповіси мені про {prepositional}! +Тобі варто познайомитися з {instrumental_with_preposition}. Тобі варто познайомитися з {instrumental_with_preposition}. +У {genitive_with_preposition} є кіт. У {genitive_with_preposition} є кіт. +{'nominative} чудов{adjective}. {'nominative} чудов{adjective}. +{'possessive} знайом{adjective} вміє грати на гітарі. {'possessive} знайом{adjective} вміють грати на гітарі. +{'nominative} зібра{reflexive_verb_past} на роботу. {'nominative} зібра{reflexive_verb_past} на роботу. +{'nominative} сказа{nonreflexive_verb_past}, що піде з нами! {'nominative} сказа{nonreflexive_verb_past}, що підуть з нами! +{'nominative} зробить це {definitive}. {'nominative} зроблять це {definitive}. diff --git a/locale/vi/pronouns/examples.tsv b/locale/vi/pronouns/examples.tsv index f32383ac5..b0acd5120 100644 --- a/locale/vi/pronouns/examples.tsv +++ b/locale/vi/pronouns/examples.tsv @@ -1,5 +1,5 @@ -singular plural isHonorific -{2nd_person} ơi, hôm nay {2nd_person} khỏe chứ? FALSE -Tôi thấy {3rd_person} thật tốt tính. FALSE -Tôi đã hỏi {3rd_person} cho tôi mượn cái bút chì của {3rd_person}. FALSE -{3rd_person} nói rằng {3rd_person} muốn làm cái này. FALSE +singular +{2nd_person} ơi, hôm nay {2nd_person} khỏe chứ? +Tôi thấy {3rd_person} thật tốt tính. +Tôi đã hỏi {3rd_person} cho tôi mượn cái bút chì của {3rd_person}. +{3rd_person} nói rằng {3rd_person} muốn làm cái này. diff --git a/locale/yi/pronouns/examples.tsv b/locale/yi/pronouns/examples.tsv index f8e0a6f58..707870bcf 100644 --- a/locale/yi/pronouns/examples.tsv +++ b/locale/yi/pronouns/examples.tsv @@ -1,6 +1,6 @@ -singular plural isHonorific -איך טראַכט ‎אַז {pronoun_n} איז זייער ליב. איך טראַכט ‎אַז {pronoun_n} זענען זייער ליב. FALSE -איז דאָס {pronoun_g} הויז? FALSE -איך האָב {pronoun_d} ערשט לעצטנס באַגעגנט. FALSE -איך פֿאַרשטיי {pronoun_a} זייער גוט. FALSE -איז דאָס {pronoun_n}, {article_n} וואָס האָט גערופן? זענען דאָס {pronoun_n}, {article_n} וואָס האָבן גערופן? FALSE +singular plural +איך טראַכט ‎אַז {pronoun_n} איז זייער ליב. איך טראַכט ‎אַז {pronoun_n} זענען זייער ליב. +איז דאָס {pronoun_g} הויז? +איך האָב {pronoun_d} ערשט לעצטנס באַגעגנט. +איך פֿאַרשטיי {pronoun_a} זייער גוט. +איז דאָס {pronoun_n}, {article_n} וואָס האָט גערופן? זענען דאָס {pronoun_n}, {article_n} וואָס האָבן גערופן? diff --git a/locale/zh/pronouns/examples.tsv b/locale/zh/pronouns/examples.tsv index 1b57cee6e..98cdbbecc 100644 --- a/locale/zh/pronouns/examples.tsv +++ b/locale/zh/pronouns/examples.tsv @@ -1,4 +1,4 @@ -singular plural isHonorific -{3rd_person}是一個非常好的學生。 FALSE -我可以借{2nd_person}的鉛筆嗎? FALSE -{3rd_person}告訴我那所房子是{3rd_person}的。 FALSE +singular +{3rd_person}是一個非常好的學生。 +我可以借{2nd_person}的鉛筆嗎? +{3rd_person}告訴我那所房子是{3rd_person}的。 From e9eb9aa615b0b9eeca57b173e1a8f5a064fef503 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Thu, 30 May 2024 12:46:34 +0200 Subject: [PATCH 7/7] (refactor) use unified papaparse config across all points of parsing and add typing to two files necessary for parsing single-column .tsv --- nuxt.config.ts | 8 ++------ plugins/data.d.ts | 31 +++++++++++++++++++++++++++++++ server/loader.ts | 10 +++------- server/routes/banner.js | 2 +- src/tsv.js | 10 ---------- src/tsv.ts | 13 +++++++++++++ test/locales/data.test.ts | 7 ++++--- 7 files changed, 54 insertions(+), 27 deletions(-) delete mode 100644 src/tsv.js create mode 100644 src/tsv.ts diff --git a/nuxt.config.ts b/nuxt.config.ts index ece9b5a5e..7d4db8c62 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -12,6 +12,7 @@ import type { Plugin as PostcssPlugin } from 'postcss'; import { buildList } from './src/helpers.ts'; import buildLocaleList from './src/buildLocaleList.ts'; import formatError from './src/error.js'; +import { tsvParseConfig } from './src/tsv.ts'; import type { Config } from './locale/config.ts'; import type { Translations } from './locale/translations.ts'; @@ -272,12 +273,7 @@ const nuxtConfig: NuxtConfig = { config.module!.rules.push({ test: /\.csv|\.tsv$/, loader: 'csv-loader', - options: { - dynamicTyping: true, - header: true, - skipEmptyLines: true, - delimiter: '\t', - }, + options: tsvParseConfig, }); config.module!.rules.push({ test: /\.suml$/, diff --git a/plugins/data.d.ts b/plugins/data.d.ts index f6ae877b4..ae2ab2e1d 100644 --- a/plugins/data.d.ts +++ b/plugins/data.d.ts @@ -1,6 +1,27 @@ import type { Config } from '../locale/config.ts'; import type { Translations } from '../locale/translations.ts'; +export interface PronounsData { + key: string; + description: string; + normative: string; + [morpheme: M]: string | null; + plural: string; + pluralHonorific: string; + pronounceable: string; + history?: string; + thirdForm?: M; + smallForm?: M; + sourcesInfo?: string; + hidden?: boolean; +} + +export interface PronounExamplesData { + singular: string; + plural?: string; + isHonorific?: boolean; +} + declare namespace Data { declare module '*/config.suml' { declare const config: Config; @@ -12,6 +33,16 @@ declare namespace Data { export default translations; } + declare module '*/pronouns/pronouns.tsv' { + declare const data: PronounsData[]; + export default data; + } + + declare module '*/pronouns/examples.tsv' { + declare const data: PronounExamplesData[]; + export default data; + } + declare module '*.tsv' { declare const data: Record[]; export default data; diff --git a/server/loader.ts b/server/loader.ts index 6834d18e1..f45674841 100644 --- a/server/loader.ts +++ b/server/loader.ts @@ -1,13 +1,9 @@ import fs from 'fs'; import Suml from 'suml'; -import Papa from 'papaparse'; + +import { loadTsv as baseLoadTsv } from '../src/tsv.ts'; export const loadSumlFromBase = (name: string): unknown => new Suml().parse(fs.readFileSync(`./${name}.suml`, 'utf-8')); export const loadSuml = (name: string): unknown => loadSumlFromBase(`data/${name}`); -export const loadTsv = (name: string): unknown => Papa.parse(fs.readFileSync(`./data/${name}.tsv`).toString(), { - dynamicTyping: true, - header: true, - skipEmptyLines: true, - delimiter: '\t', -}).data; +export const loadTsv = (name: string): T[] => baseLoadTsv(`./data/${name}.tsv`); diff --git a/server/routes/banner.js b/server/routes/banner.js index 92305d48e..509b2c57b 100644 --- a/server/routes/banner.js +++ b/server/routes/banner.js @@ -4,7 +4,7 @@ import { createCanvas, loadImage } from 'canvas'; import { loadSuml, loadSumlFromBase } from '../loader.ts'; import avatar from '../avatar.ts'; import { buildPronoun, parsePronouns } from '../../src/buildPronoun.ts'; -import { loadTsv } from '../../src/tsv.js'; +import { loadTsv } from '../../src/tsv.ts'; import { handleErrorAsync } from '../../src/helpers.ts'; import { Translator } from '../../src/translator.js'; import { CacheObject } from '../../src/cache.js'; diff --git a/src/tsv.js b/src/tsv.js deleted file mode 100644 index 34729b444..000000000 --- a/src/tsv.js +++ /dev/null @@ -1,10 +0,0 @@ -import Papa from 'papaparse'; -import fs from 'fs'; - -export const loadTsv = (filename) => { - return Papa.parse(fs.readFileSync(filename).toString('utf-8'), { - dynamicTyping: true, - header: true, - skipEmptyLines: true, - }).data; -}; diff --git a/src/tsv.ts b/src/tsv.ts new file mode 100644 index 000000000..cfe508ee0 --- /dev/null +++ b/src/tsv.ts @@ -0,0 +1,13 @@ +import Papa from 'papaparse'; +import fs from 'fs'; + +export const tsvParseConfig = { + dynamicTyping: true, + header: true, + skipEmptyLines: true, + delimiter: '\t', +}; + +export const loadTsv = (filename: string): T[] => { + return Papa.parse(fs.readFileSync(filename).toString('utf-8'), tsvParseConfig).data as T[]; +}; diff --git a/test/locales/data.test.ts b/test/locales/data.test.ts index 817dd7786..0b7e6aedb 100644 --- a/test/locales/data.test.ts +++ b/test/locales/data.test.ts @@ -1,11 +1,12 @@ import { describe, expect, test } from '@jest/globals'; import allLocales from '../../locale/locales.ts'; -import { loadTsv } from '../../src/tsv.js'; +import { loadTsv } from '../../src/tsv.ts'; import { Example } from '../../src/classes.ts'; import type { ExpectationResult } from 'expect'; import { loadSumlFromBase } from '../../server/loader.ts'; import type { Config } from '../../locale/config.ts'; +import type { PronounExamplesData, PronounsData } from '../../plugins/data'; const __dirname = new URL('.', import.meta.url).pathname; @@ -38,11 +39,11 @@ expect.extend({ toHaveValidMorphemes }); describe.each(allLocales)('data files of $code', ({ code }) => { const config = loadSumlFromBase(`locale/${code}/config`) as Config; - const examples = loadTsv(`${__dirname}/../../locale/${code}/pronouns/examples.tsv`); + const examples = loadTsv(`${__dirname}/../../locale/${code}/pronouns/examples.tsv`); test('pronouns/pronouns.tsv match schema', async () => { const { default: MORPHEMES } = await import(`../../locale/${code}/pronouns/morphemes.js`); - const pronouns = loadTsv(`${__dirname}/../../locale/${code}/pronouns/pronouns.tsv`); + const pronouns = loadTsv>(`${__dirname}/../../locale/${code}/pronouns/pronouns.tsv`); if (pronouns.length === 0) { return; }