extractKeyTopics 从摘要中提取关键主题
(summary string)
| 252 | |
| 253 | // extractKeyTopics 从摘要中提取关键主题 |
| 254 | func extractKeyTopics(summary string) []string { |
| 255 | topics := []string{} |
| 256 | |
| 257 | // 简单的主题提取逻辑 |
| 258 | lines := strings.Split(summary, "\n") |
| 259 | inTopicsSection := false |
| 260 | |
| 261 | for _, line := range lines { |
| 262 | line = strings.TrimSpace(line) |
| 263 | |
| 264 | if strings.Contains(strings.ToLower(line), "main topics") { |
| 265 | inTopicsSection = true |
| 266 | continue |
| 267 | } |
| 268 | |
| 269 | if inTopicsSection { |
| 270 | if strings.HasPrefix(line, "-") || strings.HasPrefix(line, "*") { |
| 271 | topic := strings.TrimSpace(strings.TrimPrefix(strings.TrimPrefix(line, "-"), "*")) |
| 272 | if topic != "" { |
| 273 | topics = append(topics, topic) |
| 274 | } |
| 275 | } else if strings.HasPrefix(line, "#") { |
| 276 | // 遇到新的标题,退出主题部分 |
| 277 | break |
| 278 | } |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | return topics |
| 283 | } |
| 284 | |
| 285 | // extractParticipants 提取参与者 |
| 286 | func extractParticipants(messages []types.Message) []string { |
no outgoing calls
no test coverage detected