@@ -32,6 +32,10 @@ const CRAFT_TITLE_RE =
3232const LECTURE_TITLE_RE =
3333 / 讲 座 | 演 讲 | 发 布 会 | 报 告 | 论 坛 | 会 议 | 访 谈 | 大 师 课 | 公 开 课 / i;
3434
35+ /** 软件技能进程名单(标题无特征词时,进程名兜底判定;Windows) */
36+ const SOFTWARE_PROCESS_RE =
37+ / p h o t o s h o p | p r e m i e r e | a f t e r f x | i l l u s t r a t o r | l i g h t r o o m | 剪 映 | o b s 6 4 | b l e n d e r | f i g m a | s k e t c h | u n i t y | u n r e a l | c o d e \. e x e | p y c h a r m | i n t e l l i j | w e b s t o r m | n o t e p a d \+ \+ | w p s \. e x e / i;
38+
3539// ================================================================
3640// 转写术语证据规则
3741// ================================================================
@@ -59,13 +63,15 @@ const COURSE_CUES = [
5963// ================================================================
6064
6165/** 窗口标题单独分类(无转写信号时) */
62- export function classifyByTitle ( title : string ) : ContentKind {
66+ export function classifyByTitle ( title : string , processName ?: string ) : ContentKind {
6367 const t = ( title ?? '' ) . trim ( ) ;
6468 if ( ! t ) return 'unknown' ;
6569 // 讲座/会议类优先("AI 开发者大会"含"开发"字样但属讲座场景,需先于软件判定)
6670 if ( LECTURE_TITLE_RE . test ( t ) ) return 'lecture' ;
6771 if ( SOFTWARE_TITLE_RE . test ( t ) ) return 'software_skill' ;
6872 if ( CRAFT_TITLE_RE . test ( t ) ) return 'craft_skill' ;
73+ // 进程名兜底:软件技能进程在标题无特征词时判为软件技能
74+ if ( processName && SOFTWARE_PROCESS_RE . test ( processName ) ) return 'software_skill' ;
6975 // 标题含"教程/课程/课堂/教学"默认按知识授课(视频站标题高频形态)
7076 if ( / 教 程 | 课 程 | 课 堂 | 教 学 | 网 课 / i. test ( t ) ) return 'course' ;
7177 return 'unknown' ;
@@ -100,8 +106,12 @@ export interface ClassificationResult {
100106 * 综合分类:标题优先,无标题信号时用转写证据。
101107 * 标题信号覆盖转写(窗口标题是用户主动选择的上下文,可信度更高)。
102108 */
103- export function classifyContent ( windowTitle : string , transcriptText : string ) : ClassificationResult {
104- const byTitle = classifyByTitle ( windowTitle ) ;
109+ export function classifyContent (
110+ windowTitle : string ,
111+ transcriptText : string ,
112+ processName ?: string ,
113+ ) : ClassificationResult {
114+ const byTitle = classifyByTitle ( windowTitle , processName ) ;
105115 if ( byTitle !== 'unknown' ) return { kind : byTitle , source : 'title' } ;
106116 const byTranscript = classifyByTranscript ( transcriptText ) ;
107117 if ( byTranscript !== 'unknown' ) return { kind : byTranscript , source : 'transcript' } ;
0 commit comments