-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathtable.schema.yaml
52 lines (46 loc) · 1.29 KB
/
table.schema.yaml
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
$schema: https://json-schema.org/draft/2019-09/schema
$id: https://github.com/dahlia/cjk-compsci-terms/raw/main/table.schema.yaml
title: CJK computer science terms
description: |
The list of computer science terms and their translations in English & CJK
type: array
items:
$ref: "#/definitions/translation"
definitions:
translation:
type: object
propertyNames:
$ref: "#/definitions/locale"
patternProperties:
"^[a-z]{2}(-[A-Z]{2}|-[A-Z][a-z]+)?$":
$ref: "#/definitions/wordMap"
locale:
type: string
# In order to prevent mistakes, accept only the main CJK locales
# rather than accept any valid locale codes:
enum: ["en", "ja", "ko", "zh-CN", "zh-HK", "zh-TW"]
wordMap:
propertyNames:
# TODO: Reject non-English/non-CJK characters
pattern: "^.+$"
patternProperties:
".*":
$ref: "#/definitions/word"
word:
type: array
items:
$ref: "#/definitions/term"
term:
type: object
additionalProperties: false
properties:
term: { type: string }
space:
anyOf:
- { type: boolean }
- { const: "hyphen" }
correspond: { type: string }
read: { type: string }
loan: { type: string }
required: [ term ]
# vim: set et sw=2 ts=2 sts=2 ft=yaml: