Skip to content

Commit

Permalink
Revert "debug rtl row string in CI"
Browse files Browse the repository at this point in the history
This reverts commit 53da2ef.
  • Loading branch information
sterlingwes committed Feb 12, 2024
1 parent b0024ef commit d99eda1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"dependencies": {
"arabic-name-to-en": "^1.0.6",
"arabic-utils": "^5.1.0",
"bidi-js": "^1.0.3",
"d3-node": "^3.0.0",
"date-fns": "^3.3.1",
"react-loadable": "npm:@docusaurus/react-loadable@^5.5.2"
Expand Down
12 changes: 2 additions & 10 deletions scripts/data/common/killed-in-gaza/generate_killed_list.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import fs from "fs";
import Bidi from "bidi-js";
import { ArabicClass } from "arabic-utils";

const bidi = Bidi();
const pwd = "scripts/data/common/killed-in-gaza";
const arRawNameColumnLabel = "name_ar_raw";
const arEnNameColumnLabel = "name_en";
Expand All @@ -11,12 +9,7 @@ const readCsv = (repoPath: string, rtl: boolean) => {
const csvString = fs.readFileSync(repoPath).toString();
return csvString.split(/\r?\n/g).map((row) => {
if (rtl) {
const { paragraphs } = bidi.getEmbeddingLevels(row);
console.log(
">>",
row,
paragraphs.length === 1 && paragraphs[0].level === 1
);
console.log(">>", row);
}
const ltrRow = row.replace(/\u200f/u, "");
return ltrRow.split(",");
Expand Down Expand Up @@ -78,8 +71,7 @@ const resultList = rawListRows.map((row) => {
return [...row, replaceWholeNameSegments(normalizedArName, arToEn)];
});

const toCsv = (list: string[][]) =>
list.map((row) => row.join(",")).join("\r\n");
const toCsv = (list: string[][]) => list.map((row) => row.join(",")).join("\n");

const newHeaders = [...rawHeaderRow, arEnNameColumnLabel].join(",");
fs.writeFileSync(
Expand Down

0 comments on commit d99eda1

Please sign in to comment.