Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
543 changes: 180 additions & 363 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ quick_check_oracle = []

[dev-dependencies]
proptest = "1.12"
unicode-normalization = "0.1"
unicode-normalization = "0.1.26"
icu_normalizer = "2.4"
simdutf8 = "0.1"
criterion = { version = "0.8", features = ["html_reports"] }
simdutf8 = "0.1.5"
criterion = { version = "0.8.2", features = ["html_reports"] }
simd-normalizer = { path = ".", features = ["internal-test-api"] }

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Provides NFC, NFD, NFKC, and NFKD normalization with a single-pass,
SIMD-guided architecture that scans 64-byte chunks to skip ASCII and
passthrough regions in bulk. Non-passthrough bytes are handled with scalar
decode, decompose, CCC sort, and optional recomposition. Tables are generated
from Unicode 17.0 data.
from Unicode 18.0 data.

## Features

Expand Down
75 changes: 25 additions & 50 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ publish = false
cargo-fuzz = true

[dependencies]
libfuzzer-sys = "0.4"
libfuzzer-sys = "0.4.13"
simd-normalizer = { path = ".." }
unicode-normalization = "0.1"
unicode-normalization = "0.1.26"

[[bin]]
name = "fuzz_nfc"
Expand Down
17 changes: 12 additions & 5 deletions scripts/generate_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Usage:
python3 scripts/generate_tables.py

Downloads UCD files for Unicode 17.0 and generates:
Downloads UCD files for Unicode 18.0 and generates:
src/tables/decomposition.rs
src/tables/composition.rs
src/tables/ccc.rs
Expand All @@ -19,7 +19,7 @@
from pathlib import Path
from collections import defaultdict

UNICODE_VERSION = "17.0.0"
UNICODE_VERSION = "18.0.0"
UCD_BASE_URL = f"https://www.unicode.org/Public/{UNICODE_VERSION}/ucd"

UCD_FILES = {
Expand All @@ -30,13 +30,13 @@
"CaseFolding.txt": f"{UCD_BASE_URL}/CaseFolding.txt",
}

SECURITY_BASE_URL = "https://www.unicode.org/Public/security/latest"
SECURITY_BASE_URL = f"https://www.unicode.org/Public/{UNICODE_VERSION}/security"
SECURITY_FILES = {
"confusables.txt": f"{SECURITY_BASE_URL}/confusables.txt",
}

SCRIPT_DIR = Path(__file__).resolve().parent
CACHE_DIR = SCRIPT_DIR / "ucd_cache"
CACHE_DIR = SCRIPT_DIR / "ucd_cache" / UNICODE_VERSION
PROJECT_ROOT = SCRIPT_DIR.parent
OUTPUT_DIR = PROJECT_ROOT / "src" / "tables"
TEST_DATA_DIR = PROJECT_ROOT / "tests" / "data"
Expand Down Expand Up @@ -901,6 +901,7 @@ def write_normalization_tests_rs(tests):
f.write(f"// Test cases: {len(tests)}\n\n")
f.write("#![cfg_attr(rustfmt, rustfmt::skip)]\n\n")
f.write("#[derive(Debug)]\n")
f.write("#[allow(dead_code)]\n")
f.write("pub struct NormalizationTest {\n")
f.write(" pub source: &'static str,\n")
f.write(" pub nfc: &'static str,\n")
Expand All @@ -915,7 +916,13 @@ def write_normalization_tests_rs(tests):
nfd_lit = codepoints_to_rust_str(nfd)
nfkc_lit = codepoints_to_rust_str(nfkc)
nfkd_lit = codepoints_to_rust_str(nfkd)
f.write(f" NormalizationTest {{ source: {src_lit}, nfc: {nfc_lit}, nfd: {nfd_lit}, nfkc: {nfkc_lit}, nfkd: {nfkd_lit} }},\n")
f.write(" NormalizationTest {\n")
f.write(f" source: {src_lit},\n")
f.write(f" nfc: {nfc_lit},\n")
f.write(f" nfd: {nfd_lit},\n")
f.write(f" nfkc: {nfkc_lit},\n")
f.write(f" nfkd: {nfkd_lit},\n")
f.write(" },\n")
f.write("];\n")
print(f" Wrote {path} ({path.stat().st_size} bytes, {len(tests)} test cases)")

Expand Down
Loading
Loading