diff --git a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Stats.cs b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Stats.cs index b5ccbe18..d7f31a28 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Stats.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Partials/GanjoorService-Stats.cs @@ -328,6 +328,7 @@ namespace RMuseum.Services.Implementation List coupletCountsList = new List(); int maxCouplets = 0; + int minCouplets = 100000; foreach (var coupletCount in groupedCoupletCounts) { coupletCountsList.Add(new SectionCoupletCount() { CoupletCount = coupletCount.Key, Count = coupletCount.Value }); @@ -335,12 +336,16 @@ namespace RMuseum.Services.Implementation { maxCouplets = coupletCount.Key; } + if (coupletCount.Key < minCouplets) + { + minCouplets = coupletCount.Key; + } } coupletCountsList.Sort((a, b) => b.Count - a.Count); int cc = coupletCountsList.Sum(c => c.Count); if (coupletCountsList.Count > 0 && cc > 0) { - htmlText += $"

آمار فراوانی تعداد ابیات اشعار {poet.Nickname} به شرح زیر است (بلندترین شعر شامل {maxCouplets.ToPersianNumbers()} بیت شعر است):

{Environment.NewLine}"; + htmlText += $"

آمار فراوانی تعداد ابیات اشعار {poet.Nickname} به شرح زیر است (بلندترین شعر شامل {maxCouplets.ToPersianNumbers()} بیت و کوتاه‌ترین شامل {minCouplets.ToPersianNumbers()} بیت شعر است):

{Environment.NewLine}"; htmlText += $"{Environment.NewLine}" + $"{Environment.NewLine}" + @@ -659,6 +664,7 @@ namespace RMuseum.Services.Implementation List coupletCountsList = new List(); int maxCouplets = 0; + int minCouplets = 100000; foreach (var coupletCount in groupedCoupletCounts) { coupletCountsList.Add(new SectionCoupletCount() { CoupletCount = coupletCount.Key, Count = coupletCount.Value }); @@ -666,12 +672,16 @@ namespace RMuseum.Services.Implementation { maxCouplets = coupletCount.Key; } + if (coupletCount.Key < minCouplets) + { + minCouplets = coupletCount.Key; + } } coupletCountsList.Sort((a, b) => b.Count - a.Count); int cc = coupletCountsList.Sum(c => c.Count); if (coupletCountsList.Count > 0 && cc > 0) { - htmlText += $"

آمار فراوانی تعداد ابیات اشعار این بخش به شرح زیر است (بلندترین شعر شامل {maxCouplets.ToPersianNumbers()} بیت شعر است):

{Environment.NewLine}"; + htmlText += $"

آمار فراوانی تعداد ابیات اشعار این بخش به شرح زیر است (بلندترین شعر شامل {maxCouplets.ToPersianNumbers()} بیت و کوتاه‌ترین شامل {minCouplets.ToPersianNumbers()} بیت شعر است):

{Environment.NewLine}"; htmlText += $"
{Environment.NewLine}" + $"{Environment.NewLine}" +