Page 1 of 1

Dictionary / Word Searcher

Posted: Sat Nov 07, 2009 7:45 am
by jan Kete
I found a list of Toki Pona words and their English equivalents and I made a Lua program which allows you to search for the Toki Pona word, and it provides you with its English equivalents, or an English word and it will give you the Toki Pona word.

As it is a Lua script, you can see it's code and add words or meanings. I believe the list of words was outdated - there are about 118 words, so if someone could tell me which are missing, then it would help, I will add them to the source.

Please remember, it will only work if you have Lua installed, it can be downloaded for free http://www.lua.org/download.html there, it is also open-source.

Code: Select all

    dictionary = {
	["Conjunction: "] = {
		ante	=	{"otherwise","or else"},
		anu	=	{"or"},
		en	=	{"and (used to coordinate head nouns)"},
		taso	=	{"but"},
	},
	["Context: "] = {
		ken	=	{"it is possible that"},
	},
	["Interjection: "] = {
		a	=	{"ah","ha","uh","oh","ooh","aw","well (emotion word)"},
		ala	=	{"no!"},
		ike	=	{"oh dear! woe! alas!"},
		jaki	=	{"ew! yuck!"},
		mu	=	{"woof! meow! moo! etc. (cute animal noise)"},
		o	=	{"hey! (calling somebody's attention)"},
		pakala	=	{"damn! fuck!"},
		pona	=	{"great! good! thanks! OK! cool! yay!"},
		toki	=	{"hello! hi!"},
	},
	["Kama: "] = {
		jo	=	{"receive","get","take","obtain"},
		sona	=	{"learn","study"},
	},
	["Modifier: "] = {
		ala	=	{"no","not","none","un-"},
		ale	=	{"all","every","complete","whole"},
		anpa	=	{"low","lower","bottom","down"},
		ante	=	{"different"},
		awen	=	{"remaining","stationary","permanent","sedentary"},
		ijo	=	{"of something"},
		ike	=	{"bad","negative","wrong","evil","overly complex","(figuratively) unhealthy"},
		insa	=	{"inner","internal"},
		jaki	=	{"dirty","gross","filthy"},
		jan	=	{"human","somebody's","personal","of people"},
		jelo	=	{"yellow","light green"},
		kama	=	{"coming","future"},
		kin	=	{"also","too","even","indeed (emphasizes the word(s) before it)"},
		kiwen	=	{"hard","solid","stone-like","made of stone or metal"},
		kon	=	{"air-like","ethereal","gaseous"},
		kule	=	{"colourful"},
		kulupu	=	{"communal","shared","public","of the society"},
		kute	=	{"auditory","hearing"},
		lape	=	{"sleeping","of sleep"},
		laso	=	{"blue","blue-green"},
		lawa	=	{"main","leading","in charge"},
		lete	=	{"cold","uncooked"},
		lili	=	{"small","little","young","a bit","short","few","less"},
		loje	=	{"red"},
		lukin	=	{"visual(ly)"},
		mama	=	{"of the parent","parental","maternal","fatherly"},
		meli	=	{"female","feminine","womanly"},
		mi	=	{"my","our"},
		mije	=	{"male","masculine","manly"},
		moli	=	{"dead","deadly","fatal"},
		monsi	=	{"back","rear"},
		mun	=	{"lunar"},
		musi	=	{"artful","fun","recreational"},
		mute	=	{"many, very","much","several","a lot","abundant","numerous","more"},
		nasa	=	{"silly","crazy","foolish","drunk","strange","stupid","weird"},
		ni	=	{"this","that"},
		olin	=	{"love"},
		ona	=	{"her","his","its","their"},
		pali	=	{"active","work-related","operating","working"},
		pimeja	=	{"black","dark"},
		pini	=	{"completed","finished","past","done","ago"},
		poka	=	{"neighbouring"},
		pona	=	{"good","simple","positive","nice","correct","right"},
		sama	=	{"same","similar","equal","of equal status or position"},
		seli	=	{"hot","warm","cooked"},
		sewi	=	{"superior","elevated","religious","formal"},
		sike	=	{"round","cyclical"},
		sin	=	{"new","fresh","another","more"},
		sina	=	{"your"},
		suli	=	{"big","tall","long","adult","important"},
		suwi	=	{"sweet","cute"},
		taso	=	{"only","sole"},
		tawa	=	{"moving","mobile"},
		toki	=	{"talking","verbal"},
		tomo	=	{"urban","domestic","household"},
		tu	=	{"two"},
		unpa	=	{"erotic","sexual"},
		uta	=	{"oral"},
		walo	=	{"white","light (colour)"},
		wan	=	{"one","a"},
		wawa	=	{"energetic","strong","fierce","intense","sure","confident"},
		weka	=	{"away","absent","missing"},
		wile	=	{"necessary"},
	},
	["Noun: "] = {
		akesi	=	{"non-cute animal","reptile","amphibian"},
		ala	=	{"nothing","negation","zero"},
		ale	=	{"everything","anything","life","the universe"},
		anpa	=	{"bottom","lower part","under","below","floor","beneath"},
		ante	=	{"difference"},
		esun	=	{"market","shop"},
		ijo	=	{"thing","something","stuff","anything","object"},
		ike	=	{"negativity","badness","evil"},
		ilo	=	{"tool","device","machine","thing used for a specific purpose"},
		insa	=	{"inside","inner world","centre","stomach"},
		jaki	=	{"dirt","pollution","garbage","filth"},
		jan	=	{"person","people","human","being","somebody","anybody"},
		jo	=	{"having"},
		kala	=	{"fish","sea creature"},
		kalama	=	{"sound","noise","voice"},
		kama	=	{"event","happening","chance","arrival","beginning"},
		kasi	=	{"plant","leaf","herb","tree","wood"},
		ken	=	{"possibility","ability","power to do things","permission"},
		kili	=	{"fruit","pulpy vegetable","mushroom"},
		kiwen	=	{"hard thing","rock","stone","metal","mineral","clay"},
		ko	=	{"semi-solid or squishy substance","e.g. paste","powder","gum"},
		kon	=	{"air","wind","smell","soul"},
		kule	=	{"colour","paint"},
		kulupu	=	{"group","community","society","company","people"},
		lape	=	{"sleep","rest"},
		lawa	=	{"head","mind"},
		len	=	{"clothing","cloth","fabric"},
		lete	=	{"cold"},
		linja	=	{"long, very thin, floppy thing","e.g. string","rope","hair","thread","cord","chain"},
		lipu	=	{"flat and bendable thing","e.g. paper","card","ticket"},
		luka	=	{"hand","arm"},
		lupa	=	{"hole","orifice","window","door"},
		ma	=	{"land","earth","country","(outdoor) area"},
		mama	=	{"parent","mother","father"},
		mani	=	{"money","material wealth","currency","dollar","capital"},
		meli	=	{"woman","female","girl","wife","girlfriend"},
		mi	=	{"I","we"},
		mije	=	{"man","male","boy","husband","boyfriend"},
		moku	=	{"food","meal"},
		moli	=	{"death"},
		monsi	=	{"back","rear end","butt","behind"},
		mun	=	{"moon"},
		musi	=	{"fun","playing","game","recreation","art","entertainment"},
		mute	=	{"amount","quantity"},
		nanpa	=	{"number"},
		nasin	=	{"way, manner","custom","road","path","doctrine","system","method"},
		nena	=	{"bump","nose","hill","mountain","button"},
		nimi	=	{"word","name"},
		noka	=	{"leg","foot"},
		oko	=	{"eye"},
		olin	=	{"love"},
		ona	=	{"she","he","it","they"},
		pakala	=	{"blunder","accident","mistake","destruction","damage","breaking"},
		pali	=	{"activity","work","deed","project"},
		palisa	=	{"long","mostly hard object","e.g. rod","stick","branch"},
		pan	=	{"grain","cereal"},
		pana	=	{"giving","transfer","exchange"},
		pilin	=	{"feelings","emotion","heart"},
		pimeja	=	{"darkness","shadows"},
		pini	=	{"end","tip"},
		pipi	=	{"bug","insect","spider"},
		poka	=	{"side","hip","next to"},
		poki	=	{"container","box","bowl","cup","glass"},
		pona	=	{"good","simplicity","positivity"},
		seli	=	{"fire","warmth","heat"},
		selo	=	{"outside","surface","skin","shell","bark","shape","peel"},
		sewi	=	{"high","up","above","top","over","on"},
		sijelo	=	{"body","physical state"},
		sike	=	{"circle","wheel","sphere","ball","cycle"},
		sina	=	{"you"},
		sinpin	=	{"front","chest","torso","face","wall"},
		sitelen	=	{"picture","image"},
		sona	=	{"knowledge","wisdom","intelligence","understanding"},
		soweli	=	{"animal","especially land mammal","lovable animal"},
		suli	=	{"size"},
		suno	=	{"sun","light"},
		supa	=	{"horizontal surface","e.g furniture","table","chair","pillow","floor"},
		suwi	=	{"candy","sweet food"},
		tan	=	{"origin","cause"},
		tawa	=	{"movement","transportation"},
		telo	=	{"water","liquid","juice","sauce"},
		tenpo	=	{"time","period of time","moment","duration","situation"},
		toki	=	{"language","talking","speech","communication"},
		tomo	=	{"indoor constructed space","e.g. house","home","room","building"},
		tu	=	{"duo","pair"},
		unpa	=	{"sex","sexuality"},
		uta	=	{"mouth"},
		utala	=	{"conflict, disharmony, competition, fight","war","battle","attack","blow","argument","p"},
		walo	=	{"white thing or part","whiteness","lightness"},
		wan	=	{"unit","element","particle","part","piece"},
		waso	=	{"bird","winged animal"},
		wawa	=	{"energy","strength","power"},
		weka	=	{"absence"},
		wile	=	{"desire","need","will"},
	},
	["Other: "] = {
		nanpa	=	{"-th (ordinal numbers)"},
		seme	=	{"what","which","wh- (question word)"},
	},
	["Prepostion: "] = {
		kepeken	=	{"with"},
		lon	=	{"be (located) in/at/on"},
		poka	=	{"in the accompaniment of","with"},
		sama	=	{"like","as","seem"},
		tan	=	{"from","by","because of","since"},
		tawa	=	{"to","in order to","towards","for","until"},
	},
	["Seperator: "] = {
		e	=	{"(introduces a direct object)"},
		la	=	{"(between adverb or phrase of context and sentence)"},
		li	=	{"(between any subject except mi and sina and its verb; also used to introduce a n"},
		o	=	{"O (vocative or imperative)"},
		pi	=	{"of","belonging to"},
	},
	["Sound: "] = {
		ike	=	{"sounds like icky"},
		insa	=	{"inside"},
		jaki	=	{"yucky"},
		jelo	=	{"yellow"},
		kama	=	{"come up"},
		lukin	=	{"looking"},
		lupa	=	{"sounds like loop"},
		mama	=	{"sounds like momma"},
		mani	=	{"money"},
		meli	=	{"Mary"},
		mi	=	{"me"},
		mu	=	{"moo"},
		mun	=	{"moon"},
		mute	=	{"multi"},
		nanpa	=	{"number"},
		oko	=	{"similar to oculist"},
		pilin	=	{"feeling"},
		poki	=	{"box"},
		pona	=	{"bonam"},
		suwi	=	{"sweet"},
		taso	=	{"that's all"},
		tawa	=	{"towards"},
		tu	=	{"two"},
		walo	=	{"sounds like wall","which is often white"},
		wan	=	{"one"},
	},
	["Verb Intransitive: "] = {
		awen	=	{"stay","wait","remain"},
		ike	=	{"to be bad","to suck"},
		kalama	=	{"make noise"},
		kama	=	{"come","become","arrive","happen","pursue actions to arrive to (a certain state)"},
		ken	=	{"can","is able to","is allowed to","may","is possible"},
		lape	=	{"sleep","rest"},
		lon	=	{"be there","be present","be real/true","exist","be awake"},
		lukin	=	{"look","watch out","pay attention"},
		moli	=	{"die","be dead"},
		musi	=	{"play","have fun"},
		pakala	=	{"screw up","fall apart","break"},
		pali	=	{"act","work","function"},
		pilin	=	{"feel"},
		sona	=	{"know","understand"},
		tawa	=	{"go to","walk","travel","move","leave"},
		toki	=	{"talk","chat","communicate"},
		unpa	=	{"have sex"},
	},
	["Verb Transitive: "] = {
		ante	=	{"change","alter","modify"},
		awen	=	{"keep"},
		ijo	=	{"objectify"},
		ike	=	{"to make bad","to worsen","to have a negative effect upon"},
		jaki	=	{"pollute","dirty"},
		jan	=	{"personify","humanize","personalize"},
		jo	=	{"have","contain"},
		kalama	=	{"sound","ring","play (an instrument)"},
		kama	=	{"bring about","summon"},
		ken	=	{"make possible","enable","allow","permit"},
		kepeken	=	{"use"},
		kule	=	{"colour","paint"},
		kute	=	{"listen","hear"},
		lawa	=	{"lead","control","rule","steer"},
		lete	=	{"cool down","chill"},
		lili	=	{"reduce","shorten","shrink","lessen"},
		lukin	=	{"see","look at","watch","read"},
		moku	=	{"eat","drink","swallow","ingest","consume"},
		moli	=	{"kill"},
		musi	=	{"amuse","entertain"},
		mute	=	{"make many or much"},
		nasa	=	{"drive crazy","make weird"},
		olin	=	{"to love (a person)"},
		open	=	{"open","turn on"},
		pakala	=	{"screw up, fuck up, botch, ruin","break","hurt","injure","damage","spoil","ruin"},
		pali	=	{"do","make","build","create"},
		pana	=	{"give","put","send","place","release","emit","cause"},
		pilin	=	{"feel","think","sense","touch"},
		pimeja	=	{"darken"},
		pini	=	{"finish","close","end","turn off"},
		pona	=	{"improve","fix","repair","make good"},
		seli	=	{"heat","warm up","cook"},
		sin	=	{"renew","renovate","freshen"},
		sitelen	=	{"draw","write"},
		sona	=	{"know","understand","know how to"},
		suli	=	{"enlarge","lengthen"},
		suwi	=	{"sweeten"},
		tawa	=	{"move","displace"},
		telo	=	{"water","wash with water"},
		toki	=	{"say"},
		tu	=	{"double","separate/cut/divide in two"},
		unpa	=	{"have sex with","sleep with","fuck"},
		utala	=	{"hit","strike","attack","compete against"},
		wan	=	{"unite","make one"},
		wawa	=	{"strengthen","energize","empower"},
		weka	=	{"throw away","remove","get rid of"},
		wile	=	{"to want","need","wish","have to","must","will","should"},
	},
    }

       function pA(array)      -- Prints the array
        for k, v in pairs(array) do print("  "..k..": "..array[k]); end
    end
    
    function pona_eng()
	while true do
	    io.write("Word: ");
	    local word = string.lower(io.stdin:read'*l')
	    if word == "quit" then break
	    else
		for k, v in pairs(dictionary) do
		    if dictionary[k][word] then
			print(" "..k); pA(dictionary[k][word])
		    end
		end
	    end
	end
	main()
    end

    function eng_pona()
	while true do
	    io.write("Word: ");
	    local word = string.lower(io.stdin:read'*l')
	    if word == "quit" then break
	    else
		for k, v in pairs(dictionary) do
		    for k2, v2 in pairs(dictionary[k]) do
			for i = 1, table.getn(dictionary[k][k2]) do
			    if word == dictionary[k][k2][i] then
				print(k2);eng_pona()
			    end
			end
		    end
		end
	    end
	end
	main()
    end

    print("eng: eng to pona; pona: pona to eng")

    function main()
	io.write("[eng|pona]: ")
	local option = string.lower(io.stdin:read'*l')
	if option == "quit" then
	    os.exit()
	elseif option == "eng" then
	    eng_pona()
	elseif option == "pona" then
	    pona_eng()
	else
	    print("Invalid Choice")
	end
	main()
    end

    main()
I release it under the same terms as the Toki Pona website and wiki aka: Creative Commons Attribution-Non-Commercial-Share Alike 3.0 Unported Licence

Re: Dictionary / Word Searcher

Posted: Mon Nov 09, 2009 12:59 am
by aikidave
I just downloaded Lua, tried your script with the IExecutor and received an error message. Since I don't know Lua, I don't know what to do next.

I had previously created an English to toki pona dictionary using Sonja's toki pona to English dictionary as my source and working backwards.
The page is located here:
http://aiki.pbworks.com/English+to+TP+dictionary

Re: Dictionary / Word Searcher

Posted: Mon Nov 09, 2009 4:06 am
by jan Kete
Did you copy and paste the code? It should work if you save it to a file and then run it via the IExecutor from the file.

Re: Dictionary / Word Searcher

Posted: Mon Nov 09, 2009 11:21 am
by aikidave
I got it working ! I saved the text into a file called wordSearcher.lua
Lua recognizes the lua extension, so I double clicked on it and the program runs perfectly.

I would advise people to run the script as described above and not use IExecutor to run the file. IExecutor gave me these error messages:
http://aiki.pbworks.com/f/lua%20error%20message%201.jpg
http://aiki.pbworks.com/f/lua%20error%20message%202.jpg

This is a great little program. I like the way you grouped words by category in the script (nouns, transitive verbs, instransitive verbs, sounds). You put a lot of work into this program. Thank you !

I found 1 small bug so far: in English to TP mode, if I enter the word 'man' the program comes back with 'kama'.

Re: Dictionary / Word Searcher

Posted: Mon Nov 09, 2009 2:52 pm
by jan Kete
aikidave wrote:I got it working ! I saved the text into a file called wordSearcher.lua
Lua recognizes the lua extension, so I double clicked on it and the program runs perfectly.

I would advise people to run the script as described above and not use IExecutor to run the file. IExecutor gave me these error messages:
http://aiki.pbworks.com/f/lua%20error%20message%201.jpg
http://aiki.pbworks.com/f/lua%20error%20message%202.jpg

This is a great little program. I like the way you grouped words by category in the script (nouns, transitive verbs, instransitive verbs, sounds). You put a lot of work into this program. Thank you !

I found 1 small bug so far: in English to TP mode, if I enter the word 'man' the program comes back with 'kama'.
Thanks for the pick-up, I have modified the above.