added lessons!

This commit is contained in:
UndeadMaelys 2022-03-25 10:46:30 +01:00
parent 93da415c03
commit 95c0ce5062
7 changed files with 204 additions and 9 deletions

View File

@ -25,6 +25,23 @@ 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"
end

30
lessons.lua Normal file
View File

@ -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

41
lessons/nouns.lua Normal file
View File

@ -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]])) .. [[
]])

View File

@ -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 <n>.]]) .. [[
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
]])

21
lessons/syntax.lua Normal file
View File

@ -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]])) .. [[
]])

39
lexicon
View File

@ -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"
@ -36,14 +39,17 @@ or arg[1] == "how"
or arg[1] == "howdo" then
print([[
[a]ll
- shows all words in heonian.
[e]dit <word_id>
- 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 <lesson>
- 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

View File

@ -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