From 95c0ce506206f2a615e99a9c30a76d353e53a220 Mon Sep 17 00:00:00 2001 From: UndeadMaelys Date: Fri, 25 Mar 2022 10:46:30 +0100 Subject: [PATCH] added lessons! --- color.lua | 23 ++++++++++++-- lessons.lua | 30 +++++++++++++++++++ lessons/nouns.lua | 41 +++++++++++++++++++++++++ lessons/personal_pronouns.lua | 56 +++++++++++++++++++++++++++++++++++ lessons/syntax.lua | 21 +++++++++++++ lexicon | 41 +++++++++++++++++++++---- words.lua | 1 + 7 files changed, 204 insertions(+), 9 deletions(-) create mode 100644 lessons.lua create mode 100644 lessons/nouns.lua create mode 100644 lessons/personal_pronouns.lua create mode 100644 lessons/syntax.lua diff --git a/color.lua b/color.lua index d4aca10..5d8adbb 100644 --- a/color.lua +++ b/color.lua @@ -25,10 +25,27 @@ COLOR = Enum { "White" } +EFFECT = Enum { + "Normal", + "Bold", + "Dim", + "Italic", + "Underline", + "BlinkSlow", + "BlinkFast", + "Invert", + "Conceal", + "CrossedOut" +} + +function makeTextEffect(Effect, Text) + return "\027["..tostring(Effect-1).."m"..Text.."\027[0;m" +end + function colorText(Color, Text) - return "\027[38;5;"..tostring(Color-1).."m"..Text.."\027[0;m" + return "\027[38;5;"..tostring(Color-1).."m"..Text.."\027[0;m" end function colorTextBackground(Color, Text) - return "\027[48;5;"..tostring(Color-1).."m"..Text.."\027[0;m" -end \ No newline at end of file + return "\027[48;5;"..tostring(Color-1).."m"..Text.."\027[0;m" +end diff --git a/lessons.lua b/lessons.lua new file mode 100644 index 0000000..72b14ba --- /dev/null +++ b/lessons.lua @@ -0,0 +1,30 @@ +-- Source https://stackoverflow.com/a/11130774 +function scandir(directory) + local directory = directory or "" + local i, t, popen = 0, {}, io.popen + local pfile = popen('ls "'..directory..'"') + for filename in pfile:lines() do + i = i + 1 + t[i] = filename + end + pfile:close() + return t +end + +function getFormattedLessonNames(directory) + local t = scandir(directory) + for i=1, #t do + t[i] = colorTextBackground(COLOR.Black,"\n#" .. i .. " " .. colorText(COLOR.HighBlue,string.gsub(t[i],".lua",""))) + end + return t +end + +function lesson(number) + number = tonumber(number) + local t = scandir(dir.."/lessons/") + if t[number] then + dofile("lessons/"..t[number]) + else + print("lesson not found") + end +end diff --git a/lessons/nouns.lua b/lessons/nouns.lua new file mode 100644 index 0000000..aee2da5 --- /dev/null +++ b/lessons/nouns.lua @@ -0,0 +1,41 @@ +print([[ + +]] .. makeTextEffect(EFFECT.Bold,makeTextEffect(EFFECT.Italic,colorText(COLOR.LightGray,[[ + NOUNS]]))) .. colorTextBackground(COLOR.Gray,[[ + + MODIFYING NOUNS + Nouns can be preceeded by a modifier to alter its meaning.]]) .. makeTextEffect(EFFECT.Bold,colorText(COLOR.HighYellow,[[ + + + Examples:]])) .. colorText(COLOR.Black,colorTextBackground(COLOR.HighYellow,[[ + + Fruit | shepa | + Orange | lunyaton | (modifier & noun!) + Orange fruit | lunyaton shepa |]])) .. [[ + +]] .. colorTextBackground(COLOR.Gray,[[ + + PLURAL NOUNS + Nouns can be made plural by using the suffix "-n". + This signifies an ambiguous amount of noun, greater than one.]]) .. [[ + +]] .. colorTextBackground(COLOR.Gray,[[ + + POSSESIVE RELATION + Nouns can be modified by another noun or pronouns using the suffix "-la". + This signifies a possesive from the first noun onto the second. + + If the plural suffix is added to the possesive relation, it brings + the sense that it is common of all instances.]]) .. makeTextEffect(EFFECT.Bold,colorText(COLOR.HighYellow,[[ + + + Examples:]])) .. colorText(COLOR.Black,colorTextBackground(COLOR.HighYellow,[[ + + Fruit | shepa + Fruits | shepan + Of the fruit | shepala + Of the fruits | shepanla + Of all instances of the fruit | shepalan + Of all fruits | shepanlan]])) .. [[ + +]]) diff --git a/lessons/personal_pronouns.lua b/lessons/personal_pronouns.lua new file mode 100644 index 0000000..c8ca76a --- /dev/null +++ b/lessons/personal_pronouns.lua @@ -0,0 +1,56 @@ +print([[ + +]] .. makeTextEffect(EFFECT.Bold,makeTextEffect(EFFECT.Italic,colorText(COLOR.LightGray,[[ + PERSONAL PRONOUNS]]))) .. colorTextBackground(COLOR.Gray,[[ + + SINGULAR FORM]]) .. [[ + + + 1st Person | re | me + 2nd Person | ba | you + 3rd Person | i.ma | they +]] .. colorTextBackground(COLOR.Gray,[[ + + DUAL FORM + You can combine two singular forms to make for a dual form. + Dual forms refers exclusively to pairs of people.]]) .. [[ + + + 1st Person Dual | re.re | excludes you + | re.ba | includes you + | re.ma | emphasizes someone else (not present or unknown) + 2nd Person Dual | ba.ba | you two + | ba.ma | emphasizes someone else (not present or unknown) + 3rd Person Dual | i.ma.ma | +]] .. colorTextBackground(COLOR.Gray,[[ + + OTHER PLURAL FORMS + To make other plural forms, you combine singular forms and + suffix the plural conjugation .]]) .. [[ + + + 1st Person Plural | ren | ambiguous + | re.ren | emphasizes (present or known, not you) + | re.ban | emphasizes (present or known, you) + | re.man | emphasises (not present or unknown) + 2nd Person Plural | ban | ambiguous + | ba.ban | emphasizes (present or known) + | ba.man | emphasizes (not present or unknown) + 3rd Person Plural | i.man | ambiguous + | i.ma.man | emphasizes (not present or unknown) + Other | re.ba.man | "me, you, everyone else" +]] .. colorTextBackground(COLOR.Gray,[[ + + FORMAL FORMS + Formal pronouns are used in formal situations. They are formed as following: + + 1. If the pronoun is singular or dual, suffixing "-l.fur". + 2. If the pronoun is another plural form, suffixing -"al.fur" instead. + + (This brings the sense of fully acknowledging the persons).]]) .. [[ + + + 1st Person Singular | rel.fur | formal + 2nd Person Singular | bal.fur | formal + 3rd Person Singular | i.mal.fur | formal +]]) diff --git a/lessons/syntax.lua b/lessons/syntax.lua new file mode 100644 index 0000000..007691a --- /dev/null +++ b/lessons/syntax.lua @@ -0,0 +1,21 @@ +print([[ + +]] .. makeTextEffect(EFFECT.Bold,makeTextEffect(EFFECT.Italic,colorText(COLOR.LightGray,[[ + SYNTAXIS]]))) .. colorTextBackground(COLOR.Gray,[[ + + 1. The basic sentence structure is SOV (Subject - Object - Verb) + 2. Subject is followed by the marker "chu" + 3. Markers follow the constituents they target. + 4. Modifiers precede the constituents they target.]]) .. [[ + +]] .. makeTextEffect(EFFECT.Bold,colorText(COLOR.HighYellow,[[ + + Examples:]])) .. colorText(COLOR.Black,colorTextBackground(COLOR.HighYellow,[[ + + I want to kiss you | re chu ba mukanyapash yu + They laughed | baman chu wiwikome + To dream dragons | daka shamiminku + Did not know | parefakome + Orange Fruit | lunyaton shipa]])) .. [[ + +]]) diff --git a/lexicon b/lexicon index d56167b..5300515 100755 --- a/lexicon +++ b/lexicon @@ -1,5 +1,7 @@ #!/usr/bin/env lua +dir = os.getenv("PWD") or io.popen("cd"):read() + if not arg[1] then print("no argument, try again") return end require "R2H2" @@ -14,6 +16,7 @@ require "search_list" require "remove_word" require "add_word" require "edit_word" +require "lessons" data_get = "words.lua" data_output = "words.lua" @@ -35,15 +38,18 @@ or arg[1] == "help" or arg[1] == "how" or arg[1] == "howdo" then print([[ - + +[a]ll + - shows all words in heonian. + [e]dit - removes the word from the lexicon [h]elp - shows this message -[l]ist - - shows all words in heonian. +[l]esson + - shows heonian lessons. [n]ew - add new word to the data @@ -62,12 +68,13 @@ General parameters: ]]) return end -if arg[1] == "l" -or arg[1] == "list" then + +if arg[1] == "a" +or arg[1] == "all" then if please_help then print([[ -[l]ist +[a]ll - shows all words in heonian. Parameters: @@ -79,6 +86,7 @@ Parameters: end return end + if arg[1] == "s" or arg[1] == "search" then if please_help then @@ -100,6 +108,27 @@ Parameters: end return end + +if arg[1] == "l" +or arg[1] == "lesson" then + if please_help then + print([[ + +[l]esson + - shows heonian lessons. if no lesson is specified, lists all the lessons. + +Parameters: +-h / --help (shows what does the command do) +]]) + else + if arg[2] then lesson(arg[2]) + else + print("specify a lesson",table.unpack(getFormattedLessonNames(dir.."/lessons/"))) + end + end + return +end + if arg[1] == "tr" or arg[1] == "transcript" then if please_help then diff --git a/words.lua b/words.lua index fdb80bf..85057e2 100644 --- a/words.lua +++ b/words.lua @@ -293,4 +293,5 @@ table.insert(t,{"yea.mat","area","noun","","",""}) table.insert(t,{"yesh","adorable","modifier","","",""}) table.insert(t,{"yi.ma","year","noun","","",""}) table.insert(t,{"yu","denotes topic, emphasis","marker","","","overwrites subject marker if they are in the same position, otherwise goes after it"}) +table.insert(t,{"po.ku","to paint, to make a color","verb","","",""}) return t