comparison of usage stats of a selected word among all poets #471

This commit is contained in:
Hamid Reza Mohammadi 2025-03-08 19:41:04 +03:30
parent eca6b42c05
commit 25e2722ba2
31 changed files with 107 additions and 105 deletions

View File

@ -14,7 +14,7 @@
<meta name="robots" content="noindex, nofollow" />
<title>پیشنهاد اضافه شدن مصرع‌های جا افتاده</title>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<style>
label {
width: 100px;

View File

@ -15,7 +15,7 @@
گنجور » نمایش خوانش
</title>
<link href="~/dist/skin/pink.flag/css/jplayer.pink.flag.min.css" rel="stylesheet" type="text/css" />
<link href="~/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="~/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script>

View File

@ -12,7 +12,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -12,7 +12,7 @@
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link href="/css/spotify.css" rel="stylesheet" type="text/css" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -14,7 +14,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />

View File

@ -12,7 +12,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -11,7 +11,7 @@
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link href="/css/spotify.css" rel="stylesheet" type="text/css" />
<script src="/lib/jquery/dist/jquery.min.js"></script>
<script src="~/js/golha.js"></script>

View File

@ -14,7 +14,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -12,7 +12,7 @@
<title>
@Html.Raw(ViewData["Title"])
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css">
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css">
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon">
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml">
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -13,7 +13,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
</head>
<body class="bk-background">
<div id="hdr">

View File

@ -12,7 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="سخنوران و نویسندگان گنجور روی نقشهٔ جغرافیایی" />
<meta charset="utf-8" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/css/leaflet.css" />
<style>
.leaflet-container {

View File

@ -11,7 +11,7 @@
<title>
@Html.Raw(ViewData["Title"])
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -12,7 +12,7 @@
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link href="/css/spotify.css" rel="stylesheet" type="text/css" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -12,7 +12,7 @@
<title>
@Html.Raw(ViewData["Title"])
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -12,7 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex, nofollow" />
<title>اطلاعات رتبه‌بندی خوانش‌های شعر</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
</head>
<body>

View File

@ -11,7 +11,7 @@
<meta name="robots" content="noindex, nofollow" />
<title>درخواست حذف حاشیه</title>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<style>
label {
width: 100px;

View File

@ -13,7 +13,7 @@
<meta name="robots" content="noindex, nofollow" />
<title>گنجور » گزارش خطا در خوانش</title>
<script src="/lib/jquery/dist/jquery.min.js"></script>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link href="~/dist/skin/pink.flag/css/jplayer.pink.flag.min.css" rel="stylesheet" type="text/css" />
<style>
label {

View File

@ -11,7 +11,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
</head>
<body class="bk-background">
<div id="hdr">

View File

@ -17,7 +17,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="/js/chart.js"></script>
@ -31,41 +31,7 @@
var stickyEnabled = cookieValue != "false";
</script>
<script>
function deletePoetFromSearch(poetId, poetName){
if(!confirm('آیا می‌خواهید '+ poetName+ ' را از نتایج حذف کنید؟')) return;
const currentUrl = new URL(window.location.href);
const params = currentUrl.searchParams;
params.append('e', poetId.toString());
currentUrl.search = params.toString();
window.location.href = currentUrl.toString();
}
</script>
<style>
.expandable-container-wrapper {
position: relative;
}
.expandable-content {
width: 100%;
overflow: hidden;
transition: height 0.3s ease-out;
position: relative;
}
/* Blurred bottom overlay effect */
.expandable-blur-overlay {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 200px; /* Height of the blur effect */
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
pointer-events: none; /* Prevents interaction */
transition: opacity 0.3s ease-out;
}
</style>
</head>
<body>
@ -235,7 +201,7 @@
<div class="expandable-container-wrapper">
<div class="expandable-content" id="expandableContent">
<div id="wordcounts-placeholder">
<a href="javascript:loadWordCountsByPoet('@Model.Query')" id="load-word-counts" class="pagebutton comments-link">
<a href="javascript:loadWordCountsByPoet('@Model.Query', @Model.PoetId, @Model.CatId)" id="load-word-counts" class="pagebutton comments-link">
مشاهدهٔ بسامد واژگان «@Model.Query» به تفکیک سخنور
<svg class="noindent-info-button" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#5f6368"><g><rect fill="none" height="24" width="24" /></g><g><g><g><path d="M7.5,4C5.57,4,4,5.57,4,7.5S5.57,11,7.5,11S11,9.43,11,7.5S9.43,4,7.5,4z M7.5,9C6.67,9,6,8.33,6,7.5S6.67,6,7.5,6 S9,6.67,9,7.5S8.33,9,7.5,9z M16.5,13c-1.93,0-3.5,1.57-3.5,3.5s1.57,3.5,3.5,3.5s3.5-1.57,3.5-3.5S18.43,13,16.5,13z M16.5,18 c-0.83,0-1.5-0.67-1.5-1.5s0.67-1.5,1.5-1.5s1.5,0.67,1.5,1.5S17.33,18,16.5,18z M5.41,20L4,18.59L18.59,4L20,5.41L5.41,20z" /></g></g></g></svg>
</a>
@ -350,7 +316,7 @@
@if (Model.QueryIsSingleWord)
{
<script>
loadWordCountsByPoet('@Model.QueryDin');
loadWordCountsByPoet('@Model.QueryDin', @Model.PoetId, @Model.CatId);
</script>
}

View File

@ -164,7 +164,7 @@ namespace GanjooRazor.Pages
{
get
{
return Request.Query["s"].ApplyCorrectYeKe().Trim();
return Query.ApplyCorrectYeKe().Trim().Replace("\"", "");
}
}
@ -456,14 +456,29 @@ namespace GanjooRazor.Pages
return htmlText;
}
public async Task<ActionResult> OnGetWordCountsByPoetAsync(string term)
public async Task<ActionResult> OnGetWordCountsByPoetAsync(string term, int poetId, int catId)
{
if (term == null) return new BadRequestObjectResult("term is null");
term = term.Replace("\"", "");
if (!string.IsNullOrEmpty(term))
{
term = term.Trim();
}
var wordCountsResponse = await _httpClient.GetAsync($"{APIRoot.Url}/api/ganjoor/wordcounts/bypoet?term={term}&PageNumber=1&PageSize=1000");
else
{
if (term == null) return new BadRequestObjectResult("term is empty");
}
string url = $"{APIRoot.Url}/api/ganjoor/wordcounts/bycat?term={term}";
if(poetId != 0)
{
url += $"&poetId={poetId}";
}
if (catId != 0)
{
url += $"&catId={catId}";
}
var wordCountsResponse = await _httpClient.GetAsync(url);
if (!wordCountsResponse.IsSuccessStatusCode)
{

View File

@ -10,7 +10,7 @@
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
<link href="/dist/skin/blue.monday/css/jplayer.blue.monday.min.css" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="~/lib/jquery/dist/jquery.min.js"></script>

View File

@ -9,7 +9,7 @@
</title>
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="~/lib/jquery/dist/jquery.min.js"></script>

View File

@ -12,7 +12,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
</head>
<body class="bk-background">
<div id="hdr">

View File

@ -14,7 +14,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="/lib/jquery/dist/jquery.min.js"></script>
@ -27,16 +27,6 @@
var stickyEnabled = cookieValue != "false";
</script>
<script>
function deletePoetFromSearch(poetId, poetName){
if(!confirm('آیا می‌خواهید '+ poetName+ ' را از نتایج حذف کنید؟')) return;
const currentUrl = new URL(window.location.href);
const params = currentUrl.searchParams;
params.append('e', poetId.toString());
currentUrl.search = params.toString();
window.location.href = currentUrl.toString();
}
</script>
@if (Model.CanEdit)
{

View File

@ -12,7 +12,7 @@
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link href="/css/spotify.css" rel="stylesheet" type="text/css" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -14,7 +14,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
<script src="/lib/jquery/dist/jquery.min.js"></script>

View File

@ -14,7 +14,7 @@
گنجور » برگردان‌ها و نویس‌های شعر
</title>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<link href="~/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="~/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />
</head>

View File

@ -14,7 +14,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />

View File

@ -15,7 +15,7 @@
@ViewData["Title"]
</title>
<link href="/css/p8.css?version=78" rel="stylesheet" type="text/css" />
<link href="/css/p8.css?version=79" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" href="/favicon.ico?version=1" type="image/x-icon" />
<link rel="search" type="application/opensearchdescription+xml" title="گنجور" href="https://ganjoor.net/search.xml" />

View File

@ -247,33 +247,33 @@ select {
border-top: 1px dashed;
}
#tab-items{
border:none !important;
#tab-items {
border: none !important;
}
.poemtablinks {
display: inline-table;
}
.poet .caption{
display: block;
width: 100%;
font-family: Vazir;
font-weight: 300;
font-size: 0.8em;
text-align: center;
margin-bottom: 30px;
}
.poet .caption {
display: block;
width: 100%;
font-family: Vazir;
font-weight: 300;
font-size: 0.8em;
text-align: center;
margin-bottom: 30px;
}
.poet .caption a, .poemtablinks a {
border-radius: 5px;
display: block;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
padding: 5px;
background-color: darkred;
border-radius: 5px;
margin-top: 5px;
}
.poet .caption a, .poemtablinks a {
border-radius: 5px;
display: block;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
padding: 5px;
background-color: darkred;
border-radius: 5px;
margin-top: 5px;
}
.caption, .poemtablinks {
@ -293,10 +293,10 @@ select {
background-color: #300;
}
#fa .active a{
font-weight: bold;
background-color: #300;
}
#fa .active a {
font-weight: bold;
background-color: #300;
}
.width-100per {
width: 100% !important;
@ -2180,6 +2180,7 @@ mark {
.footer-icon {
fill: #300;
}
.tabcontent {
display: none;
}
@ -2207,6 +2208,29 @@ mark {
background-color: rgb(51, 0, 0);
}
.expandable-container-wrapper {
position: relative;
}
.expandable-content {
width: 100%;
overflow: hidden;
transition: height 0.3s ease-out;
position: relative;
}
/* Blurred bottom overlay effect */
.expandable-blur-overlay {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 200px; /* Height of the blur effect */
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
pointer-events: none; /* Prevents interaction */
transition: opacity 0.3s ease-out;
}
@media(prefers-color-scheme: dark) {
body {
background: rgba(0, 0, 0, 0.9);

View File

@ -1695,13 +1695,13 @@ function onSearchWordCounts(catId, poetId, totalWordCount) {
}, 500);
}
function loadWordCountsByPoet(term) {
function loadWordCountsByPoet(term, poetId, catId) {
var divParent = document.getElementById('wordcounts-placeholder');
var imgElementId = 'loadingwordcountsimg';
divParent.innerHTML = divParent.innerHTML + '<div class="bnumdiv" id="remove-this-wordcounts"><img id="' + imgElementId + '" src="/image/loading.gif" alt="بارگذاری"/></div>';
$.ajax({
type: "GET",
url: '?Handler=WordCountsByPoet&term='+term,
url: '?Handler=WordCountsByPoet&term=' + term + '&poetId=' + poetId.toString() + '&catId=' + catId.toString(),
error: function () {
if (document.getElementById("remove-this-wordcounts") != null) {
document.getElementById("remove-this-wordcounts").remove();
@ -1864,5 +1864,12 @@ function plotChart(tableId) {
});
}
function deletePoetFromSearch(poetId, poetName) {
if (!confirm('آیا می‌خواهید ' + poetName + ' را از نتایج حذف کنید؟')) return;
const currentUrl = new URL(window.location.href);
const params = currentUrl.searchParams;
params.append('e', poetId.toString());
currentUrl.search = params.toString();
window.location.href = currentUrl.toString();
}