Skip to content

Commit

Permalink
fix aligner
Browse files Browse the repository at this point in the history
  • Loading branch information
dwmitelman committed Apr 5, 2024
1 parent c28eb92 commit 51bd7aa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions global_def/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ transformers>=4.36.0
python-docx==0.8.11
pyarabic==0.6.15
google-api-python-client
tabulate
6 changes: 3 additions & 3 deletions pre_train/aligner/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
from tabulate import tabulate
from typing import List

from ja_transliteration_tool.pre_train.generic.const import *
from ja_transliteration_tool.pre_train.generic.word_clean import Ar, Ja
from ja_transliteration_tool.pre_train.aligner.transliterate import Ja2Ar, Ar2Ja
from pre_train.generic.const import *
from pre_train.generic.word_clean import Ar, Ja
from pre_train.aligner.transliterate import Ja2Ar, Ar2Ja


class Comparator(object):
Expand Down
11 changes: 5 additions & 6 deletions pre_train/aligner/sample.m.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ def sample(text_ar, text_ja):
# print(len(split_ja), len(split_ar))
# assert len(split_ja) == len(split_ar)

Aligner(split_ar, split_ja)._run()
return Aligner(split_ar, split_ja)

# for i in range(len(split_ar)):
# assert Comparator(split_ar[i], split_ja[i]).compare()


# text_ar = "سُئِلْتُ عمّا عنديَ من الاحتجاج خخخخخخخ على مُخالفينا من الفلاسفة وأهل الأديان ثمّ على الخوارج الذين يخالفون الجمهور"
# text_ja = "סילת עמא ענדי מן אלאחתג'אג' עלי מכ'אלפינא מן <אלפלאספה> ואה<ל אלאדיאן> ת'ם עלי אלכ'וארג עעעעעעעע אלד'ין יכ'אלפון אלג'מהור"
#
# sample(text_ar, text_ja)

text_ar = "سُئِلْتُ عمّا عنديَ من الاحتجاج خخخخخخخ على مُخالفينا من الفلاسفة وأهل الأديان ثمّ على الخوارج الذين يخالفون الجمهور"
text_ja = "סילת עמא ענדי מן אלאחתג'אג' עלי מכ'אלפינא מן <אלפלאספה> ואה<ל אלאדיאן> ת'ם עלי אלכ'וארג עעעעעעעע אלד'ין יכ'אלפון אלג'מהור"

res = sample(text_ar, text_ja).get_tws()
print(res)

0 comments on commit 51bd7aa

Please sign in to comment.