From 55f7d5c0e8f8d8dce356c2b4201ee596e918879d Mon Sep 17 00:00:00 2001 From: funix Date: Wed, 6 Oct 2021 03:35:24 +0200 Subject: [PATCH] comments and tidy --- {speech => 0_speech}/index.html | 0 {speech => 0_speech}/index.js | 0 {speech => 0_speech}/style.css | 0 1_pythoning/1-2_NLTKing.py | 106 +++++++++++++ 1_pythoning/3_imageScraping.py | 68 ++++++++ 1_pythoning/bonus_imageDownloader.py | 132 ++++++++++++++++ 1_pythoning/pythonInstallationParty.txt | 25 +++ 2_layout/1.html | 149 ++++++++++++++++++ 2_layout/2.html | 149 ++++++++++++++++++ 2_layout/3.html | 47 ++++++ .../pagedjs_files/interface.css | 0 {layout => 2_layout}/pagedjs_files/paged.js | 0 .../pagedjs_files/paged.polyfill.js | 0 {layout => 2_layout}/speech.txt | 0 {layout => 2_layout}/styles/1.css | 6 +- {layout => 2_layout}/styles/2.css | 68 ++++---- {layout => 2_layout}/styles/3.css | 8 +- .../styles}/fonts/NeuzeitOffice-Regular.ttf | Bin .../styles}/fonts/fivo-sans.medium.otf | Bin {layout => 2_layout/styles}/style.css | 0 layout/.DS_Store | Bin 6148 -> 0 bytes .../.ipynb_checkpoints/index-checkpoint.html | 17 -- layout/.ipynb_checkpoints/nltk-checkpoint.py | 35 ---- .../.ipynb_checkpoints/speech-checkpoint.txt | 3 - layout/picDownload.py | 87 ---------- .../Untitled-checkpoint.ipynb | 131 --------------- layout/pythoning/Untitled.ipynb | 131 --------------- layout/pythoning/index.html | 1 - 28 files changed, 722 insertions(+), 441 deletions(-) rename {speech => 0_speech}/index.html (100%) rename {speech => 0_speech}/index.js (100%) rename {speech => 0_speech}/style.css (100%) create mode 100644 1_pythoning/1-2_NLTKing.py create mode 100644 1_pythoning/3_imageScraping.py create mode 100644 1_pythoning/bonus_imageDownloader.py create mode 100644 1_pythoning/pythonInstallationParty.txt create mode 100644 2_layout/1.html create mode 100644 2_layout/2.html create mode 100644 2_layout/3.html rename {layout => 2_layout}/pagedjs_files/interface.css (100%) rename {layout => 2_layout}/pagedjs_files/paged.js (100%) rename {layout => 2_layout}/pagedjs_files/paged.polyfill.js (100%) rename {layout => 2_layout}/speech.txt (100%) rename {layout => 2_layout}/styles/1.css (95%) rename {layout => 2_layout}/styles/2.css (52%) rename {layout => 2_layout}/styles/3.css (87%) rename {layout => 2_layout/styles}/fonts/NeuzeitOffice-Regular.ttf (100%) rename {layout => 2_layout/styles}/fonts/fivo-sans.medium.otf (100%) rename {layout => 2_layout/styles}/style.css (100%) delete mode 100644 layout/.DS_Store delete mode 100644 layout/.ipynb_checkpoints/index-checkpoint.html delete mode 100644 layout/.ipynb_checkpoints/nltk-checkpoint.py delete mode 100644 layout/.ipynb_checkpoints/speech-checkpoint.txt delete mode 100644 layout/picDownload.py delete mode 100644 layout/pythoning/.ipynb_checkpoints/Untitled-checkpoint.ipynb delete mode 100644 layout/pythoning/Untitled.ipynb delete mode 100644 layout/pythoning/index.html 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 39297fd14d39b2db26e9722bd9a6828ef62931bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK&1%~~5T5l^GjBSuvl)jt2lle-?KEngAeC2`e5h&j{_4Zb`*?s))jz zkw^1<5~VuYie<C8Wcin6)7AL)TZFST=UbfYu*Xy*^@zML`(vt^=-4ACsclX~H56j0NmRW(HppiEY zSMU>!jS{~F(=6552)&fy!36HH^s%8JK^jJJ{xyxTjMV{*%m6dM4D1>M?!uI>cdan4 zhZ$f7{+a>09~3H~@36FJt`1zx2!L2aw-K~ymY^Kv(05o`#2pl2QxR>da3hAW>F8H3 z&UaW^wCNz+@FCojg_}@>c{-l2OgISNBCpH - - - - - - - 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}

' - os.rmdir(f'./images/{qBinded}/') - continue - - - print('NORMALIZE', normalize) - normalize = normalize[0] - - splitExtension = os.path.splitext(normalize) - print('ESTENSIONE', splitExtension) - - - os.rename(f'./images/{qBinded}/{normalize}', f'./images/{qBinded}/{qBinded}') - os.replace(f'./images/{qBinded}/{qBinded}', f'./images/{qBinded}.jpg') - shutil.rmtree(f'./images/{qBinded}/') - - html += f"""{q}""" - html += f"""""" - - - -html += ''' -''' - -html = html.replace(' .','.').replace(" '", "'") - -with open('picindex.html','w') as index: - index.write(html) \ No newline at end of file diff --git a/layout/pythoning/.ipynb_checkpoints/Untitled-checkpoint.ipynb b/layout/pythoning/.ipynb_checkpoints/Untitled-checkpoint.ipynb deleted file mode 100644 index 3229866..0000000 --- a/layout/pythoning/.ipynb_checkpoints/Untitled-checkpoint.ipynb +++ /dev/null @@ -1,131 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 2, - "id": "35367849-a425-404c-bbbd-d8d7138f1838", - "metadata": {}, - "outputs": [], - "source": [ - "import nltk\n", - "\n", - "with open('../speech.txt','r') as result:\n", - " r = result.read()\n", - " \n", - "r = r.replace('','').replace('\\n','. ')\n", - "\n", - "l=nltk.word_tokenize(r)\n", - "pos = nltk.pos_tag(l)\n", - "\n", - "html = ''\n", - "for x in pos:\n", - " if x[0] == '.':\n", - " html += \".
\"\n", - " else:\n", - " html += \" \"+x[0]+\"\"\n", - " \n" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "0d1737d0-cda2-4208-9585-487ef809bdff", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "\"and again are we are .
let 's see if it works again with these fantastic xt500 .
\"" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "html" - ] - }, - { - "cell_type": "code", - "execution_count": 127, - "id": "cfe7aecd-bcff-4e3b-81c2-0622434cf62b", - "metadata": {}, - "outputs": [], - "source": [ - "with open('index.html','w') as index:\n", - " index.write(html)" - ] - }, - { - "cell_type": "code", - "execution_count": 137, - "id": "8d2195b3-dc7a-4cdc-b599-5570766df12d", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 138, - "id": "02f79b41-8238-4fa1-9530-a84b5069bce0", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c6e3cf8e-3493-463b-807a-89342e7c8731", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ac322fc4-db27-42a3-aef0-ac0fbe3e26fb", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1e02a152-1c3c-4e2c-b1aa-1a1f3172810c", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "264c688c-aba4-4cf5-8f6d-b9b35c3a0969", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.7" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/layout/pythoning/Untitled.ipynb b/layout/pythoning/Untitled.ipynb deleted file mode 100644 index 3229866..0000000 --- a/layout/pythoning/Untitled.ipynb +++ /dev/null @@ -1,131 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 2, - "id": "35367849-a425-404c-bbbd-d8d7138f1838", - "metadata": {}, - "outputs": [], - "source": [ - "import nltk\n", - "\n", - "with open('../speech.txt','r') as result:\n", - " r = result.read()\n", - " \n", - "r = r.replace('','').replace('\\n','. ')\n", - "\n", - "l=nltk.word_tokenize(r)\n", - "pos = nltk.pos_tag(l)\n", - "\n", - "html = ''\n", - "for x in pos:\n", - " if x[0] == '.':\n", - " html += \".
\"\n", - " else:\n", - " html += \" \"+x[0]+\"\"\n", - " \n" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "0d1737d0-cda2-4208-9585-487ef809bdff", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "\"and again are we are .
let 's see if it works again with these fantastic xt500 .
\"" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "html" - ] - }, - { - "cell_type": "code", - "execution_count": 127, - "id": "cfe7aecd-bcff-4e3b-81c2-0622434cf62b", - "metadata": {}, - "outputs": [], - "source": [ - "with open('index.html','w') as index:\n", - " index.write(html)" - ] - }, - { - "cell_type": "code", - "execution_count": 137, - "id": "8d2195b3-dc7a-4cdc-b599-5570766df12d", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": 138, - "id": "02f79b41-8238-4fa1-9530-a84b5069bce0", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "c6e3cf8e-3493-463b-807a-89342e7c8731", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ac322fc4-db27-42a3-aef0-ac0fbe3e26fb", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1e02a152-1c3c-4e2c-b1aa-1a1f3172810c", - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "264c688c-aba4-4cf5-8f6d-b9b35c3a0969", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.9.7" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/layout/pythoning/index.html b/layout/pythoning/index.html deleted file mode 100644 index 70d572b..0000000 --- a/layout/pythoning/index.html +++ /dev/null @@ -1 +0,0 @@ -and again are we are .
let 's see if it works again with these fantastic xt500 .
\ No newline at end of file