Skip to content

Commit

Permalink
add test for wiktextract
Browse files Browse the repository at this point in the history
  • Loading branch information
ilius committed Dec 18, 2024
1 parent fcaea6f commit 50e32fd
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions tests/g_wiktextract_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import sys
import unittest
from os.path import abspath, dirname

rootDir = dirname(dirname(abspath(__file__)))
sys.path.insert(0, rootDir)

from glossary_v2_test import TestGlossaryBase


class TestGlossaryWiktextract(TestGlossaryBase):
def __init__(self, *args, **kwargs):
TestGlossaryBase.__init__(self, *args, **kwargs)

self.dataFileCRC32.update(
{
"wiktextract/10-kaikki-fa-PlacesInIran.jsonl": "f7f4a92f",
"wiktextract/10-kaikki-fa-PlacesInIran.txt": "29b20845",
},
)

def convert_jsonl_txt(self, fname, fname2, **convertArgs):
self.convert(
f"wiktextract/{fname}.jsonl",
f"{fname}-2.txt",
compareText=f"wiktextract/{fname2}.txt",
infoOverride={
# without this, glos name would become f"wiktextract__{fname}.jsonl"
"name": f"{fname}.jsonl",
},
**convertArgs,
)

def test_convert_jsonl_txt_1(self):
self.convert_jsonl_txt(
"10-kaikki-fa-PlacesInIran",
"10-kaikki-fa-PlacesInIran",
)


if __name__ == "__main__":
unittest.main()

0 comments on commit 50e32fd

Please sign in to comment.