EugeneXiang commited on
Commit
b9bae16
·
verified ·
1 Parent(s): d4a8865

Rename slang_parser.py to slang.py

Browse files
Files changed (2) hide show
  1. slang.py +8 -0
  2. 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()