summaryrefslogtreecommitdiff
path: root/deps/icu-small/source/python/icutools/databuilder/filtration_schema.json
blob: 2b7ff9989992a12e77a81ad9d6f2a6418351f22e (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// Copyright (C) 2018 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html

{
    "$id": "http://unicode.org/icu-filter-schema",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "JSON Schema for an ICU data filter file",
    "type": "object",
    "properties": {
        "strategy": {
            "type": "string",
            "enum": ["additive", "subtractive"]
        },
        "localeFilter": { "$ref": "#/definitions/filter" },
        "featureFilters": {
            "type": "object",
            "additionalProperties": {
                "oneOf": [
                    { "$ref": "#/definitions/filter" },
                    {
                        "type": "string",
                        "enum": ["include", "exclude"]
                    }
                ]
            }
        },
        "resourceFilters": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "categories": {
                        "type": "array",
                        "items": { "type": "string" }
                    },
                    "files": { "$ref": "#/definitions/filter" },
                    "rules": {
                        "type": "array",
                        "items": {
                            "type": "string",
                            "pattern": "^[+-]/[\\S]*$"
                        }
                    }
                },
                "required": ["categories", "rules"],
                "additionalProperties": false
            }
        },
        "fileReplacements": {
            "type": "object",
            "properties": {
                "directory": {
                    "type": "string",
                    "pattern": "^(\\$SRC|\\$FILTERS|\\$CWD|/$|/[^/]+)(/[^/]+)*$"
                },
                "replacements": {
                    "type": "array",
                    "items": {
                        "oneOf": [
                            { "type": "string" },
                            {
                                "type": "object",
                                "properties": {
                                    "src": { "type": "string" },
                                    "dest": { "type": "string" }
                                },
                                "additionalProperties": false,
                                "required": ["src", "dest"]
                            }
                        ]
                    }
                }
            },
            "additionalProperties": false,
            "required": ["directory", "replacements"]
        },
        "collationUCAData": {
            "type": "string",
            "enum": ["unihan", "implicithan"]
        },
        "usePoolBundle": {
            "type": "boolean"
        }
    },
    "additionalProperties": false,
    "definitions": {
        "filter": {
            "type": "object",
            "oneOf": [
                {
                    "properties": {
                        "filterType": {
                            "$ref": "#/definitions/blacklistWhitelistFilterTypes"
                        },
                        "whitelist": { "$ref": "#/definitions/stringList" }
                    },
                    "required": ["whitelist"],
                    "additionalProperties": false
                },
                {
                    "properties": {
                        "filterType": {
                            "$ref": "#/definitions/blacklistWhitelistFilterTypes"
                        },
                        "blacklist": { "$ref": "#/definitions/stringList" }
                    },
                    "required": ["blacklist"],
                    "additionalProperties": false
                },
                {
                    "properties": {
                        "filterType": {
                            "type": "string",
                            "enum": ["exclude"]
                        }
                    },
                    "required": ["filterType"],
                    "additionalProperties": false
                },
                {
                    "properties": {
                        "filterType": {
                            "type": "string",
                            "enum": ["locale"]
                        },
                        "includeChildren": {
                            "type": "boolean"
                        },
                        "includeScripts": {
                            "type": "boolean"
                        },
                        "whitelist": { "$ref": "#/definitions/stringList" }
                    },
                    "required": ["filterType", "whitelist"],
                    "additionalProperties": false
                },
                {
                    "properties": {
                        "filterType": {
                            "type": "string",
                            "enum": ["union"]
                        },
                        "unionOf": {
                            "type": "array",
                            "items": { "$ref": "#/definitions/filter" }
                        }
                    },
                    "required": ["filterType", "unionOf"],
                    "additionalProperties": false
                }
            ]
        },
        "blacklistWhitelistFilterTypes": {
            "type": "string",
            "enum": [
                "language",
                "regex"
            ]
        },
        "stringList": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "minItems": 1,
            "uniqueItems": true
        }
    }
}