Четверг, 28.11.2024, 06:57 | Приветствую Вас Гость

...

Код

Главная » Статьи » Autoit

Транслит 5

#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>


func generate_word1($word)

Local $s = ""
for $i = 1 to StringLen($word)
if StringMid($word,$i,1) =" " then $s &= " "
for $j = 0 to 32
if $alphabet1[$j] = StringMid($word,$i,1) then
$s &= $alphabet2[$j]
endif

next
next

return $s
EndFunc


func generate_word2($word)


Local $s = ""
for $i = 1 to StringLen($word)
if StringMid($word,$i,1) =" " then $s &= " "
if StringMid($word,$i,1) ="c" then
if (MsgBox($MB_OKCANCEL, "Title", "Это одиночная буква c", 10) = 1 ) then
$s &= "с"
$i = $i + 1
endif
endif

if StringMid($word,$i,1) ="z" and StringMid($word,$i+1,1) ="h" then
if (MsgBox($MB_OKCANCEL, "Title", "Это буква ж", 10) = 1 ) then
$s &= "ж"
$i = $i + 2
endif
endif

if StringMid($word,$i,1) ="t" and StringMid($word,$i+1,1) ="s" then
if (MsgBox($MB_OKCANCEL, "Title", "Это буква ц", 10) = 1 ) then
$s &= "ц"
$i = $i + 2
endif
endif

if StringMid($word,$i,1) ="c" and StringMid($word,$i+1,1) ="h" then


if (MsgBox($MB_OKCANCEL, "Title", "Это буква ч", 10) = 1 ) then
$s &= "ч"
$i = $i + 2
endif
endif

if StringMid($word,$i,1) ="s" and StringMid($word,$i+1,1) ="h" then
if (MsgBox($MB_OKCANCEL, "Title", "Это буква ш", 10) = 1 ) then
$s &= "ш"
$i = $i + 2
endif
endif

if StringMid($word,$i,1) ="s" and StringMid($word,$i+1,1) ="c" and StringMid($word,$i+2,1) ="h" then

$s &= "щ"
$i = $i + 3
endif

if StringMid($word,$i,1) ="e" and StringMid($word,$i+1,1) ="h" then
if (MsgBox($MB_OKCANCEL, "Title", "Это буква э", 10) = 1 ) then
$s &= "э"
$i = $i + 2
endif
endif

if StringMid($word,$i,1) ="j" and StringMid($word,$i+1,1) ="u" then
$s &= "ю"
$i = $i + 2
endif

if StringMid($word,$i,1) ="j" and StringMid($word,$i+1,1) ="a" then
$s &= "я"
$i = $i + 2
endif

for $j = 0 to 32

if $alphabet2[$j] = StringMid($word,$i,1) then
$s &= $alphabet1[$j]
endif

next
next

return $s
EndFunc

Global $alphabet1[34]
Global $alphabet2[34]

$alphabet1[0] = "а"
$alphabet1[1] = "б"
$alphabet1[2] = "в"
$alphabet1[3] = "г"
$alphabet1[4] = "д"
$alphabet1[5] = "е"
$alphabet1[6] = "ё"
$alphabet1[7] = "ж"
$alphabet1[8] = "з"
$alphabet1[9] = "и"
$alphabet1[10] = "й"
$alphabet1[11] = "к"
$alphabet1[12] = "л"
$alphabet1[13] = "м"
$alphabet1[14] = "н"
$alphabet1[15] = "о"
$alphabet1[16] = "п"
$alphabet1[17] = "р"
$alphabet1[18] = "с"
$alphabet1[19] = "т"
$alphabet1[20] = "у"
$alphabet1[21] = "ф"
$alphabet1[22] = "х"
$alphabet1[23] = "ц"
$alphabet1[24] = "ч"
$alphabet1[25] = "ш"
$alphabet1[26] = "щ"
$alphabet1[27] = "ъ"
$alphabet1[28] = "ы"
$alphabet1[29] = "ь"
$alphabet1[30] = "э"
$alphabet1[31] = "ю"
$alphabet1[32] = "я"

$alphabet2[0] = "a"
$alphabet2[1] = "b"
$alphabet2[2] = "v"
$alphabet2[3] = "g"
$alphabet2[4] = "d"
$alphabet2[5] = "e"
$alphabet2[6] = "~"
$alphabet2[7] = "zh"
$alphabet2[8] = "z"
$alphabet2[9] = "i"
$alphabet2[10] = "j"
$alphabet2[11] = "k"
$alphabet2[12] = "l"
$alphabet2[13] = "m"
$alphabet2[14] = "n"
$alphabet2[15] = "o"
$alphabet2[16] = "p"
$alphabet2[17] = "r"
$alphabet2[18] = "s"
$alphabet2[19] = "t"
$alphabet2[20] = "u"
$alphabet2[21] = "f"
$alphabet2[22] = "h"
$alphabet2[23] = "ts"
$alphabet2[24] = "ch"
$alphabet2[25] = "sh"
$alphabet2[26] = "sch"
$alphabet2[27] = "^"
$alphabet2[28] = "y"
$alphabet2[29] = "'"
$alphabet2[30] = "eh"
$alphabet2[31] = "ju"
$alphabet2[32] = "ja"


Local $hGUI = GUICreate("Транслит", 900,700)


Local $idedit1 = GUICtrlCreateEdit("" ,0, 0,300, 97, $ES_AUTOVSCROLL + $WS_VSCROLL)
Local $idedit2 = GUICtrlCreateEdit("" ,0, 150,300, 97, $ES_AUTOVSCROLL + $WS_VSCROLL)


GUICtrlSetFont($idedit1,25)
GUICtrlSetFont($idedit2,25)
Local $idButton_Generate1 = GUICtrlCreateButton("с русского на транслит", 100, 300, 150, 25)

Local $idButton_Generate2 = GUICtrlCreateButton("с транслита на русский", 100, 340, 150, 25)


Local $labeltest1[100]
Local $labeltest2[100]

for $i = 0 to 12
$labeltest1[$i] = GUICtrlCreateLabel($alphabet1[$i] & " = " & $alphabet2[$i],350,$i*25,100)
GUICtrlSetFont($labeltest1[$i],15)
next

for $i = 0 to 12
$labeltest1[$i] = GUICtrlCreateLabel($alphabet1[$i+13]& "="& $alphabet2[$i+13],550,$i*25,100)
GUICtrlSetFont($labeltest1[$i],15)
next


for $i = 0 to 6
$labeltest1[$i] = GUICtrlCreateLabel($alphabet1[$i+26]& "=" &$alphabet2[$i+26],750,$i*25,100)
GUICtrlSetFont($labeltest1[$i],15)
next

GUISetState(@SW_SHOW, $hGUI)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idButton_Generate1
GUICtrlSetData($idedit2,generate_word1(GUICtrlRead($idedit1)))

Case $idButton_Generate2
GUICtrlSetData($idedit2,generate_word2(GUICtrlRead($idedit1)))

EndSwitch
WEnd

Категория: Autoit | Добавил: moskov (12.01.2020)
Просмотров: 225 | Рейтинг: 0.0/0
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]

Меню сайта

Категории раздела

PHP [41]
C++ [71]
Autoit [108]
Processing [105]
Basic4GL [7]
Fasm [2]
PABC [7]
Js [236]
Gentee [1]
Python [204]
Java android [3]
Small Basic [9]

Мини-чат

Статистика


Онлайн всего: 9
Гостей: 9
Пользователей: 0

Форма входа

Друзья сайта

  • ЗОВ КОСМОСА

  • Хулиган Вселенной

  • Тюремная поэзия

  • Религиозная поэзия

  • Сайт клана ЛеГиоН
  • Поиск