From 51de0ed94ba25e0ad377f06ec8dced257f236cc3 Mon Sep 17 00:00:00 2001 From: koogua Date: Sun, 1 Oct 2023 11:05:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=95=B0=E7=BB=9F=E8=AE=A1=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E5=9B=BE=E7=89=87=E5=AD=97=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Library/Utils/Word.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Library/Utils/Word.php b/app/Library/Utils/Word.php index 9193e8e4..6bca8601 100644 --- a/app/Library/Utils/Word.php +++ b/app/Library/Utils/Word.php @@ -14,13 +14,15 @@ class Word public static function getWordCount($str) { + $imageWordCount = self::getImageWordCount($str); + $chineseWordCount = self::getChineseWordCount($str); $str = self::filterChineseWords($str); $englishWordCount = self::getEnglishWordCount($str); - $count = $chineseWordCount + $englishWordCount; + $count = $imageWordCount + $chineseWordCount + $englishWordCount; return (int)$count; } @@ -54,6 +56,11 @@ class Word return (int)$count; } + public static function getImageWordCount($str) + { + return 100 * substr_count($str, '