Skip to content

Commit 2bbb73d

Browse files
authored
patch: make the dataset ready to use by the afrim ime (#28)
1 parent 1e516ce commit 2bbb73d

9 files changed

Lines changed: 49 additions & 18 deletions

File tree

am/am.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[info]
22
description = "Amharic Config File"
3-
version = "2023-10-02"
3+
version = "2024-03-23"
4+
5+
[core]
6+
buffer_size = 64
7+
auto_capitalize = false
8+
auto_commit = true
49

510
[data]
611
geez = { path = "../gez/code.toml" }

am/scripts/datetime/date.rhai

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Version: 2023-09-29
1+
// Version: 2024-03-23
22

33
const MONTHS = [
44
"መስከረም", "ጥቅምት", "ሕዳር", "ታህሳስ", "ጥር", "የካቲት", "መጋቢት",
@@ -7,7 +7,6 @@ const MONTHS = [
77

88
fn parse_date(input) {
99
let data = input.split('/');
10-
1110
if data.len() != 3 {
1211
return [];
1312
}
@@ -23,14 +22,19 @@ fn parse_date(input) {
2322

2423
// Main function
2524
fn translate(input) {
25+
let commit = if input.ends_with("'") {
26+
let n = input.len();
27+
input = input.sub_string(0..(n-1));
28+
true
29+
} else { false };
30+
2631
let date = parse_date(input);
27-
2832
if date.is_empty() { return [] }
2933

3034
let amharic_month = global::MONTHS[date[1]-1];
3135

3236
[input, "", [
3337
`${date[0]} ${amharic_month} ${date[2]}`,
3438
`${amharic_month} ${date[0]}, ${date[2]}`
35-
], true]
39+
], commit]
3640
}

clafrica/clafrica.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ name = "Clafrica"
33
description = "Clafrica Config File"
44
authors = ["Resulam <contact@resulam.com>"]
55
website = "https://resulam.com"
6-
version = "2023-10-02"
6+
version = "2024-03-23"
7+
8+
[core]
9+
buffer_size = 64
10+
auto_capitalize = true
11+
auto_commit = true
712

813
[data]
914
single = { path = "./clafrica_single.toml" }

ethiopic/ethiopic.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[info]
22
description = "Ethiopic Config File"
3-
version = "2023-11-07"
3+
version = "2024-03-23"
4+
5+
[core]
6+
buffer_size = 64
7+
auto_capitalize = false
8+
auto_commit = false
49

510
[data]
611
ethiopic = { path = "./code.toml" }

fmp/fmp.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ name = "nufi"
33
description = "Nufi Config File"
44
authors = ["Resulam <contact@resulam.com>"]
55
website = "https://resulam.com"
6-
version = "2023-10-02"
6+
version = "2024-03-23"
7+
8+
[core]
9+
buffer_size = 64
10+
auto_capitalize = true
11+
auto_commit = true
712

813
[translation]
914
sms = { path = "./nufi_sms.toml" }

fmp/scripts/datetime/date.rhai

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Version: 2023-09-29
1+
// Version: 2024-03-23
22

33
const MONTHS = [
44
"Ngù'fī", "Nkùɑ̀nʉ̀ɑ̀", "Mbàkngòfāt",
@@ -9,7 +9,6 @@ const MONTHS = [
99

1010
fn parse_date(input) {
1111
let data = input.split('/');
12-
1312
if data.len() != 3 {
1413
return [];
1514
}
@@ -25,8 +24,13 @@ fn parse_date(input) {
2524

2625
// Main function
2726
fn translate(input) {
28-
let date = parse_date(input);
27+
let commit = if input.ends_with("'") {
28+
let n = input.len();
29+
input = input.sub_string(0..(n-1));
30+
true
31+
} else { false };
2932

33+
let date = parse_date(input);
3034
if date.is_empty() { return }
3135

3236
let nufi_month = global::MONTHS[date[1]-1];
@@ -36,5 +40,5 @@ fn translate(input) {
3640
if date[0] == 1 { "Ntûmbhì līē'" }
3741
else { `līē' ${date[0]}` }
3842
) + `, ${nufi_month} ${date[2]}`
39-
], true]
43+
], commit]
4044
}

fmp/scripts/numerals.rhai

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Version: 2023-09-29
1+
// Version: 2024-03-23
22

33
const UNITS = [
44
"", "nshʉ̀'", "pʉ́ɑ́", "tāā", "kwɑ̀", "tî", "ntòhō",
@@ -12,7 +12,6 @@ const TENS = [
1212

1313
fn translate(input) {
1414
let n = input.len();
15-
let result = "";
1615
let commit = if input.ends_with("'") {
1716
input = input.sub_string(0..(n-1));
1817
n = input.len();
@@ -24,7 +23,6 @@ fn translate(input) {
2423
2 => {
2524
let unit = parse_int(input.sub_string(1,2));
2625
let ten = parse_int(input.sub_string(0,1));
27-
print([ten, unit]);
2826
let nufi_unit = global::UNITS[unit];
2927
let nufi_ten = global::TENS[ten];
3028

gez/gez.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[info]
22
description = "Ge'ez Config File"
3-
version = "2023-10-02"
3+
version = "2024-03-23"
4+
5+
[core]
6+
buffer_size = 64
7+
auto_capitalize = false
8+
auto_commit = true
49

510
[data]
611
geez = { path = "./code.toml" }

gez/scripts/numerals.rhai

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Based on https://www.geez.org/Numerals/
22
// Tested with https://www.geez.org/Numerals/NumberSamples.html
3-
// Version: 2023-09-01
3+
// Version: 2024-03-23
44

55
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
66
const UNITS = ["", "፩", "፪", "፫", "፬", "፭", "፮", "፯", "፰", "፱"];
@@ -11,12 +11,12 @@ const GROUPS = ["", "፻", "፼"];
1111

1212
fn translate(input) {
1313
let n = input.len();
14-
let result = "";
1514
let commit = if input.ends_with("'") {
1615
input = input.sub_string(0..(n-1));
1716
n = input.len();
1817
true
1918
} else { false };
19+
let result = "";
2020

2121
// Just a limit like that
2222
if n > 13 {

0 commit comments

Comments
 (0)