Improve Korean understanding at every speech level and long talks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -268,16 +268,18 @@ NO = [t for t in NO if t not in _said] # a wording
|
||||
|
||||
CAMERA = re.compile(r"\b(?:see|seeing|saw|look(?:s|ing)?|watch|camera|wearing|holding|in front of|behind|colou?r|"
|
||||
r"recogni[sz]e|remember)\b|보여|보이|보니|(?<!해 )(?<!해)봐|봤|입었|들고|색|카메라|앞에|뒤에|알아봐|기억", re.I)
|
||||
ABOUT_ME = re.compile(r"\b(?:i(?! (?:call|address) you\b)|i'm|am i|my|me|mine)\b|(?:^|\s)(?:나|내|제|저|난|전)(?:는|가|를|의)?\s", re.I)
|
||||
ABOUT_ME = re.compile(r"\b(?:i(?! (?:call|address) you\b)(?! (?:talk|speak|chat) (?:to|with) you\b)|i'm|am i|my|"
|
||||
r"(?<!tell )(?<!give )(?<!let )(?<!show )me|mine)\b|(?:^|\s)(?:나|내|제|저|난|전)(?:는|가|를|의)?\s", re.I)
|
||||
FRAGMENT = re.compile(r"^\W*(?:and|so|but|then|or|also|why|really|seriously|wait|what about|how about|how come|are you sure)\b|"
|
||||
r"^\W*(?:그럼|그러면|그리고|근데|그런데|그래서|아니|왜|진짜|정말|확실|설마|또)|"
|
||||
r"\b(?:that|(?<!is )(?<!was )(?<!is it )(?<!how's )(?<!how is )it(?! is (?:now|today))|they|them|"
|
||||
r"(?<!hello )(?<!hi )(?<!hey )there|this one|the arm|your arm)\b|"
|
||||
r"그거|그건|거기|그분|그 회사|걔", re.I) # not the clock's "it": "what day is it?"
|
||||
OTHER = re.compile(r"\b(?:lift|carry|hold|items?|(?<!this )things?|stuff|price|cost)\b|들 ?수|(?<!만)들어|물건|"
|
||||
r"^(?!.*(?:키|무게|체중|신장|속도|시간|나이)).*얼마(?:야|예요)|"
|
||||
OTHER = re.compile(r"\b(?:lift|carry|hold|items?|(?<!this )things?|stuff|price|cost)\b|들 ?수|(?<!만)(?<!알아)(?<!뭐 )들어|물건|"
|
||||
r"^(?!.*(?:키|무게|체중|신장|속도|시간|나이|높이|길이|크기)).*얼마(?:야|예요)|"
|
||||
r"맞(?:아|지|죠|나|습니까)|아니(?:야|에요|죠)", re.I) # what it can hold, the price, a check: the LLM
|
||||
SEVERAL = re.compile(r"\band\b|그리고|[??].+\S|하고\s|랑\s", re.I)
|
||||
SEVERAL = re.compile(r"\band\b|\bthen\b|그리고|[??].+\S|하고\s|랑\s|"
|
||||
r"[가-힣](?<![최광참사창공경재원])(?<!그리)고\s+(?!싶|있|계)", re.I) # "고개 숙이고 몇 시야?", "보고 시간 알려 줘"
|
||||
EVENT_TIME = re.compile(r"\b(?:what time|what day|which day|what date) (?:does|do|did|will|is|are|was|were|should|can)\b"
|
||||
r"(?!\s+(?:it|today)\b)|몇 ?시(?:에|부터|까지|쯤에)|며칠(?:에|까지|부터)|무슨 요일(?:에|까지|부터)|"
|
||||
r"\b(?:open|close|start|end|begin|finish)\b|열어요|닫아요|시작|끝나", re.I) # an event's time: the LLM
|
||||
@@ -330,6 +332,9 @@ def guarded(text, history=()):
|
||||
return "camera"
|
||||
if ABOUT_ME.search(t):
|
||||
return "about the visitor"
|
||||
lead = re.match(r"^\W*(?:and|so|but|okay so|then)\W+", t, re.I)
|
||||
if lead and len(t[lead.end():].split()) >= 3 and NAMES_LUMI.search(t[lead.end():]):
|
||||
t = t[lead.end():] # "and your name is?", "so who are you?": a whole question
|
||||
if FRAGMENT.search(t):
|
||||
return "fragment"
|
||||
if SEVERAL.search(t):
|
||||
|
||||
Reference in New Issue
Block a user