Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function replaceText(t1,t2,bool){
- if (t1) {
- if (bool) {
- var temp = t1
- t1 = t2
- t2 = temp
- // var docBody = DocumentApp.getActiveDocument().getBody();
- docBody.replaceText(t1,t2)
- }
- var docBody = DocumentApp.getActiveDocument().getBody();
- var txt = docBody.getText()
- // docBody.replaceText(new RegExp('\\b'+t1+'\\b','g'),t2)
- docBody.setText(txt.replace(new RegExp('\\b'+t1+'\\b','g'),t2))
- }
- }
- function onOpen() {
- var ui = DocumentApp.getUi();
- ui.createMenu('sitelen pona')
- .addItem('o ante tawa sitelen pona', 'ante')
- // .addItem('o ante tawa toki pona', 'antetp') // doesn't work right now
- .addToUi()
- }
- function ante(bool) {
- // 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!!!
- // "mi","⍴",
- // "utala","⤩",
- // "tu","‖",
- // "li",">",
- // "ala","⨉",
- // "ma","⨁",
- // "alasa","Ð",
- // "ike","ᴖ",
- // "pona","ᵕ",
- // ]
- // var i = 0
- // 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
- // i += 1
- // var nimimama = (i * 2) - 1
- // var nimitawa = i * 2
- // replaceText(tbl[nimimama],tbl[nimitawa])
- // }
- //
- // haha couldn't figure out how to do all of this if you want to fix my code over here go ahead
- //
- if (bool) {} else { // ik its weird but i prefer this over !
- bool = false;
- }
- replaceText("mi","ᑭ",bool)
- replaceText("utala","⤩",bool)
- replaceText("tu","‖",bool)
- replaceText("ma","⨁",bool)
- replaceText("ike","◠",bool)
- replaceText("pona","◡",bool)
- replaceText("akesi","akesi",bool)
- replaceText("alasa","Ð",bool)
- replaceText("ala","⨉",bool)
- replaceText("ale","∞",bool)
- replaceText("ali","∞",bool)
- replaceText("anpa","џ",bool)
- replaceText("ante","≍",bool) // i don't like this one but couldn't find a better one
- replaceText("anu","ᵞ",bool)
- replaceText("awen","𝛬",bool)
- replaceText("a","ἀ",bool) // i know this is inaccurate but i just cant get anything better
- replaceText("e","⨠",bool)
- replaceText("en","╁",bool) //normal + sign makes error
- replaceText("esun","Ⴥ",bool)
- replaceText("ijo","◯",bool)
- replaceText("ilo","中",bool)
- replaceText("insa","⨃",bool) //also hate this one but its recognizable
- replaceText("jaki","ൾ",bool) //really looking forward to finding one for this UPDATE: got it while looking for kama
- replaceText("jan","ᗩ",bool) //really want to change this
- replaceText("jelo","jelo",bool)
- replaceText("jo","ල",bool)
- replaceText("kala","ю",bool)
- replaceText("kalama","kalama",bool) // ni li seme a?! sijelo moli kon jaki, telo loje taki...
- replaceText("kama","kama",bool)
- replaceText("kasi","⚚",bool)
- replaceText("ken","𝙺",bool)
- replaceText("kepeken","ቋ",bool)
- replaceText("kili","kili",bool)
- replaceText("kiwen","⌔",bool)
- replaceText("ko","ko",bool)
- replaceText("kon","⧛",bool) //stopped adding comments here (hate it)
- replaceText("kule","🜁",bool) // i sweear this has a line (ignore above)
- replaceText("kulupu","ꖜ",bool)
- replaceText("kute","kute",bool)
- replaceText("la","❩",bool)
- replaceText("lape","⊸",bool)
- replaceText("laso","Ϫ",bool)
- replaceText("lawa","lawa",bool)
- replaceText("len","𝈤",bool)
- replaceText("lete","✳",bool) //maybe ӿ works too (paste in doc otherwise it looks bad in script editor)
- replaceText("li",">",bool)
- replaceText("lili","ᵛ",bool)
- replaceText("linja","linja",bool)
- replaceText("lipu","⎕",bool)
- replaceText("loje","loje",bool)
- replaceText("lon","∸",bool)
- replaceText("luka","ᕄ",bool)
- replaceText("lukin","lukin",bool)
- replaceText("lupa","⋃",bool)
- replaceText("mama","mama",bool)
- replaceText("mani","mani",bool)
- replaceText("meli","⍝",bool)
- replaceText("mije","⍜",bool)
- replaceText("moku","moku",bool)
- replaceText("moli","moli",bool)
- replaceText("monsi","∙ⵎ",bool) // NOTE: this one is two characters
- replaceText("mun","☽",bool)
- replaceText("musi","☋",bool)
- replaceText("mute","ꔖ",bool)
- replaceText("mu","ಆ",bool)
- replaceText("nanpa","ꖛ",bool)
- replaceText("nasa","nasa",bool)
- replaceText("nasin","nasin",bool)
- replaceText("nena","∩",bool)
- replaceText("nimi","▭",bool)
- replaceText("ni","↓",bool)
- replaceText("noka","noka",bool)
- replaceText("olin","olin",bool)
- replaceText("ona","ᓀ",bool)
- replaceText("open","𝈣",bool)
- replaceText("o","⫰",bool)
- replaceText("pakala","pakala",bool)
- replaceText("palisa","palisa",bool)
- replaceText("pali","pali",bool)
- replaceText("pana","pana",bool)
- replaceText("pan","pan",bool)
- replaceText("pilin","♡",bool)
- replaceText("pimeja","pimeja",bool)
- replaceText("pini","𝙸",bool)
- replaceText("pipi","ⱡ",bool)
- replaceText("pi","⎿",bool)
- replaceText("poka","⨆∙",bool) //two characters btw
- replaceText("poki","ⵡ",bool)
- replaceText("pu","⌻",bool) // theres no way this is a unicode character UPDATE: not really but ⌼ and ⌻ are close
- replaceText("sama","═",bool)
- replaceText("seli","ᗐ",bool)
- replaceText("selo","selo",bool)
- replaceText("seme","?",bool)
- replaceText("sewi","ﷲ",bool) //ꘕ might work, tell me if it does (changed to ﷲ)
- replaceText("sijelo","sijelo",bool)
- replaceText("sike","◎",bool)
- replaceText("sina","ᑲ",bool)
- replaceText("sinpin","コ∙",bool) //two characters btw
- replaceText("sin","sin",bool)
- replaceText("sitelen","ꘖ",bool) // i don't like this one, but i find it's too important to leave out.
- replaceText("sona","⸌🝅ᐟ",bool) //3 chars
- replaceText("soweli","soweli",bool)
- replaceText("suli","⋎",bool)
- replaceText("suno","¤",bool) //flipped but ok
- replaceText("supa","⫪",bool)
- replaceText("suwi","suwi",bool)
- replaceText("tan","↶",bool)
- replaceText("taso","┤",bool)
- replaceText("tawa","𝈵",bool)
- replaceText("telo","≈",bool)
- replaceText("tenpo","◷",bool)
- replaceText("toki","⸌ȯᐟ",bool) // 3 CHARACTERS!11!! //also dont like this one but too important to miss, (original was ő)
- replaceText("tomo","⌂",bool)
- replaceText("unpa","ꕢ",bool)
- replaceText("uta","uta",bool)
- replaceText("walo","walo",bool)
- replaceText("wan","ߗ",bool)
- replaceText("waso","waso",bool)
- replaceText("wawa","wawa",bool)
- replaceText("weka","⤬",bool)
- replaceText("wile","ω",bool)
- ////////////////////////////////// NIMISIN
- replaceText("tonsi","tonsi",bool)
- replaceText("kipisi","⁒",bool)
- replaceText("kijetesantakalu","kijetesantakalu",bool)
- }
- function antetp() {
- ante(true)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement