aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/example_rule.json
blob: 0cb5b6ccb6e283bd5ce6d1e06f84edc7fd5fc39a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
[
    {
        // 匹配日志元数据,提取 id、QQ 账号和时间。例如:墨勒托.DW(1571806261) 2025-01-27 19:58:15
        "type": "metadata",
        "patterns": [
            "^(\\S+)\\((\\d+)\\)\\s+(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2})"
        ],
        "groups": [
            "user_name",
            "user_id",
            "time"
        ]
    },
    {
        "type": "action",
        "patterns": [
            "^#s*((?:(?![“”\"(【】]).)+)"
        ], // 排除后续特殊符号
        "groups": [
            "action_content"
        ]
    },
    {
        "type": "speech",
        "patterns": [
            "[“](.+?)[”]", // 中文引号
            "\"(.*?)\"", // 英文引号
            "”(.+?)“" // 混合引号
        ],
        "groups": [
            "speech_content"
        ]
    },
    {
        "type": "ooc_speech",
        "patterns": [
            // "((.*?))", // 英文括号
            "((.*?))", // 中文括号
            // "((.*)", // 未闭合英文括号
            "((.*)" // 未闭合中文括号
        ],
        "groups": [
            "ooc_content"
        ]
    },
    {
        // 匹配掷骰指令,以 . 或 。开头但是不匹配连续的指令前缀。例如:匹配".ra智力",不匹配"。。。"
        "type": "dice_order",
        "patterns": [
            "^(?:[\\.。]([^.。].+))"
        ],
        "groups": [
            "dice_command"
        ]
    },
    {
        // 匹配角色心理活动。例如:【这里好可怕】
        "type": "thought",
        "patterns": [
            "【(.+)】"
        ],
        "groups": [
            "thought_content"
        ]
    }
]