Calculates Chinese kinship relationship names (亲戚关系计算器). Use when the user asks how to address a relative, what to call someone given a relation chain (e.g. 爸爸的妈妈的弟弟), or for 亲戚/称呼/称谓. Uses the relationship.js npm package.
Resolve Chinese kinship relation chains to the correct form of address (称呼). User inputs a chain like 爸爸的妈妈的弟弟 and gets the kin name(s), e.g. 舅外公 / 舅爷爷.
Uses the relationship.js npm package ( mumuy/relationship ). Install in the skill directory:
cd workspace/skills/ChineseKinRelationship
npm install
Pass the relation chain as a single argument (use quotes if it contains spaces or special chars):
node scripts/calc.mjs "爸爸的妈妈的弟弟"
# => ["舅爷爷"]
node scripts/calc.mjs "妈妈的妈妈的哥哥"
# => ["舅外公"]
node scripts/calc.mjs "外婆的哥哥"
# => ["舅外公"]
Reply to the user with the resulting 称呼 (one or more options). If multiple results, list them (e.g. "舅外公 或 舅爷爷").
When integrating in Node:
const relationship = require('relationship.js');
// 我称呼对方:关系链 → 称呼
relationship({ text: '爸爸的妈妈的弟弟' });
// => ['舅外公', '舅爷爷']
// 对方称呼我(reverse: true)
relationship({ text: '七舅姥爷', reverse: true, sex: 1 });
// => ['甥外孙']
// 称呼 → 关系链(type: 'chain')
relationship({ text: '舅公', type: 'chain' });
// => ['爸爸的妈妈的兄弟', '妈妈的妈妈的兄弟', ...]
// 两人关系合称(type: 'pair')
relationship({ text: '外婆', target: '奶奶', type: 'pair' });
// => ['儿女亲家']
Options:
| Option | Meaning |
|---|---|
text | Relation chain (的 separated) or a single 称呼 when type is 'chain' |
target | For type 'pair': second person's 称呼 |
sex | 0 = 女性, 1 = 男性 (affects 称呼 when ambiguous) |
reverse | true = 对方称呼我, false = 我称呼对方 |
type | 'default' = 称呼, 'chain' = 关系链, 'pair' = 两人合称 |
| User query / input | Output (examples) |
|---|---|
| 爸爸的妈妈的弟弟 | 舅爷爷 |
| 妈妈的妈妈的哥哥 | 舅外公 |
| 外婆的哥哥 | 舅外公 |
| 七舅姥爷应该叫我什么? | 甥外孙 (use reverse:true, sex:1) |
| 舅公是什么亲戚? | 爸爸的妈妈的兄弟 等 (use type:'chain') |