initial commit

This commit is contained in:
Daniel Tsvetkov 2023-10-08 18:27:27 +02:00
commit 52dc733cf3
17 changed files with 5607 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
venv
__pycache__
.idea
tts

739
dictionary.py Normal file
View File

@ -0,0 +1,739 @@
# toki pona
MI = 'mi'
SINA = 'sina'
ONA = 'ona'
LI = 'li'
PONA = 'pona'
IKE = 'ike'
SULI = 'suli'
LILI = 'lili'
KILI = 'kili'
SOWELI = 'soweli'
ALA = 'ala'
ALE = 'ale'
UTALA = 'utala'
WAWA = 'wawa'
SUWI = 'suwi'
JAN = 'jan'
MAMA = 'mama'
MELI = 'meli'
MIJE = 'mije'
MOKU = 'moku'
E = 'e'
IJO = 'ijo'
ILO = 'ilo'
LIPU = 'lipu'
LUKIN = 'lukin'
OLIN = 'olin'
PALI = 'pali'
PANA = 'pana'
TELO = 'telo'
TOMO = 'tomo'
JO = 'jo'
KALA = 'kala'
KASI = 'kasi'
PIPI = 'pipi'
SITELEN = 'sitelen'
TOKI = 'toki'
WASO = 'waso'
MA = 'ma'
KIWEN = 'kiwen'
KO = 'ko'
ANTE = 'ante'
AWEN = 'awen'
EN = 'en'
KALAMA = 'kalama'
KULUPU = 'kulupu'
LAPE = 'lape'
MUTE = 'mute'
NI = 'ni'
PAKALA = 'pakala'
SELI = 'seli'
KEPEKEN = 'kepeken'
LON = 'lon'
SAMA = 'sama'
TAN = 'tan'
TAWA = 'tawa'
SEWI = 'sewi'
NOKA = 'noka'
POKA = 'poka'
MONSI = 'monsi'
SINPIN = 'sinpin'
A = 'a'
ANU = 'anu'
MU = 'mu'
O = 'o'
SEME = 'seme'
KUTE = 'kute'
NIMI = 'nimi'
LAWA = 'lawa'
ANPA = 'anpa'
INSA = 'insa'
KULE = 'kule'
JELO = 'jelo'
LASO = 'laso'
LOJE = 'loje'
PIMEJA = 'pimeja'
WALO = 'walo'
NASA = 'nasa'
JAKI = 'jaki'
MOLI = 'moli'
UNPA = 'unpa'
PI = 'pi'
LA = 'la'
LUKA = 'luka'
LINJA = 'linja'
PALISA = 'palisa'
SELO = 'selo'
SIJELO = 'sijelo'
LEN = 'len'
LETE = 'lete'
MUSI = 'musi'
KAMA = 'kama'
KEN = 'ken'
OPEN = 'open'
PINI = 'pini'
SONA = 'sona'
WILE = 'wile'
LUPA = 'lupa'
NASIN = 'nasin'
NENA = 'nena'
TENPO = 'tenpo'
WAN = 'wan'
TU = 'tu'
SIKE = 'sike'
MANI = 'mani'
ESUN = 'esun'
MUN = 'mun'
NANPA = 'nanpa'
POKI = 'poki'
SIN = 'sin'
SUNO = 'suno'
AKESI = 'akesi'
ALASA = 'alasa'
KON = 'kon'
PAN = 'pan'
PILIN = 'pilin'
PU = 'pu'
SUPA = 'supa'
TASO = 'taso'
UTA = 'uta'
WEKA = 'weka'
NAMAKO = 'namako'
KIN = 'kin'
OKO = 'oko'
KIPISI = 'kipisi'
LEKO = 'leko'
MONSUTA = 'monsuta'
MISIKEKE = 'misikeke'
SOKO = 'soko'
MESO = 'meso'
EPIKU = 'epiku'
LANPAN = 'lanpan'
N = 'n'
KIJETESANTAKALU = 'kijetesantakalu'
KU = 'ku'
# english
toki_pona_en = {
"LESSON_01": {
MI: 'I, me, us',
SINA: 'you, your',
ONA: 'he, she, it, they',
LI: 'is, are, was, were',
PONA: 'good, simple, to improve, to fix',
IKE: 'bad, evil, complex, unnecessary',
SULI: 'big, great, important, to grow',
LILI: 'small, little, few, young, to shrink',
KILI: 'fruit, vegetable, mushroom',
SOWELI: 'animal, mammal, land animal',
},
"LESSON_02": {
ALA: 'no, not, zero',
ALE: 'everything, anything, life, the universe',
UTALA: 'fight, war, battle, to fight',
WAWA: 'strong, powerful, energy, strength',
SUWI: 'sweet, cute, to sweeten',
JAN: 'person, people, human, somebody',
MAMA: 'parent, mother, father',
MELI: 'woman, female, feminine, wife',
MIJE: 'man, male, masculine, husband',
MOKU: 'to eat, food',
},
"LESSON_03": {
E: 'specify direct object',
IJO: 'thing, something, stuff, anything',
ILO: 'tool, device, machine',
LIPU: 'book, document, paper',
LUKIN: 'to look, eye, to see, to seek to',
OLIN: 'love, compassion, affection',
PALI: 'to do, to work, to make, labor',
PANA: 'to give, to send, to emit',
TELO: 'water, liquid, juice, to wash, to clean',
TOMO: 'house, home, building, room',
},
"LESSON_04": {
JO: 'to have, to contain, to hold',
KALA: 'fish, sea creature, marine animal',
KASI: 'plant, leaf, herb, tree, wood',
PIPI: 'bug, insect, spider, worm',
SITELEN: 'picture, image, to draw, to write',
TOKI: 'to talk, language, speech, to say',
WASO: 'bird, flying animal, winged creature',
MA: 'land, earth, country, outside area',
KIWEN: 'rock, stone, metal, hard thing',
KO: 'clay, dough, paste, powder',
},
"LESSON_05": {
ANTE: 'different, changed, other, to change',
AWEN: 'stay, keep, endure, protect, continue',
EN: 'and, also, too, in addition',
KALAMA: 'to make noise, sound, noise, voice',
KULUPU: 'group, community, society, nation',
LAPE: 'sleep, rest, to sleep',
MUTE: 'many, very, much, several, a lot',
NI: 'this, that, these, those',
PAKALA: 'broken, ruined, destroyed, to break, curse',
SELI: 'fire, warmth, heat, to heat, to warm up',
},
"LESSON_06": {
KEPEKEN: 'to use, with, by means of, to use',
LON: 'in, at, on, true, to exist',
SAMA: 'same, similar, equal, to resemble',
TAN: 'from, by, because of, since, origin',
TAWA: 'going to, toward, to, for, towards, movement',
SEWI: 'up, high, above, top, sky, god, to elevate',
NOKA: 'leg, foot, to walk, to travel',
POKA: 'side, hip, next to, nearby, to be next to',
MONSI: 'back, rear, butt, behind, to follow',
SINPIN: 'front, chest, wall, to face',
},
"LESSON_07": {
A: 'ah, ha, uh, oh, oops, woe',
ANU: 'or',
MU: 'moo, any animal noise',
O: 'hey, oh, o, oops, uh, ah',
SEME: 'what, which, wh- question word',
KUTE: 'ear, to hear, to listen',
NIMI: 'word, name, to name',
LAWA: 'head, mind, brain, to control',
ANPA: 'bottom, lower part, under, to be below',
INSA: 'inside, inner world, stomach, to be inside',
},
"LESSON_08": {
KULE: 'color, paint, colorful, to color',
JELO: 'yellow',
LASO: 'blue, green',
LOJE: 'red, pink, orange, purple',
PIMEJA: 'black, dark, shadow, darkness',
WALO: 'white, light, bright, clear',
NASA: 'unusual, strange, crazy, silly, drunk',
JAKI: 'dirty, gross, to pollute, to contaminate',
MOLI: 'dying, death',
UNPA: 'sexual relations',
},
"LESSON_09": {
PI: 'of, belonging to',
LA: 'if, when, during, while, because',
LUKA: 'hand, arm, five, to grab',
LINJA: 'thread, hair, long, straight, rope, ',
PALISA: 'stick, rod, branch, long, straight',
SELO: 'outside, surface, skin, bark, shell',
SIJELO: 'body, physical state, torso, shape',
LEN: 'clothing, cloth, fabric, to wear',
LETE: 'cold, cool, frozen, to cool down',
MUSI: 'fun, art, play, game, to play',
},
"LESSON_10": {
KAMA: 'to come, to become, to arrive, to happen',
KEN: 'can, is able to, is allowed to, to be able to',
OPEN: 'to open, to turn on, to start, to begin',
PINI: 'finished, past, done, to finish',
SONA: 'to know, knowledge, wisdom, intelligence',
WILE: 'to want, to need, to have to, to wish',
LUPA: 'hole, orifice, window, door, to open',
NASIN: 'way, manner, custom, road, path, doctrine',
NENA: 'bump, hill, mountain, button, nose',
TENPO: 'time, period of time, moment, duration',
},
"LESSON_11": {
WAN: 'one, a, unit, element, particle',
TU: 'two, pair, double, to separate',
SIKE: 'circle, wheel, ball, cycle, round',
MANI: 'money, material wealth, currency, large domesticated animal',
ESUN: 'market, shop, store, to buy, to sell',
MUN: 'moon, satellite',
NANPA: 'number, amount, quantity, to count',
POKI: 'container, box, bowl, cup, to contain',
SIN: 'new, fresh, another, more',
SUNO: 'sun, light, bright, to shine',
},
"LESSON_12": {
AKESI: 'reptile, amphibian, dragon, monster',
ALASA: 'hunt, to hunt, to forage',
KON: 'air, wind, smell, soul, spirit',
PAN: 'bread, grain, cereal, pasta, rice',
PILIN: 'feeling, emotion, heart, to feel',
PU: 'book of Toki Pona',
SUPA: 'horizontal surface, table, chair, to sit',
TASO: 'only, sole, but, however, to limit',
UTA: 'mouth, lips, to kiss',
WEKA: 'absent, missing, to remove',
},
"LESSON_13": {
NAMAKO: 'extra, accessory, spice, to add',
KIN: 'also, even, indeed, too, still',
OKO: 'eye, to see, to watch, to look at',
KIPISI: 'to cut, to slice, to divide, to share',
LEKO: 'block, cube, square, rectangle, to block',
MONSUTA: 'monster, alien, mutant, demon',
MISIKEKE: 'medicine, drug, chemical, to medicate',
SOKO: 'mushroom, fungus',
EPIKU: 'epic, epic poem, saga',
LANPAN: 'to get, seize, steal, to take',
N: 'hmm..., umm...',
KIJETESANTAKALU: 'racoon',
KU: 'toki pona dictionary'
},
}
TOK_EN_PHRASES = {
"LESSON_01": {
'ona li suli': 'he is big',
'ona li lili': 'he is small',
'ona li moku': 'he is eating',
'kili li pona': 'fruit is good',
'sina suli': 'you are important',
'sowli li suli': 'animals are important',
'mi suli': 'I am great',
'ona li soweli': 'it is an animal',
'sina ike': 'you are bad',
},
"LESSON_02": {
'jan wawa': 'a strong person',
'mama mi': 'my parent',
'soweli sina': 'your animal',
'moku ona': 'his food',
'wawa sina': 'your strength',
'suli ona': 'his greatness',
'soweli lili suli': 'cute small animal',
'mama mi li pona': 'my parent is good',
'kili suwi li moku pona': 'sweet fruit is good food',
'jan utala li wawa': 'a warrior is strong',
'jan lili mi li suwi': 'my child is cute',
'soweli lili li wawa ala': 'small animals are not strong',
'meli mi li pona': 'my wife is good',
'mije sina li suli': 'your husband is big',
'mama mije mi li wawa': 'my father is strong',
'soweli ale li pona': 'all animals are good',
'kili li moku suli': 'fruits are important food',
'meli mi li suwi': 'my wife is adorable',
'jan utala ale li ike': 'all warriors are bad',
'jan pona mi li jan pona sina': 'my friend is your friend',
'jan lili mije sina li wawa': 'your son is strong',
'kili lili li suwi': 'small fruits are sweet',
},
"LESSON_03": {
'mije li pali': 'a man is working',
'jan wawa li pali pona': 'a strong person is working well',
'jan wawa li pali e tomo': 'a strong person is building a house',
'jan pali li pana e moku pona': 'a worker is giving good food',
'jan pona mi li pona e ilo lukin': 'my friend is fixing the glasses',
'mi telo e moku': 'I am washing the food',
'mi olin e meli mi': 'I love my wife',
'sina pona lukin': 'you look good',
'jan lili li pana e telo lukin': 'a child is crying',
'ona li lukin e lipu': 'he is reading a book',
'soweli ike li utala e meli': 'bad animal is attacking a woman',
'jan utala li moku e kili suli': 'a warrior is eating a big fruit',
'soweli lili li moku e telo': 'a small animal is drinking water',
'mi telo e ijo suli': 'I am washing a big thing',
'ona li olin e jan ale': 'he loves everyone',
'tomo telo li pona': 'a bathroom is good',
'mi pana e lipu': 'I am giving a book',
'jan utala ike li lukin e tomo sina': 'a bad warrior is looking at your house',
'ilo mi li pali pona': 'my tool is working well',
},
"LESSON_04": {
'jan pali li telo e kasi': 'The worker is watering the plants.',
'jan wawa li jo e kiwen suli': 'The strong person is carrying big rocks.',
'telo suli li jo e kala': 'The sea has fish.',
'mi sitelen e toki sina': 'I am writing down your speech.',
'waso lili li moku e pipi': 'The small bird eats bugs.',
'ma tomo mi li suli': 'My city is big.',
'ona li toki meli': 'They talk about women.',
'sina toki e kala': 'You talk about fish.',
'mi toki lon ijo': 'I talk about something.',
'jan pali li toki utala e tomo mi': 'The worker criticizes my house.',
'ona li toki ike e jan pona mi': 'They speak bad things about my friend.',
'meli li toki e soweli, e waso': 'A woman is talking about land animals and birds.',
'jan pali li pona e ilo, li lukin e lipu': 'A worker fixes the device and looks at a document.',
'mi moku ala e soweli': 'I dont eat animals',
'jan pona sina li toki e ma, e telo': 'Your friend is talking about the land and the water.',
'jan suli li lukin e ma tomo, li sitelen e ijo': 'An important person is looking at the city and writing things down.',
'ma li jo e kasi ike': 'The land has weeds',
'pipi lili li suli, li pona': 'Small bugs are important and good.',
'ma tomo sina li jo ala e jan pali': 'Your city doesnt have any workers.',
'mije mi li pali ala, li moku, li utala': 'My husband doesnt work, only eats and fights.',
'ma mama mi li suli': 'My homeland is large.',
'sitelen sina li pona lukin': 'Your painting looks good.',
'jan pona mi li jo e kala e kili li pali e moku pona': 'My friend has fish and fruit and makes good food.',
},
"LESSON_05": {
'mi en sina li moku': 'You and I are eating.',
'jan utala mute': 'many warriors',
'jan lili mute li lape': 'The children are sleeping',
'kiwen suli li pakala e tomo lipu': 'A big rock damaged the library',
'mi pakala lili': 'I made a little mistake.',
'ilo sina li kalama mute ike': 'Your instrument is making lots of bad noise.',
'kulupu ni li pona mute': 'This community is very good.',
'jan lili li toki e ni: sina pona': 'The child said that youre good.',
'ona li toki e ni: “toki! sina pona lukin”': 'They said: “Hello! You look good.”',
'jan pali ni li pali e tomo mi: ona li jo e kiwen mute': 'The worker with lots of rocks built my home',
'kulupu sina li ante mute': 'Your community is very different.',
'jan ike li pakala e ilo mi': 'A bad person broke my tools.',
'mi pali e tomo ni': 'I built this house.',
'jan utala pona mute li awen e kulupu ni': 'The good warriors protect this community.',
'kulupu suli li awen, li suli e ona': 'The large community endures and grows itself',
'moku seli li pona mute': 'Warm food is very good.',
'jan lili lape li kalama ala': 'Sleeping children dont make noises.',
'jan pali mute li toki e ni: ona li wawa, li kiwen': 'The workers said that they are strong and tough.',
'sina ante lukin': 'You look different.',
'tomo ni li awen e seli': 'This house preserves the heat.',
},
"LESSON_06": {
'': '',
},
"LESSON_07": {
'': '',
},
"LESSON_08": {
'': '',
},
"LESSON_09": {
'': '',
},
"LESSON_10": {
'': '',
},
"LESSON_11": {
'': '',
},
"LESSON_12": {
'': '',
},
"LESSON_13": {
'': '',
},
}
# groups
GROUPS = dict(
GROUP_VERBS=[
OLIN,
LANPAN,
PANA,
JO,
KEN,
WILE,
PALI,
KAMA,
KEPEKEN,
TOKI,
ALASA,
LUKIN,
LAPE,
LAWA,
AWEN,
MOKU,
MOLI,
KIPISI,
WEKA,
UNPA,
TAWA,
KALAMA,
UTALA,
SONA,
],
GROUP_NOUNS=[
IJO,
ILO,
ESUN,
TOMO,
SITELEN,
KIWEN,
KO,
LEKO,
SIKE,
PAN,
PALISA,
LIPU,
POKI,
MONSUTA,
],
GROUP_ADJECTIVES=[
PONA,
IKE,
WAWA,
EPIKU,
SULI,
LILI,
SUWI,
SIN,
PINI,
PAKALA,
NAMAKO,
NASA,
],
GROUP_HARDNESS=[
KIWEN,
KO,
PALISA,
PAKALA,
],
GROUP_ANIMALS=[
SOWELI,
PIPI,
AKESI,
KALA,
WASO,
KIJETESANTAKALU,
MU,
],
GROUP_PLANTS=[
KASI,
KILI,
SOKO,
],
GROUP_NATURE=[
NENA,
KIWEN,
KASI,
],
GROUP_ASTRONOMY=[
MUN,
SUNO,
MA,
],
GROUP_TIME=[
TENPO,
PINI,
KAMA,
SIN,
],
GROUP_PRONOUNS=[
MI,
SINA,
ONA,
],
GROUP_TEMPERATURE=[
LETE,
SELI,
],
GROUP_LOGICAL=[
ANU,
LA,
TASO,
EN,
ALE,
ALA,
LON,
KIN,
TAN,
ANTE,
MUTE,
],
GROUP_GRAMMAR=[
LI,
E,
PI,
SEME,
],
GROUP_QUESTION=[
SEME,
],
GROUP_ELEMENTS=[
KON,
SELI,
MA,
TELO,
],
GROUP_TASTE=[
SUWI,
JAKI,
],
GROUP_DIFFERENT=[
ANTE,
NASA,
],
GROUP_SIZE=[
LILI,
SULI,
],
GROUP_LIVING=[
KILI,
SOWELI,
],
GROUP_NUMBERS=[
NANPA,
ALA,
WAN,
TU,
LUKA,
MUTE,
ALE,
],
GROUP_PEOPLE=[
JAN,
KULUPU,
MAMA,
MELI,
MIJE,
],
GROUP_GENDERS=[
MELI,
MIJE,
],
GROUP_FOOD=[
MOKU,
PAN,
KILI,
NAMAKO,
],
GROUP_BODY=[
SIJELO,
LUKIN,
NOKA,
POKA,
MONSI,
SINPIN,
LUKA,
KUTE,
LAWA,
LINJA,
PILIN,
UTA,
OKO,
NENA,
MISIKEKE,
],
GROUP_OBJECTS=[
IJO,
ILO,
LIPU,
TOMO,
LEN,
POKI,
SIKE,
LEKO,
],
GROUP_SHAPES=[
SIKE,
LEKO,
LINJA,
],
GROUP_LOCATIONS=[
ESUN,
MA,
TOMO,
],
GROUP_COLORS=[
KULE,
JELO,
LASO,
LOJE,
PIMEJA,
WALO,
],
GROUP_FEELINGS=[
PILIN,
OLIN,
MONSUTA,
],
GROUP_HOUSE=[
TOMO,
LEKO,
SITELEN,
],
GROUP_ENGLISH_LIKE=[
LUKIN,
JELO,
JAKI,
MUSI,
OPEN,
TENPO,
MANI,
KEN,
MUN,
WAN,
TU,
SAMA,
SUNO,
],
GROUP_BULGARIAN_LIKE=[
LINJA,
SELO,
LETE,
LEN,
LUPA,
SUPA,
UTA,
OKO,
NASIN,
LAWA,
LUKA,
MAMA,
],
GROUP_SERBIAN_LIKE=[
NOKA,
OLIN,
ONA,
SIJELO,
],
GROUP_LANGUAGE=[
KU,
PU,
NIMI,
],
GROUP_INTERJECTIONS=[
A,
MU,
O,
N,
],
GROUP_DIRECTIONS=[
SEWI,
ANPA,
POKA,
INSA,
LON,
SINPIN,
MONSI,
NI,
]
)

18
get_categories.py Normal file
View File

@ -0,0 +1,18 @@
from collections import defaultdict
from pprint import pprint
from dictionary import GROUPS, toki_pona_en
def main():
counter = dict()
for word in toki_pona_en.keys():
counter[word] = []
for group_name, words in GROUPS.items():
for word in words:
counter[word].append(group_name.split('GROUP_')[1])
pprint(sorted(counter.items(), key=lambda x: len(x[1]), reverse=True))
if __name__ == '__main__':
main()

3715
lexconvert.py Normal file

File diff suppressed because it is too large Load Diff

31
lyrics_pan_nanpa_wan.txt Normal file
View File

@ -0,0 +1,31 @@
jan lawa sewi li toki sike
toki ona la: "sina ike!"
sina wile e moku lili;
taso, ona li toki e ni:
moku la? sina nasa!
jan li jo anu jo ala la pona
pan suwi li lon ma sewi;
ona li pan nanpa wan tawa jan!
ona li jo e ilo kalama
li wile toki e jan lon lupa
ona li lanpan e pan, e mani
pini la, ona li toki e ni:
... (suwi a!)
jan li pali tan ona olin
anu li wile pi pona lukin
… la, jan li ike, li kama jaki;
ona li seli lon tenpo moli
taso, kama la ante li ken
lon poka ante pi nena kiwen
sina ale o pana pali!
jan lanpan jo la, mi toki e ni:
...
sike a!
...

129
mylist.txt Normal file
View File

@ -0,0 +1,129 @@
file 'tts/tok_phrases/lesson_names/lesson_05.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/misc/words.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/ante.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/awen.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/en.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/kalama.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/kulupu.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/lape.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/mute.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/ni.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/pakala.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_words_double_meaning/seli.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/misc/silence_1.mp3'
file 'tts/misc/phrases.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/tok/mi_en_sina_li_moku.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/you_and_i_are_eating..mp4'
file 'tts/tok_phrases/tok/mi_en_sina_li_moku.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/jan_utala_mute.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/many_warriors.mp4'
file 'tts/tok_phrases/tok/jan_utala_mute.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/jan_lili_mute_li_lape.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/the_children_are_sleeping.mp4'
file 'tts/tok_phrases/tok/jan_lili_mute_li_lape.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/kiwen_suli_li_pakala_e_tomo_lipu.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/a_big_rock_damaged_the_library.mp4'
file 'tts/tok_phrases/tok/kiwen_suli_li_pakala_e_tomo_lipu.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/mi_pakala_lili.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/i_made_a_little_mistake..mp4'
file 'tts/tok_phrases/tok/mi_pakala_lili.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/ilo_sina_li_kalama_mute_ike.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/your_instrument_is_making_lots_of_bad_noise..mp4'
file 'tts/tok_phrases/tok/ilo_sina_li_kalama_mute_ike.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/kulupu_ni_li_pona_mute.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/this_community_is_very_good..mp4'
file 'tts/tok_phrases/tok/kulupu_ni_li_pona_mute.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/jan_lili_li_toki_e_ni:_sina_pona.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/the_child_said_that_youre_good..mp4'
file 'tts/tok_phrases/tok/jan_lili_li_toki_e_ni:_sina_pona.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/ona_li_toki_e_ni:_“toki!_sina_pona_lukin”.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/they_said:_“hello!_you_look_good.”.mp4'
file 'tts/tok_phrases/tok/ona_li_toki_e_ni:_“toki!_sina_pona_lukin”.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/jan_pali_ni_li_pali_e_tomo_mi:_ona_li_jo_e_kiwen_mute.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/the_worker_with_lots_of_rocks_built_my_home.mp4'
file 'tts/tok_phrases/tok/jan_pali_ni_li_pali_e_tomo_mi:_ona_li_jo_e_kiwen_mute.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/kulupu_sina_li_ante_mute.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/your_community_is_very_different..mp4'
file 'tts/tok_phrases/tok/kulupu_sina_li_ante_mute.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/jan_ike_li_pakala_e_ilo_mi.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/a_bad_person_broke_my_tools..mp4'
file 'tts/tok_phrases/tok/jan_ike_li_pakala_e_ilo_mi.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/mi_pali_e_tomo_ni.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/i_built_this_house..mp4'
file 'tts/tok_phrases/tok/mi_pali_e_tomo_ni.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/jan_utala_pona_mute_li_awen_e_kulupu_ni.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/the_good_warriors_protect_this_community..mp4'
file 'tts/tok_phrases/tok/jan_utala_pona_mute_li_awen_e_kulupu_ni.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/kulupu_suli_li_awen___li_suli_e_ona.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/the_large_community_endures_and_grows_itself.mp4'
file 'tts/tok_phrases/tok/kulupu_suli_li_awen___li_suli_e_ona.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/moku_seli_li_pona_mute.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/warm_food_is_very_good..mp4'
file 'tts/tok_phrases/tok/moku_seli_li_pona_mute.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/jan_lili_lape_li_kalama_ala.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/sleeping_children_dont_make_noises..mp4'
file 'tts/tok_phrases/tok/jan_lili_lape_li_kalama_ala.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/jan_pali_mute_li_toki_e_ni:_ona_li_wawa___li_kiwen.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/the_workers_said_that_they_are_strong_and_tough..mp4'
file 'tts/tok_phrases/tok/jan_pali_mute_li_toki_e_ni:_ona_li_wawa___li_kiwen.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/sina_ante_lukin.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/you_look_different..mp4'
file 'tts/tok_phrases/tok/sina_ante_lukin.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/tok/tomo_ni_li_awen_e_seli.mp4'
file 'tts/misc/silence_0.5.mp3'
file 'tts/tok_phrases/en/this_house_preserves_the_heat..mp4'
file 'tts/tok_phrases/tok/tomo_ni_li_awen_e_seli.mp4'
file 'tts/misc/silence_1.mp3'
file 'tts/tok_phrases/lesson_names/end_of_lesson_05.mp4'
file 'tts/misc/silence_0.5.mp3'

39
regroup.py Normal file
View File

@ -0,0 +1,39 @@
from dictionary import GROUPS, toki_pona_en
def main():
rv = ['---group toki pona grouped words']
all_words = dict()
for word_dict in toki_pona_en.values():
for word, meanings in word_dict.items():
all_words[word] = meanings.split(',')[0].strip()
used_words = set()
for group_name in ['BULGARIAN_LIKE', 'ENGLISH_LIKE', 'ELEMENTS', 'COLORS',
'ANIMALS', 'PLANTS', 'DIRECTIONS', 'PEOPLE', 'BODY', 'LOGICAL',
'PRONOUNS', 'VERBS', 'NOUNS', 'ADJECTIVES',
'GRAMMAR', 'INTERJECTIONS']:
print('==============')
print(group_name)
print()
rv.append('---group {}'.format(group_name.lower().replace('_', ' ')))
for word in GROUPS['GROUP_{}'.format(group_name)]:
if word in used_words:
continue
used_words.add(word)
print('{:<16}: {}'.format(word, all_words[word]))
rv.append(word)
print()
rv.append('---PAUSE---')
print('==============')
print('UNUSED WORDS:')
print()
rv.append('---group unused words')
for word in sorted(set(all_words.keys()) - used_words):
print('{:<16}: {}'.format(word, all_words[word]))
rv.append(word)
rv.append('---group the end')
print(rv)
if __name__ == '__main__':
main()

0
requirements.txt Normal file
View File

544
sitelen/sitelen.svg Normal file
View File

@ -0,0 +1,544 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="210mm"
height="297mm"
viewBox="0 0 210 297"
version="1.1"
id="svg5"
xml:space="preserve"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="sitelen.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.84096521"
inkscape:cx="329.97798"
inkscape:cy="425.70132"
inkscape:window-width="1910"
inkscape:window-height="1129"
inkscape:window-x="0"
inkscape:window-y="35"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs2" /><g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"><g
id="g986"
transform="translate(-3.2895645,9.6593276)" /><g
id="g992"
transform="translate(-1.7975124,-3.4319614)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="88.607384"
y="138.95259"
id="text315-9-2"><tspan
sodipodi:role="line"
id="tspan313-1-2"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="88.607384"
y="138.95259">moku</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="87.994514"
y="123.48627"
id="text847"><tspan
sodipodi:role="line"
id="tspan845"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="87.994514"
y="123.48627">moku</tspan></text></g><g
id="g992-7"
transform="translate(-1.7967966,89.942298)"><g
id="g1187"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="91.112282"
y="138.95259"
id="text315-9-2-8"><tspan
sodipodi:role="line"
id="tspan313-1-2-4"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="91.112282"
y="138.95259">pali</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="87.994514"
y="123.48627"
id="text847-5"><tspan
sodipodi:role="line"
id="tspan845-0"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="87.994514"
y="123.48627">pali</tspan></text></g></g><g
id="g992-7-4"
transform="translate(0.95134129,137.58652)"><g
id="g1187-8"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="91.112282"
y="138.95259"
id="text315-9-2-8-7"><tspan
sodipodi:role="line"
id="tspan313-1-2-4-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="91.112282"
y="138.95259">toki</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="86.462105"
y="129.57239"
id="text847-5-7"><tspan
sodipodi:role="line"
id="tspan845-0-2"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="86.462105"
y="129.57239">toki</tspan></text></g></g><g
id="g981"
transform="translate(18.970205,-2.9128039)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="35.593468"
y="152.79846"
id="text315-9-2-7"><tspan
sodipodi:role="line"
id="tspan313-1-2-3"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="35.593468"
y="152.79846">uta</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302"
id="text847-8"><tspan
sodipodi:role="line"
id="tspan845-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302">uta</tspan></text></g><g
id="g981-30"
transform="translate(22.747315,124.7379)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="35.593468"
y="152.79846"
id="text315-9-2-7-7"><tspan
sodipodi:role="line"
id="tspan313-1-2-3-8"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="35.593468"
y="152.79846">seli</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302"
id="text847-8-6"><tspan
sodipodi:role="line"
id="tspan845-9-8"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302">seli</tspan></text></g><g
id="g981-7"
transform="translate(56.033286,18.762878)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="30.920315"
y="152.47745"
id="text315-9-2-7-65"><tspan
sodipodi:role="line"
id="tspan313-1-2-3-6"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="30.920315"
y="152.47745">kalama</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302"
id="text847-8-9"><tspan
sodipodi:role="line"
id="tspan845-9-3"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302">kalama</tspan></text></g><g
id="g981-7-7"
transform="translate(56.463645,162.60348)"><g
id="g1556"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="32.978306"
y="152.47745"
id="text315-9-2-7-65-4"><tspan
sodipodi:role="line"
id="tspan313-1-2-3-6-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="32.978306"
y="152.47745">pana</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302"
id="text847-8-9-2"><tspan
sodipodi:role="line"
id="tspan845-9-3-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302">pana</tspan></text></g></g><g
id="g981-7-7-3"
transform="translate(57.23989,205.02829)"><g
id="g1556-1"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="32.978306"
y="152.47745"
id="text315-9-2-7-65-4-4"><tspan
sodipodi:role="line"
id="tspan313-1-2-3-6-5-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="32.978306"
y="152.47745">sona</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302"
id="text847-8-9-2-2"><tspan
sodipodi:role="line"
id="tspan845-9-3-5-0"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302">sona</tspan></text></g></g><g
id="g981-7-7-3-9"
transform="translate(20.59734,187.60658)"><g
id="g1556-1-2"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="34.474319"
y="152.54411"
id="text315-9-2-7-65-4-4-6"><tspan
sodipodi:role="line"
id="tspan313-1-2-3-6-5-9-6"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="34.474319"
y="152.54411">lipu</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302"
id="text847-8-9-2-2-4"><tspan
sodipodi:role="line"
id="tspan845-9-3-5-0-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302">lipu</tspan></text></g></g><g
id="g981-3"
transform="translate(22.242606,64.759317)"><g
id="g1235"
transform="translate(0.33902621,-3.0031411)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="36.611202"
y="152.79846"
id="text315-9-2-7-6"><tspan
sodipodi:role="line"
id="tspan313-1-2-3-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="36.611202"
y="152.79846">ijo</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302"
id="text847-8-0"><tspan
sodipodi:role="line"
id="tspan845-9-6"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="30.712563"
y="145.64302">ijo</tspan></text></g></g><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="84.012306"
y="79.739532"
id="text315"><tspan
sodipodi:role="line"
id="tspan313"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="84.012306"
y="79.739532">kepeken</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#ff0000;stroke-width:0.0746962"
x="89.201904"
y="87.56913"
id="text315-3"><tspan
sodipodi:role="line"
id="tspan313-6"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#ff0000;stroke-width:0.0746962"
x="89.201904"
y="87.56913">to use</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#ff0000;stroke-width:0.0746962"
x="87.975388"
y="233.5446"
id="text315-3-3"><tspan
sodipodi:role="line"
id="tspan313-6-2"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#ff0000;stroke-width:0.0746962"
x="87.975388"
y="233.5446">to work</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#ff0000;stroke-width:0.0746962"
x="89.894798"
y="319.48141"
id="text315-3-3-4"><tspan
sodipodi:role="line"
id="tspan313-6-2-4"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#ff0000;stroke-width:0.0746962"
x="89.894798"
y="319.48141">to give</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#0000ff;stroke-width:0.0746962"
x="89.770081"
y="83.52784"
id="text315-3-7"><tspan
sodipodi:role="line"
id="tspan313-6-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#0000ff;stroke-width:0.0746962"
x="89.770081"
y="83.52784">a use</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#008080;stroke-width:0.0746962"
x="74.352417"
y="91.056221"
id="text315-3-7-3"><tspan
sodipodi:role="line"
id="tspan313-6-5-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#008080;stroke-width:0.0746962"
x="74.352417"
y="91.056221">using; with; by means of</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#0000ff;stroke-width:0.0746962"
x="58.187191"
y="219.28575"
id="text315-3-7-1"><tspan
sodipodi:role="line"
id="tspan313-6-5-55"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#0000ff;stroke-width:0.0746962"
x="58.187191"
y="219.28575">thing</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#0000ff;stroke-width:0.0746962"
x="59.211407"
y="283.96292"
id="text315-3-7-1-8"><tspan
sodipodi:role="line"
id="tspan313-6-5-55-4"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#0000ff;stroke-width:0.0746962"
x="59.211407"
y="283.96292">fire</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#0000ff;stroke-width:0.0746962"
x="90.693344"
y="175.69058"
id="text315-3-7-1-4"><tspan
sodipodi:role="line"
id="tspan313-6-5-55-7"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#0000ff;stroke-width:0.0746962"
x="90.693344"
y="175.69058">sound</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="85.142731"
y="66.748405"
id="text847-6"><tspan
sodipodi:role="line"
id="tspan845-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="85.142731"
y="66.748405">kepeken</tspan></text><g
id="g1139"
transform="translate(21.84943,16.179058)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="35.880539"
y="59.311291"
id="text315-6"><tspan
sodipodi:role="line"
id="tspan313-2"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="35.880539"
y="59.311291">ilo</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="29.981901"
y="46.791794"
id="text847-2"><tspan
sodipodi:role="line"
id="tspan845-93"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="29.981901"
y="46.791794">ilo</tspan></text></g><g
id="g1139-7"
transform="translate(132.22436,14.476008)"><g
id="g2194"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="31.175097"
y="59.800583"
id="text315-6-2"><tspan
sodipodi:role="line"
id="tspan313-2-2"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="31.175097"
y="59.800583">soweli</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="29.758224"
y="46.791794"
id="text847-2-6"><tspan
sodipodi:role="line"
id="tspan845-93-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="29.758224"
y="46.791794">soweli</tspan></text></g></g><g
id="g1139-7-0"
transform="translate(155.38434,59.97419)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="31.175097"
y="59.800583"
id="text315-6-2-1"><tspan
sodipodi:role="line"
id="tspan313-2-2-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="31.175097"
y="59.800583">waso</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="29.758224"
y="46.791794"
id="text847-2-6-9"><tspan
sodipodi:role="line"
id="tspan845-93-1-4"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="29.758224"
y="46.791794">waso</tspan></text></g><g
id="g1139-7-0-9"
transform="translate(152.86691,146.50037)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="34.205086"
y="57.661121"
id="text315-6-2-1-0"><tspan
sodipodi:role="line"
id="tspan313-2-2-5-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="34.205086"
y="57.661121">kala</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="29.758224"
y="46.791794"
id="text847-2-6-9-1"><tspan
sodipodi:role="line"
id="tspan845-93-1-4-7"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="29.758224"
y="46.791794">kala</tspan></text></g><g
id="g1139-7-0-9-7"
transform="translate(195.92389,115.4571)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="34.205086"
y="57.661121"
id="text315-6-2-1-0-1"><tspan
sodipodi:role="line"
id="tspan313-2-2-5-9-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="34.205086"
y="57.661121">akesi</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="29.758224"
y="46.791794"
id="text847-2-6-9-1-5"><tspan
sodipodi:role="line"
id="tspan845-93-1-4-7-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="29.758224"
y="46.791794">akesi</tspan></text></g><g
id="g1139-7-0-9-7-7"
transform="translate(227.66654,116.64847)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="34.205086"
y="57.661121"
id="text315-6-2-1-0-1-7"><tspan
sodipodi:role="line"
id="tspan313-2-2-5-9-1-6"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="34.205086"
y="57.661121">pipi</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="31.874449"
y="48.116886"
id="text847-2-6-9-1-5-7"><tspan
sodipodi:role="line"
id="tspan845-93-1-4-7-9-3"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="31.874449"
y="48.116886">pipi</tspan></text></g><g
id="g1120"
transform="translate(-26.251828,10.736307)"><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.78055px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:0.0746962"
x="37.377304"
y="106.50707"
id="text315-9"
transform="translate(-3.2895646,9.6593276)"><tspan
sodipodi:role="line"
id="tspan313-1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sans-serif;-inkscape-font-specification:sans-serif;stroke-width:0.0746962"
x="37.377304"
y="106.50707">luka</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:31.941px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#000000;stroke-width:2.66175"
x="31.099329"
y="107.04546"
id="text847-8-1"><tspan
sodipodi:role="line"
id="tspan845-9-9"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#000000;stroke-width:2.66175"
x="31.099329"
y="107.04546">luka</tspan></text></g><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#0000ff;stroke-width:0.0746962"
x="88.204742"
y="362.00336"
id="text315-3-7-1-8-6"><tspan
sodipodi:role="line"
id="tspan313-6-5-55-4-8"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#0000ff;stroke-width:0.0746962"
x="88.204742"
y="362.00336">knowledge</tspan></text><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sitelen-pona;-inkscape-font-specification:sitelen-pona;fill:#0000ff;stroke-width:0.0746962"
x="47.63055"
y="345.97549"
id="text315-3-7-1-8-6-5"><tspan
sodipodi:role="line"
id="tspan313-6-5-55-4-8-0"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:3.175px;font-family:sans-serif;-inkscape-font-specification:sans-serif;fill:#0000ff;stroke-width:0.0746962"
x="47.63055"
y="345.97549">book; document</tspan></text></g></svg>

After

Width:  |  Height:  |  Size: 32 KiB

19
sorted.py Normal file
View File

@ -0,0 +1,19 @@
from dictionary import toki_pona_en
def main():
all_words = dict()
for lesson, word_dict in toki_pona_en.items():
for word, meanings in word_dict.items():
lesson_n = lesson.split('_')[1]
all_words[word] = '{}_{}'.format(lesson_n, meanings.split(',')[0].strip())
for idx, word in enumerate(sorted(all_words.keys())):
if idx % 2 == 0:
print()
lesson, meaning = all_words[word].split('_')
print('{} {:<16}: {}'.format(lesson, word, meaning))
if __name__ == "__main__":
main()

18
test.py Normal file
View File

@ -0,0 +1,18 @@
import random
from dictionary import toki_pona_en
def test_en_toki_pona():
while True:
toki_pona = random.choice(list(toki_pona_en.keys()))
en = toki_pona_en[toki_pona]
while True:
toki_pona_guess = input(f'{en}? ')
if toki_pona_guess == toki_pona:
print('Correct!')
break
if __name__ == '__main__':
test_en_toki_pona()

71
tmp.py Normal file
View File

@ -0,0 +1,71 @@
import os
new_ordered_filenames = [
"01. 3rd Award - International Astronomy Olympiad 2007.pdf",
"02. 1st Place - National Astronomy Olympiad 2007.pdf",
"03. 1st Place - National Astronomy Olympiad 2009.pdf",
"04. Medals Various - 3rd place International Astronomy Olympiad, 1st Place Italian-Bulgarian Physics Competition, 2x 1st Place + 2nd Place National Astronomy Olympiad, SoftUni Tech Fest Hackathon.jpg",
"05. Physicist Of The Class Award, High School 2006-2011.jpg",
"06. Statue - 1st Place - Multimedia Award, National Information Technology Award, 2010.jpg",
"07. Statue - 2nd Place Bulgaria Italy 2010.jpg",
"08. 2nd Place - Bulgarian-Italian Physics Competition 2010.pdf",
"10. 2nd Place - National Astronomy Olympiad 2008.pdf",
"09. 2nd Place - Award by the Network of Innovators Teachers - Video competition, 2010.pdf",
"14. 3rd Place - National Autumn Physics Competition 2008.pdf",
"11. 3rd Award - National Autumn Physics Competition 2009.pdf",
"12. 3rd Award - National Spring Physics Competition 2009.pdf",
"13. 3rd Place - City round of National Physics Competition 2008.pdf",
"43. University of Glasgow, Class Representative Certificate 2012.pdf",
"35. Certificate of Achievement - Google Android Camp 2012.pdf",
"15. Best Observation Round - National Astronomy Olympiad 2009.pdf",
"16. Certificate - European Expo Sciences Moscow 2010.pdf",
"21. Certificate - For young amateur astronomer 2010.pdf",
"37. Certificate - Participation in Astronomy, Astrophysics and Informatics Summer School 2008.pdf",
"38. Certificate - Participation in Astronomy, Astrophysics and Informatics Summer School 2009.pdf",
"39. Certificate - Participation in Astronomy, Astrophysics and Informatics Summer School 2010.pdf",
"29. Certificate - National Olympiad IT 2010.pdf",
"41. Certificate - Young Talents 2009.pdf",
"42. Certificate - Young Talents 2010.pdf",
"44. Special Award - For Preparing a movie Biological effects of the Ionized Radiation, 2010.pdf",
"45. Work - Work at Ministry of Finances 2012.pdf",
"22. Certificate - National Astronomy Olympiad 2008.pdf",
"23. Certificate - National Astronomy Olympiad 2009.pdf",
"24. Certificate - National Astronomy Olympiad 2010.pdf",
"25. Certificate - National Astronomy Olympiad, Qualification Round 2007.pdf",
"26. Certificate - National Astronomy Olympiad, Qualification Round 2008.pdf",
"27. Certificate - National Astronomy Olympiad, Qualification Round 2009.pdf",
"28. Certificate - National Astronomy Olympiad, Third Round 2007.pdf",
"30. Certificate - National Physics Conference 2010.pdf",
"31. Certificate - National Physics Olympiad 2009.pdf",
"32. Certificate - National Physics Olympiad 2010.pdf",
"33. Certificate - National Spring Physics Competition 2008.pdf",
"34. Certificate - National Spring Physics Competition 2010.pdf",
"40. Certificate - Plovdiv University acceptance 2009.pdf",
"17. Certificate - For achievements in biology olympiad 2006.pdf",
"18. Certificate - For high grades achievements 2006.pdf",
"19. Certificate - For high mathematics achievements 2005.pdf",
"20. Certificate - For high sports achievements 2006.pdf",
"36. Certificate of Education in English as a Foreign Language 2009.pdf",
]
def main():
"""
rename all files in directory /home/pi2/Desktop/application/awards of type "NN. filename.ext" where NN. is a number with a leading 0 (e.g. 01. or 05.).
However some of the numbers are repeated. I want to rename all files and have unique number for each file. """
filenames = os.listdir("/home/pi2/Desktop/application/awards")
ordered_filenames = sorted(filenames)
new_order = {}
for idx, filename in enumerate(ordered_filenames):
if filename in ['new']:
continue
new_idx = new_ordered_filenames.index(filename)
new_filename = "{:02d}.{}".format(new_idx + 1, '.'.join(filename.split(".")[-2:]))
new_order[filename] = new_filename
for old_filename, filename in new_order.items():
# copy
os.system("cp '/home/pi2/Desktop/application/awards/{}' '/home/pi2/Desktop/application/awards/new/{}'".format(old_filename, filename))
if __name__ == "__main__":
main()

17
to_csv.py Normal file
View File

@ -0,0 +1,17 @@
import csv
from dictionary import toki_pona_en
def main():
with open('dict.csv', 'w+') as f:
for tp, en in toki_pona_en.items():
en_words = en.split(',')
for en_word in en_words:
en_word = en_word.strip()
f.write(f'{tp},{en_word}\n')
if __name__ == '__main__':
main()

247
tts.py Normal file
View File

@ -0,0 +1,247 @@
import os
import subprocess
from time import sleep
from dictionary import toki_pona_en, TOK_EN_PHRASES
group_list = ['---group toki pona grouped words', '---group bulgarian like', 'linja', 'selo', 'lete', 'len', 'lupa',
'supa', 'uta', 'oko', 'nasin', 'lawa',
'luka', 'mama', '---PAUSE---', '---group english like', 'lukin', 'jelo', 'jaki', 'musi', 'open', 'tenpo',
'mani', 'ken', 'mun', 'wan', 'tu', 'sama', 'suno', '---PAUSE---', '---group elements', 'kon', 'seli',
'ma', 'telo', '---PAUSE---', '---group colors', 'kule', 'laso', 'loje', 'pimeja', 'walo', '---PAUSE---',
'---group animals', 'soweli', 'pipi', 'akesi', 'kala', 'waso', 'kijetesantakalu', 'mu', '---PAUSE---',
'---group plants', 'kasi', 'kili', 'soko', '---PAUSE---', '---group directions', 'sewi', 'anpa', 'poka',
'insa', 'lon', 'sinpin', 'monsi', 'ni', '---PAUSE---', '---group people', 'jan', 'kulupu', 'meli', 'mije',
'---PAUSE---', '---group body', 'sijelo', 'noka', 'kute', 'pilin', 'nena', 'misikeke', '---PAUSE---',
'---group logical', 'anu', 'la', 'taso', 'en', 'ale', 'ala', 'kin', 'tan', 'ante', 'mute', '---PAUSE---',
'---group pronouns', 'mi', 'sina', 'ona', '---PAUSE---', '---group verbs', 'olin', 'lanpan', 'pana', 'jo',
'wile', 'pali', 'kama', 'kepeken', 'toki', 'alasa', 'lape', 'awen', 'moku', 'moli', 'kipisi', 'weka',
'unpa', 'tawa', 'kalama', 'utala', 'sona', '---PAUSE---', '---group nouns', 'ijo', 'ilo', 'esun', 'tomo',
'sitelen', 'kiwen', 'ko', 'leko', 'sike', 'pan', 'palisa', 'lipu', 'poki', 'monsuta', '---PAUSE---',
'---group adjectives', 'pona', 'ike', 'wawa', 'epiku', 'suli', 'lili', 'suwi', 'sin', 'pini', 'pakala',
'namako', 'nasa', '---PAUSE---', '---group grammar', 'li', 'e', 'pi', 'seme', '---PAUSE---',
'---group interjections', 'a', 'o', 'n', '---PAUSE---', '---group unused words', 'ku', 'nanpa', 'nimi',
'pu', '---group the end', ]
def run_os_command(cmd):
print(cmd)
return os.system(cmd)
def gen_tok_words():
wordlist = list()
for word_dict in toki_pona_en.values():
for word in word_dict.keys():
wordlist.append(word)
for word in wordlist:
run_os_command(
'python lexconvert.py --phones2phones unicode-ipa espeak "{word}" | espeak -g 50 -s 80 -z -v gmw/en+f4 -w "tts/tok_words/{word}.wav"'.format(
word=word))
duration = subprocess.run(
'ffprobe -v error -show_entries format=duration -of csv=p=0 tts/tok_words/{word}.wav'.format(
word=word).split(), stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
cut_to = round(float(duration) - 3.3, 1)
run_os_command(
'ffmpeg -y -ss 00:00:00 -to 00:00:0{secs} -i tts/tok_words/{word}.wav tts/tok_words/{word}.mp4'.format(
word=word, secs=cut_to))
run_os_command('rm tts/tok_words/{word}.wav'.format(word=word))
def gen_silence(seconds):
run_os_command('ffmpeg -f lavfi -i aevalsrc=0:d={seconds} tts/misc/silence_{seconds}.mp3'.format(seconds=seconds))
def gen_tok_meanings(directory, max_meanings, max_words=5000):
all_words = dict()
for word_dict in toki_pona_en.values():
for word, meanings in word_dict.items():
all_words[word] = ', '.join([w.strip() for w in meanings.split(',')[0:max_meanings]])
for word, meaning in list(all_words.items())[:max_words]:
meaning_fname = meaning.replace(' ', '_')
meaning_fname = meaning_fname.replace(',', '__')
run_os_command(
'echo "{meaning}" | espeak -g 1 -s 130 -v gmw/en-US+m2 -w "{dir}/en/{meaning_fname}.wav"'.format(
dir=directory, meaning=meaning, meaning_fname=meaning_fname))
run_os_command(
'ffmpeg -y -i {dir}/en/{meaning_fname}.wav {dir}/en/{meaning_fname}.mp4'.format(
dir=directory, meaning_fname=meaning_fname))
run_os_command('rm {dir}/en/{meaning_fname}.wav'.format(dir=directory, meaning_fname=meaning_fname))
with open('mylist.txt', 'w') as f:
f.write("file 'tts/tok_words/{word}.mp4'\n".format(word=word))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
f.write("file '{dir}/en/{meaning_fname}.mp4'\n".format(dir=directory, meaning_fname=meaning_fname))
f.write("file 'tts/tok_words/{word}.mp4'\n".format(word=word))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
run_os_command(
'ffmpeg -y -f concat -safe 0 -i mylist.txt {dir}/{word}.mp4'.format(dir=directory, word=word))
def gen_tok_words_single_meaning():
gen_tok_meanings('tts/tok_words_single_meaning', 1)
def gen_tok_words_double_meaning():
gen_tok_meanings('tts/tok_words_double_meaning', 2)
def gen_group_tts():
directory = 'tts/tok_words_grouped'
meaning_dir = 'tts/tok_words_double_meaning'
run_os_command('rm mylist.txt')
run_os_command('touch mylist.txt')
for word in group_list:
if word.startswith('---group'):
group_name = word.replace('---group ', '')
group_fname = group_name.lower().replace(' ', '_')
run_os_command(
'echo "{group_name}" | espeak -g 1 -s 130 -v gmw/en-US+m2 -w "{dir}/group_names/{group_fname}.wav"'.format(
dir=directory, group_name=group_name, group_fname=group_fname))
run_os_command(
'ffmpeg -y -i {dir}/group_names/{group_fname}.wav {dir}/group_names/{group_fname}.mp4'.format(
dir=directory, group_fname=group_fname))
run_os_command('rm {dir}/group_names/{group_fname}.wav'.format(dir=directory, group_fname=group_fname))
with open('mylist.txt', 'a+') as f:
f.write("file '{dir}/group_names/{group_fname}.mp4'\n".format(dir=directory, group_fname=group_fname))
f.write("file 'tts/misc/silence_1.mp3'\n")
elif word in ['---PAUSE---']:
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/misc/silence_1.mp3'\n")
else:
with open('mylist.txt', 'a+') as f:
f.write("file '{meaning_dir}/{word}.mp4'\n".format(meaning_dir=meaning_dir, word=word))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
group_type = meaning_dir.split('tok_words_')[1]
run_os_command(
'ffmpeg -y -f concat -safe 0 -i mylist.txt {dir}/grouped_{group_type}.mp4'.format(dir=directory,
group_type=group_type))
def lesson_name_tts(lesson_name):
directory = 'tts/tok_phrases'
lesson_name = lesson_name.lower().replace('_', ' ')
lesson_fname = lesson_name.lower().replace(' ', '_')
if os.path.exists('{dir}/lesson_names/{lesson_fname}.mp4'.format(lesson_fname=lesson_fname, dir=directory)):
return
run_os_command(
'echo "{lesson_name}" | espeak -g 1 -s 130 -v gmw/en-US+m2 -w "{dir}/lesson_names/{lesson_fname}.wav"'.format(
dir=directory, lesson_name=lesson_name, lesson_fname=lesson_fname))
run_os_command(
'ffmpeg -y -i {dir}/lesson_names/{lesson_fname}.wav {dir}/lesson_names/{lesson_fname}.mp4'.format(
dir=directory, lesson_fname=lesson_fname))
run_os_command('rm {dir}/lesson_names/{lesson_fname}.wav'.format(dir=directory, lesson_fname=lesson_fname))
run_os_command(
'echo "end of {lesson_name}" | espeak -g 1 -s 130 -v gmw/en-US+m2 -w "{dir}/lesson_names/end_of_{lesson_fname}.wav"'.format(
dir=directory, lesson_name=lesson_name, lesson_fname=lesson_fname))
run_os_command(
'ffmpeg -y -i {dir}/lesson_names/end_of_{lesson_fname}.wav {dir}/lesson_names/end_of_{lesson_fname}.mp4'.format(
dir=directory, lesson_fname=lesson_fname))
run_os_command('rm {dir}/lesson_names/end_of_{lesson_fname}.wav'.format(dir=directory, lesson_fname=lesson_fname))
def phrase_tts_tok(phrase):
tok_dir = 'tts/tok_phrases/tok'
phrase_fname = phrase.lower().replace(' ', '_')
phrase_fname = phrase_fname.replace(',', '__')
if os.path.exists('{tok_dir}/{phrase_fname}.mp4'.format(phrase_fname=phrase_fname, tok_dir=tok_dir)):
return
run_os_command(
'python lexconvert.py --phones2phones unicode-ipa espeak "{phrase}. ... a." | espeak -g 2 -s 80 -z -v gmw/en+f4 -w "{tok_dir}/{phrase_fname}.wav"'.format(
phrase=phrase, phrase_fname=phrase_fname, tok_dir=tok_dir, ))
duration = subprocess.run(
'ffprobe -v error -show_entries format=duration -of csv=p=0 {tok_dir}/{phrase_fname}.wav'.format(
phrase_fname=phrase_fname, tok_dir=tok_dir).split(), stdout=subprocess.PIPE).stdout.decode('utf-8').strip()
cut_to = round(float(duration) - 0.7, 1)
run_os_command(
'ffmpeg -y -ss 00:00:00 -to 00:00:{secs:02.1f} -i {tok_dir}/{phrase_fname}.wav {tok_dir}/{phrase_fname}.mp4'.format(
tok_dir=tok_dir, phrase_fname=phrase_fname, secs=cut_to))
run_os_command('rm {tok_dir}/{phrase_fname}.wav'.format(phrase_fname=phrase_fname, tok_dir=tok_dir))
def phrase_tts_en(phrase):
en_dir = 'tts/tok_phrases/en'
phrase_fname = phrase.lower().replace(' ', '_')
phrase_fname = phrase_fname.replace(',', '__')
if os.path.exists('{en_dir}/{phrase_fname}.mp4'.format(phrase_fname=phrase_fname, en_dir=en_dir)):
return
run_os_command(
'echo "{phrase}" | espeak -g 1 -s 130 -v gmw/en-US+m2 -w "{en_dir}/{phrase_fname}.wav"'.format(
en_dir=en_dir, phrase=phrase, phrase_fname=phrase_fname))
run_os_command(
'ffmpeg -y -i {en_dir}/{phrase_fname}.wav {en_dir}/{phrase_fname}.mp4'.format(
en_dir=en_dir, phrase_fname=phrase_fname))
run_os_command('rm {en_dir}/{phrase_fname}.wav'.format(en_dir=en_dir, phrase_fname=phrase_fname))
def phrase_tts(min_lesson=1, max_lesson=1000):
for lesson, phrases in list(TOK_EN_PHRASES.items())[min_lesson - 1:max_lesson]:
run_os_command('rm mylist.txt')
sleep(0.5)
run_os_command('touch mylist.txt')
sleep(0.5)
lesson_name_tts(lesson)
lesson_fname = lesson.lower()
with open('mylist.txt', 'w+') as f:
f.write("file 'tts/tok_phrases/lesson_names/{lesson_fname}.mp4'\n".format(lesson_fname=lesson_fname))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/misc/words.mp4'\n")
f.write("file 'tts/misc/silence_0.5.mp3'\n")
for word in toki_pona_en[lesson].keys():
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/tok_words_double_meaning/{word}.mp4'\n".format(word=word))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/misc/silence_1.mp3'\n")
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/misc/phrases.mp4'\n")
f.write("file 'tts/misc/silence_0.5.mp3'\n")
for tok_phrase, en_phrase in phrases.items():
phrase_tts_tok(tok_phrase)
phrase_tts_en(en_phrase)
tok_phrase_fname = tok_phrase.lower().replace(' ', '_').replace(',', '__')
en_phrase_fname = en_phrase.lower().replace(' ', '_').replace(',', '__')
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/tok_phrases/tok/{tok_phrase_fname}.mp4'\n".format(tok_phrase_fname=tok_phrase_fname))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
f.write("file 'tts/tok_phrases/en/{en_phrase_fname}.mp4'\n".format(en_phrase_fname=en_phrase_fname))
f.write("file 'tts/tok_phrases/tok/{tok_phrase_fname}.mp4'\n".format(tok_phrase_fname=tok_phrase_fname))
f.write("file 'tts/misc/silence_1.mp3'\n")
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/tok_phrases/lesson_names/end_of_{lesson_fname}.mp4'\n".format(lesson_fname=lesson_fname))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
run_os_command(
'ffmpeg -y -f concat -safe 0 -i mylist.txt tts/tok_phrases/phrases_{lesson_fname}.mp4'.format(
lesson_fname=lesson_fname))
def lessons_tts():
directory = 'tts/tok_words_lessons'
for lesson in toki_pona_en.keys():
run_os_command('rm mylist.txt')
sleep(0.5)
run_os_command('touch mylist.txt')
sleep(0.5)
lesson_name_tts(lesson)
lesson_fname = lesson.lower()
with open('mylist.txt', 'w+') as f:
f.write("file 'tts/tok_phrases/lesson_names/{lesson_fname}.mp4'\n".format(lesson_fname=lesson_fname))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/misc/words.mp4'\n")
f.write("file 'tts/misc/silence_0.5.mp3'\n")
for word in toki_pona_en[lesson].keys():
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/tok_words_double_meaning/{word}.mp4'\n".format(word=word))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
with open('mylist.txt', 'a+') as f:
f.write("file 'tts/tok_phrases/lesson_names/end_of_{lesson_fname}.mp4'\n".format(lesson_fname=lesson_fname))
f.write("file 'tts/misc/silence_0.5.mp3'\n")
run_os_command(
'ffmpeg -y -f concat -safe 0 -i mylist.txt {directory}/words_{lesson_fname}.mp4'.format(
directory=directory, lesson_fname=lesson_fname))
if __name__ == '__main__':
phrase_tts(min_lesson=5, max_lesson=5)

2
tts.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
python lexconvert.py --phones2phones unicode-ipa espeak "${1}" | espeak -g 50 -s 80 -z -v gmw/en+f4 -w "tts/tok_words/${2}.wav"

14
word_count.py Normal file
View File

@ -0,0 +1,14 @@
from collections import Counter
def main():
with open('lyrics_pan_nanpa_wan.txt') as f:
lyrics = f.read()
alphabetic_only = ''.join([c for c in lyrics if c.isalpha() or c == ' '])
words = alphabetic_only.split()
print(Counter(words))
print(len(Counter(words)))
if __name__ == '__main__':
main()

BIN
words.ods Normal file

Binary file not shown.