Spaces:
Running
Running
Rename slang_parser.py to slang.py
Browse files- slang.py +8 -0
- slang_parser.py +0 -7
slang.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import re
|
2 |
+
|
3 |
+
def detect_slang(text: str) -> str:
|
4 |
+
"""Simple placeholder: identify slang or technical terms in text"""
|
5 |
+
# Customize with real patterns
|
6 |
+
slang_patterns = re.compile(r"\b(LOL|BTW|FYI)\b", re.IGNORECASE)
|
7 |
+
matches = slang_patterns.findall(text)
|
8 |
+
return ", ".join(set(matches)) if matches else ""
|
slang_parser.py
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
|
2 |
-
def extract_slang_notes(user_notes):
|
3 |
-
"""
|
4 |
-
占位函数:用于处理用户输入的网络用语备注。
|
5 |
-
当前版本仅做原样返回,可扩展为检测敏感词/非规范词/风险语义等。
|
6 |
-
"""
|
7 |
-
return user_notes.strip()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|