added letters
This commit is contained in:
parent
f3c580bd3b
commit
fed3a8f082
17
txt.py
17
txt.py
|
@ -38,11 +38,14 @@ def map_to_keyboard_hebrew(input_text):
|
||||||
'f': 'כ',
|
'f': 'כ',
|
||||||
'k': 'ל',
|
'k': 'ל',
|
||||||
'n': 'מ',
|
'n': 'מ',
|
||||||
|
'o': 'ם',
|
||||||
'b': 'נ',
|
'b': 'נ',
|
||||||
|
'i': 'ן',
|
||||||
'x': 'ס',
|
'x': 'ס',
|
||||||
'g': 'ע',
|
'g': 'ע',
|
||||||
'p': 'פ',
|
'p': 'פ',
|
||||||
'm': 'צ',
|
'm': 'צ',
|
||||||
|
'.': 'ץ',
|
||||||
'e': 'ק',
|
'e': 'ק',
|
||||||
'r': 'ר',
|
'r': 'ר',
|
||||||
'a': 'ש',
|
'a': 'ש',
|
||||||
|
@ -50,6 +53,8 @@ def map_to_keyboard_hebrew(input_text):
|
||||||
';': 'ף',
|
';': 'ף',
|
||||||
'i': 'ן',
|
'i': 'ן',
|
||||||
'l': 'ך',
|
'l': 'ך',
|
||||||
|
'/': '.',
|
||||||
|
'\/': ','
|
||||||
# Add any other characters you want to map
|
# Add any other characters you want to map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,23 +63,27 @@ def map_to_keyboard_hebrew(input_text):
|
||||||
|
|
||||||
def rtl_text_wrap(text, width):
|
def rtl_text_wrap(text, width):
|
||||||
words = text.split()
|
words = text.split()
|
||||||
|
# Reverse the order of words for RTL language
|
||||||
|
words = words[::-1]
|
||||||
|
|
||||||
lines = []
|
lines = []
|
||||||
current_line = []
|
current_line = []
|
||||||
current_line_length = 0
|
current_line_length = 0
|
||||||
|
|
||||||
for word in reversed(words): # Reverse words for RTL
|
for word in words: # No need to reverse the words list again
|
||||||
if current_line_length + len(word) <= width:
|
if current_line_length + len(word) <= width:
|
||||||
current_line.append(word)
|
current_line.append(word)
|
||||||
current_line_length += len(word) + 1 # +1 for the space
|
current_line_length += len(word) + 1 # +1 for the space
|
||||||
else:
|
else:
|
||||||
lines.append(' '.join(reversed(current_line))) # Reverse back to original
|
lines.append(' '.join(current_line))
|
||||||
current_line = [word]
|
current_line = [word]
|
||||||
current_line_length = len(word) + 1 # +1 for the space
|
current_line_length = len(word) + 1
|
||||||
|
|
||||||
lines.append(' '.join(reversed(current_line))) # Add the last line
|
lines.append(' '.join(current_line)) # Add the last line
|
||||||
return '\n'.join(lines)
|
return '\n'.join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
user_input = input("Type something (or press Enter to generate image): ")
|
user_input = input("Type something (or press Enter to generate image): ")
|
||||||
logging.info(f"User input: {user_input}")
|
logging.info(f"User input: {user_input}")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user