Isoraqathedh

IPA.ahk

Jan 30th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #singleInstance force
  2. MsgBox IPA Mode Activated.
  3. ;BeginRegion beginnings
  4. lastKey =  
  5. toggleMode = 0
  6. symbol = a
  7. symbolName = aaa
  8. GUI +LastFound +AlwaysOnTop +owner
  9. GUI Font, s30, code2000
  10. GUI Add, Text, vSymb h50 w300 center, %symbol%
  11. GUI Font, s10, Arial
  12. GUI Add, Text, vDesc w300 center, %symbolName%
  13. GUI Add, Text, vNext w300 center,
  14.  
  15. ;EndRegion beginnings
  16. ;BeginRegion Engine
  17. typeLetter(ByRef string, ByRef description = "") {
  18.     global lastKey
  19.     global toggleMode
  20.     global allSymbolNames
  21.     global Desc
  22.     global Symb
  23.     global Next
  24.     invokeKey := SubStr(string, 0, 1)
  25.     if (invokeKey <> lastKey) {
  26.         gosub resetValue
  27.     }
  28.     toggleMode += 1
  29.     if (toggleMode <> 0) {
  30.         SendInput {backspace}
  31.     }
  32.     order := Mod(toggleMode, StrLen(string)) + 1
  33.     symbol := SubStr(string, order, 1)
  34.     StringSplit allSymbolNames, description, |, %A_Space%
  35.     allSymbolNames := ""
  36.     symbolName := allSymbolNames%order%
  37.     SendInput %symbol%
  38.     if symbolName
  39.     {
  40.         GUIControl,, Desc, %symbolName%
  41.         GUIControl,, Symb, %symbol%
  42.         GUIControl,, Next, %string%
  43.         GUI show, X0 Y800 NoActivate, IPA Symbol Inserted
  44.     }
  45.     lastKey := invokeKey
  46.     SetTimer, resetValue, 750
  47. }
  48. resetValue:
  49.     toggleMode = -1
  50.     lastKey =
  51.     GUI hide
  52. return
  53. ;EndRegion
  54. ;BeginRegion symbol list
  55. ;BeginRegion A-M and 3 but not F or K
  56. +a::typeLetter("aɑæɐ", "Open Front Vowel | Open Back Vowel | Near-Open Front Vowel | Near-Open Central Vowel")
  57. +b::typeLetter("bβɓʙ", "Voiced Bilabial Plosive | Voiced Bilabial Fricative | Voiced Bilabial Implosive | Bilabial Trill")
  58. +c::typeLetter("cɕç", "Voiceless Palatal Plosive | Voiceless Alveo-Palatal Fricative | Voiceless Palatal Fricative")
  59. +d::typeLetter("dðɖɗ", "Voiced Alveolar Plosive | Voiced Dental Fricative | Voiced Retroflex Plosive | Voiced Alveolar Implosive")
  60. +e::typeLetter("eəɚɵɘ", "Close-Mid Front Vowel | Mid Central Vowel | Rhoticized Mid Central Vowl | Close-Mid Central Rounded Vowel | Close-Mid Central Vowel")
  61. +3::typeLetter("3ɛɜɝɞ", "Three (Not an IPA Character) | Open-Mid Front Vowel | Open-Mid Central Vowel | Rhoticized Open-Mid Central Vowel | Open-Mid Central Rounded Vowel")
  62. +g::typeLetter("gɠɢʛ", "Voiced Velar Plosive | Voiced Velar Implosive | Voiced Uvular Plosive | Voiced Uvular Implosive")
  63. +h::typeLetter("hɥɦħɧʜ", "Voiceless Glottal Transition | Labial-Palatal Approximant | Voiced Glottal Fricative | Voiceless Pharangeal Fricative | Sje-sound | Voiceless Epiglottal Fricative")
  64. +i::typeLetter("iɪɨ", "Close Front Vowel | Near-Close Near-Front Vowel | Close Central Vowel")
  65. +j::typeLetter("jʝɟʄ", "Palatal Approximant | Voiced Palatal Fricative | Voiced Palatal Plosive | Voiced Palatal Implosive")
  66. +l::typeLetter("lɫɬʟɭɮ", "Alveolar Lateral Approximant | Velarized Alveolar Lateral Approximant, Voiced Alveolar Lateral Fricative | Velar Lateral Approximant | Retroflex Lateral Approximant | Voiced Alveolar Lateral Fricative")
  67. +m::typeLetter("mɱ", "Bilabial Nasal | Labiodental Nasal")
  68. ;EndRegion A-M
  69. ;BeginRegion N-Z and \
  70. +n::typeLetter("nŋɲɴɳ", "Alveolar Nasal | Velar Nasal | Palatal Nasal | Uvular Nasal | Retroflex Nasal")
  71. +o::typeLetter("oɔœøɒɶ", "Close-Mid Back Rounded Vowel | Open-Mid Back Rounded Vowel | Open-Mid Front Rounded Vowel | Close-Mid Front Rounded Vowel | Open Back Rounded Vowel | Open Front Rounded Vowel")
  72. +p::typeLetter("pɸ", "Voiceless Bilabial Plosive | Voiceless Bilabial Fricative")
  73. +q::typeLetter("qʔʕʢʡ", "Voiceless Uvular Plosive | Glottal Stop | Voiced Pharyngeal Fricative | Voiced Epiglottal Fricative | Epiglottal Plosive")
  74. +r::typeLetter("rɾʁɹɻʀɽɺ", "Alveolar Trill | Alveolar Tap | Voiced Uvular Fricative | Alveolar Approximant | Retroflex Approximant | Uvular Trill | Retroflex Flap | Alveolar Lateral Flap")
  75. +s::typeLetter("sʃʂ", "Voiceless Alveolar Sibliant | Voiceless Post-Alveolar Fricative | Voiceless Retroflex Fricative")
  76. +t::typeLetter("tθʈ", "Voiceless Alveolar Plosive | Voiceless Dental Fricative | Voiceless Retroflex Plosive")
  77. +u::typeLetter("uʊʉ", "Close Back Rounded Vowel | Near-Close Near-Back Vowel | Close Central Rounded Vowel")
  78. +v::typeLetter("vʌʋⱱ", "Voiced Labio-Dental Fricative | Open-Back Mid Unrounded Vowel | Labiodental Approximant | Labiodental Flap")
  79. +w::typeLetter("wʍɯɰ", "Labio-Velar Approximant | Voiceless Labio-Velar Approximant | Close Back Unrounded Vowel | Velar Approximant")
  80. +x::typeLetter("xχ", "Voiceless Velar Fricative | Voiceless Uvular Fricative")
  81. +y::typeLetter("yʎɣʏɤ", "Close Front Rounded Vowel | Palatal Lateral Approximant | Voiced Velar Fricative | Near-Close Near-Front Rounded Vowel | Close-Mid Back Vowel")
  82. +z::typeLetter("zʒʐʑ", "Voiced Dental Fricative | Voiced Post-Alveolar Fricative | Voiced Retroflex Fricative | Voiced Alveo-Palatal Fricative")
  83. \::typeLetter("ʘǀǃǂǁ", "Bilabial Click | Dental Click | Retroflex Click | Palatal-Alveolar Click | Alveolar Lateral Click")
  84. ;EndRegion N-Z and \
  85. ;BeginRegion non-combining diacritics
  86. ;BeginRegion tones and intonation
  87. !t:: typeLetter("˥˦˧˨˩", "Tone Level 5 | Tone Level 4 | Tone Level 3 | Tone Level 2 | Tone Level 1")
  88. !+t:: typeLetter("↓↑↗↘", "Upstep | Downstep | Global Rise | Global Fall")
  89. ;EndRegion tones and intonation
  90. ;BeginRegion letter modifiers
  91. <^>!h::typeLetter("ʰʱ", "Aspirated | Breathy-Voiced Aspirated")
  92. <^>!e::typeLetter("ᵊ", "Syllabic/Schwa")
  93. <^>!r::typeLetter("ʳ˞", "Optional R | Rhoticized")
  94. <^>!w::typeLetter("ʷ", "Labialized")  
  95. <^>!j::typeLetter("ʲ", "Palatalized")
  96. <^>!y::typeletter("ˠ", "Velarized")
  97. <^>!q::typeLetter("ˤ", "Pharyngealized")
  98. <^>!n::typeLetter("ⁿ", "Nasalized")
  99. <^>!l::typeLetter("ˡ", "Lateral Release")
  100. ;EndRegion letter modifiers
  101. ;BeginRegion Phoneme Modifiers
  102. +Enter::
  103. +Space::typeLetter("→", "Becomes…")
  104. +,::typeLetter("'ˈˌʼ", "Apostrophe | Primary Stress | Secondary Stress | Ejective")
  105. ;EndRegion phoneme modifiers
  106. +;::
  107.     typeLetter("ːˑ̆", "Long | Half-Long | Short")
  108. ;EndRegion non-combining diacritics
  109. ;BeginRegion combining diacritics (warning: zalgo ahead)       
  110. ;BeginRegion tones and intonation
  111. #t::typeLetter("̋́̄̀̏", "Tone Level 5 | Tone Level 4 | Tone Level 3 | Tone Level 2 | Tone Level 1")
  112. #+t::typeLetter("̌̂᷄᷅᷈", "Rising | Falling | High Rising | Low Rising | Rising-Falling")
  113. ;EndRegion tones and intonation
  114. ;BeginRegion tongue placement modifiers
  115. <^>!+r::typeLetter("̹̜̘̚", "More Rounded | Less Rounded | Advanced Tongue Root | Retracted Tongue Root | No Audible Release")
  116. <^>!d::typeLetter("̪", "Dental")
  117. <^>!a::typeLetter("̺", "Apical")
  118. <^>!m::typeLetter("̽", "Mid-Centralized")
  119. <^>!+l::typeLetter("̻", "Laminal")
  120. +right::typeLetter("̠̙", "Retracted | Retracted Tongue Root")
  121. +left::typeLetter("̟̘", "Advanced | Advanced Tongue Root")
  122.  
  123. ;EndRegion tongue placement modifiers
  124. ;BeginRegion breath output modifiers
  125. <^>!b::typeLetter("̯̤̰̼̥̩̬̊̈", "Non-Syllabic | Breathy | Creaky | Linguolabial | Voiceless | Voiceless | Syllabic | Voiced | Centralized")
  126. ;EndRegion breath output modifiers
  127. ;BeginRegion letter modifiers
  128. <^>!+n::typeLetter("̴̃", "Nasalized | Velarized")
  129. +up::typeLetter("̝", "Raised")
  130. +down:: typeLetter("̞", "Lowered")
  131. ;EndRegion letter modifiers
  132. ;BeginRegion double diacritics
  133. +6:: typeLetter("͜͡‿", "Tie Bar | Tie Bar Below | Linking")
  134. ;EndRegion double diacritics
  135. ;EndRegion combining diacritics
  136. ;EndRegion
  137. ;BeginRegion Stop IPA Mode
  138. Esc::
  139. endMode:
  140. MsgBox IPA Mode deactivated.
  141. GUI destroy
  142. ExitApp
  143. ;EndRegion
Advertisement
Add Comment
Please, Sign In to add comment