From 6342f9140a4c8179667a1757461bd8fe1d6bf4b9 Mon Sep 17 00:00:00 2001 From: Robert Bastian Date: Wed, 26 Apr 2023 10:08:45 +0200 Subject: [PATCH] ICU-22373 Export segmentation dictionaries (cherry picked from commit 6c05042cbcf447eefd49da70c4d94359c336e60d) --- .ci-builds/.azure-pipelines.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.ci-builds/.azure-pipelines.yml b/.ci-builds/.azure-pipelines.yml index 115b383797af..a04aa1ccc9cd 100644 --- a/.ci-builds/.azure-pipelines.yml +++ b/.ci-builds/.azure-pipelines.yml @@ -633,7 +633,7 @@ jobs: ./bin/icuexportdata --mode uprops --index --copyright --verbose --destdir icuexportdata/uprops/fast --trie-type fast --all mkdir -p icuexportdata/uprops/small ./bin/icuexportdata --mode uprops --index --copyright --verbose --destdir icuexportdata/uprops/small --trie-type small --all - displayName: 'Build property data export files' + displayName: 'Build property data files' env: LD_LIBRARY_PATH: lib - script: | @@ -642,7 +642,7 @@ jobs: ./bin/icuexportdata --mode norm --index --copyright --verbose --destdir icuexportdata/norm/fast --trie-type fast --all mkdir -p icuexportdata/norm/small ./bin/icuexportdata --mode norm --index --copyright --verbose --destdir icuexportdata/norm/small --trie-type small --all - displayName: 'Build normalization data export files' + displayName: 'Build normalization data files' env: LD_LIBRARY_PATH: lib - script: | @@ -651,7 +651,7 @@ jobs: ./bin/icuexportdata --mode ucase --index --copyright --verbose --destdir icuexportdata/ucase/fast --trie-type fast --all mkdir -p icuexportdata/ucase/small ./bin/icuexportdata --mode ucase --index --copyright --verbose --destdir icuexportdata/ucase/small --trie-type small --all - displayName: 'Build case data export files' + displayName: 'Build case data files' env: LD_LIBRARY_PATH: lib - script: | @@ -663,7 +663,19 @@ jobs: mkdir -p icuexportdata/collation/implicithan ./bin/genrb -X -s data/coll/ --ucadata data/in/coll/ucadata-implicithan-icu4x.icu -d icuexportdata/collation/implicithan $FILES rm icuexportdata/collation/implicithan/*.res - displayName: 'Build collation data export files' + displayName: 'Build collation data files' + env: + LD_LIBRARY_PATH: lib + - script: | + cd icu4c/source + mkdir -p icuexportdata/segmenter/dictionary + for FILE in `ls data/brkitr/dictionaries` + do + ./bin/gendict --uchars data/brkitr/dictionaries/$FILE /dev/stdout | \ + python3 -c 'import sys; data = sys.stdin.buffer.read(); print(f"trie_data = {[data[i + 1] << 8 | data[i] for i in range(64, len(data) - 1, 2)]}")' \ + > icuexportdata/segmenter/dictionary/`basename $FILE .txt`.toml + done + displayName: 'Build segmenter dictionary files' env: LD_LIBRARY_PATH: lib - task: ArchiveFiles@2