youssefreda9 commited on
Commit
400e996
·
1 Parent(s): 8804f87

fix: grammar/quran icons different, tooltip no strikethrough, punctuation no duplicate dots

Browse files
Files changed (3) hide show
  1. src/app.py +7 -0
  2. src/css/components.css +4 -4
  3. src/index.html +2 -2
src/app.py CHANGED
@@ -1664,6 +1664,13 @@ def analyze_text():
1664
  from nlp.punctuation.punctuation_service import get_punctuation_model
1665
  punc_checker = get_punctuation_model()
1666
  corrected_punc = punc_checker.correct(ctx.current_text)
 
 
 
 
 
 
 
1667
  timing_ms['punctuation_ms'] = int((time.time() - t0) * 1000)
1668
  logger.info(f"[ANALYZE] Step 3: Punctuation done in {timing_ms['punctuation_ms']}ms")
1669
  if corrected_punc != ctx.current_text:
 
1664
  from nlp.punctuation.punctuation_service import get_punctuation_model
1665
  punc_checker = get_punctuation_model()
1666
  corrected_punc = punc_checker.correct(ctx.current_text)
1667
+ # ── Post-process: strip duplicate trailing punctuation ──
1668
+ # Model sometimes turns "..." into "...." or "." into ".."
1669
+ import re as _punc_re
1670
+ # Collapse non-dot duplicate punctuation: ,, → , ;; → ; etc.
1671
+ corrected_punc = _punc_re.sub(r'([،؛:!?؟])\1+', r'\1', corrected_punc)
1672
+ # Collapse 4+ dots into ellipsis (3 dots), preserve intentional ...
1673
+ corrected_punc = _punc_re.sub(r'\.{4,}', '...', corrected_punc)
1674
  timing_ms['punctuation_ms'] = int((time.time() - t0) * 1000)
1675
  logger.info(f"[ANALYZE] Step 3: Punctuation done in {timing_ms['punctuation_ms']}ms")
1676
  if corrected_punc != ctx.current_text:
src/css/components.css CHANGED
@@ -768,8 +768,8 @@
768
  }
769
 
770
  #tooltip-original {
771
- text-decoration: line-through;
772
- color: var(--color-error);
773
  }
774
 
775
  .popover-alternatives {
@@ -860,8 +860,8 @@
860
  }
861
 
862
  .popover-original-word {
863
- text-decoration: line-through;
864
- color: var(--color-error);
865
  font-weight: var(--font-weight-semibold);
866
  }
867
 
 
768
  }
769
 
770
  #tooltip-original {
771
+ text-decoration: none;
772
+ color: var(--color-text-secondary);
773
  }
774
 
775
  .popover-alternatives {
 
860
  }
861
 
862
  .popover-original-word {
863
+ text-decoration: none;
864
+ color: var(--color-text-primary);
865
  font-weight: var(--font-weight-semibold);
866
  }
867
 
src/index.html CHANGED
@@ -258,7 +258,7 @@
258
  </div><!-- Feature 2: Grammar -->
259
  <div class="card-hover p-8 rounded-3xl" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08);">
260
  <div class="feature-icon mb-6" style="background: rgba(251, 191, 36, 0.15); color: #fbbf24;">
261
- <svg width="24" height="24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/></svg>
262
  </div>
263
  <h3 class="text-xl font-bold mb-3">تصحيح القواعد النحوية</h3>
264
  <p class="text-sm leading-relaxed" style="color: var(--text-secondary); line-height: 1.8;">توافق الفعل والفاعل واقتراح الإعراب الصحيح بشكل تلقائي</p>
@@ -287,7 +287,7 @@
287
  <!-- Feature 6: Quran Verification -->
288
  <div class="card-hover p-8 rounded-3xl" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08);">
289
  <div class="feature-icon mb-6" style="background: rgba(6, 182, 212, 0.15); color: #06b6d4;">
290
- <svg width="24" height="24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/></svg>
291
  </div>
292
  <h3 class="text-xl font-bold mb-3">تدقيق النص القرآني</h3>
293
  <p class="text-sm leading-relaxed" style="color: var(--text-secondary); line-height: 1.8;">تحقق من النص القرآني وعرضه بالتشكيل مع اسم السورة ورقم الآية</p>
 
258
  </div><!-- Feature 2: Grammar -->
259
  <div class="card-hover p-8 rounded-3xl" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08);">
260
  <div class="feature-icon mb-6" style="background: rgba(251, 191, 36, 0.15); color: #fbbf24;">
261
+ <svg width="24" height="24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"/></svg>
262
  </div>
263
  <h3 class="text-xl font-bold mb-3">تصحيح القواعد النحوية</h3>
264
  <p class="text-sm leading-relaxed" style="color: var(--text-secondary); line-height: 1.8;">توافق الفعل والفاعل واقتراح الإعراب الصحيح بشكل تلقائي</p>
 
287
  <!-- Feature 6: Quran Verification -->
288
  <div class="card-hover p-8 rounded-3xl" style="background: var(--surface-color); border: 1px solid rgba(255, 255, 255, 0.08);">
289
  <div class="feature-icon mb-6" style="background: rgba(6, 182, 212, 0.15); color: #06b6d4;">
290
+ <svg width="24" height="24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>
291
  </div>
292
  <h3 class="text-xl font-bold mb-3">تدقيق النص القرآني</h3>
293
  <p class="text-sm leading-relaxed" style="color: var(--text-secondary); line-height: 1.8;">تحقق من النص القرآني وعرضه بالتشكيل مع اسم السورة ورقم الآية</p>