Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fumiama/emozi
Emoji-lized HanZi generator. ๐๐ฌ๐ง๐ค๐ธ๏ธ๐๐งโ๏ธ๐๐๐จ๐ ๐น๐งฆ๐จ๐ฅ๐น๐๐จ๐ฆโฌ
๏ธโ๏ธ๐จ๐ก๐ฆ๐ก๐๐ฑ๐ต๐ก๐ง๐ช๐๐๐จ๐ถ
https://github.com/fumiama/emozi
Last synced: 16 days ago
JSON representation
Emoji-lized HanZi generator. ๐๐ฌ๐ง๐ค๐ธ๏ธ๐๐งโ๏ธ๐๐๐จ๐ ๐น๐งฆ๐จ๐ฅ๐น๐๐จ๐ฆโฌ ๏ธโ๏ธ๐จ๐ก๐ฆ๐ก๐๐ฑ๐ต๐ก๐ง๐ช๐๐๐จ๐ถ
- Host: GitHub
- URL: https://github.com/fumiama/emozi
- Owner: fumiama
- License: agpl-3.0
- Created: 2024-02-13T07:44:59.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-22T06:59:51.000Z (11 months ago)
- Last Synced: 2024-10-30T17:08:46.966Z (2 months ago)
- Language: Go
- Size: 1.09 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
EMOZI
[![See My Viedo](https://img.shields.io/badge/%E5%8E%9F%E7%90%86%E8%AF%A6%E8%A7%81%E6%88%91%E5%8F%91%E5%B8%83%E7%9A%84%E8%A7%86%E9%A2%91-Bilibili-pink?style=for-the-badge)](https://www.bilibili.com/video/BV14K421y75F)
ๅ่ๅคๅๅๅฃไนฆไฝ่ฎพ่ฎก็ไธ็งๅบไบ้ขๆๅญ็ๆฑๅญๆฝ่ฑก่ฝฌๅๆณ
๐๐ฌ๐ง๐ค๐ธ๏ธ๐๐งโ๏ธ๐๐๐จ๐ ๐น๐งฆ๐จ๐ฅ๐น๐๐จ๐ฆโฌ ๏ธโ๏ธ๐จ๐ก๐ฆ๐ก๐๐ฑ๐ต๐ก๐ง๐ช๐๐๐จ๐ถ
## ๅฝไปค่กๅทฅๅ ท
ไฝไบ`cmd`ๆไปถๅคนใ
```bash
็จๆณ: [-h|f|nr] [-db ๅญ.db] [-d ๐นโช๐ฑโข๐ดโญ๐ฉ] [-e ๅฅฝ] ๅฝขๅฃฐๅญ้ๆฉ1 ๅฝขๅฃฐๅญ้ๆฉ2 ...
-a string
ๆทปๅ ไธไธชๆฑๅญๅฐ้ๅ ๅบ
-d string
่งฃ็ ้ขๆๅญไธบๆฑๅญๅบๅ
-db string
็ฌฆๅ่ง่็ๆฅ่ฏขๆฐๆฎๅบไฝ็ฝฎ, ไธๅญๅจๅไผ่ชๅจ้ๆพๅฐ่ฏฅ่ทฏๅพ. (default "ๅญ.db")
-deloverlay int
ๅ ้คไธไธช้ๅ ๅบไธญ็ๅญ
-delradical
ๅ ้ค-rๆๅฎ็้จ้ฆ็่ฎฐๅฝ
-e string
็ผ็ ๆฑๅญๅบๅไธบ้ขๆๅญ
-f ๅผบๅถ่งฃ็ ๅนถ้็ฑๆฌ็จๅบ็ๆ็้ขๆๅญๅบๅ
-h ๆพ็คบๅธฎๅฉไฟกๆฏ
-i ๆๅฎๆฑๅญ-aๅๅธฆๅฃฐ่ฐ็ๆผ้ณ-pไปฅ่ฎก็ฎๅ ถๅ จๅฑๅฏไธID
-nr
ไธ้ๆบ้ๅๆๆ่ฏป้ณ็ธ่ฟ็้ขๆๅญ
-p string
ๅธฆๅฃฐ่ฐ็ๆผ้ณ
-r string
ๆๅฎๆฌฒ็ผ่พ็้จ้ฆ
-re string
ๆๅฎ้จ้ฆๅฏนๅบ็้ขๆๅญ
-stabilize int
ๅบๅฎ้ๅ ๅบไธญ็ๅญๅฐไธปๅบ
```
ไธ้ขๆฏไธไบ็จไพใ
### ่ฎก็ฎไธไธชๅญ็ๅฝ้ ้ณๆ ใ้จ้ฆใๅ จๅฑID
> ่ฏฅ่ฎก็ฎไธๆฅๆฐๆฎๅบ, ๅฎๅ จไธๆฐๆฎๅบๆ ๅ ณ.
```bash
go run cmd/main.go -i -a ๅฆ -p o
ๆๅญ: ๅฆ ๆผ้ณIPA: 0 ษ ่ฝปๅฃฐ ID: 93346820784388
็จๅบๅค็็ปๆ
```
### ๆฅ่ฏขๅบไธญ่ฎฐๅฝ็ๅญ็ไฟกๆฏ
```bash
go run cmd/main.go -a ่ก
ๆฅ่ฏขๅฐๆฑๅญ ่ก ็่ฎฐๅฝ:
0) #149859999752449 ่ก [ษ, iล, ้ณๅนณ] ไป่ก xing xรญnษก
1) #149859999554817 ่ก [x, ษล, ้ณๅนณ] ไป่ก hang hรกng
็จๅบๅค็็ปๆ
```
### ็ผ็
> ๆณจๆ: ๅฏไปฅๆๅฎ`-nr`ๅๆฐไป่ไฝฟ็ผ่งฃ็ ็ปๆๅฏไธใ
```bash
go run cmd/main.go -e ๅฅฝ
็ผ็ ็ปๆ: ๐นโช๐ฑโข๐ดโญ๐ฉ
็จๅบๅค็็ปๆ
```
### ่งฃ็
```bash
go run cmd/main.go -d ๐นโช๐ฑโข๐ดโญ๐ฉ
่งฃ็ ็ปๆ: ๅฅฝ
็จๅบๅค็็ปๆ
```
### ๆทปๅ ไธไธชๅญๅฐ้ๅ ๅบ
```bash
go run cmd/main.go -e ็
็ผ็ ็ปๆ: ็โฌ๐ณโญ๐ณโค๐ณ
็จๅบๅค็็ปๆgo run cmd/main.go -a ็ -p de -r ๆฅ -re ๐
ๅทฒๆทปๅ ๆฑๅญ: ็ ่ฏป้ณ: t, ษค, ่ฝปๅฃฐ ้จ้ฆ: ๆฅ ID: 130309308023300
ๅทฒๆทปๅ ้จ้ฆ: ๆฅ ้ขๆๅญ: ๐
ๆฅ่ฏขๅฐๆฑๅญ ็ ็่ฎฐๅฝ:
0) #130309308023300 ็ [t, ษค, ่ฝปๅฃฐ] ไปๆฅ de de
็จๅบๅค็็ปๆgo run cmd/main.go -e ็
็ผ็ ็ปๆ: ๐ชโฌ๐โญ๐ฏโ๐
็จๅบๅค็็ปๆ
```
### ๆๅฎๅค้ณๅญ
```bash
go run cmd/main.go -e ไฝ ๅฅฝ๏ผไธ็๏ผ็็ๅค้ณๅญ๏ผ่กใ
็ผ็ ็ปๆ: ๐ฅโฉ๐โจ๐ดโ๐ค๐ธ๐ฑ๐ด๐ฉ๏ผ๐โ๏ธ๐จ๐๐ฆถ๐ด๐จ๐จโ๐พ๏ผ๐๐๐๐๏ธ๐ญ๐๐๐๏ธ๐ซ๐๐๐ชฉ๐๐ต๐๐ตโฌ ๐ ๐จ๐ผ๏ผ[โจ๐ฆ ๐งโโ๏ธโ|๐ต๐๐งโโ๏ธโ]ใ
ๅฏ้ๅฝขๅฃฐ: [2]
ๅจๅๆฐไธญๆๅฎๅฝขๅฃฐๅญ็ผๅท(ไป0ๅผๅง)ไปฅ็ๆไธๅธฆไธญๆฌๅท็็ผ็ ็ปๆ
็จๅบๅค็็ปๆgo run cmd/main.go -e ไฝ ๅฅฝ๏ผไธ็๏ผ็็ๅค้ณๅญ๏ผ่กใ 1
็ผ็ ็ปๆ: ๐ฅโญ๐โจ๐ดโช๐ค๐ผ๐บ๐ด๐ฉ๏ผ๐๏ธ๐ ๐จ๐โ๐ด๐จ๐จโ๐พ๏ผ๐๐๐๐๏ธ๐๐๐๐๏ธ๐ช๐๐๐ชฉ๐ฆท๐ต๐๐ตโฌ โ๏ธ๐จ๐ผ๏ผ๐ฅ๐๐งโใ
็จๅบๅค็็ปๆgo run cmd/main.go -d "๐ฅโญ๐โจ๐ดโช๐ค๐ผ๐บ๐ด๐ฉ๏ผ๐๏ธ๐ ๐จ๐โ๐ด๐จ๐จโ๐พ๏ผ๐๐๐๐๏ธ๐๐๐๐๏ธ๐ช๐๐๐ชฉ๐ฆท๐ต๐๐ตโฌ โ๏ธ๐จ๐ผ๏ผ๐ฅ๐๐งโใ"
่งฃ็ ็ปๆ: [ไฝ |ๅ]ๅฅฝ๏ผไธ[็|็]๏ผ็็ๅค้ณๅญ๏ผ่กใ
็จๅบๅค็็ปๆ
```## ไฝไธบๅบๅผ็จ
### ็นๅซๆณจๆ
ๆฌ`package`ไฝฟ็จไบ่ชไฟฎๆน็`modernc.org/sqlite`ๆฐๆฎๅบ๏ผๅฆๆฌฒๅผๅ ฅๆฌๅ ๏ผ้่ฆๅจ`go.mod`ๆทปๅ ๅฆไธๆฟๆข้กนใ
```bash
replace modernc.org/sqlite => github.com/fumiama/sqlite3 v1.20.0-with-win386replace github.com/remyoudompheng/bigfft => github.com/fumiama/bigfft v0.0.0-20211011143303-6e0bfa3c836b
```
### ๆผ้ณ่ฏๅซๆๅ
ๅฐๅธฆๅฃฐ่ฐ็ๆผ้ณๆๅไธบไปฅๅฝ้ ้ณๆ ่กจ็คบ็ๅฃฐๆฏ้ตๆฏใ
```go
s, y, t, err := emozi.SplitPinyin("jiวng")
if err != nil {
panic(err)
}
fmt.Println(s, y, tone) // tษ iฬฏสล ไธๅฃฐ
```
### ๆฅๆฑๅญ
ๆฅไธไธชๆฑๅญๅจๆฐๆฎๅบไธญ็่ฎฐๅฝใ
```go
coder, err := emozi.NewCoder(time.Minute)
if err != nil {
panic(err)
}
defer coder.Close()
lst, err := coder.Lookup('่ก')
if err != nil {
panic(err)
}
fmt.Println("ๆฅ่ฏขๅฐๆฑๅญ ่ก ็่ฎฐๅฝ:")
for i, x := range lst {
fmt.Printf("%d)\t%s\n", i, x)
}
/*
ๆฅ่ฏขๅฐๆฑๅญ ่ก ็่ฎฐๅฝ:
0) #149859999752449 ่ก [ษ, iล, ้ณๅนณ] ไป่ก xing xรญnษก
1) #149859999554817 ่ก [x, ษล, ้ณๅนณ] ไป่ก hang hรกng
*/
```