Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
a255a63
feat: add Script_Extensions and script helpers
google-labs-jules[bot] Jun 27, 2026
3f60d11
feat: add comprehensive script support
google-labs-jules[bot] Jun 27, 2026
acff46a
feat: add Script_Extensions and additional Unicode helpers
google-labs-jules[bot] Jun 27, 2026
b56b2a2
feat: add comprehensive Unicode properties for regex support
google-labs-jules[bot] Jun 27, 2026
a3fe5ed
feat: comprehensive Unicode support for scripts, regex, and text proc…
google-labs-jules[bot] Jun 27, 2026
fab38ab
Merge pull request #1 from srghma/issue-112-script-extensions-1470444…
srghma Jun 30, 2026
b4371f2
Merge branch 'fgdorais:main' into main
srghma Jun 30, 2026
ce69e54
feat: download ALL files from https://www.unicode.org/Public/17.0.0/u…
srghma Jun 30, 2026
415f9d6
merge origin/main
srghma Jun 30, 2026
b52c19c
feat: status scripts
srghma Jun 30, 2026
e7ccced
feat: use unused UCD tables
srghma Jun 30, 2026
d87787a
feat: add East Asian width lookup
srghma Jun 30, 2026
6c13afe
feat: add vertical orientation and bidi mirroring
srghma Jun 30, 2026
98423fc
feat: port derived combining class
srghma Jun 30, 2026
791653e
feat: port derived binary properties
srghma Jun 30, 2026
896b442
feat: port derived general category
srghma Jun 30, 2026
9c0ecf7
feat: port derived line break
srghma Jun 30, 2026
f5dba78
feat: port derived age
srghma Jun 30, 2026
f289c28
feat: port derived decomposition type
srghma Jun 30, 2026
74a7f3e
feat: add derived numeric values support
srghma Jun 30, 2026
03075b4
feat: port derived joining group
srghma Jun 30, 2026
70c142d
feat: port derived joining type
srghma Jun 30, 2026
5a72b14
feat: port derived name lookup
srghma Jun 30, 2026
caaf6f8
feat: port derived normalization props
srghma Jun 30, 2026
40dcc4f
feat: port unihan dictionary indices
srghma Jun 30, 2026
9880cb0
feat: port Unihan dictionary-like data
srghma Jun 30, 2026
89e951b
feat: port Unihan IRG sources
srghma Jun 30, 2026
d433f72
feat: port Unihan numeric values
srghma Jun 30, 2026
daa5bc8
feat: port Unihan other mappings
srghma Jun 30, 2026
c676322
feat: port Unihan radical stroke counts
srghma Jun 30, 2026
46f3e56
feat: port Unihan readings
srghma Jun 30, 2026
41892cc
feat: UnihanVariants
srghma Jun 30, 2026
d7bb393
feat: UcdParse
srghma Jun 30, 2026
a4f3a22
feat: expand UCD raw coverage
srghma Jun 30, 2026
4ed1e4b
feat: add NamesList and DoNotEmit, but disable these files for now
srghma Jun 30, 2026
264a5f7
refactor: restructure UnicodeData dir
srghma Jun 30, 2026
ce16bc8
feat: add tests that use xxxTest.txt files, add word and sentence bre…
srghma Jun 30, 2026
19ab92e
feat: move word-sentence segmentation to UnicodeBasic
srghma Jun 30, 2026
b49be75
feat: line breaking
srghma Jun 30, 2026
3669c3e
fix: use `usize` instead of `size.toUsize`
fgdorais Jul 1, 2026
f767e5c
feat: implement bidi
srghma Jul 1, 2026
5fababd
feat: bidi tests -> better api
srghma Jul 1, 2026
3ace13b
feat: implement bidi in lean
srghma Jul 1, 2026
51e0a53
feat: more tests for bidi
srghma Jul 1, 2026
a4a46c3
fix: review
srghma Jul 1, 2026
2978bb9
fix: downloader
srghma Jul 1, 2026
6bb277e
fix: tests -> and move to ./tests dir to use lean-spec without instal…
srghma Jul 1, 2026
3c2546c
feat: generate docs/status/data-table-usage.md to answer question are…
srghma Jul 1, 2026
5a882d2
fix: UnicodeBasic does not import UnicodeData modules
fgdorais Jul 1, 2026
8575d21
feat: split all lib on separate sublibs so that UnicodeBasic cannot e…
srghma Jul 2, 2026
8d0865b
fix: Bidi_Class and Numeric_Value tests by fixing makeTable.lean (now…
srghma Jul 2, 2026
4e1552e
refactor: remove non-needed cpp lib
srghma Jul 2, 2026
718b19f
feat: update documentation
srghma Jul 2, 2026
cb17357
feat: not inject txt into cpp as text - pregenerate lean code (though…
srghma Jul 2, 2026
19ab984
fix: ci
srghma Jul 2, 2026
923b177
feat: reimplement UnicodeCLib fully in lean
srghma Jul 2, 2026
2ccbf4d
feat: split TableLookup.lean
srghma Jul 2, 2026
6682bfb
feat: split UnicodeBasic and UncodeBasic/Bidi
srghma Jul 2, 2026
29891d6
feat: better table-generator
srghma Jul 2, 2026
34179e3
feat: generate functions instead of Array (N x N x a)
srghma Jul 3, 2026
7b8cccd
feat: CanonicalDecompositionMapping
srghma Jul 3, 2026
9ecc16c
feat: WIP
srghma Jul 3, 2026
309e37b
feat: LineBreak
srghma Jul 3, 2026
e2c5a92
fix: IdContinue
srghma Jul 3, 2026
9d0b5a9
fix: DecompositionMapping
srghma Jul 3, 2026
7d72157
feat: DecompositionMapping
srghma Jul 4, 2026
97907f9
feat: inductive BlockName
srghma Jul 4, 2026
b8b7cb4
feat: ScriptName -> use inductive type
srghma Jul 4, 2026
f727081
feat: Hangul -> add Hangul.Syllable.IsBtwBaseAndLast
srghma Jul 4, 2026
128ee5d
feat: fix lookups that were returning Bool (now return Prop) (Emoji_M…
srghma Jul 4, 2026
1831fe4
feat: no cpp -> finish rewrite
srghma Jul 4, 2026
e3dbd0c
fix: tests -> wip
srghma Jul 4, 2026
415ca07
fix: tests have found error in NumericValue generator
srghma Jul 4, 2026
e151526
fix: more tests -> Script_Extensions exposed a real bug, similar in s…
srghma Jul 4, 2026
1d5ef92
feat: Script_Extensions generated table no longer returns encoded str…
srghma Jul 4, 2026
7afc912
fix: before Script allowed invalid UInt32
srghma Jul 4, 2026
c19e34a
refactor: more pre-parsing
srghma Jul 4, 2026
70c24c8
refactor: split WordBreak
srghma Jul 4, 2026
6701654
refactor: safe toHexStringRaw
srghma Jul 4, 2026
3f3b9aa
fix: tests
srghma Jul 4, 2026
a920176
refactor: safe ofAbbrev?
srghma Jul 5, 2026
2faf40d
refactor: Script
srghma Jul 5, 2026
32197df
fix: isScript with unknown, make typesafe and faster
srghma Jul 5, 2026
ab863ea
refactor: dont use throwing functions if possible
srghma Jul 5, 2026
8976326
refactor: Bidi algo -> reduce amount of []!
srghma Jul 5, 2026
f467a5d
fix: tests -> increase timeout for Line_Break
srghma Jul 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
47 changes: 42 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,51 @@ jobs:
build:
runs-on: ubuntu-latest
steps:

- name: checkout
- name: Checkout
uses: actions/checkout@v7

- name: build
- name: Build Common
uses: leanprover/lean-action@v1
with:
build: true
build-args: "--wfail"
lake-package-directory: common
test: false
use-mathlib-cache: false

- name: Build Table Generators
uses: leanprover/lean-action@v1
with:
build: true
build-args: "--wfail UnicodeBasic UnicodeData lookup makeCLib makeTables"
test: true
build-args: "--wfail"
lake-package-directory: table-generators
test: false
use-mathlib-cache: false

- name: Build Library
uses: leanprover/lean-action@v1
with:
build: true
build-args: "--wfail"
lake-package-directory: lib
test: false

- name: Build Lean Scripts
uses: leanprover/lean-action@v1
with:
build: true
build-args: "--wfail"
lake-package-directory: lean-scripts
test: false

- name: Build Tests
uses: leanprover/lean-action@v1
with:
build: true
build-args: "--wfail"
lake-package-directory: tests
test: false

- name: Run Tests
working-directory: tests
run: lake exe testAll -- --timeout 120
16 changes: 12 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,24 @@ jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v7

- name: Install Lean
- name: Build UnicodeBasic Docs
uses: leanprover/lean-action@v1
with:
build: true
build-args: "--keep-toolchain UnicodeBasic:docs"
lake-package-directory: lib
test: false

- name: Build UnicodeData Docs
uses: leanprover/lean-action@v1
with:
build: true
build-args: "--keep-toolchain UnicodeData:docs"
lake-package-directory: table-generators
test: false
lint: false
use-github-cache: true

- name: Build Docs
working-directory: docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-to-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git merge origin/main --no-commit --strategy-option ours --allow-unrelated-histories
git restore --staged lean-toolchain lake-manifest.json
git restore --staged */lean-toolchain */lake-manifest.json
git commit --allow-empty -m "chore: merge main into nightly-testing"
git push origin nightly-testing
19 changes: 13 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,24 @@ jobs:
build:
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v7

- name: Install Lean
- name: Build UnicodeBasic Docs
uses: leanprover/lean-action@v1
with:
build: true
build-args: "--keep-toolchain UnicodeBasic:docs"
lake-package-directory: lib
test: false

- name: Build UnicodeData Docs
uses: leanprover/lean-action@v1
with:
build: false
build: true
build-args: "--wfail"
lake-package-directory: lib
test: false
lint: false
use-github-cache: true

- name: Build Docs
working-directory: docs
Expand All @@ -36,7 +43,7 @@ jobs:
tar -czf docs-${TAG_NAME}.tar.gz doc doc-data
zip -rq docs-${TAG_NAME}.zip doc doc-data

- name: Release
- name: Upload Release Assets
uses: softprops/action-gh-release@v3
with:
files: |
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/update-nightly-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,35 @@ jobs:
update:
runs-on: ubuntu-latest
steps:

- name: checkout
- name: Checkout
uses: actions/checkout@v7
with:
ref: nightly-testing
token: ${{ secrets.UNICODE_BASIC_TOKEN }}

- name: install jq
- name: Install jq
uses: dcarbone/install-jq-action@v4

- name: set user
- name: Set User
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"

- name: get toochain tags
- name: Get Toolchain Tags
id: toolchain-tag
run: |
LEAN_TAG=$(curl -s "https://api.github.com/repos/leanprover/lean4-nightly/releases" | jq -r '.[0].tag_name')
REPO_TAG=$(cut -d ':' -f2 lean-toolchain | tr -d '\n')
REPO_TAG=$(cut -d ':' -f2 common/lean-toolchain | tr -d '\n')
echo "lean_tag=$LEAN_TAG" >> $GITHUB_OUTPUT
echo "repo_tag=$REPO_TAG" >> $GITHUB_OUTPUT

- name: commit and push
- name: Update Toolchain Files
if: ${{ steps.toolchain-tag.outputs.lean_tag != steps.toolchain-tag.outputs.repo_tag }}
run: just set-toolchain "${{ steps.toolchain-tag.outputs.lean_tag }}"

- name: Commit and Push
if: ${{ steps.toolchain-tag.outputs.lean_tag != steps.toolchain-tag.outputs.repo_tag }}
run: |
echo "leanprover/lean4:${{ steps.toolchain-tag.outputs.lean_tag }}" > lean-toolchain
git add lean-toolchain
git add common/lean-toolchain lean-scripts/lean-toolchain lib/lean-toolchain table-generators/lean-toolchain tests/lean-toolchain
git commit -m "chore: update toolchain ${{ steps.toolchain-tag.outputs.lean_tag }}"
git push origin nightly-testing
22 changes: 10 additions & 12 deletions .github/workflows/update-toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,31 @@ jobs:
name: update toolchain
runs-on: ubuntu-latest
steps:

- name: checkout
- name: Checkout
uses: actions/checkout@v7
with:
ref: nightly-testing
fetch-depth: 0

- name: install jq
# - name: Fetch Main
# run: git fetch origin main:refs/remotes/origin/main --depth=1

- name: Install jq
uses: dcarbone/install-jq-action@v4

- name: get toolchain tags
- name: Get Toolchain Tags
id: toolchain-tag
run: |
REPO_TAG=$(git show main:lean-toolchain | cut -d':' -f2 | tr -d '\n')
REPO_TAG=$(git show origin/main:common/lean-toolchain | cut -d':' -f2 | tr -d '\n')
LEAN_TAG=$(curl -s "https://api.github.com/repos/leanprover/lean4/releases" | jq -r '.[0].tag_name' | tr -d '\n')
echo "repo_tag=$REPO_TAG" >> $GITHUB_OUTPUT
echo "lean_tag=$LEAN_TAG" >> $GITHUB_OUTPUT

- name: update toolchain
id: update
- name: Update Toolchain Files
if: ${{ steps.toolchain-tag.outputs.lean_tag != steps.toolchain-tag.outputs.repo_tag }}
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
echo "leanprover/lean4:${{ steps.toolchain-tag.outputs.lean_tag }}" > lean-toolchain
run: just set-toolchain "${{ steps.toolchain-tag.outputs.lean_tag }}"

- name: create pull request
- name: Create Pull Request
if: ${{ steps.toolchain-tag.outputs.lean_tag != steps.toolchain-tag.outputs.repo_tag }}
uses: peter-evans/create-pull-request@v8
with:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/.lake
*/.lake/
tests/.spec-failures
.data-ucd-download-meta.json
*~
45 changes: 41 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,62 @@ Unicode properties that are currently supported by `UnicodeBasic` include:
* `Alphabetic`
* `Bidi_Class`
* `Bidi_Control`
* `Bidi_Paired_Bracket`
* `Bidi_Paired_Bracket_Type`
* `Bidi_Mirrored`
* `Bidi_Mirroring_Glyph`
* `Canonical_Combining_Class`
* `Case_Folding`
* `Case_Ignorable`
* `Cased`
* `Dash`
* `Decomposition_Mapping`
* `Decomposition_Type`
* `Default_Ignorable_Code_Point`
* `Diacritic`
* `East_Asian_Width`
* `Emoji_Component`
* `Emoji_Modifier_Base`
* `Emoji_Modifier`
* `Emoji_Presentation`
* `Emoji`
* `Extended_Pictographic`
* `Extender`
* `Block`
* `General_Category`
* `Grapheme_Base`
* `Grapheme_Cluster_Break`
* `Grapheme_Extend`
* `Hex_Digit`
* `Hyphen`
* `ID_Continue`
* `ID_Start`
* `Line_Break`
* `Lowercase`
* `Math`
* `Name`
* `Noncharacter_Code_Point`
* `Numeric_Type`
* `Numeric_Value`
* `Noncharacter_Code_Point`
* `Pattern_Syntax`
* `Pattern_White_Space`
* `Quotation_Mark`
* `Regional_Indicator`
* `Script_Extensions`
* `Script`
* `Sentence_Break`
* `Sentence_Terminal`
* `Simple_Case_Folding`
* `Simple_Lowercase_Mapping`
* `Simple_Uppercase_Mapping`
* `Simple_Titlecase_Mapping`
* `Lowercase`
* `Simple_Uppercase_Mapping`
* `Terminal_Punctuation`
* `Uppercase`
* `White_Space`
* `Word_Break`
* `XID_Continue`
* `XID_Start`
* `Vertical_Orientation`

To keep the `UnicodeBasic` library lightweight, only commonly used properties can be supported. If you need a property not yet in the list above, please submit a feature request!

Expand All @@ -39,13 +75,14 @@ Add the following dependency to your project's `lakefile.toml`:
name = "UnicodeBasic"
git = "https://github.com/fgdorais/lean4-unicode-basic.git"
rev = "main" # or any specific revision
subDir = "lib"
```

Or this dependency to your project's `lakefile.lean`:

```lean4
require UnicodeBasic from git
"https://github.com/fgdorais/lean4-unicode-basic.git" @ "main"
"https://github.com/fgdorais/lean4-unicode-basic.git" @ "main" / "lib"
```

Then add `import UnicodeBasic` at the top of any Lean file where you plan to use this library.
Expand Down
Loading