diff --git a/speech/index.html b/0_speech/index.html
similarity index 100%
rename from speech/index.html
rename to 0_speech/index.html
diff --git a/speech/index.js b/0_speech/index.js
similarity index 100%
rename from speech/index.js
rename to 0_speech/index.js
diff --git a/speech/style.css b/0_speech/style.css
similarity index 100%
rename from speech/style.css
rename to 0_speech/style.css
diff --git a/1_pythoning/1-2_NLTKing.py b/1_pythoning/1-2_NLTKing.py
new file mode 100644
index 0000000..c87e8f8
--- /dev/null
+++ b/1_pythoning/1-2_NLTKing.py
@@ -0,0 +1,106 @@
+#
+# NLTK (Natural Language ToolKit) is a library for Natural Language Process.
+# We will use it to get the Part Of Speech (POS) of the speech-to-text results.
+#
+# What does it mean?
+#
+# It works as grammar tagging: for instance, the sentence "Around the clouds"
+# would have this output:
+#
+# [('Around', 'IN'), ('the', 'DT'), ('clouds', 'NN')]
+#
+# 'IN' means 'preposition' - 'DT' means 'determiner' - 'NN' means 'noun, common, singular or mass'
+
+
+import time # to create delays :: for having a few seconds to check the console
+import nltk # to use NLTK
+
+ # Open the speech-to-text result :: downloaded from the web interface >>
+
+with open('speech.txt','r') as speech: # let's import the text
+ text = speech.read() # and make python read it :)
+ print(text) # print it!
+
+time.sleep(2) # check it in the console!
+
+
+text = text.replace('','').replace('\n','. ') # delete this from the results
+
+tokens = nltk.word_tokenize(text) # Tokenize the words :: split each word
+pos = nltk.pos_tag(tokens) # Elaborate the Part of Speech! It will create an array, a list
+print(pos) # print the array!
+
+time.sleep(2) # check it in the console!
+
+
+
+ # To see all the POS tags, open the terminal and copy:
+ #
+ # python3
+ # import nltk
+ # nltk.help.upenn_tagset()
+
+
+
+
+ # start the layouting :: html + css + paged.js >>
+ #
+ # declare html :: we will fill it in the process with loops
+ # declare the first part of the text for two html files with different CSS
+
+html = ''
+
+html1 = '''
+
+
+
+
+
+
+
+ 📡 💻📘
+
+
+'''
+
+html2 = '''
+
+
+
+
+
+
+
+ 📡 💻📘
+
+
+'''
+
+
+ # Process each element of the list
+
+for e in pos: # e is the current element, pos is the array to process
+
+ if e[0] == '.': # if e is a dot, its class will be 'dot'
+ html += " . \n"
+
+ else: # fill the html with each word and assign it as class its POS
+ html += " "+e[0]+"\n"
+
+
+ # Close the html text
+html += '''
+'''
+
+html = html.replace(' .','.').replace(" '", "'") # to tidy wrong " . " and " ' " position
+
+
+ # Save the files!
+
+with open('../2_layout/1.html','w') as index:
+ index.write(html1)
+ index.write(html)
+
+with open('../2_layout/2.html','w') as index:
+ index.write(html2)
+ index.write(html)
\ No newline at end of file
diff --git a/1_pythoning/3_imageScraping.py b/1_pythoning/3_imageScraping.py
new file mode 100644
index 0000000..5b643f4
--- /dev/null
+++ b/1_pythoning/3_imageScraping.py
@@ -0,0 +1,68 @@
+# Scrape images from DuckDuckGo
+#
+# With duckduckgo_images_api!
+
+
+from duckduckgo_images_api import search # import the library for scrape
+import time # to create delays :: for having a few seconds to check the console
+
+
+with open('speech.txt','r') as speech: # let's import the text
+ qq = speech.readlines() # and split it in lines, it will create an array, a list
+ print(qq) # print the array!
+
+time.sleep(2) # check qq in the console!
+
+
+ # declare the first part of the text of the html, we will fill it
+ # in the process with loops
+
+html = '''
+
+
+
+
+
+
+
+ 📡 💻📘
+
+
+'''
+
+
+ # Elaborate each line :: process every element of the array qq
+
+ # q is for "query", qq for "queries", because we will send requests to
+ # DuckDuckGo searching the text of each line of speech.txt
+
+for q in qq:
+
+ print(q) # print the q!
+
+ time.sleep(2) # check current q in the console!
+
+ q = q.strip()
+
+ if q == '''''': # This nope.
+ continue
+
+ q = q.replace("\n","") # remove "\n", which means "return to the next line"
+
+ # Scrape images with search()!
+ # q is, indeed, the query for DuckDuckGo
+ results = search(q)
+ r = results["results"][0]["image"] # get the http link to the image
+
+ html += f""" {q} \n""" # Now let's fill the html with text and the pic
+ html += f""" \n"""
+
+
+ # Close the html text
+html += '''
+'''
+
+html = html.replace(" '", "'")
+
+with open(',,/2_layout/3.html','w') as index: # Save the file!
+ index.write(html)
\ No newline at end of file
diff --git a/1_pythoning/bonus_imageDownloader.py b/1_pythoning/bonus_imageDownloader.py
new file mode 100644
index 0000000..169dcd2
--- /dev/null
+++ b/1_pythoning/bonus_imageDownloader.py
@@ -0,0 +1,132 @@
+# Bonus!
+#
+# Scrape and download images in local from DuckDuckGo
+
+# with DuckDuckGoImages!
+
+
+
+import DuckDuckGoImages as ddg # import the library for scrape
+import os # to manipulate the file system
+import shutil # same but powerfull >:D
+import time # to create delays :: for having a few seconds to check the console
+import random # to get random numbers
+
+
+
+ # Prepare the local folder :: where the images will be saved >>
+
+if os.path.isdir('./images/'): # check if the folder "images" exists
+ shutil.rmtree('./images/') # if yes, delete it
+
+os.mkdir('./images/') # and then create a fresh new one
+
+ # start the layouting :: html + css + paged.js >>
+
+ # declare the first part of the text of the html, we will fill it
+ # in the process with loops
+html = '''
+
+
+
+
+
+
+
+ 📡 💻📘
+
+
+'''
+
+
+
+ # Open the speech-to-text result :: downloaded from the web interface >>
+
+with open('speech.txt','r') as speech: # let's import the text
+ qq = speech.readlines() # and split it in lines, it will create an array, a list
+ print(qq) # print the array!
+
+
+time.sleep(2) # check qq in the console!
+
+
+ # Elaborate each line :: process every element of the array qq
+
+ # q is for "query", qq for "queries", because we will send requests to
+ # DuckDuckGo searching the text of each line of speech.txt
+
+for q in qq:
+
+ print(q) # print the q!
+
+ time.sleep(2) # check current q in the console!
+
+ if q == '''''': # This nope.
+ continue
+
+
+ qBinded = q.replace(' ','') # qBinded is the current q but without spaces and "\n", which
+ qBinded = qBinded.replace("\n","") # means "return to the next line";
+ # because we will qBinded to name each file downloaded
+
+ os.mkdir(f'./images/{qBinded}') # create the folder with the name given by qBinded
+
+ print(qBinded) # print qBinded!
+
+ time.sleep(2) # check current q in the console!
+
+
+
+ # Scrape images with ddg.download()! :: we imported DuckDuckGoImages *as* ddg,
+ # it's just compacted the name
+
+ # q is, indeed, the query for DuckDuckGo
+ # folder=(../path/to/download)
+ # max_urls=(how many results attempt to scrape
+ # thumbnails=(True/False, to download thumbnails or bigger images)
+
+ ddg.download(q, folder= f"./images/{qBinded}/", max_urls=10, thumbnails=True)
+
+
+ picsList = os.listdir(f"./images/{qBinded}/") # get the contents of the folder, it will create another array
+ # each downloaded image will have a randomic UUIDv4 name so next step is
+ # to change its name with the name of the current q
+
+ print("List of pics:", picsList) # Check how many downloaded pictures!
+
+ time.sleep(2) # check in the console!
+
+
+
+
+ if len(picsList) == 0: # if the the list is empty..
+ html += f'{q}
' # ..add now the for just the text, since there are no images downloaded..
+ html += "\n"
+ os.rmdir(f'./images/{qBinded}/') # ..and delete the folder created, since is useless..
+ continue # ..from now on this q can't do anything more, let's go to the next iteration
+
+
+
+ # Layout q and its pic!
+
+ r = random.randint(0,len(picsList)) # get a random number from 0 to the lenght of the array {in compiuters 0 means the first!! :]] }
+ pic = picsList[r] # let's take a random picture from the array
+
+
+ os.rename(f'./images/{qBinded}/{pic}', f'./images/{qBinded}/{qBinded}.jpg') # This is to rename the pic with qBinded + the .jpg extension
+ os.replace(f'./images/{qBinded}/{qBinded}.jpg', f'./images/{qBinded}.jpg') # This is to move the pic to the main folder
+ shutil.rmtree(f'./images/{qBinded}/') # and it's time to delete the folder of this q
+
+ html += f""" {q}""" # Now let's fill the html with text and the pic
+ html += "\n"
+ html += f""" """
+ html += "\n"
+
+
+
+ # Close the html text
+html += '''
+'''
+
+with open('../2_layout/localpics.html','w') as index: # Save the file!
+ index.write(html)
\ No newline at end of file
diff --git a/1_pythoning/pythonInstallationParty.txt b/1_pythoning/pythonInstallationParty.txt
new file mode 100644
index 0000000..dc14407
--- /dev/null
+++ b/1_pythoning/pythonInstallationParty.txt
@@ -0,0 +1,25 @@
+First, you need python. You can download Python from its website:
+
+ https://www.python.org/
+
+
+
+If you need to install NLTK, open the terminal and copy:
+
+ pip3 install nltk
+ python3
+ import nltk
+ nltk.download('tagsets')
+ nltk.download('')
+
+
+
+If you need to install duckduckgo-images-api, open the terminal and digit:
+
+ pip3 install duckduckgo-images-api
+
+
+
+If you need to install DuckDuckGoImages, open the terminal and digit:
+
+ pip3 install DuckDuckGoImages
\ No newline at end of file
diff --git a/2_layout/1.html b/2_layout/1.html
new file mode 100644
index 0000000..c28d238
--- /dev/null
+++ b/2_layout/1.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+ 📡 💻📘
+
+
+ ok
+ let
+ 's
+ talk
+ in
+ English
+ for
+ awhile
+ what
+ are
+ we
+ eating
+ .
+ or
+ not
+ so
+ it
+ is
+ starting
+ again
+ .
+ ok
+ navigate
+ .
+ you
+ need
+ to
+ rest
+ sometimes
+ .
+ also
+ implemented
+ that
+ implementing
+ .
+ he
+ 's
+ a
+ sentence
+ and
+ we
+ are
+ not
+ interested
+ .
+ remember
+ .
+ so
+ basically
+ sentence
+ .
+ where
+ is
+ to
+ go
+ a
+ couple
+ and
+ then
+ you
+ put
+ the
+ adult
+ .
+ a
+ bit
+ easier
+ to
+ understand
+ .
+ actually
+ maybe
+ people
+ just
+ do
+ n't
+ just
+ .
+ I
+ 'm
+ just
+ thinking
+ it
+ 's
+ not
+ the
+ centres
+ do
+ n't
+ put
+ the
+ dot
+ and
+ just
+ put
+ a
+ couple
+ .
+ because
+ then
+ .
+ they
+ are
+ talking
+ they
+ are
+ a
+ booklet
+ but
+ they
+ are
+ not
+ writing
+ .
+ so
+ it
+ is
+ just
+ fine
+ .
+ so
+ are
+ you
+ done
+ .
+ and
+ now
+ is
+ f
+ *
+ *
+ *
+ *
+ *
+ up
+ .
+
+
\ No newline at end of file
diff --git a/2_layout/2.html b/2_layout/2.html
new file mode 100644
index 0000000..d09e046
--- /dev/null
+++ b/2_layout/2.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+ 📡 💻📘
+
+
+ ok
+ let
+ 's
+ talk
+ in
+ English
+ for
+ awhile
+ what
+ are
+ we
+ eating
+ .
+ or
+ not
+ so
+ it
+ is
+ starting
+ again
+ .
+ ok
+ navigate
+ .
+ you
+ need
+ to
+ rest
+ sometimes
+ .
+ also
+ implemented
+ that
+ implementing
+ .
+ he
+ 's
+ a
+ sentence
+ and
+ we
+ are
+ not
+ interested
+ .
+ remember
+ .
+ so
+ basically
+ sentence
+ .
+ where
+ is
+ to
+ go
+ a
+ couple
+ and
+ then
+ you
+ put
+ the
+ adult
+ .
+ a
+ bit
+ easier
+ to
+ understand
+ .
+ actually
+ maybe
+ people
+ just
+ do
+ n't
+ just
+ .
+ I
+ 'm
+ just
+ thinking
+ it
+ 's
+ not
+ the
+ centres
+ do
+ n't
+ put
+ the
+ dot
+ and
+ just
+ put
+ a
+ couple
+ .
+ because
+ then
+ .
+ they
+ are
+ talking
+ they
+ are
+ a
+ booklet
+ but
+ they
+ are
+ not
+ writing
+ .
+ so
+ it
+ is
+ just
+ fine
+ .
+ so
+ are
+ you
+ done
+ .
+ and
+ now
+ is
+ f
+ *
+ *
+ *
+ *
+ *
+ up
+ .
+
+
\ No newline at end of file
diff --git a/2_layout/3.html b/2_layout/3.html
new file mode 100644
index 0000000..9003f6d
--- /dev/null
+++ b/2_layout/3.html
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+ Booklet
+
+
+ok let's talk in English for awhile what are we eating
+
+or not so it is starting again
+
+ok navigate
+
+you need to rest sometimes
+
+also implemented that implementing
+
+he's a sentence and we are not interested
+
+remember
+
+so basically sentence
+
+where is to go a couple and then you put the adult
+
+a bit easier to understand
+
+actually maybe people just don't just
+
+I'm just thinking it's not the centres don't put the dot and just put a couple
+
+because then
+
+they are talking they are a booklet but they are not writing
+
+so it is just fine
+
+so are you done
+
+and now is f***** up
+
+
+
\ No newline at end of file
diff --git a/layout/pagedjs_files/interface.css b/2_layout/pagedjs_files/interface.css
similarity index 100%
rename from layout/pagedjs_files/interface.css
rename to 2_layout/pagedjs_files/interface.css
diff --git a/layout/pagedjs_files/paged.js b/2_layout/pagedjs_files/paged.js
similarity index 100%
rename from layout/pagedjs_files/paged.js
rename to 2_layout/pagedjs_files/paged.js
diff --git a/layout/pagedjs_files/paged.polyfill.js b/2_layout/pagedjs_files/paged.polyfill.js
similarity index 100%
rename from layout/pagedjs_files/paged.polyfill.js
rename to 2_layout/pagedjs_files/paged.polyfill.js
diff --git a/layout/speech.txt b/2_layout/speech.txt
similarity index 100%
rename from layout/speech.txt
rename to 2_layout/speech.txt
diff --git a/layout/styles/1.css b/2_layout/styles/1.css
similarity index 95%
rename from layout/styles/1.css
rename to 2_layout/styles/1.css
index fa34b8e..6d17a80 100644
--- a/layout/styles/1.css
+++ b/2_layout/styles/1.css
@@ -5,19 +5,19 @@
@page {
size: 148mm 210mm;
marks: crop cross;
- bleed: 5mm;
+ margin: 15mm;
}
/* Custom font */
@font-face {
font-family: "neuzeit";
- src: url("../fonts/NeuzeitOffice-Regular.ttf")
+ src: url("./fonts/NeuzeitOffice-Regular.ttf")
}
@font-face {
font-family: "fivo";
- src: url("../fonts/fivo-sans.medium.otf")
+ src: url("./fonts/fivo-sans.medium.otf")
}
/* Custom variables */
diff --git a/layout/styles/2.css b/2_layout/styles/2.css
similarity index 52%
rename from layout/styles/2.css
rename to 2_layout/styles/2.css
index 6086055..b8c8883 100644
--- a/layout/styles/2.css
+++ b/2_layout/styles/2.css
@@ -5,7 +5,7 @@
@page {
size: 148mm 210mm;
marks: crop cross;
- bleed: 5mm;
+ margin: 15mm;
}
/* Custom font */
@@ -23,49 +23,61 @@
/* Custom variables */
:root{
-
-
+ --first: #19B7B9;
+ --second: #0B1136;
+ --third: #2E4473;
}
+ /* Rules for everything */
+
body{
- font-size: 1.5vw;
- text-align: justify;
- text-justify: inter-word;
- line-height: 1.8vw;
- /* color: rgb(0,0,0) */
+ font-family: "neuzeit";
+ font-size: 20px;
+ line-height: 35px;
+ }
+
+ /* Rules for the rest */
+
+ div{
+ box-sizing: border-box;
}
span{
- color: white
+ color: white;
}
+
+ /* Rules for dots */
+
+ .dot{
+ color: var(--third);
+ }
+
+ /* Rules for Part Of Speech (POS), defined in classes in */
+ /* This case, conjunctions + verbs ) */
span.CC{
font-size: 3vw;
- color: chartreuse;
+ color: var(--first)
}
+
span.VB{
- color: black;
+ color: var(--second);
}
-
- .dot{
- color: black;
+ span.VBD{
+ color: var(--second);
}
-
- /* Rules for everything */
-
- body{
- font-family: "neuzeit";
+ span.VBG{
+ color: var(--second);
}
-
- /* Rules for the rest */
-
- div{
- box-sizing: border-box;
+ span.VBN{
+ color: var(--second);
+ }
+ span.VBP{
+ color: var(--second);
+ }
+ span.VBZ{
+ color: var(--second);
}
-
-
-
-
}
\ No newline at end of file
diff --git a/layout/styles/3.css b/2_layout/styles/3.css
similarity index 87%
rename from layout/styles/3.css
rename to 2_layout/styles/3.css
index 46f6008..8cd8e3f 100644
--- a/layout/styles/3.css
+++ b/2_layout/styles/3.css
@@ -5,11 +5,10 @@
@page {
size: 148mm 210mm;
marks: crop cross;
- bleed: 5mm;
- margin: 1cm;
+ margin: 15mm;
}
- /* Custom font */
+ /* Custom fonts */
@font-face {
font-family: "neuzeit";
@@ -48,8 +47,7 @@
img {
margin: 0 5px;
height: 50px;
- vertical-align:middle;
-
+ vertical-align: middle;
}
diff --git a/layout/fonts/NeuzeitOffice-Regular.ttf b/2_layout/styles/fonts/NeuzeitOffice-Regular.ttf
similarity index 100%
rename from layout/fonts/NeuzeitOffice-Regular.ttf
rename to 2_layout/styles/fonts/NeuzeitOffice-Regular.ttf
diff --git a/layout/fonts/fivo-sans.medium.otf b/2_layout/styles/fonts/fivo-sans.medium.otf
similarity index 100%
rename from layout/fonts/fivo-sans.medium.otf
rename to 2_layout/styles/fonts/fivo-sans.medium.otf
diff --git a/layout/style.css b/2_layout/styles/style.css
similarity index 100%
rename from layout/style.css
rename to 2_layout/styles/style.css
diff --git a/layout/.DS_Store b/layout/.DS_Store
deleted file mode 100644
index 39297fd..0000000
Binary files a/layout/.DS_Store and /dev/null differ
diff --git a/layout/.ipynb_checkpoints/index-checkpoint.html b/layout/.ipynb_checkpoints/index-checkpoint.html
deleted file mode 100644
index 674d6bb..0000000
--- a/layout/.ipynb_checkpoints/index-checkpoint.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
- Booklet
-
-
-
-
-
I WISH I COULD SHOW YOU A PICTURE OF WHAT I GOT🤮
-
-
-
-
\ No newline at end of file
diff --git a/layout/.ipynb_checkpoints/nltk-checkpoint.py b/layout/.ipynb_checkpoints/nltk-checkpoint.py
deleted file mode 100644
index 18b413d..0000000
--- a/layout/.ipynb_checkpoints/nltk-checkpoint.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import nltk
-nltk.download('punkt')
-
-with open('speech.txt','r') as result:
- r = result.read()
-
-r = r.replace('','').replace('\n','. ')
-
-l=nltk.word_tokenize(r)
-pos = nltk.pos_tag(l)
-
-html = '''
-
-
-
-
-
-
-
- Booklet
-
-
-'''
-
-for x in pos:
- if x[0] == '.':
- html += ". "
- else:
- html += ""+x[0]+" "
-
-html = '''
-'''
-
-with open('index.html','w') as index:
- index.write(html)
\ No newline at end of file
diff --git a/layout/.ipynb_checkpoints/speech-checkpoint.txt b/layout/.ipynb_checkpoints/speech-checkpoint.txt
deleted file mode 100644
index 1fcbc70..0000000
--- a/layout/.ipynb_checkpoints/speech-checkpoint.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-and again are we are
-let's see if it works again with these fantastic xt500
-
\ No newline at end of file
diff --git a/layout/picDownload.py b/layout/picDownload.py
deleted file mode 100644
index 1dda26f..0000000
--- a/layout/picDownload.py
+++ /dev/null
@@ -1,87 +0,0 @@
-# Bonus!
-
-# Scrape and download images in local from DuckDuckGo
-
-
-# First, you need python. You can download Python from its website:
-
-# https://www.python.org/
-
-
-# Then, you need to install DuckDuckGoImages,open the terminal and digit:
-
-# pip3 install DuckDuckGoImages
-
-
-
-import DuckDuckGoImages as ddg
-import os
-import shutil
-
-with open('speech.txt','r') as speech:
- qq = speech.readlines()
-
-html = ''
-
-html = '''
-
-
-
-
-
-
-
- Booklet
-
-
-'''
-
-if os.path.isdir('./images/') is True:
- shutil.rmtree('./images/')
-
-os.mkdir('./images/')
-
-
-for q in qq:
- if q == '''''':
- continue
-
- qDDG = q.replace(' ','+')
- qBinded = q.replace(' ','')
- print(qDDG)
- qBinded = qBinded.replace("\n","")
- os.mkdir(f'./images/{qBinded}')
- ddg.download(qDDG, folder= f"./images/{qBinded}/", max_urls=10, thumbnails=True)
- normalize = os.listdir(f"./images/{qBinded}/")
-
- print(len(os.listdir(f"./images/{qBinded}/")))
-
- if len(os.listdir(f"./images/{qBinded}/")) == 0:
- html += f'{q}