|
1 | 1 | import argparse |
2 | | -import os, errno |
| 2 | +import errno |
| 3 | +import os |
3 | 4 | import sys |
4 | 5 |
|
5 | 6 | sys.path.append(os.path.join(os.path.dirname(__file__), "..")) |
6 | 7 |
|
7 | 8 | import random as rnd |
8 | 9 | import string |
9 | 10 | import sys |
| 11 | +from multiprocessing import Pool |
10 | 12 |
|
11 | 13 | from tqdm import tqdm |
12 | | -from trdg.string_generator import ( |
13 | | - create_strings_from_dict, |
14 | | - create_strings_from_file, |
15 | | - create_strings_from_wikipedia, |
16 | | - create_strings_randomly, |
17 | | -) |
18 | | -from trdg.utils import load_dict, load_fonts |
| 14 | + |
19 | 15 | from trdg.data_generator import FakeTextDataGenerator |
20 | | -from multiprocessing import Pool |
| 16 | +from trdg.string_generator import (create_strings_from_dict, |
| 17 | + create_strings_from_file, |
| 18 | + create_strings_from_wikipedia, |
| 19 | + create_strings_randomly) |
| 20 | +from trdg.utils import load_dict, load_fonts |
21 | 21 |
|
22 | 22 |
|
23 | 23 | def margins(margin): |
@@ -407,10 +407,11 @@ def main(): |
407 | 407 |
|
408 | 408 | if args.language == "ar": |
409 | 409 | from arabic_reshaper import ArabicReshaper |
| 410 | + from bidi.algorithm import get_display |
410 | 411 |
|
411 | 412 | arabic_reshaper = ArabicReshaper() |
412 | 413 | strings = [ |
413 | | - " ".join([arabic_reshaper.reshape(w) for w in s.split(" ")[::-1]]) |
| 414 | + " ".join([get_display(arabic_reshaper.reshape(w)) for w in s.split(" ")[::-1]]) |
414 | 415 | for s in strings |
415 | 416 | ] |
416 | 417 | if args.case == "upper": |
|
0 commit comments