Skip to content

Commit

Permalink
fix missing IPA tags (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanVukovic99 authored Nov 14, 2024
1 parent ca096e5 commit 351fa0d
Show file tree
Hide file tree
Showing 14 changed files with 321 additions and 18 deletions.
5 changes: 4 additions & 1 deletion 3-tidy-up.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,11 @@ function processForms(forms, word, pos) {
function saveIpaResult(word, readings, pos, ipaObj) {
for (const reading of readings) {
const result = lemmaDict[word][reading][pos];
if (!result.ipa.some(obj => obj.ipa === ipaObj.ipa)) {
const existingIpa = result.ipa.find(obj => obj.ipa === ipaObj.ipa);
if (!existingIpa) {
result.ipa.push(ipaObj);
} else {
existingIpa.tags = [...new Set([...existingIpa.tags, ...ipaObj.tags])];
}
}
}
Expand Down
7 changes: 7 additions & 0 deletions data/test/dict/en/en/tag_bank_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,12 @@
-1,
"noun",
1
],
[
"hist",
"",
0,
"historical",
0
]
]
55 changes: 55 additions & 0 deletions data/test/dict/en/en/term_bank_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -303,5 +303,60 @@
],
0,
""
],
[
"falcon",
"",
"n",
"n",
0,
[
{
"type": "structured-content",
"content": [
{
"tag": "div",
"content": [
"Any bird of the genus Falco, all of which are birds of prey."
]
}
]
},
{
"type": "structured-content",
"content": [
{
"tag": "div",
"content": [
"(falconry) A female such bird, a male being a tiercel."
]
}
]
}
],
0,
""
],
[
"falcon",
"",
"hist n",
"n",
0,
[
{
"type": "structured-content",
"content": [
{
"tag": "div",
"content": [
"A light cannon used from the 15th to the 17th century; a falconet."
]
}
]
}
],
0,
""
]
]
17 changes: 17 additions & 0 deletions data/test/dict/en/en/term_bank_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,22 @@
],
0,
""
],
[
"falcons",
"",
"non-lemma",
"",
0,
[
[
"falcon",
[
"plural"
]
]
],
0,
""
]
]
31 changes: 30 additions & 1 deletion data/test/ipa/en/en/tag_bank_1.json
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
[]
[
[
"🏴󠁧󠁢󠁥󠁮󠁧󠁿",
"dialect",
0,
"Received-Pronunciation",
0
],
[
"🇺🇸",
"dialect",
0,
"US",
0
],
[
"🇦🇺",
"dialect",
0,
"General-Australian",
0
],
[
"🇳🇿",
"dialect",
0,
"New-Zealand",
0
]
]
47 changes: 47 additions & 0 deletions data/test/ipa/en/en/term_meta_bank_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,52 @@
}
]
}
],
[
"falcon",
"ipa",
{
"reading": "falcon",
"transcriptions": [
{
"ipa": "/ˈfɔː(l)kən/",
"tags": [
"🏴󠁧󠁢󠁥󠁮󠁧󠁿"
]
},
{
"ipa": "/ˈfɒlkən/",
"tags": [
"🏴󠁧󠁢󠁥󠁮󠁧󠁿"
]
},
{
"ipa": "/ˈfælkən/",
"tags": [
"🇺🇸",
"🇦🇺"
]
},
{
"ipa": "/ˈfɑːlkən/",
"tags": [
"🇺🇸"
]
},
{
"ipa": "/ˈfoːlkən/",
"tags": [
"🇦🇺",
"🇳🇿"
]
},
{
"ipa": "/ˈfɛlkən/",
"tags": [
"🇳🇿"
]
}
]
}
]
]
19 changes: 13 additions & 6 deletions data/test/ipa/fa/en/tag_bank_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
0
],
[
"🇦🇫",
"🇹🇯",
"dialect",
0,
"Dari",
"Tajik",
0
],
[
Expand All @@ -21,17 +21,24 @@
0
],
[
"🇮🇷",
"🇦🇫",
"dialect",
0,
"Iran",
"Dari",
0
],
[
"🇹🇯",
"🇦🇫KA",
"dialect",
0,
"Tajik",
"Kabuli",
0
],
[
"🇮🇷",
"dialect",
0,
"Iran",
0
]
]
11 changes: 8 additions & 3 deletions data/test/ipa/fa/en/term_meta_bank_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
{
"ipa": "[mulk]",
"tags": [
"classic"
"classic",
"Hazaragi",
"🇹🇯",
"frm"
]
},
{
"ipa": "[mʊlk]",
"tags": [
"🇦🇫",
"frm"
"frm",
"🇦🇫KA"
]
},
{
Expand Down Expand Up @@ -44,7 +48,8 @@
"ipa": "[fɑːɾ.síː]",
"tags": [
"🇦🇫",
"frm"
"frm",
"🇦🇫KA"
]
},
{
Expand Down
6 changes: 4 additions & 2 deletions data/test/ipa/la/en/term_meta_bank_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
{
"ipa": "[ˈfäːmä]",
"tags": [
"Classical"
"Classical",
"✝️"
]
},
{
Expand Down Expand Up @@ -179,7 +180,8 @@
{
"ipa": "/ˈdo.mus/",
"tags": [
"Classical"
"Classical",
"✝️"
]
},
{
Expand Down
1 change: 1 addition & 0 deletions data/test/kaikki/en-en.json

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions data/test/tidy/en-en-forms-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,28 @@
]
]
}
],
[
"falcon",
{
"_type": "map",
"map": [
[
"falcons",
{
"_type": "map",
"map": [
[
"noun",
[
"plural"
]
]
]
}
]
]
}
]
]
}
Loading

0 comments on commit 351fa0d

Please sign in to comment.