[PR #928] [MERGED] Add a function to check if target_word contains CJK characters #1024

Closed
opened 2026-02-25 20:37:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/benbusby/whoogle-search/pull/928
Author: @ahmad-alkadri
Created: 1/8/2023
Status: Merged
Merged: 1/9/2023
Merged by: @benbusby

Base: mainHead: fix/904-bold-cjk-characters


📝 Commits (2)

  • b380115 Add a function to check if target_word contains CJK characters
  • b82b5ee Python function to check cjko characters modified

📊 Changes

1 file changed (+28 additions, -1 deletions)

View changed files

📝 app/utils/results.py (+28 -1)

📄 Description

This PR is linked to Issue #904 which shows that Whoogle results do not render bold all of target words if they are Chinese characters.

Further investigations show similar behavior for Japanese (hiragana, katakana, kanji), and Korean (hangul syllables, hangul jamo) characters: not all of the words displayed on the result page are bolded.

To handle this, a function was added to check if target_word in bold_search_terms.replace_any_case contains Chinese, Korean, or Japanese characters and apply the regex that doesn't check for whitespace. This way, each search term would be bolded differently.

Screenshots of the search results after the commits linked to this PR:

screenshot-localhost_5000-2023 01 08-23_12_08

screenshot-localhost_5000-2023 01 08-23_14_26

screenshot-localhost_5000-2023 01 08-23_17_20


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/benbusby/whoogle-search/pull/928 **Author:** [@ahmad-alkadri](https://github.com/ahmad-alkadri) **Created:** 1/8/2023 **Status:** ✅ Merged **Merged:** 1/9/2023 **Merged by:** [@benbusby](https://github.com/benbusby) **Base:** `main` ← **Head:** `fix/904-bold-cjk-characters` --- ### 📝 Commits (2) - [`b380115`](https://github.com/benbusby/whoogle-search/commit/b3801151efe044e1f8200fe1184feac6cf101140) Add a function to check if target_word contains CJK characters - [`b82b5ee`](https://github.com/benbusby/whoogle-search/commit/b82b5ee91fe4209cbaa97eb2e9899b6e9f6474af) Python function to check cjko characters modified ### 📊 Changes **1 file changed** (+28 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `app/utils/results.py` (+28 -1) </details> ### 📄 Description This PR is linked to Issue #904 which shows that Whoogle results do not render bold all of target words if they are Chinese characters. Further investigations show similar behavior for Japanese (hiragana, katakana, kanji), and Korean (hangul syllables, hangul jamo) characters: not all of the words displayed on the result page are bolded. To handle this, a function was added to check if `target_word` in `bold_search_terms.replace_any_case` contains Chinese, Korean, or Japanese characters and apply the regex that doesn't check for whitespace. This way, each search term would be bolded differently. Screenshots of the search results after the commits linked to this PR: ![screenshot-localhost_5000-2023 01 08-23_12_08](https://user-images.githubusercontent.com/22837764/211222505-0d9a7a2c-8adf-4447-a6f5-db104e008d51.png) ![screenshot-localhost_5000-2023 01 08-23_14_26](https://user-images.githubusercontent.com/22837764/211222511-588fa4a3-82b4-43a0-ac5f-507ac9d14613.png) ![screenshot-localhost_5000-2023 01 08-23_17_20](https://user-images.githubusercontent.com/22837764/211222520-b6bbf13c-1815-459f-b9c4-6e25d2789816.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 20:37:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whoogle-search#1024
No description provided.