people tags #387

This commit is contained in:
Hamid Reza Mohammadi 2026-10-03 21:16:42 +03:30
parent dfe514c55e
commit 3493225dc5
9 changed files with 105 additions and 6 deletions

View File

@ -34,6 +34,9 @@
case PersonAffiliationType.Successor: return "جانشین";
case PersonAffiliationType.Panegyrized: return "مدح‌گو";
case PersonAffiliationType.Satirized: return "هجوگو";
case PersonAffiliationType.MilitaryCommander: return "سردار";
case PersonAffiliationType.Champion: return "پهلوان";
case PersonAffiliationType.Contemporary: return "هم‌عصر";
case PersonAffiliationType.Other: return "نوع دیگر";
default: return t.ToString();
}

View File

@ -264,6 +264,9 @@
'<option value="Rival">رقیب</option>' +
'<option value="Panegyrized">مدح‌گو (طرف اول، طرف دوم را مدح کرده)</option>' +
'<option value="Satirized">هجوگو (طرف اول، طرف دوم را هجو کرده)</option>' +
'<option value="MilitaryCommander">سردار</option>' +
'<option value="Champion">پهلوان</option>' +
'<option value="Contemporary">هم‌عصر (بدون نسبت دیگر)</option>' +
'<option value="Other">سایر</option>' +
'</select>' +
'</div>' +
@ -378,6 +381,9 @@
Ally: function (p1, p2) { return p1 + ' و ' + p2 + ' متحد هم هستند.'; },
Rival: function (p1, p2) { return p1 + ' و ' + p2 + ' رقیب هم هستند.'; },
Companion: function (p1, p2) { return p1 + ' و ' + p2 + ' همراه هم هستند.'; },
MilitaryCommander: function (p1, p2) { return p1 + ' سردار ' + p2 + ' است.'; },
Champion: function (p1, p2) { return p1 + ' پهلوان ' + p2 + ' است.'; },
Contemporary: function (p1, p2) { return p1 + ' و ' + p2 + ' هم‌عصر هم هستند.'; },
Other: function (p1, p2) { return p1 + ' با ' + p2 + ' نسبتی دارد (طبق یادداشت).'; }
}
};

View File

@ -98,9 +98,14 @@ else
<option value="Panegyrized_Subject">این نامبرده در شعری او را مدح/ستایش کرد (مدح‌گوی او بود)</option>
<option value="Satirized_Other">او در شعری این نامبرده را هجو کرد (هجوگوی او بود)</option>
<option value="Satirized_Subject">این نامبرده در شعری او را هجو کرد (هجوگوی او بود)</option>
<option value="MilitaryCommander_Other">او سردار این نامبرده بود</option>
<option value="MilitaryCommander_Subject">این نامبرده سردار او بود</option>
<option value="Champion_Other">او پهلوان این نامبرده بود</option>
<option value="Champion_Subject">این نامبرده پهلوان او بود</option>
<option value="Ally">با او متحد/هم‌پیمان بود</option>
<option value="Rival">با او رقیب/دشمن بود</option>
<option value="Companion">با او همراه/همدم بود</option>
<option value="Contemporary">هم‌عصر او بود (بدون نسبت دیگر)</option>
<option value="Other">نوع دیگر (در یادداشت توضیح دهید)</option>
</select>
</td>

View File

@ -147,10 +147,10 @@ namespace GanjooRazor.Areas.User.Pages
// OtherIsPerson1/SubjectIsPerson1 pairs translate the direction-aware choice into the
// symmetric Person1Id/Person2Id pair, following the direction each PersonAffiliationType
// value's own doc comment defines (Minister/Advisor/Courtier/Servant: Person1 is the
// subordinate one; Patron/Successor: Person1 is the patron/later one; Panegyrized/
// Satirized: Person1 is the poet; Ally/Rival/Companion/Other: symmetric, direction
// doesn't matter)
// value's own doc comment defines (Minister/Advisor/Courtier/Servant/MilitaryCommander/
// Champion: Person1 is the subordinate one; Patron/Successor: Person1 is the
// patron/later one; Panegyrized/Satirized: Person1 is the poet; Ally/Rival/Companion/
// Contemporary/Other: symmetric, direction doesn't matter)
switch (AffiliationKind)
{
case "Minister_Other": // the other person served as minister to this one
@ -233,6 +233,26 @@ namespace GanjooRazor.Areas.User.Pages
suggestion.Person2Id = OtherPersonId;
suggestion.SuggestedAffiliationType = PersonAffiliationType.Satirized;
break;
case "MilitaryCommander_Other": // the other person served as military commander (سردار) to this one
suggestion.Person1Id = OtherPersonId;
suggestion.Person2Id = personId;
suggestion.SuggestedAffiliationType = PersonAffiliationType.MilitaryCommander;
break;
case "MilitaryCommander_Subject": // this person served as military commander (سردار) to the other one
suggestion.Person1Id = personId;
suggestion.Person2Id = OtherPersonId;
suggestion.SuggestedAffiliationType = PersonAffiliationType.MilitaryCommander;
break;
case "Champion_Other": // the other person was champion/warrior (پهلوان) to this one
suggestion.Person1Id = OtherPersonId;
suggestion.Person2Id = personId;
suggestion.SuggestedAffiliationType = PersonAffiliationType.Champion;
break;
case "Champion_Subject": // this person was champion/warrior (پهلوان) to the other one
suggestion.Person1Id = personId;
suggestion.Person2Id = OtherPersonId;
suggestion.SuggestedAffiliationType = PersonAffiliationType.Champion;
break;
case "Ally":
suggestion.Person1Id = personId;
suggestion.Person2Id = OtherPersonId;
@ -248,6 +268,11 @@ namespace GanjooRazor.Areas.User.Pages
suggestion.Person2Id = OtherPersonId;
suggestion.SuggestedAffiliationType = PersonAffiliationType.Companion;
break;
case "Contemporary": // symmetric - no other relationship implied, just overlapping lifetimes
suggestion.Person1Id = personId;
suggestion.Person2Id = OtherPersonId;
suggestion.SuggestedAffiliationType = PersonAffiliationType.Contemporary;
break;
case "Other":
suggestion.Person1Id = personId;
suggestion.Person2Id = OtherPersonId;

View File

@ -66,9 +66,12 @@ else
<option value="@((int)PersonAffiliationType.Successor)">جانشین (طرف اول، جانشین طرف دوم است)</option>
<option value="@((int)PersonAffiliationType.Panegyrized)">مدح‌گو (طرف اول، طرف دوم را مدح کرده است)</option>
<option value="@((int)PersonAffiliationType.Satirized)">هجوگو (طرف اول، طرف دوم را هجو کرده است)</option>
<option value="@((int)PersonAffiliationType.MilitaryCommander)">سردار (طرف اول، سردار طرف دوم بوده است)</option>
<option value="@((int)PersonAffiliationType.Champion)">پهلوان (طرف اول، پهلوان طرف دوم بوده است)</option>
<option value="@((int)PersonAffiliationType.Ally)">متحد/هم‌پیمان</option>
<option value="@((int)PersonAffiliationType.Rival)">رقیب/دشمن</option>
<option value="@((int)PersonAffiliationType.Companion)">همراه/همدم</option>
<option value="@((int)PersonAffiliationType.Contemporary)">هم‌عصر (بدون نسبت دیگر)</option>
<option value="@((int)PersonAffiliationType.Other)">نوع دیگر (در یادداشت توضیح دهید)</option>
</select>
<p class="up-hint"><small>جهت وابستگی (کدام طرف زیردست/حامی/... است) قابل تغییر نیست؛ در صورت اشتباه بودن جهت، این وابستگی را حذف و یکی تازه پیشنهاد کنید.</small></p>

View File

@ -115,12 +115,16 @@ namespace GanjooRazor.Pages
{ PersonAffiliationType.Successor, "جانشینِ" },
{ PersonAffiliationType.Panegyrized, "مدح‌گویِ" },
{ PersonAffiliationType.Satirized, "هجوگویِ" },
{ PersonAffiliationType.MilitaryCommander, "سردارِ" },
{ PersonAffiliationType.Champion, "پهلوانِ" },
{ PersonAffiliationType.Contemporary, "هم‌عصرِ" },
{ PersonAffiliationType.Other, "دارای نسبتی (به یادداشت نگاه کنید) با" },
};
private static bool IsSymmetricAffiliation(PersonAffiliationType t) =>
t == PersonAffiliationType.Ally || t == PersonAffiliationType.Rival ||
t == PersonAffiliationType.Companion || t == PersonAffiliationType.Other;
t == PersonAffiliationType.Companion || t == PersonAffiliationType.Contemporary ||
t == PersonAffiliationType.Other;
public async Task<IActionResult> OnGetAsync(int id)
{

View File

@ -8,7 +8,8 @@
// person2Id, person2Name, category, typeValue, degreeHint, note}] } where category is
// "Relation" (typeValue is PersonRelationType: 0=Parent,1=Sibling,2=Spouse,3=Ancestor) or
// "Affiliation" (typeValue is PersonAffiliationType: 0=Minister,1=Advisor,2=Courtier,3=Patron,
// 4=Ally,5=Rival,6=Servant,7=Companion,8=Successor,9=Panegyrized,10=Satirized,99=Other). directlyTagged is false only on
// 4=Ally,5=Rival,6=Servant,7=Companion,8=Successor,9=Panegyrized,10=Satirized,11=MilitaryCommander,
// 12=Champion,13=Contemporary,99=Other). directlyTagged is false only on
// the category-scoped graph (GET api/ganjoor/cat/{id}/persongraph, the "characters in this work"
// tab): such a node was pulled in as a one-hop relative/affiliate of someone actually named in the
// work's verses, and is never false on the whole-site graph fed by PeopleExplorer.cshtml. importance

View File

@ -70,6 +70,32 @@ namespace RMuseum.Models.Ganjoor
/// </summary>
Satirized = 10,
/// <summary>
/// Person1 served as a military commander/general (سردار) under Person2 - directional, same
/// subordinate-side convention as Minister/Advisor/Courtier, but deliberately kept separate
/// from Courtier: a سردار's tie to Person2 is a military command relationship, not a court
/// role, and (unlike e.g. Minister, which implies one standing appointment) doesn't imply the
/// tie held continuously - a commander could serve across campaigns/kings, with specifics
/// (which campaign, how long) left to Note
/// </summary>
MilitaryCommander = 11,
/// <summary>
/// Person1 was a champion/legendary warrior (پهلوان) associated with Person2 - directional,
/// same subordinate-side convention as MilitaryCommander, but distinct from it: a پهلوان's
/// standing comes from individual prowess/heroism (e.g. Rostam), not from holding a command
/// post, and like MilitaryCommander this doesn't imply a permanent/continuous tie
/// </summary>
Champion = 12,
/// <summary>
/// Person1 and Person2 lived in the same era (هم‌عصر), with no other relationship between
/// them necessarily known/implied - symmetric (order doesn't matter). Unlike every other
/// value here, this doesn't assert any kind of tie or interaction, only overlapping lifetimes;
/// use one of the other types instead whenever an actual relationship is known
/// </summary>
Contemporary = 13,
/// <summary>
/// doesn't fit any of the above - rely on Note for what the tie actually is
/// </summary>

View File

@ -11926,6 +11926,32 @@
the satire's target) - directional, same convention as Minister/Patron
</summary>
</member>
<member name="F:RMuseum.Models.Ganjoor.PersonAffiliationType.MilitaryCommander">
<summary>
Person1 served as a military commander/general (سردار) under Person2 - directional, same
subordinate-side convention as Minister/Advisor/Courtier, but deliberately kept separate
from Courtier: a سردار's tie to Person2 is a military command relationship, not a court
role, and (unlike e.g. Minister, which implies one standing appointment) doesn't imply the
tie held continuously - a commander could serve across campaigns/kings, with specifics
(which campaign, how long) left to Note
</summary>
</member>
<member name="F:RMuseum.Models.Ganjoor.PersonAffiliationType.Champion">
<summary>
Person1 was a champion/legendary warrior (پهلوان) associated with Person2 - directional,
same subordinate-side convention as MilitaryCommander, but distinct from it: a پهلوان's
standing comes from individual prowess/heroism (e.g. Rostam), not from holding a command
post, and like MilitaryCommander this doesn't imply a permanent/continuous tie
</summary>
</member>
<member name="F:RMuseum.Models.Ganjoor.PersonAffiliationType.Contemporary">
<summary>
Person1 and Person2 lived in the same era (هم‌عصر), with no other relationship between
them necessarily known/implied - symmetric (order doesn't matter). Unlike every other
value here, this doesn't assert any kind of tie or interaction, only overlapping lifetimes;
use one of the other types instead whenever an actual relationship is known
</summary>
</member>
<member name="F:RMuseum.Models.Ganjoor.PersonAffiliationType.Other">
<summary>
doesn't fit any of the above - rely on Note for what the tie actually is