Advertisement
Trisodin

google docs toki pona tawa sitelen pona

Sep 17th, 2022 (edited)
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.02 KB | None | 0 0
  1. function replaceText(t1,t2,bool){
  2. if (t1) {
  3. if (bool) {
  4. var temp = t1
  5. t1 = t2
  6. t2 = temp
  7.  
  8. // var docBody = DocumentApp.getActiveDocument().getBody();
  9. docBody.replaceText(t1,t2)
  10. }
  11. var docBody = DocumentApp.getActiveDocument().getBody();
  12. var txt = docBody.getText()
  13. // docBody.replaceText(new RegExp('\\b'+t1+'\\b','g'),t2)
  14.  
  15. docBody.setText(txt.replace(new RegExp('\\b'+t1+'\\b','g'),t2))
  16. }
  17. }
  18.  
  19. function onOpen() {
  20. var ui = DocumentApp.getUi();
  21. ui.createMenu('sitelen pona')
  22. .addItem('o ante tawa sitelen pona', 'ante')
  23. // .addItem('o ante tawa toki pona', 'antetp') // doesn't work right now
  24. .addToUi()
  25. }
  26.  
  27. function ante(bool) {
  28. // var tbl = [ // but actually a dictionary i think but whatever most people reading this probably don't care UPDATE: couldn't figure out how to make it a dictionary so i did this and now variable name works!!!
  29. // "mi","⍴",
  30. // "utala","⤩",
  31. // "tu","‖",
  32. // "li",">",
  33. // "ala","⨉",
  34. // "ma","⨁",
  35. // "alasa","Ð",
  36. // "ike","ᴖ",
  37. // "pona","ᵕ",
  38. // ]
  39. // var i = 0
  40. // while (i < tbl.length) { // i know to people who know js and c# this is probably pain to see but i never learned the "proper" way to do this
  41. // i += 1
  42. // var nimimama = (i * 2) - 1
  43. // var nimitawa = i * 2
  44. // replaceText(tbl[nimimama],tbl[nimitawa])
  45. // }
  46. //
  47. // haha couldn't figure out how to do all of this if you want to fix my code over here go ahead
  48. //
  49.  
  50. if (bool) {} else { // ik its weird but i prefer this over !
  51. bool = false;
  52. }
  53.  
  54. replaceText("mi","ᑭ",bool)
  55. replaceText("utala","⤩",bool)
  56. replaceText("tu","‖",bool)
  57. replaceText("ma","⨁",bool)
  58. replaceText("ike","◠",bool)
  59. replaceText("pona","◡",bool)
  60. replaceText("akesi","akesi",bool)
  61. replaceText("alasa","Ð",bool)
  62. replaceText("ala","⨉",bool)
  63. replaceText("ale","∞",bool)
  64. replaceText("ali","∞",bool)
  65. replaceText("anpa","џ",bool)
  66. replaceText("ante","≍",bool) // i don't like this one but couldn't find a better one
  67. replaceText("anu","ᵞ",bool)
  68. replaceText("awen","𝛬",bool)
  69. replaceText("a","ἀ",bool) // i know this is inaccurate but i just cant get anything better
  70. replaceText("e","⨠",bool)
  71. replaceText("en","╁",bool) //normal + sign makes error
  72. replaceText("esun","Ⴥ",bool)
  73. replaceText("ijo","◯",bool)
  74. replaceText("ilo","中",bool)
  75. replaceText("insa","⨃",bool) //also hate this one but its recognizable
  76. replaceText("jaki","ൾ",bool) //really looking forward to finding one for this UPDATE: got it while looking for kama
  77. replaceText("jan","ᗩ",bool) //really want to change this
  78. replaceText("jelo","jelo",bool)
  79. replaceText("jo","ල",bool)
  80. replaceText("kala","ю",bool)
  81. replaceText("kalama","kalama",bool) // ni li seme a?! sijelo moli kon jaki, telo loje taki...
  82. replaceText("kama","kama",bool)
  83. replaceText("kasi","⚚",bool)
  84. replaceText("ken","𝙺",bool)
  85. replaceText("kepeken","ቋ",bool)
  86. replaceText("kili","kili",bool)
  87. replaceText("kiwen","⌔",bool)
  88. replaceText("ko","ko",bool)
  89. replaceText("kon","⧛",bool) //stopped adding comments here (hate it)
  90. replaceText("kule","🜁",bool) // i sweear this has a line (ignore above)
  91. replaceText("kulupu","ꖜ",bool)
  92. replaceText("kute","kute",bool)
  93. replaceText("la","❩",bool)
  94. replaceText("lape","⊸",bool)
  95. replaceText("laso","Ϫ",bool)
  96. replaceText("lawa","lawa",bool)
  97. replaceText("len","𝈤",bool)
  98. replaceText("lete","✳",bool) //maybe ӿ works too (paste in doc otherwise it looks bad in script editor)
  99. replaceText("li",">",bool)
  100. replaceText("lili","ᵛ",bool)
  101. replaceText("linja","linja",bool)
  102. replaceText("lipu","⎕",bool)
  103. replaceText("loje","loje",bool)
  104. replaceText("lon","∸",bool)
  105. replaceText("luka","ᕄ",bool)
  106. replaceText("lukin","lukin",bool)
  107. replaceText("lupa","⋃",bool)
  108. replaceText("mama","mama",bool)
  109. replaceText("mani","mani",bool)
  110. replaceText("meli","⍝",bool)
  111. replaceText("mije","⍜",bool)
  112. replaceText("moku","moku",bool)
  113. replaceText("moli","moli",bool)
  114. replaceText("monsi","∙ⵎ",bool) // NOTE: this one is two characters
  115. replaceText("mun","☽",bool)
  116. replaceText("musi","☋",bool)
  117. replaceText("mute","ꔖ",bool)
  118. replaceText("mu","ಆ",bool)
  119. replaceText("nanpa","ꖛ",bool)
  120. replaceText("nasa","nasa",bool)
  121. replaceText("nasin","nasin",bool)
  122. replaceText("nena","∩",bool)
  123. replaceText("nimi","▭",bool)
  124. replaceText("ni","↓",bool)
  125. replaceText("noka","noka",bool)
  126. replaceText("olin","olin",bool)
  127. replaceText("ona","ᓀ",bool)
  128. replaceText("open","𝈣",bool)
  129. replaceText("o","⫰",bool)
  130. replaceText("pakala","pakala",bool)
  131. replaceText("palisa","palisa",bool)
  132. replaceText("pali","pali",bool)
  133. replaceText("pana","pana",bool)
  134. replaceText("pan","pan",bool)
  135. replaceText("pilin","♡",bool)
  136. replaceText("pimeja","pimeja",bool)
  137. replaceText("pini","𝙸",bool)
  138. replaceText("pipi","ⱡ",bool)
  139. replaceText("pi","⎿",bool)
  140. replaceText("poka","⨆∙",bool) //two characters btw
  141. replaceText("poki","ⵡ",bool)
  142. replaceText("pu","⌻",bool) // theres no way this is a unicode character UPDATE: not really but ⌼ and ⌻ are close
  143. replaceText("sama","═",bool)
  144. replaceText("seli","ᗐ",bool)
  145. replaceText("selo","selo",bool)
  146. replaceText("seme","?",bool)
  147. replaceText("sewi","ﷲ",bool) //ꘕ might work, tell me if it does (changed to ﷲ)
  148. replaceText("sijelo","sijelo",bool)
  149. replaceText("sike","◎",bool)
  150. replaceText("sina","ᑲ",bool)
  151. replaceText("sinpin","コ∙",bool) //two characters btw
  152. replaceText("sin","sin",bool)
  153. replaceText("sitelen","ꘖ",bool) // i don't like this one, but i find it's too important to leave out.
  154. replaceText("sona","⸌🝅ᐟ",bool) //3 chars
  155. replaceText("soweli","soweli",bool)
  156. replaceText("suli","⋎",bool)
  157. replaceText("suno","¤",bool) //flipped but ok
  158. replaceText("supa","⫪",bool)
  159. replaceText("suwi","suwi",bool)
  160. replaceText("tan","↶",bool)
  161. replaceText("taso","┤",bool)
  162. replaceText("tawa","𝈵",bool)
  163. replaceText("telo","≈",bool)
  164. replaceText("tenpo","◷",bool)
  165. replaceText("toki","⸌ȯᐟ",bool) // 3 CHARACTERS!11!! //also dont like this one but too important to miss, (original was ő)
  166. replaceText("tomo","⌂",bool)
  167. replaceText("unpa","ꕢ",bool)
  168. replaceText("uta","uta",bool)
  169. replaceText("walo","walo",bool)
  170. replaceText("wan","ߗ",bool)
  171. replaceText("waso","waso",bool)
  172. replaceText("wawa","wawa",bool)
  173. replaceText("weka","⤬",bool)
  174. replaceText("wile","ω",bool)
  175.  
  176.  
  177. ////////////////////////////////// NIMISIN
  178.  
  179.  
  180. replaceText("tonsi","tonsi",bool)
  181. replaceText("kipisi","⁒",bool)
  182. replaceText("kijetesantakalu","kijetesantakalu",bool)
  183.  
  184.  
  185. }
  186.  
  187. function antetp() {
  188. ante(true)
  189. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement