代词

fbt:pronounfbt.pronoun 都需要一个必需的 PRONOUN_USAGE 枚举和一个 GenderConst 枚举

const PRONOUN_USAGE = {
OBJECT: 0,
POSSESSIVE: 1,
REFLEXIVE: 2,
SUBJECT: 3,
}
const GenderConst = {
NOT_A_PERSON: 0
FEMALE_SINGULAR: 1
MALE_SINGULAR: 2
FEMALE_SINGULAR_GUESS: 3
MALE_SINGULAR_GUESS: 4
MIXED_UNKNOWN: 5
NEUTER_SINGULAR: 6
UNKNOWN_SINGULAR: 7
FEMALE_PLURAL: 8
MALE_PLURAL: 9
NEUTER_PLURAL: 10
UNKNOWN_PLURAL: 11
}

注意:这与 fbt:paramfbt:namesubject 中使用的性别不同!
在这些情况下使用的 IntlVariations 只有 GENDER_MALEGENDER_FEMALEGENDER_UNKNOWN

代词示例:

<fbt desc="pronoun example">
<fbt:param name="name">{ent.getName()}</fbt:param>
分享了
<fbt:pronoun type="possessive" gender={ent.getPronounGender()} human={true} />
和你的照片。
</fbt>

可选属性

  • capitalize bool:是否在源字符串中将代词大写。
  • human bool:是否在生成的文本变体中省略 NOT_A_PERSON 选项。

上面的例子生成

{
"hashToLeaf": {
"I/p+TWpGhrtv9gnABybPMw==": {
"text": "{name} 分享了她的照片。",
"desc": "pronoun example",
},
"3Yb/zNhF8nZ8aR+NSPaeJQ==": {
"text": "{name} 分享了他的照片。",
"desc": "pronoun example",
},
"JYTtgHGMpBOM2Vrc9JLeUw==": {
"text": "{name} 分享了他们的照片。"
"desc": "pronoun example",
},
},
...,
"type": "table",
"jsfbt": {
"t": {
"1": "{name} 分享了她的照片。",
"2": "{name} 分享了他的照片。",
"*": "{name} 分享了他们的照片。"
},
"m": [
null
]
}
}

组合

从概念上讲,代词的工作方式就好像为给定的 type 提供了 enum 一样。 下面是各种类型的可能值的表格。 请注意 reflexiveobject 有 4 种类型

subject: he/she/they (他/她/他们)
possessive: his/her/their (他的/她的/他们的)
reflexive: himself/herself/themselves/themself (他自己/她自己/他们自己/ta 自己)
object: him/her/them/this (他/她/他们/这个)
V 名称 主语 属格 反身代词 宾语
=============================================================
0 NOT_A_PERSON they their themself this (他们 他们的 ta 自己 这个)
1 FEMALE_SINGULAR she her herself her (她 她的 她自己 她)
2 MALE_SINGULAR he his himself him (他 他的 他自己 他)
3 FEMALE_SINGULAR_GUESS she her herself her (她 她的 她自己 她)
4 MALE_SINGULAR_GUESS he his himself him (他 他的 他自己 他)
5 MIXED_UNKNOWN they their themselves them (他们 他们的 他们自己 他们)
6 NEUTER_SINGULAR they their themself them (它们 它们的 ta 自己 它们)
7 UNKNOWN_SINGULAR they their themself them (他们 他们的 ta 自己 他们)
8 FEMALE_PLURAL they their themselves them (她们 她们的 她们自己 她们)
9 MALE_PLURAL they their themselves them (他们 他们的 他们自己 他们)
10 NEUTER_PLURAL they their themselves them (它们 它们的 它们自己 它们)
11 UNKNOWN_PLURAL they their themselves them (他们 他们的 他们自己 他们)
上次更新于 David