Spaces:
Running
Running
sync V9 teacher-student dialogue role fix from qt2 3597738
Browse files- hachimimt-local.zip +2 -2
- src/pronoun_harmonizer_v9.py +5 -0
- src/test_pronoun_harmonizer_v9.py +27 -0
hachimimt-local.zip
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a62da7ff74071059be2c65e6dbceef487d2865f429d267e6368acd1319a15144
|
| 3 |
+
size 74058
|
src/pronoun_harmonizer_v9.py
CHANGED
|
@@ -693,6 +693,10 @@ def harmonize_stability_row(
|
|
| 693 |
text = apply_many_words(text, ("ngươi", "cậu"), "em", applied, "teacher_you_as_student")
|
| 694 |
text = add_ta_replacement(text, "thầy", applied, "teacher_self_as_thay")
|
| 695 |
text = add_toi_replacement(text, "thầy", applied, "teacher_self_as_thay")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 696 |
text = apply_replacement(text, "lão sư", "giáo viên", applied, "teacher_context_lao_su")
|
| 697 |
return text, dict(applied)
|
| 698 |
|
|
@@ -700,6 +704,7 @@ def harmonize_stability_row(
|
|
| 700 |
text = add_ta_replacement(text, "em", applied, "student_self_as_em")
|
| 701 |
text = add_toi_replacement(text, "em", applied, "student_self_as_em")
|
| 702 |
text = apply_many_words(text, ("ngươi", "cậu"), "thầy", applied, "student_you_as_teacher")
|
|
|
|
| 703 |
return text, dict(applied)
|
| 704 |
|
| 705 |
if "generic_modern_dialogue" in tags:
|
|
|
|
| 693 |
text = apply_many_words(text, ("ngươi", "cậu"), "em", applied, "teacher_you_as_student")
|
| 694 |
text = add_ta_replacement(text, "thầy", applied, "teacher_self_as_thay")
|
| 695 |
text = add_toi_replacement(text, "thầy", applied, "teacher_self_as_thay")
|
| 696 |
+
if "我相信你" in source:
|
| 697 |
+
text = apply_replacement(text, "anh tin em", "thầy tin em", applied, "teacher_self_as_thay")
|
| 698 |
+
if "我的肩膀" in source:
|
| 699 |
+
text = apply_replacement(text, "vỗ vai thầy", "vỗ vai em", applied, "teacher_student_shoulder")
|
| 700 |
text = apply_replacement(text, "lão sư", "giáo viên", applied, "teacher_context_lao_su")
|
| 701 |
return text, dict(applied)
|
| 702 |
|
|
|
|
| 704 |
text = add_ta_replacement(text, "em", applied, "student_self_as_em")
|
| 705 |
text = add_toi_replacement(text, "em", applied, "student_self_as_em")
|
| 706 |
text = apply_many_words(text, ("ngươi", "cậu"), "thầy", applied, "student_you_as_teacher")
|
| 707 |
+
text = apply_replacement(text, "lão sư", "thầy", applied, "student_teacher_lao_su")
|
| 708 |
return text, dict(applied)
|
| 709 |
|
| 710 |
if "generic_modern_dialogue" in tags:
|
src/test_pronoun_harmonizer_v9.py
CHANGED
|
@@ -473,6 +473,33 @@ check_rows_route(
|
|
| 473 |
route="modern_school",
|
| 474 |
)
|
| 475 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 476 |
check_rows(
|
| 477 |
"mother as object no-op in modern route",
|
| 478 |
[
|
|
|
|
| 473 |
route="modern_school",
|
| 474 |
)
|
| 475 |
|
| 476 |
+
check_rows_route(
|
| 477 |
+
"teacher student dialogue window keeps roles",
|
| 478 |
+
[
|
| 479 |
+
(
|
| 480 |
+
1,
|
| 481 |
+
"张老师看着眼前的学生,问道:“你明天的考试准备好了吗?”",
|
| 482 |
+
'Thầy Trương nhìn học sinh trước mặt, hỏi: "Kỳ thi ngày mai em đã chuẩn bị xong chưa?"',
|
| 483 |
+
),
|
| 484 |
+
(
|
| 485 |
+
2,
|
| 486 |
+
"“我已经复习完了,老师。”我恭敬地回答道。",
|
| 487 |
+
'"Em đã ôn tập xong rồi, lão sư." Em cung kính trả lời.',
|
| 488 |
+
),
|
| 489 |
+
(
|
| 490 |
+
3,
|
| 491 |
+
"“你是个聪明的孩子,我相信你。”老师拍了拍我的肩膀。",
|
| 492 |
+
"“Em là một đứa trẻ thông minh, anh tin em.” Thầy giáo vỗ vai thầy.",
|
| 493 |
+
),
|
| 494 |
+
],
|
| 495 |
+
[
|
| 496 |
+
'Thầy Trương nhìn học sinh trước mặt, hỏi: "Kỳ thi ngày mai em đã chuẩn bị xong chưa?"',
|
| 497 |
+
'"Em đã ôn tập xong rồi, thầy." Em cung kính trả lời.',
|
| 498 |
+
"“Em là một đứa trẻ thông minh, thầy tin em.” Thầy giáo vỗ vai em.",
|
| 499 |
+
],
|
| 500 |
+
route="modern_school",
|
| 501 |
+
)
|
| 502 |
+
|
| 503 |
check_rows(
|
| 504 |
"mother as object no-op in modern route",
|
| 505 |
[
|