Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
wydengyre committed Mar 2, 2024
1 parent 2f751dd commit 1a23884
Show file tree
Hide file tree
Showing 42 changed files with 1,232,067 additions and 9 deletions.
21 changes: 19 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions packages/cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ async function goWithLanguagesAndText(
const hunalignWasm = await readFile(HUNALIGN_WASM_PATH);
const hunalignLib = await HunalignLib.Hunalign.create(hunalignWasm);

const dictName = `${targetLangAbbr}-${sourceLangAbbr}.dic`;
const hunalignDictData = await readFile(
fileURLToPath(
import.meta.resolve(
`@bitextual/hunalign/dictionaries/${targetLangAbbr}-${sourceLangAbbr}.dic`,
),
import.meta.resolve(`@bitextual/wiktionary/dictionaries/${dictName}`),
),
);
console.error(
`using dictionary: ${dictName} with size ${hunalignDictData.length} bytes`,
);

const sourceLang = languageCodes.get(sourceLangAbbr);
if (sourceLang === undefined) {
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
},
"dependencies": {
"@bitextual/core": "*",
"@bitextual/hunalign": "*"
"@bitextual/hunalign": "*",
"@bitextual/wiktionary": "*"
}
}
1 change: 0 additions & 1 deletion packages/hunalign/dictionaries/en-fr.dic
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

-- @ --
--- @ ---
---- @ ----
Expand Down
2 changes: 1 addition & 1 deletion packages/test/bovary.aligned.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/test/marianela.aligned.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/wiktionary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
raw-wiktextract-data.json
1 change: 1 addition & 0 deletions packages/wiktionary/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Data from https://kaikki.org/dictionary/raw-wiktextract-data.json
1 change: 1 addition & 0 deletions packages/wiktionary/dictionaries/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Dictionary files generated from Wiktionary data go in this directory
Loading

0 comments on commit 1a23884

Please sign in to comment.