Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wiktionary-based dictionaries #393

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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