Skip to content

Commit

Permalink
Removed empty fields from words.toml
Browse files Browse the repository at this point in the history
added words.toml schema
replaced custom validation script with the Taplo CLI
removed the python extension recommendation
  • Loading branch information
TheOnlyTails committed Nov 30, 2023
1 parent 7e0df00 commit db12062
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 1,740 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/validate_toml.py

This file was deleted.

16 changes: 4 additions & 12 deletions .github/workflows/validate_toml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,12 @@ permissions:
jobs:
validate:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .github/workflows/
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Validate translations
run: npx --yes @taplo/cli check --schema https://raw.githubusercontent.com/lipu-linku/sona/${{vars.GITHUB_SHA || 'main'}}/schemas/translation.schema.json ./translations/*.toml

- name: Install Dependencies
run: python -m pip install --upgrade pip setuptools wheel jsonschema

- name: Validate Files
run: python validate_toml.py
- name: Validate words.toml
run: npx --yes @taplo/cli check --schema https://raw.githubusercontent.com/lipu-linku/sona/${{vars.GITHUB_SHA || 'main'}}/schemas/words.schema.json ./words.toml
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"recommendations": [
"tamasfe.even-better-toml",
"ms-python.python"
]
}
13 changes: 0 additions & 13 deletions schemas/translation.schema.ts

This file was deleted.

155 changes: 155 additions & 0 deletions schemas/words.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://linku.la/sona/schemas/words.schema.json",
"title": "sona words.toml file",
"description": "General info on a Toki Pona word",
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"author_verbatim": {
"description": "The author's original definition, taken verbatim in their words",
"type": "string"
},
"author_verbatim_source": {
"description": "Where the author's original definition is located (usually Discord)",
"type": "string"
},
"book": {
"description": "Which official Toki Pona book was this word featured in, if any.",
"type": "string",
"enum": ["pu", "ku suli", "ku lili", "none"]
},
"coined_era": {
"description": "When this word was coined (relative to the publication dates of the official Toki Pona books)",
"type": "string"
},
"coined_year": {
"description": "The exact year when this word was coined (if known)",
"type": "number",
"minimum": 2000
},
"creator": {
"description": "The person who created this word (if known)",
"type": "string"
},
"ku_data": {
"description": "The usage data of the word as described in ku (the official Toki Pona dictionary), formatted as a map between a meaning and its frequency index (0 to 5)",
"additionalProperties": {
"type": "number",
"minimum": 0,
"maximum": 5
},
"type": "object"
},
"see_also": {
"description": "A list of related words",
"type": "array",
"items": {
"type": "string"
}
},
"sitelen_emosi": {
"description": "The sitelen emosi representation of this word, a script for writing Toki Pona using emoji",
"type": "string",
"pattern": "(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])"
},
"sitelen_pona": {
"description": "A list of sitelen Lasina representations of this word, to be converted into sitelen pona glyphs",
"type": "array",
"items": {
"type": "string"
}
},
"sitelen_sitelen": {
"description": "A URL pointing to an image of this word's sitelen sitelen hieroglyphic block",
"type": "string",
"format": "uri"
},
"source_language": {
"description": "The language this word originated from",
"type": "string"
},
"ucsur": {
"description": "The word's UCSUR codepoint",
"type": "string",
"pattern": "U\\+[\\da-fA-F]{4,6}"
},
"usage_category": {
"description": "The word's usage category, according to a survey performed by the Linku Project",
"type": "string",
"enum": ["core", "widespread", "common", "uncommon", "rare", "obscure"]
},
"word": {
"description": "The word's actual text, in case of a word with multiple definitions",
"type": "string"
},
"audio": {
"description": "Audio files of the words pronounced out loud",
"type": "object",
"properties": {
"jan_lakuse": {
"type": "string",
"description": "jan Lakuse's pronounciation of the word, made for jan Sonja's Memrise course: https://archive.org/details/toki-pona-audio-by-jan-lakuse",
"format": "uri"
},
"kala_asi": {
"type": "string",
"description": "kala Asi's pronounciation of the word, made for the Linku Project",
"format": "uri"
}
}
},
"luka_pona": {
"description": "Video clips of the word being signed in Luka Pona, a Toki Pona sign language",
"type": "object",
"properties": {
"mp4": {
"description": "The video clip in MP4 format",
"type": "string",
"format": "uri"
},
"gif": {
"description": "The video clip as a GIF",
"type": "string",
"format": "uri"
}
},
"required": ["mp4", "gif"]
},
"pu_verbatim": {
"description": "The original definition of the word, as described in the book The Language Of Good (pu). May be inaccurate or outdated",
"type": "object",
"properties": {
"en": {
"description": "The original definition in the English version of pu",
"type": "string"
},
"fr": {
"description": "The original definition in the French version of pu",
"type": "string"
},
"de": {
"description": "The original definition in the German version of pu",
"type": "string"
},
"eo": {
"description": "The original definition in the Esperanto version of pu",
"type": "string"
}
},
"required": ["en", "fr", "de", "eo"]
},
"recognition": {
"description": "The percentage of people in the Toki Pona community who recognize this word, according to surveys performed by the Linku Project",
"type": "object",
"patternProperties": {
"\\d{4}-\\d{2}": {
"type": "number"
}
}
}
},
"required": ["word", "usage_category", "book", "recognition"]
}
}
Loading

0 comments on commit db12062

Please sign in to comment.