Initial commit
This commit is contained in:
commit
050df05154
7 changed files with 884 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
/target
|
||||||
|
*~
|
||||||
369
Cargo.lock
generated
Normal file
369
Cargo.lock
generated
Normal file
|
|
@ -0,0 +1,369 @@
|
||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aho-corasick"
|
||||||
|
version = "1.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba"
|
||||||
|
dependencies = [
|
||||||
|
"memchr",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "app_data"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "07ec1b6aed854f15a2226f7e2a44cc2822b4f06896bcb0ba13431b59edd7f14f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "buhong"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"app_data",
|
||||||
|
"curl",
|
||||||
|
"js-sys",
|
||||||
|
"regex",
|
||||||
|
"unicode-normalization",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bumpalo"
|
||||||
|
version = "3.20.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cc"
|
||||||
|
version = "1.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4ff2a8126fff0f8c839080d619675a585e61720bb12d2baceae45769fd66f155"
|
||||||
|
dependencies = [
|
||||||
|
"find-msvc-tools",
|
||||||
|
"shlex",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg-if"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "curl"
|
||||||
|
version = "0.4.51"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ef3ce06df3ac230a4f5c91bfd3e3961cd66f177bd9964c87deb3cce59a54fb7b"
|
||||||
|
dependencies = [
|
||||||
|
"curl-sys",
|
||||||
|
"libc",
|
||||||
|
"openssl-probe",
|
||||||
|
"openssl-sys",
|
||||||
|
"schannel",
|
||||||
|
"socket2",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "curl-sys"
|
||||||
|
version = "0.4.91+curl-8.22.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cd39579123e45bf762716bb893d43886ed1cabe6289455be29a4f1d4e37afb06"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
"libz-sys",
|
||||||
|
"openssl-sys",
|
||||||
|
"pkg-config",
|
||||||
|
"vcpkg",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "find-msvc-tools"
|
||||||
|
version = "0.1.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1c66915cc5391097de7a2b0b972e8505aa33c0df401fd3a6811dbdb32881ba48"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-core"
|
||||||
|
version = "0.3.34"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-task"
|
||||||
|
version = "0.3.34"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-util"
|
||||||
|
version = "0.3.34"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
|
||||||
|
dependencies = [
|
||||||
|
"futures-core",
|
||||||
|
"futures-task",
|
||||||
|
"pin-project-lite",
|
||||||
|
"slab",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "js-sys"
|
||||||
|
version = "0.3.107"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"futures-util",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libc"
|
||||||
|
version = "0.2.191"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "libz-sys"
|
||||||
|
version = "1.1.32"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "69965d2409bff8c8cea3829009fff66a86f05a0570656552ef70f616e8e4bd85"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
"pkg-config",
|
||||||
|
"vcpkg",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "memchr"
|
||||||
|
version = "2.8.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "openssl-probe"
|
||||||
|
version = "0.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "openssl-sys"
|
||||||
|
version = "0.9.118"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "19c413d6ec9ebaf5e1c829d355cb3e9f783778d700f135be0921d52fce3c60ae"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"libc",
|
||||||
|
"pkg-config",
|
||||||
|
"vcpkg",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pin-project-lite"
|
||||||
|
version = "0.2.17"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pkg-config"
|
||||||
|
version = "0.3.34"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.107"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.47"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex"
|
||||||
|
version = "1.13.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-automata",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-automata"
|
||||||
|
version = "0.4.18"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2"
|
||||||
|
dependencies = [
|
||||||
|
"aho-corasick",
|
||||||
|
"memchr",
|
||||||
|
"regex-syntax",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "regex-syntax"
|
||||||
|
version = "0.8.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustversion"
|
||||||
|
version = "1.0.23"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "schannel"
|
||||||
|
version = "0.1.30"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9cb23c424d8ee841bb4d813677ca237e2a610067d594fec130f87d6093495ab5"
|
||||||
|
dependencies = [
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "shlex"
|
||||||
|
version = "2.0.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "slab"
|
||||||
|
version = "0.4.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "socket2"
|
||||||
|
version = "0.6.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"windows-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "3.0.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tinyvec"
|
||||||
|
version = "1.13.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-ident"
|
||||||
|
version = "1.0.27"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-normalization"
|
||||||
|
version = "0.1.26"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d"
|
||||||
|
dependencies = [
|
||||||
|
"tinyvec",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "vcpkg"
|
||||||
|
version = "0.2.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen"
|
||||||
|
version = "0.2.130"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a0181c14ddd6c7b8b0b0132a5f1ea2f32be0d893cd3ea97b6e3b28886b8a3d1c"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
"rustversion",
|
||||||
|
"wasm-bindgen-macro",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro"
|
||||||
|
version = "0.2.130"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6e931a02a39abdbf66966fc35902b5ed58344750a70885bed4ebb3d8eaf28ed9"
|
||||||
|
dependencies = [
|
||||||
|
"quote",
|
||||||
|
"wasm-bindgen-macro-support",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-macro-support"
|
||||||
|
version = "0.2.130"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2ca4b54280e455bd831e33a6b8e734baf432fe63fbc35c42ac14ce67a043a53a"
|
||||||
|
dependencies = [
|
||||||
|
"bumpalo",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
"wasm-bindgen-shared",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wasm-bindgen-shared"
|
||||||
|
version = "0.2.130"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3b1f9c3798725016c6ee5f2f57869ec0831e8bbc0ab0310a86e787e97f41389e"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-ident",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "web-sys"
|
||||||
|
version = "0.3.107"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d7d179596ff5ec0f6de4db64d54011bde6289cc49603d3a6e4ce3f329207ab88"
|
||||||
|
dependencies = [
|
||||||
|
"js-sys",
|
||||||
|
"wasm-bindgen",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-link"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-sys"
|
||||||
|
version = "0.61.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link",
|
||||||
|
]
|
||||||
29
Cargo.toml
Normal file
29
Cargo.toml
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
[package]
|
||||||
|
name = "buhong"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
description = "a Taiwanese/Hokkien processing tool"
|
||||||
|
repository = ""
|
||||||
|
license = "MIT"
|
||||||
|
|
||||||
|
[target.dependencies]
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["cdylib", "rlib"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
regex = "1.13.1"
|
||||||
|
unicode-normalization = "0.1.26"
|
||||||
|
|
||||||
|
[target.'cfg(unix)'.dependencies]
|
||||||
|
app_data = "0.1.1"
|
||||||
|
curl = "0.4"
|
||||||
|
|
||||||
|
[target.'cfg(windows)'.dependencies]
|
||||||
|
app_data = "0.1.1"
|
||||||
|
curl = "0.4"
|
||||||
|
|
||||||
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
|
wasm-bindgen = "0.2"
|
||||||
|
js-sys = "0.3"
|
||||||
|
web-sys = "0.3"
|
||||||
9
LICENSE
Normal file
9
LICENSE
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Yoxem
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
85
README.md
Normal file
85
README.md
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
# Buhong
|
||||||
|
a Taigi processing tool
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
- libssl-dev: 3.0.13
|
||||||
|
- rust: 1.99.1
|
||||||
|
- cargo: 1.99.1
|
||||||
|
- wasm-pack: 0.15.1
|
||||||
|
- only if you want to compile it to browser-runnable WASM code. It's recommended to install with
|
||||||
|
`cargo install wasm-pack`
|
||||||
|
|
||||||
|
## How to build the wasm version
|
||||||
|
|
||||||
|
- To build the browser-runnable version, run `wasm-pack build --target web` inside the project directory.
|
||||||
|
- to use in the `.html` file, insert the code:
|
||||||
|
```
|
||||||
|
<script type="module">
|
||||||
|
import init, { f } from "./pkg/buhong.js"; // f is just an example
|
||||||
|
|
||||||
|
await init();
|
||||||
|
f(x, y);
|
||||||
|
</script>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Other documents
|
||||||
|
|
||||||
|
- For the implement details of the tool, see `./docs`.
|
||||||
|
|
||||||
|
## 了後ê做法
|
||||||
|
- 將台文語料轉作數字台羅需要函數
|
||||||
|
- 小寫化臺語文、數字加escape字元(1 => \1),koh "\" => "\\"
|
||||||
|
- 切臺語ê句變做音節
|
||||||
|
- 若準講判定是臺語音節,轉做數字音節
|
||||||
|
- 就變成按呢
|
||||||
|
```
|
||||||
|
我共你講 gua2 ka7 li2 kong2
|
||||||
|
代誌 tai7-tsi3
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
- 了後處理做:
|
||||||
|
|
||||||
|
```
|
||||||
|
s_arrayized_series = []
|
||||||
|
for s in 句ê集:
|
||||||
|
s_arrayized = arrayize(s);
|
||||||
|
s_arrayized = ["HEAD"].append(s_arrayized)
|
||||||
|
s_arrayized_series.push(s_arrayized)
|
||||||
|
|
||||||
|
```
|
||||||
|
tshiau揣:,代先按呢切:
|
||||||
|
|
||||||
|
```
|
||||||
|
阮老師欲來。 == n字
|
||||||
|
"gun2" " " "lau7" "-" "su1" " " "beh4" " " "lai5" "." 2n-1字
|
||||||
|
```
|
||||||
|
|
||||||
|
先檢查「羅字數量 == 漢字數量*2 - 1」,無就修正語料
|
||||||
|
|
||||||
|
```
|
||||||
|
for j in range(1,len(sentencePair[i].漢)):
|
||||||
|
漢 = sentencePair[i].漢[j]
|
||||||
|
頂字 = sentencePair[i].漢[j-1]
|
||||||
|
羅字 = sentencePair[i].羅[2*j-1]
|
||||||
|
羅字頂符 = sentencePair[i].羅[2*j-2]
|
||||||
|
if 羅字頂符 in ["-", "--"]": // 空白不算
|
||||||
|
頭前敢欲連字 = true
|
||||||
|
else:
|
||||||
|
false
|
||||||
|
HASHMAPHEAD = 漢 + 羅 + 頂字 + 頭前敢欲連字.as_str()
|
||||||
|
if not HASHMAPHEAD in freq_dict.keys()
|
||||||
|
freq_dict(HASHMAPHEAD) = [漢,羅,頂字,頭前敢欲連字,1]
|
||||||
|
else
|
||||||
|
freq_dict(HASHMAPHEAD) = [漢,羅,頂字,頭前敢欲連字,freq_dict["HASHMAPHEAD"]["freq"]+1]
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
漢,羅,頂字,頭前敢欲連字,出現改數
|
||||||
|
扁,pinn2,水,false,2
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
372
src/lib.rs
Normal file
372
src/lib.rs
Normal file
|
|
@ -0,0 +1,372 @@
|
||||||
|
use std::path::{PathBuf};
|
||||||
|
use std::str;
|
||||||
|
use regex::{Regex, RegexSet};
|
||||||
|
use std::fs;
|
||||||
|
use unicode_normalization::char::decompose_canonical;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
|
||||||
|
#[cfg(target_arch = "wasm32")] // not #[wasm_bindgen]
|
||||||
|
use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
|
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
use app_data::AppData;
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
use curl::easy::Easy;
|
||||||
|
|
||||||
|
/// the categories of the vaild syllables
|
||||||
|
/// the description of the categories is shown below:
|
||||||
|
/// - GeneralSyl : Non-syllablized nasal consonants, eg. à, i̍k, bah, hó, tshiànn
|
||||||
|
/// - MSyl : Syllablized "m", eg. m̄, mh, hm̂
|
||||||
|
/// - NGSyl : Syllablized "ng", eg. n̂g, ngh, nn̄g
|
||||||
|
#[derive(Debug, PartialEq)]
|
||||||
|
enum SyllableCategory{
|
||||||
|
GeneralSyl,
|
||||||
|
MSyl,
|
||||||
|
NgSyl
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_custom_data_folder() -> PathBuf{
|
||||||
|
let custom_data_folder: PathBuf;
|
||||||
|
|
||||||
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
{
|
||||||
|
custom_data_folder = std::env::temp_dir(); // for wasm browser only
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]{
|
||||||
|
custom_data_folder = AppData::new("buhong")
|
||||||
|
.ensure_data_dir()
|
||||||
|
.expect("The custom data directory can not be created.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return custom_data_folder;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// download corpus content from the default corpus repo
|
||||||
|
/// i.e. https://repo.kianting.info/yoxem/buhong-corpus
|
||||||
|
/// if it fails, download it from
|
||||||
|
/// https://repo.kianting.info/yoxem/buhong-corpus/raw/branch/main/dict/kamjitian/kamjitian.hanji.dict.yaml
|
||||||
|
/// - path: eg. `dict/kamjitian/kamjitian.hanji.dict.yaml` for
|
||||||
|
/// `https://repo.kianting.info/yoxem/buhong-corpus/raw/branch/main/dict/kamjitian/kamjitian.hanji.dict.yaml`
|
||||||
|
/// - dest_dir: the folder inside the `custom_data_folder`. It should be relative path.
|
||||||
|
|
||||||
|
#[cfg(not(target_arch = "wasm32"))]
|
||||||
|
pub fn download_corpus_content(download_path: &str, dest_dir: &str){
|
||||||
|
let main_repo_url = "https://repo.kianting.info/yoxem/buhong-corpus/raw/branch/main/";
|
||||||
|
let backup_repo_url = "https://github.com/Yoxem/buhong-corpus/raw/refs/heads/main/";
|
||||||
|
|
||||||
|
let path_seperator = Regex::new(r"[//]").expect("Invalid regex");
|
||||||
|
let path_splitted: Vec<&str> = path_seperator.split(download_path).into_iter().collect();
|
||||||
|
let file_name = path_splitted.last().unwrap();
|
||||||
|
|
||||||
|
let dest_folder = get_custom_data_folder().join(dest_dir);
|
||||||
|
|
||||||
|
|
||||||
|
let mut total_url = format!("{main_repo_url}{download_path}");
|
||||||
|
let mut file_content : Vec<u8> = Vec::new();
|
||||||
|
let mut handle = Easy::new();
|
||||||
|
handle.url(&total_url).unwrap();
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut transfer = handle.transfer();
|
||||||
|
transfer.write_function(|data| {
|
||||||
|
file_content.extend_from_slice(data);
|
||||||
|
Ok(data.len())
|
||||||
|
}).unwrap();
|
||||||
|
transfer.perform().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut res_code= handle.response_code()
|
||||||
|
.expect("The response code should be returned.");
|
||||||
|
|
||||||
|
if res_code < 200{
|
||||||
|
let file_string = String::from_utf8(file_content).expect("Our bytes should be valid utf8");
|
||||||
|
fs::write(dest_folder.join(PathBuf::from(file_name)), file_string)
|
||||||
|
.expect("The downloaded file can't be written!");
|
||||||
|
}else{
|
||||||
|
total_url = format!("{backup_repo_url}{download_path}");
|
||||||
|
handle.url(&total_url).unwrap();
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut transfer = handle.transfer();
|
||||||
|
transfer.write_function(|data| {
|
||||||
|
file_content.extend_from_slice(data);
|
||||||
|
Ok(data.len())
|
||||||
|
}).unwrap();
|
||||||
|
transfer.perform().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
res_code= handle.response_code()
|
||||||
|
.expect("The response code should be returned.");
|
||||||
|
|
||||||
|
if res_code < 400{
|
||||||
|
let file_string = String::from_utf8(file_content).expect("Our bytes should be valid utf8");
|
||||||
|
fs::write(dest_folder.join(PathBuf::from(file_name)), file_string)
|
||||||
|
.expect("The downloaded file can't be written!");
|
||||||
|
}else{
|
||||||
|
panic!("The file you want to download is not from the main repo or from the backup repo!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn add(left: u64, right: u64) -> u64 {
|
||||||
|
left + right
|
||||||
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen]
|
||||||
|
#[cfg(target_arch = "wasm32")]
|
||||||
|
pub fn add_for_browser(left: u64, right: u64) -> u64 {
|
||||||
|
add(left, right)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// check if the smallcaps and single syllable latin (without hyphens) letter is
|
||||||
|
/// a diacricitized Tâi-lô romanization of Ministry of Education syllable:
|
||||||
|
/// `input`: small-cased latin word (without hyphens and other puncutation, but diacritics are allowed.)
|
||||||
|
/// `return value`: boolean value of whether the input syllable is a valid Tailo
|
||||||
|
pub fn is_diacriticized_tl_single_syllable(latin_word: &str) -> bool{
|
||||||
|
match is_diacriticized_tl_single_syllable_aux(latin_word){
|
||||||
|
None => false,
|
||||||
|
Some(_) => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// auxlliary function check if the single syllable latin (without hyphens) letter is
|
||||||
|
/// a diacricitized Tâi-lô romanization of Ministry of Education syllable:
|
||||||
|
/// `input`: small-cased latin word (without hyphens and other puncutation, but diacritics are allowed.)
|
||||||
|
/// `return value`:
|
||||||
|
/// - `None` if it's not a valid TL syllable.
|
||||||
|
/// - `Some(string)`, where `string` is the number-tone TL syllable
|
||||||
|
pub fn is_diacriticized_tl_single_syllable_aux(latin_word: &str) -> Option<String>{
|
||||||
|
|
||||||
|
// decomposed the diacritics
|
||||||
|
let mut result_decomposed_chars = vec![];
|
||||||
|
for ch in latin_word.chars(){
|
||||||
|
let mut ch_decomposed = Vec::new();
|
||||||
|
decompose_canonical(ch, |c| { ch_decomposed.push(c); });
|
||||||
|
result_decomposed_chars.append(&mut ch_decomposed);
|
||||||
|
}
|
||||||
|
|
||||||
|
let decomposed_latin_word = result_decomposed_chars.clone().into_iter().collect::<String>();
|
||||||
|
println!("result string: {}", decomposed_latin_word);
|
||||||
|
println!("result_decomposed_chars: {:?}", result_decomposed_chars);
|
||||||
|
|
||||||
|
// raw chacking if it matches the pattern
|
||||||
|
// U+0300 = ◌̀ 3rd
|
||||||
|
// U+0301 = ◌́ 2nd
|
||||||
|
// U+0302 = ◌̂ 5th
|
||||||
|
// U+0304 = ◌̄ 7th
|
||||||
|
// U+030B = ◌̋ 9th
|
||||||
|
// U+030C = ◌̌ 6th
|
||||||
|
// U+030D = ◌̍ 8th
|
||||||
|
|
||||||
|
// raw_pattern_m should be in front of raw_pattern_general
|
||||||
|
// to avoid the bug of "m̍h" miscategorized as `GeneralSyl`:
|
||||||
|
let raw_pattern_m = r"^(([ptk]|ts)h?|[blgsjnh]|ng)?m[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?h?$";
|
||||||
|
let raw_pattern_ng = r"^(([ptk]|ts)h?|[blgsjmnh])?n[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?gh?$";
|
||||||
|
let raw_pattern_general = r"^(([ptk]|ts)h?|[blgsjmnh]|ng)?".to_owned() +
|
||||||
|
r"("+
|
||||||
|
r"[aeiou]?[aeiou][\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?[aeiou]?" + // general
|
||||||
|
r"|"+
|
||||||
|
r"[ei][\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?r" + // er, ir
|
||||||
|
r"|"+
|
||||||
|
r"ere[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?" + //ere
|
||||||
|
r")" +
|
||||||
|
r"(n[ng]|[ptkhmn]|nnh)?$";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let regex_set = RegexSet::new([raw_pattern_general.as_str(), raw_pattern_m, raw_pattern_ng]).expect("illegal regex pattern");
|
||||||
|
|
||||||
|
let raw_matched : Vec<_> = regex_set.matches(&decomposed_latin_word).into_iter().collect();
|
||||||
|
|
||||||
|
let syllable_attribute : SyllableCategory;
|
||||||
|
// assert_eq!(raw_matched.is_empty(),true);
|
||||||
|
if raw_matched.is_empty(){
|
||||||
|
println!("Invalid Tâi-lô syllable==>1");
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
match raw_matched[0] {
|
||||||
|
0 => syllable_attribute = SyllableCategory::GeneralSyl,
|
||||||
|
1 => syllable_attribute = SyllableCategory::MSyl,
|
||||||
|
2 => syllable_attribute = SyllableCategory::NgSyl,
|
||||||
|
_ => {
|
||||||
|
println!("The pattern should't be matched.");
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut has_one_diacritics_mark = false;
|
||||||
|
let mut diacritic_mark = ' ';
|
||||||
|
let valid_diacritics_pattern = Regex::new(r"[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]")
|
||||||
|
.expect("Invalid regex");
|
||||||
|
|
||||||
|
let mut chars_without_diacritics = Vec::new();
|
||||||
|
|
||||||
|
for ch in result_decomposed_chars {
|
||||||
|
if valid_diacritics_pattern.is_match(&(ch.to_string())){
|
||||||
|
if has_one_diacritics_mark == false{
|
||||||
|
has_one_diacritics_mark = true;
|
||||||
|
diacritic_mark = ch;
|
||||||
|
|
||||||
|
}else{ // the diacritics mark occured twice or more is invalid
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
chars_without_diacritics.push(ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("chars_without_diactritics: {:?}", chars_without_diacritics);
|
||||||
|
println!("diacritic_mark: {}", diacritic_mark);
|
||||||
|
println!("syllable_attribute: {:?}", syllable_attribute);
|
||||||
|
println!("=======");
|
||||||
|
|
||||||
|
|
||||||
|
// raw chacking if it matches the pattern
|
||||||
|
// U+0300 = ◌̀ 3rd
|
||||||
|
// U+0301 = ◌́ 2nd
|
||||||
|
// U+0302 = ◌̂ 5th
|
||||||
|
// U+0304 = ◌̄ 7th
|
||||||
|
// U+030B = ◌̋ 9th
|
||||||
|
// U+030C = ◌̌ 6th
|
||||||
|
// U+030D = ◌̍ 8th
|
||||||
|
|
||||||
|
// Hashmap for mapping from diacritic to tone number (2~3, 5~9)
|
||||||
|
let diacritic_to_tone_number = HashMap::from([
|
||||||
|
('\u{0301}', 2),
|
||||||
|
('\u{0300}', 3),
|
||||||
|
('\u{0302}', 5),
|
||||||
|
('\u{030C}', 6),
|
||||||
|
('\u{0304}', 7),
|
||||||
|
('\u{030D}', 8),
|
||||||
|
('\u{030B}', 9),
|
||||||
|
]);
|
||||||
|
|
||||||
|
// range: 1~3, 5~9. later will be 1~9.
|
||||||
|
// IMPORTANT: 1 is means both the "4th tone" and the 1st tone now!
|
||||||
|
// The correct 4th tone will be set later.
|
||||||
|
let mut tone_number: u32 = 1;
|
||||||
|
if diacritic_mark != ' ' {
|
||||||
|
tone_number = diacritic_to_tone_number[&diacritic_mark];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1st tone (tone_number == 1) is always without ending -p, -t, -k or -h
|
||||||
|
// 4th tone (tone_number == 1) is always with ending -p, -t ,-k, or -h,
|
||||||
|
// other tone nubmer (except tone_number == 8) is not with -p, -t, -k, or -h.
|
||||||
|
// 8th tone (tone_number == 8) is always with ending with -p, -t, -k or -h
|
||||||
|
// i.e.
|
||||||
|
// 1. if the ending is -p,-t,-k, or -h
|
||||||
|
// but the tone number is not 1 or 8, return false.
|
||||||
|
// 2. if the ending is not -p,-t,-k, or -h
|
||||||
|
// but the tone number is 8, return false.
|
||||||
|
let have_entering_tone_coda = ['p', 't', 'k', 'h']
|
||||||
|
.contains(chars_without_diacritics.last().unwrap());
|
||||||
|
// Condition 1, eg. sák
|
||||||
|
if have_entering_tone_coda && !([1, 8].contains(&tone_number)){
|
||||||
|
println!("COND 1, latin_word={}", latin_word);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Condition 2, eg. sa̍
|
||||||
|
if !have_entering_tone_coda && tone_number == 8{
|
||||||
|
println!("COND 2, latin_word={}", latin_word);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the tone number for the yin-entering (4th) tone to the correct one
|
||||||
|
if have_entering_tone_coda && tone_number == 1{
|
||||||
|
tone_number = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
// the syllable_m and syllable_ng is checked OK, return true
|
||||||
|
if syllable_attribute == SyllableCategory::MSyl || syllable_attribute == SyllableCategory::NgSyl{
|
||||||
|
let syllable_without_diacritics : String = chars_without_diacritics.iter().collect();
|
||||||
|
let syllable_with_tone_number : String = format!("{}{}", syllable_without_diacritics, tone_number);
|
||||||
|
println!("latin_word={} ({:?}) returns TRUE\n\n", latin_word, syllable_with_tone_number);
|
||||||
|
return Some(syllable_with_tone_number);
|
||||||
|
}
|
||||||
|
|
||||||
|
// for other general syllable, check the validity of vowel
|
||||||
|
// get the vowel
|
||||||
|
println!("decomposed_latin_word={}", decomposed_latin_word);
|
||||||
|
let general_pattern = Regex::new(r"^(?<onset>([ptk]|ts)h?|[blgsjmnh]|ng)?(?<vowel>[^mngptkh]+)(?<coda>[mngptkh]+)?$")
|
||||||
|
.expect("Invalid regex.");
|
||||||
|
let caps = general_pattern.captures(&decomposed_latin_word).unwrap();
|
||||||
|
let onset = caps.name("onset").map_or("", |m|m.as_str());
|
||||||
|
let vowel = caps.name("vowel").map_or("", |m|m.as_str());
|
||||||
|
let coda = caps.name("coda").map_or("", |m|m.as_str());
|
||||||
|
|
||||||
|
|
||||||
|
let vowel_pattern_set = RegexSet::new([
|
||||||
|
// Let's categorize the rimes. T for diacritics tone mark, but it's optional
|
||||||
|
// eT?
|
||||||
|
r"^e[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?$",
|
||||||
|
// iT?
|
||||||
|
r"^i[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?$",
|
||||||
|
// oT?o?
|
||||||
|
r"^o[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?o?$",
|
||||||
|
// u
|
||||||
|
r"^u[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?$",
|
||||||
|
// i?aT?u? => ia, a, au, iau
|
||||||
|
r"^i?a[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?u?$",
|
||||||
|
// u?aT?i? => ua, a, ai, uai
|
||||||
|
r"^u?a[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?i?$",
|
||||||
|
// iT?o
|
||||||
|
r"^i[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?o$",
|
||||||
|
// iT?u
|
||||||
|
r"^i[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?u$",
|
||||||
|
// uT?e
|
||||||
|
r"^u[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?e$",
|
||||||
|
// uT?i
|
||||||
|
r"^u[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?i$",
|
||||||
|
// [ie]T?r
|
||||||
|
r"^[ie][\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?r$",
|
||||||
|
// ereT?
|
||||||
|
r"^ere[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?$"])
|
||||||
|
.expect("The regex set contains invalid one");
|
||||||
|
|
||||||
|
let vowel_matched = vowel_pattern_set.is_match(&vowel);
|
||||||
|
if !vowel_matched{
|
||||||
|
println!("Illegal vowel pattern, latin_word={}", latin_word);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
|
// filter of impossible phomene combination:
|
||||||
|
// bVnn(h), lVnn(h), and gVnn(h), bVm, (m|n|ng)V(n|m|ng) , -e[nt] is not allowed.
|
||||||
|
let nnh_pattern = Regex::new(r"^nnh?$").expect("Invalid regex");
|
||||||
|
let e_pattern = Regex::new("^e[\u{300}\u{301}\u{302}\u{304}\u{30B}\u{30C}\u{30D}]?$")
|
||||||
|
.expect("Invalid regex");
|
||||||
|
let nasal_consonants = ["m", "n", "ng"];
|
||||||
|
// [blg]Vnn(h)
|
||||||
|
if ["b", "l", "g"].contains(&onset) && nnh_pattern.is_match(coda){
|
||||||
|
println!("Illegal pattern [blg]Vnn(h), latin_word={}", latin_word);
|
||||||
|
return None;
|
||||||
|
// bVm
|
||||||
|
} else if onset == "b" && coda == "m"{
|
||||||
|
println!("Illegal pattern [bm]Vm, latin_word={}", latin_word);
|
||||||
|
return None;
|
||||||
|
// (m|n|ng)V(n|m|ng)
|
||||||
|
} else if nasal_consonants.contains(&onset) && nasal_consonants.contains(&coda){
|
||||||
|
println!("Illegal pattern (m|n|ng)V(n|m|ng), latin_word={}", latin_word);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
// -e[nt]
|
||||||
|
else if e_pattern.is_match(vowel) && ["n", "t"].contains(&coda){
|
||||||
|
println!("Illegal pattern -e[nt], latin_word={}", latin_word);
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let syllable_without_diacritics : String = chars_without_diacritics.iter().collect();
|
||||||
|
let syllable_with_tone_number : String = format!("{}{}", syllable_without_diacritics, tone_number);
|
||||||
|
println!("latin_word={} ({:?}) returns TRUE\n\n", latin_word, syllable_with_tone_number);
|
||||||
|
return Some(syllable_with_tone_number);
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/main.rs
Normal file
18
src/main.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
use buhong::*;
|
||||||
|
fn main(){
|
||||||
|
|
||||||
|
// Write the contents of rust-lang.org to stdout
|
||||||
|
|
||||||
|
let a = ["oá", "guá", "a̍h", "tshiànn", "hiannh", "ah","hí",
|
||||||
|
"hi", "ha̍k", "n̂g", "sng", "ng", "sngh",
|
||||||
|
"sn̍gh", "hm̂", "m̄", "m", "m̍h", "mn̍gh", "sía", "góa",
|
||||||
|
"bân", "bâm", "ngāng", "nàm", "nàng", "lêt", "le̍t", "len"];
|
||||||
|
|
||||||
|
for w in a {
|
||||||
|
is_diacriticized_tl_single_syllable_aux(w);
|
||||||
|
}
|
||||||
|
|
||||||
|
// download_corpus_content("dict/kamjitian/kamjitian.hanji.dict.yaml", ".");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Loading…
Reference in a new issue