Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
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
14 changes: 5 additions & 9 deletions .ci/checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ smatch phonemes;
regex expr("(gw?|kw?|ng?|sh?|[bpmfdtlhzcjw])?(aa?|eo?|oe?|[iu]|yu|ng|m)([iumptk]|ng?)?([1-6])");

// CHANGE THIS -- a function to check if a jyutping word is valid
bool valid_jyutping(std::string a)
{
bool valid_jyutping(std::string a) {
// Has a jyutping-like structure -- catches most invalid spellings ('ch-', 'eu-', etc)
// If cannot be decomposed into exactly 4 groups, treat as invalid
if (!regex_match(a, phonemes, expr)) return false;
Expand Down Expand Up @@ -57,8 +56,7 @@ bool valid_jyutping(std::string a)
}

//Strips down a jyutping string into words and passes to valid_jyutping() for checking
bool process(std::string a)
{
bool process(std::string a) {
std::istringstream sin(a);
while(sin >> word) {
if (!valid_jyutping(word)) return false;
Expand All @@ -67,8 +65,7 @@ bool process(std::string a)
}

//Processes file and keeps track of discovered errors
int parse()
{
int parse() {
int count_invalid = 0;
int line_no = 0;

Expand All @@ -94,8 +91,7 @@ int parse()
}

// Wrapper for command line interface
int main (int argc, char** argv)
{
int main (int argc, char** argv) {
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);

Expand All @@ -110,4 +106,4 @@ int main (int argc, char** argv)

std::freopen(dict.c_str(), "r", stdin); // redirect file to stdin stream
return parse();
}
}
87 changes: 0 additions & 87 deletions .ci/verify.php

This file was deleted.

21 changes: 9 additions & 12 deletions .github/workflows/deploy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Install rime engine
run: |
sudo apt-get install ibus-rime -y
- name: Install rime-cantonese files
- name: Install rime-cantonese files from checked out branch
run: |
chmod u+x ./.ci/*
export rime_dir=~/.config/ibus/rime
./.ci/install-schema.sh
curl -fsSL https://git.io/rime-install | bash -s -- :preset emoji CanCLID/rime-loengfan custom:set:config=default,key=installed_from,value=rime-cantonese custom:clear_schema_list custom:add:schema=jyut6ping3 custom:add:schema=cangjie5 custom:add:schema=stroke custom:add:schema=luna_pinyin lotem/rime-octagram-data lotem/rime-octagram-data@hant lotem/rime-octagram-data:customize:schema=jyut6ping3,model=hant
cp ./*.{txt,yaml} $rime_dir
cp ./opencc/* $rime_dir

# Use cp ./** in lieu of ./.ci/install_schema.sh to ensure that action is running on checked out branch (e.g. PR refs)

- name: Compile
run: |
chmod u+wx ~/.config/ibus/rime/*
Expand All @@ -55,12 +60,4 @@ jobs:
chmod u+x ./checker.o
- run: |
echo "Checking jyut6ping3.dict.yaml"
time ./checker.o jyut6ping3.dict.yaml

check_jyutping_php:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- run: |
php .ci/verify.php
time ./checker.o jyut6ping3.dict.yaml
2 changes: 1 addition & 1 deletion jyut6ping3.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ engine:
- table_translator@cangjie5
filters:
- simplifier@emoji_cantonese_suggestion
- simplifier
- simplifier@variants_hk
- simplifier@trad_tw
- simplifier
- uniquifier
- reverse_lookup_filter@jyut6ping3_reverse_lookup

Expand Down
Loading