Skip to content

Commit

Permalink
data: fix 伐 fell element not found by 代 substitute. fix elementsDataT…
Browse files Browse the repository at this point in the history
…oJson script warning about https links

previously, elementsDataToJson said:
warning: row 836 has more than one occurence of //
  • Loading branch information
sschmidTU committed Oct 15, 2023
1 parent 685f3cd commit 0f71336
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title: Multi-Radical Kanji Search (WTK-Search)
author: sschmidTU
url: https://sschmidtu.github.io/mr-kanji-search-wtk/
description: "Search Kanji using WK radicals or RTK names. Type 'arrow mouth' to find 知, for example."
version: "1.9.5.6"
version: "1.9.5.7"
permalink: /:title/

exclude:
Expand Down
9 changes: 6 additions & 3 deletions _tools/elementsDataToJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ function processFile(fileString) {
const rows = fileString.split("\n");
// skip first row
for (let i=1; i < rows.length; i++) {
if (rows[i].trim().startsWith("//")) {
const row = rows[i];
if (row.trim().startsWith("//")) {
continue;
}
const commentSplit = rows[i].split("//");
if (commentSplit.length > 2) {
const commentSplit = row.split("//");
const numberOfLinks = row.split("https://").length - 1;
let numberOfCommentsTags = commentSplit.length - numberOfLinks; // ignore https:// links in comments
if (numberOfCommentsTags > 2) {
console.log(`warning: row ${i+1} has more than one occurence of //`);
}
const decommented = commentSplit[0];
Expand Down
2 changes: 1 addition & 1 deletion _tools/elements_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ storehouse; 蔵; storehouse; t(flowers, o(parade, retainer))
float; 桟 right part; bar; c(fiesta, two) // apparently comes from 戔, which is also a variant for the right part
warrior; 武; military; tr(arrowhead, stop)&one
style; 式; ritual; tr(arrowhead, craft)
fell; 伐; fell; l(personB, fiesta)
fell; 伐; fell; l(personB, fiesta)&substitute // could also be seen with 代 substitute as c(substitute, drop)
dog tag=dogtag; 甫; wedding; t(arrowhead, screwdriver)
bay; 浦; bay; l(water, dog tag)
stand up=vase; 立; stand; t(top hat, horns, floor) // RTK says "Used as a primitive, it can also mean vase". But stand up seems more central/well known.
Expand Down
4 changes: 3 additions & 1 deletion assets/js/elementsDict.js
Original file line number Diff line number Diff line change
Expand Up @@ -3330,6 +3330,7 @@ const elementsDict =
"subElements": [
"personB",
"fiesta",
"substitute",
"person",
"arrowhead",
"drop",
Expand All @@ -3339,7 +3340,8 @@ const elementsDict =
"synonyms": [],
"wkNames": [
"fell"
]
],
"comment": "could also be seen with 代 substitute as c(substitute, drop)"
},
"dog tag": {
"elements": [
Expand Down

0 comments on commit 0f71336

Please sign in to comment.