05e173b293
Replace the WebView shell with SwiftUI screens, add account-scoped Wiki and TTS APIs with adaptive review and photo scan support, and keep web/iOS pages usable while data loads asynchronously. Co-authored-by: Cursor <cursoragent@cursor.com>
11 lines
369 B
Python
11 lines
369 B
Python
import re
|
|
|
|
|
|
def normalize_en_answer(text: str) -> str:
|
|
"""英文拼写/短语答案:去首尾空白、小写、连续空白压成单个空格。"""
|
|
return re.sub(r"\s+", " ", (text or "").strip().lower())
|
|
|
|
|
|
def en_answers_match(user_answer: str, correct_answer: str) -> bool:
|
|
return normalize_en_answer(user_answer) == normalize_en_answer(correct_answer)
|