From 913cd50fe5db0d7aa00be10de7ca91c2f9de95b3 Mon Sep 17 00:00:00 2001 From: howardt12345 Date: Thu, 19 Sep 2024 11:46:37 -0400 Subject: [PATCH] query adjustments --- resources/reacts/tw.json | 8 +++++--- tests/test_reacts/test_reacts_tw.py | 16 +++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/resources/reacts/tw.json b/resources/reacts/tw.json index 50afc76..e22f9cf 100644 --- a/resources/reacts/tw.json +++ b/resources/reacts/tw.json @@ -58,9 +58,11 @@ { "match_whole_word": true, "keywords": [ - "Taiwan(?:[\\s-]+(?:is|be|are|=|:|\\bis\\b|\\bare\\b))?[\\s-]+(?:(?:number|#|n[o°]\\.?|n°\\.?)\\s*(?:1|one|①)|(?:first|1st|best|top|greatest))(?!\\s*\\d)", - "(?:台|臺)灣(?:[\\s-]+(?:是|=|:)?)?[\\s-]+(?:(?:第|#|No\\.?)\\s*(?:1|一|壹|①)|(?:最(?:棒|強|好)|冠軍))(?!\\s*\\d)", - "tâi-uân(?:[\\s-]*(?:tē-it))" + "Taiwan(?:[\\s-]*(?:is|be|are|=|:|\\bis\\b|\\bare\\b))?[\\s-]*(?:(?:number|#|no?\\.?|n°\\.?)\\s*(?:1|one|won|①|壹)|(?:first|1st|best|top|greatest|the\\s+best))(?![\\s-]*\\d)", + "(?:台|臺)灣(?:[\\s-]*(?:是|=|:)?)?[\\s-]*(?:(?:第|#|No\\.?)\\s*(?:1|一|壹|①)|(?:最(?:棒|強|好)|冠軍|第一名))(?![\\s-]*\\d)", + "tâi-uân[\\s-]*tē-it", + "Taiwan[\\s-]*(?:第一|最棒|最強|最好)", + "(?:台|臺)灣[\\s-]*(?:number[\\s-]*one|is[\\s-]*number[\\s-]*one)" ], "criteria_link": "tw_no_1" } diff --git a/tests/test_reacts/test_reacts_tw.py b/tests/test_reacts/test_reacts_tw.py index 48dab55..3f349e7 100644 --- a/tests/test_reacts/test_reacts_tw.py +++ b/tests/test_reacts/test_reacts_tw.py @@ -78,13 +78,12 @@ "台灣是第一", "Taiwan 第一", "臺灣 number one", - "Taiwan won", - "Taiwan ①", - "Taiwan 壹", "TAIWAN NUMBER ONE", "taiwan #1", - "I believe Taiwan is truly number one in Asia", - "Taiwan, often called Formosa, is number 1 in my heart", + "台灣冠軍", + "臺灣 is number one", + "Taiwan第一", + "tâi-uân tē-it" ) TEST_CASES_TW_NO_1_FALSE = ( @@ -100,6 +99,13 @@ "Number one", "Taiwan #", "Taiwan number", + "Taiwan is second", + "Taiwan and Japan are both great", + "Taiwan's number 1 export", + "Taiwan has won", + "Taiwan will be number 1", + "Taiwan used to be number 1", + "Taiwan aims to be number 1" ) ALL_TEST_CASES = TEST_CASE_EN + TEST_CASE_TW