master
km0 3 years ago
parent d55efff7d4
commit fd296e49a2

@ -103,7 +103,6 @@ function startConverting() {
for (let i = event.resultIndex; i < event.results.length; i++) {
let transcript = event.results[i][0].transcript;
transcript.replace("\n", "<br>");
if (event.results[i].isFinal) {
finalTranscripts += transcript.trim() + "\n";
@ -121,7 +120,7 @@ function startConverting() {
let final =
finalTranscripts + '<span class="interim">' + interimTranscripts + "</span>";
speech.innerHTML = final;
speech.innerHTML = final.replaceAll("\n", "<br />");
window.scrollTo(0, document.body.scrollHeight);
textStorage = final;

@ -26,16 +26,15 @@ with open('../speech.txt', 'r') as speech: # let's import the text
time.sleep(2) # check it in the console!
text = text.replace('<span class="interim"></span>',
'').replace('\n', '. ') # delete this from the results
tokens = nltk.word_tokenize(text) # Tokenize the words :: split each word
# Elaborate the Part of Speech! It will create an array, a list
pos = nltk.pos_tag(tokens)
print(pos) # print the array!
time.sleep(2) # check it in the console!
# print(pos) # print the array!
# time.sleep(2) # check it in the console!
# To see all the POS tags, open the terminal and copy:
#
@ -43,6 +42,10 @@ time.sleep(2) # check it in the console!
# import nltk
# nltk.help.upenn_tagset()
# see also:
# https://cheatography.com/deacondesperado/cheat-sheets/nltk-part-of-speech-tags/
# start the layouting :: html + css + paged.js >>
#
# declare html :: we will fill it in the process with loops
@ -51,26 +54,26 @@ time.sleep(2) # check it in the console!
html = ''
html1 = '''
<html>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./pagedjs_files/interface.css">
<script src="./pagedjs_files/paged.polyfill.js"></script>
<link rel="stylesheet" href="./styles/1.css">
<meta charset="utf-8"/>
<title>📡 💻📘</title>
</head>
<body>
'''
html2 = '''
<html>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./pagedjs_files/interface.css">
<script src="./pagedjs_files/paged.polyfill.js"></script>
<link rel="stylesheet" href="./styles/2.css">
<meta charset="utf-8"/>
<title>📡 💻📘</title>
</head>
<body>
@ -80,6 +83,7 @@ html2 = '''
for e in pos: # e is the current element, pos is the array to process
print(e)
if e[0] == '.': # if e is a dot, its class will be 'dot'
html += " <span class='dot'>.</span><br> \n"
@ -95,10 +99,12 @@ html = html.replace(' .', '.').replace(" '", "'")
# Save the <html> files!
with open('../2_layout/1.html', 'w') as index:
with open('../2_layout/1.html', 'w', encoding='utf-8') as index:
index.write(html1)
index.write(html)
index.close()
with open('../2_layout/2.html', 'w') as index:
with open('../2_layout/2.html', 'w', encoding='utf-8') as index:
index.write(html2)
index.write(html)
index.close()

@ -6,16 +6,17 @@
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
# to create delays :: for having a few seconds to check the console
import time
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
# and split it in lines, it will create an array, a list
qq = speech.readlines()
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
@ -32,7 +33,6 @@ html = '''
<body>
'''
# Elaborate each line :: process every element of the array qq
# q is for "query", qq for "queries", because we will send requests to
@ -46,10 +46,8 @@ for q in qq:
q = q.strip()
if q == '''<span class="interim"></span>''': # This nope.
continue
q = q.replace("\n","") # remove "\n", which means "return to the next line"
# remove "\n", which means "return to the next line"
q = q.replace("\n", "")
# Scrape images with search()!
# q is, indeed, the query for DuckDuckGo
@ -59,14 +57,11 @@ for q in qq:
html += f""" <span> {q} </span>\n""" # Now let's fill the html with text and the pic
html += f""" <img src='{r}'>\n"""
# Close the html text
html += '''</body>
</html>'''
html = html.replace(" '", "'")
with open(',,/2_layout/3.html','w') as index: # Save the <html> file!
with open('../2_layout/3.html', 'w') as index: # Save the <html> file!
index.write(html)

@ -1,149 +1,83 @@
<html>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./pagedjs_files/interface.css">
<script src="./pagedjs_files/paged.polyfill.js"></script>
<link rel="stylesheet" href="./styles/1.css">
<meta charset="utf-8"/>
<title>📡 💻📘</title>
</head>
<body>
<span class='JJ'> ok </span>
<span class='NN'> let </span>
<span class='POS'>'s </span>
<span class='NN'> talk </span>
<span class='IN'> in </span>
<span class='NNP'> English </span>
<span class='IN'> for </span>
<span class='NN'> awhile </span>
<span class='WP'> what </span>
<span class='VBP'> are </span>
<span class='PRP'> we </span>
<span class='VBG'> eating </span>
<span class='dot'>.</span><br>
<span class='CC'> or </span>
<span class='RB'> not </span>
<span class='IN'> so </span>
<span class='CD'> 12345 </span>
<span class='NN'> multiply </span>
<span class='NN'> function </span>
<span class='VBD'> hello </span>
<span class='PRP'> it </span>
<span class='VBZ'> is </span>
<span class='VBG'> starting </span>
<span class='RB'> again </span>
<span class='dot'>.</span><br>
<span class='JJ'> ok </span>
<span class='NN'> navigate </span>
<span class='dot'>.</span><br>
<span class='PRP'> you </span>
<span class='VBP'> need </span>
<span class='TO'> to </span>
<span class='VB'> rest </span>
<span class='RB'> sometimes </span>
<span class='dot'>.</span><br>
<span class='RB'> also </span>
<span class='VBD'> implemented </span>
<span class='IN'> that </span>
<span class='VBG'> implementing </span>
<span class='dot'>.</span><br>
<span class='PRP'> he </span>
<span class='VBZ'>'s </span>
<span class='DT'> a </span>
<span class='NN'> sentence </span>
<span class='CC'> and </span>
<span class='PRP'> we </span>
<span class='VBP'> are </span>
<span class='RB'> not </span>
<span class='JJ'> interested </span>
<span class='dot'>.</span><br>
<span class='VB'> remember </span>
<span class='dot'>.</span><br>
<span class='VBG'> working </span>
<span class='RB'> so </span>
<span class='RB'> basically </span>
<span class='NN'> sentence </span>
<span class='dot'>.</span><br>
<span class='WRB'> where </span>
<span class='VBZ'> is </span>
<span class='TO'> to </span>
<span class='VB'> go </span>
<span class='DT'> a </span>
<span class='NN'> couple </span>
<span class='CC'> and </span>
<span class='RB'> then </span>
<span class='PRP'> you </span>
<span class='VBP'> put </span>
<span class='DT'> the </span>
<span class='NN'> adult </span>
<span class='dot'>.</span><br>
<span class='DT'> a </span>
<span class='RB'> bit </span>
<span class='JJR'> easier </span>
<span class='TO'> to </span>
<span class='VB'> understand </span>
<span class='dot'>.</span><br>
<span class='RB'> actually </span>
<span class='RB'> maybe </span>
<span class='NNS'> people </span>
<span class='RB'> just </span>
<span class='VBP'> do </span>
<span class='RB'> n't </span>
<span class='RB'> just </span>
<span class='dot'>.</span><br>
<span class='PRP'> I </span>
<span class='VBP'>'m </span>
<span class='RB'> just </span>
<span class='VBG'> thinking </span>
<span class='PRP'> it </span>
<span class='VBZ'>'s </span>
<span class='RB'> not </span>
<span class='DT'> the </span>
<span class='NNS'> centres </span>
<span class='VBP'> do </span>
<span class='RB'> n't </span>
<span class='VB'> put </span>
<span class='DT'> the </span>
<span class='NN'> dot </span>
<span class='CC'> and </span>
<span class='RB'> just </span>
<span class='VB'> put </span>
<span class='DT'> a </span>
<span class='NN'> couple </span>
<span class='dot'>.</span><br>
<span class='IN'> because </span>
<span class='RB'> then </span>
<span class='dot'>.</span><br>
<span class='PRP'> they </span>
<span class='VBP'> are </span>
<span class='VBG'> talking </span>
<span class='PRP'> they </span>
<span class='VBP'> are </span>
<span class='DT'> a </span>
<span class='NN'> booklet </span>
<span class='CC'> but </span>
<span class='PRP'> they </span>
<span class='VBP'> are </span>
<span class='RB'> not </span>
<span class='VBG'> writing </span>
<span class='dot'>.</span><br>
<span class='JJ'> much </span>
<span class='JJR'> better </span>
<span class='RB'> now </span>
<span class='JJ'> good </span>
<span class='NNS'> purple </span>
<span class='IN'> so </span>
<span class='PRP'> it </span>
<span class='VBZ'> is </span>
<span class='RB'> just </span>
<span class='JJ'> fine </span>
<span class='dot'>.</span><br>
<span class='RB'> so </span>
<span class='VBZ'> means </span>
<span class='IN'> that </span>
<span class='PRP'> it </span>
<span class='VBZ'> works </span>
<span class='IN'> pumpkinMichaelnewspaper </span>
<span class='NN'> canGoogle </span>
<span class='NN'> speaker </span>
<span class='JJ'> small </span>
<span class='NNP'> America </span>
<span class='TO'> to </span>
<span class='VB'> see </span>
<span class='WRB'> how </span>
<span class='PRP'> it </span>
<span class='VBZ'> goes </span>
<span class='JJ'> email </span>
<span class='NNP'> Sterling </span>
<span class='NNP'> Knight </span>
<span class='NN'> part </span>
<span class='IN'> of </span>
<span class='NN'> speech </span>
<span class='CD'> 20 </span>
<span class='JJ'> ok </span>
<span class='JJ'> independent </span>
<span class='NN'> boilerplate </span>
<span class='NNP'> IKEA </span>
<span class='WRB'> where </span>
<span class='VBP'> are </span>
<span class='PRP$'> my </span>
<span class='JJ'> next </span>
<span class='NNP'> Tuesday </span>
<span class='NN'> mum </span>
<span class='NN'> barrister </span>
<span class='VBN'> assisted </span>
<span class='IN'> into </span>
<span class='NNS'> months </span>
<span class='VBP'> turn </span>
<span class='RP'> off </span>
<span class='VBG'> living </span>
<span class='NN'> room </span>
<span class='NNP'> TVmaterial </span>
<span class='NN'> lightstream </span>
<span class='NN'> todayhello </span>
<span class='TO'> to </span>
<span class='PRP'> you </span>
<span class='VBN'> done </span>
<span class='dot'>.</span><br>
<span class='CC'> and </span>
<span class='RB'> now </span>
<span class='VBZ'> is </span>
<span class='JJ'> f </span>
<span class='NNP'> * </span>
<span class='NNP'> * </span>
<span class='NNP'> * </span>
<span class='NNP'> * </span>
<span class='NNP'> * </span>
<span class='RB'> up </span>
<span class='dot'>.</span><br>
<span class='NNP'> CBR </span>
<span class='CD'> 929 </span>
<span class='MD'> ca </span>
<span class='RB'> n't </span>
<span class='VB'> encode </span>
<span class='DT'> this </span>
<span class='CD'> one </span>
<span class='NN'> kodi </span>
<span class='NN'> turn </span>
<span class='NN'> bedroom </span>
<span class='NNS'> twoalways </span>
</body>
</html>

@ -1,149 +1,83 @@
<html>
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./pagedjs_files/interface.css">
<script src="./pagedjs_files/paged.polyfill.js"></script>
<link rel="stylesheet" href="./styles/2.css">
<meta charset="utf-8"/>
<title>📡 💻📘</title>
</head>
<body>
<span class='JJ'> ok </span>
<span class='NN'> let </span>
<span class='POS'>'s </span>
<span class='NN'> talk </span>
<span class='IN'> in </span>
<span class='NNP'> English </span>
<span class='IN'> for </span>
<span class='NN'> awhile </span>
<span class='WP'> what </span>
<span class='VBP'> are </span>
<span class='PRP'> we </span>
<span class='VBG'> eating </span>
<span class='dot'>.</span><br>
<span class='CC'> or </span>
<span class='RB'> not </span>
<span class='IN'> so </span>
<span class='CD'> 12345 </span>
<span class='NN'> multiply </span>
<span class='NN'> function </span>
<span class='VBD'> hello </span>
<span class='PRP'> it </span>
<span class='VBZ'> is </span>
<span class='VBG'> starting </span>
<span class='RB'> again </span>
<span class='dot'>.</span><br>
<span class='JJ'> ok </span>
<span class='NN'> navigate </span>
<span class='dot'>.</span><br>
<span class='PRP'> you </span>
<span class='VBP'> need </span>
<span class='TO'> to </span>
<span class='VB'> rest </span>
<span class='RB'> sometimes </span>
<span class='dot'>.</span><br>
<span class='RB'> also </span>
<span class='VBD'> implemented </span>
<span class='IN'> that </span>
<span class='VBG'> implementing </span>
<span class='dot'>.</span><br>
<span class='PRP'> he </span>
<span class='VBZ'>'s </span>
<span class='DT'> a </span>
<span class='NN'> sentence </span>
<span class='CC'> and </span>
<span class='PRP'> we </span>
<span class='VBP'> are </span>
<span class='RB'> not </span>
<span class='JJ'> interested </span>
<span class='dot'>.</span><br>
<span class='VB'> remember </span>
<span class='dot'>.</span><br>
<span class='VBG'> working </span>
<span class='RB'> so </span>
<span class='RB'> basically </span>
<span class='NN'> sentence </span>
<span class='dot'>.</span><br>
<span class='WRB'> where </span>
<span class='VBZ'> is </span>
<span class='TO'> to </span>
<span class='VB'> go </span>
<span class='DT'> a </span>
<span class='NN'> couple </span>
<span class='CC'> and </span>
<span class='RB'> then </span>
<span class='PRP'> you </span>
<span class='VBP'> put </span>
<span class='DT'> the </span>
<span class='NN'> adult </span>
<span class='dot'>.</span><br>
<span class='DT'> a </span>
<span class='RB'> bit </span>
<span class='JJR'> easier </span>
<span class='TO'> to </span>
<span class='VB'> understand </span>
<span class='dot'>.</span><br>
<span class='RB'> actually </span>
<span class='RB'> maybe </span>
<span class='NNS'> people </span>
<span class='RB'> just </span>
<span class='VBP'> do </span>
<span class='RB'> n't </span>
<span class='RB'> just </span>
<span class='dot'>.</span><br>
<span class='PRP'> I </span>
<span class='VBP'>'m </span>
<span class='RB'> just </span>
<span class='VBG'> thinking </span>
<span class='PRP'> it </span>
<span class='VBZ'>'s </span>
<span class='RB'> not </span>
<span class='DT'> the </span>
<span class='NNS'> centres </span>
<span class='VBP'> do </span>
<span class='RB'> n't </span>
<span class='VB'> put </span>
<span class='DT'> the </span>
<span class='NN'> dot </span>
<span class='CC'> and </span>
<span class='RB'> just </span>
<span class='VB'> put </span>
<span class='DT'> a </span>
<span class='NN'> couple </span>
<span class='dot'>.</span><br>
<span class='IN'> because </span>
<span class='RB'> then </span>
<span class='dot'>.</span><br>
<span class='PRP'> they </span>
<span class='VBP'> are </span>
<span class='VBG'> talking </span>
<span class='PRP'> they </span>
<span class='VBP'> are </span>
<span class='DT'> a </span>
<span class='NN'> booklet </span>
<span class='CC'> but </span>
<span class='PRP'> they </span>
<span class='VBP'> are </span>
<span class='RB'> not </span>
<span class='VBG'> writing </span>
<span class='dot'>.</span><br>
<span class='JJ'> much </span>
<span class='JJR'> better </span>
<span class='RB'> now </span>
<span class='JJ'> good </span>
<span class='NNS'> purple </span>
<span class='IN'> so </span>
<span class='PRP'> it </span>
<span class='VBZ'> is </span>
<span class='RB'> just </span>
<span class='JJ'> fine </span>
<span class='dot'>.</span><br>
<span class='RB'> so </span>
<span class='VBZ'> means </span>
<span class='IN'> that </span>
<span class='PRP'> it </span>
<span class='VBZ'> works </span>
<span class='IN'> pumpkinMichaelnewspaper </span>
<span class='NN'> canGoogle </span>
<span class='NN'> speaker </span>
<span class='JJ'> small </span>
<span class='NNP'> America </span>
<span class='TO'> to </span>
<span class='VB'> see </span>
<span class='WRB'> how </span>
<span class='PRP'> it </span>
<span class='VBZ'> goes </span>
<span class='JJ'> email </span>
<span class='NNP'> Sterling </span>
<span class='NNP'> Knight </span>
<span class='NN'> part </span>
<span class='IN'> of </span>
<span class='NN'> speech </span>
<span class='CD'> 20 </span>
<span class='JJ'> ok </span>
<span class='JJ'> independent </span>
<span class='NN'> boilerplate </span>
<span class='NNP'> IKEA </span>
<span class='WRB'> where </span>
<span class='VBP'> are </span>
<span class='PRP$'> my </span>
<span class='JJ'> next </span>
<span class='NNP'> Tuesday </span>
<span class='NN'> mum </span>
<span class='NN'> barrister </span>
<span class='VBN'> assisted </span>
<span class='IN'> into </span>
<span class='NNS'> months </span>
<span class='VBP'> turn </span>
<span class='RP'> off </span>
<span class='VBG'> living </span>
<span class='NN'> room </span>
<span class='NNP'> TVmaterial </span>
<span class='NN'> lightstream </span>
<span class='NN'> todayhello </span>
<span class='TO'> to </span>
<span class='PRP'> you </span>
<span class='VBN'> done </span>
<span class='dot'>.</span><br>
<span class='CC'> and </span>
<span class='RB'> now </span>
<span class='VBZ'> is </span>
<span class='JJ'> f </span>
<span class='NNP'> * </span>
<span class='NNP'> * </span>
<span class='NNP'> * </span>
<span class='NNP'> * </span>
<span class='NNP'> * </span>
<span class='RB'> up </span>
<span class='dot'>.</span><br>
<span class='NNP'> CBR </span>
<span class='CD'> 929 </span>
<span class='MD'> ca </span>
<span class='RB'> n't </span>
<span class='VB'> encode </span>
<span class='DT'> this </span>
<span class='CD'> one </span>
<span class='NN'> kodi </span>
<span class='NN'> turn </span>
<span class='NN'> bedroom </span>
<span class='NNS'> twoalways </span>
</body>
</html>

@ -1,5 +1,4 @@
@media print {
/* Define the size of the pages and layout settings */
@page {
@ -12,20 +11,20 @@
@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 */
:root {
--first: #19B7B9;
--second: #0B1136;
--third: #2E4473;
--first: #19b7b9;
--second: #0b1136;
--third: #2e4473;
}
/* Rules for everything */
@ -55,12 +54,11 @@
/* Rules for Part Of Speech (POS), defined in classes in <span> */
/* This case, conjunctions + verbs ) */
span.CC{
span.NN {
font-size: 3vw;
color: var(--first)
color: var(--first);
}
span.VB {
color: var(--second);
}
@ -79,5 +77,4 @@
span.VBZ {
color: var(--second);
}
}

@ -1,5 +1,4 @@
@media print {
/* Define the size of the pages and layout settings */
@page {
@ -12,19 +11,17 @@
@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 */
:root {
}
/* Rules for everything */
@ -49,6 +46,4 @@
height: 50px;
vertical-align: middle;
}
}

@ -1,54 +0,0 @@
@media print{
/* Define the size of the pages and layout settings */
@page {
size: 148mm 210mm;
marks: crop cross;
bleed: 5mm;
}
/* Custom font */
@font-face {
font-family: "neuzeit";
src: url("fonts/NeuzeitOffice-Regular.ttf") format("ttf")
}
@font-face {
font-family: "fivo";
src: url("fonts/fivo-sans.medium.otf") format("otf")
}
/* Custom variables */
:root{
}
/* Rules for everything */
body{
font-family: "neuzeit";
}
/* Rules for the rest */
div{
box-sizing: border-box;
}
p{
text-align: left;
font-size: 12px;
line-height: 15.5px;
}
h1{
text-align: center;
}
}

@ -1,18 +1,18 @@
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
<span class="interim"></span>
why is pink the colour for girls and blue the colours for boys in the 19th century girls and boys were bored dress in white because it was easier to clean after WWI World War One department store in the US realise that could make more money if baby products will be gender specific
pastel swearing fashion and it was decided that thing would be the colour for boys and blue for girls in the 94 days market research in the US just that the current should be the other way around and the baby boom generation was the first where the girl dress in pink and boys in blue
blue
lupilu
Balle Balle
hello
hello hello you when I can theoretically
distinguish between 75 and 10 meal on heels
play some
0
ok
green is the colour of metal
green is the colour of netta in many cultures
early retail centre of only hope for good harvest with green vegetables green is in the traditional colour of Islam yeah the colour of Prophet Muhammad which is why many flags in this number call you with the colour green
since 1980s Green has been kind colourful environmental parties and organisation
the word green washing is used to describe advising of companies that use positive environmental practice
cease to cover-up environmentally unfriendly activities
rear room is used in television and Theatre to quite nervous performer

Loading…
Cancel
Save