diff --git a/layout/.DS_Store b/layout/.DS_Store index 6eb175a..39297fd 100644 Binary files a/layout/.DS_Store and b/layout/.DS_Store differ diff --git a/layout/.ipynb_checkpoints/index-checkpoint.html b/layout/.ipynb_checkpoints/index-checkpoint.html new file mode 100644 index 0000000..674d6bb --- /dev/null +++ b/layout/.ipynb_checkpoints/index-checkpoint.html @@ -0,0 +1,17 @@ + + + + + + + + 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 new file mode 100644 index 0000000..18b413d --- /dev/null +++ b/layout/.ipynb_checkpoints/nltk-checkpoint.py @@ -0,0 +1,35 @@ +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 new file mode 100644 index 0000000..1fcbc70 --- /dev/null +++ b/layout/.ipynb_checkpoints/speech-checkpoint.txt @@ -0,0 +1,3 @@ +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/codio.py b/layout/codio.py new file mode 100644 index 0000000..746071c --- /dev/null +++ b/layout/codio.py @@ -0,0 +1,37 @@ +import nltk + +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 += ''' +''' + +html = html.replace(' .','.').replace(" '", "'") + +with open('index.html','w') as index: + index.write(html) diff --git a/layout/index.html b/layout/index.html index 674d6bb..effb198 100644 --- a/layout/index.html +++ b/layout/index.html @@ -1,3 +1,4 @@ + @@ -7,11 +8,6 @@ Booklet - -
-

I WISH I COULD SHOW YOU A PICTURE OF WHAT I GOTšŸ¤®

-
- - + 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/layout/pythoning/.ipynb_checkpoints/Untitled-checkpoint.ipynb b/layout/pythoning/.ipynb_checkpoints/Untitled-checkpoint.ipynb new file mode 100644 index 0000000..3229866 --- /dev/null +++ b/layout/pythoning/.ipynb_checkpoints/Untitled-checkpoint.ipynb @@ -0,0 +1,131 @@ +{ + "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 new file mode 100644 index 0000000..3229866 --- /dev/null +++ b/layout/pythoning/Untitled.ipynb @@ -0,0 +1,131 @@ +{ + "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 new file mode 100644 index 0000000..70d572b --- /dev/null +++ b/layout/pythoning/index.html @@ -0,0 +1 @@ +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/speech.txt b/layout/speech.txt new file mode 100644 index 0000000..f683a1f --- /dev/null +++ b/layout/speech.txt @@ -0,0 +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 + \ No newline at end of file diff --git a/layout/styles/1.css b/layout/styles/1.css index bbfc119..2628598 100644 --- a/layout/styles/1.css +++ b/layout/styles/1.css @@ -26,6 +26,163 @@ } + + body{ + font-size: 1.5vw; + text-align: justify; + text-justify: inter-word; + line-height: 1.8vw; + color: rgb(0,0,0) + } + + + span.CC{ + background-color:#333300 + } + + span.CD{ + background-color:#999900 + } + + span.DT{ + + background-color: #ff00ff + } + + span.EX{ + background-color: #006080 + } + + span.FW{ + background-color:#f6f6ee + } + + span.IN{ + background-color:#ffccff + } + + span.JJ{ + + background-color: #f2f2f2; + } + + span.JJR{ + + background-color: #b3b3b3 + } + + span.JJS{ + background-color:#737373 + } + + span.LS{ + background-color:#666633 + } + + span.MD{ + background-color:#00cc00 + } + + span.NN{ + background-color:#33ff33 + } + + span.NNS{ + background-color:#80ff80 + } + + span.NNP{ + background-color:#ccffcc + } + + span.PDT{ + background-color:#ffd1b3 + } + + span.POS{ + background-color:#ffb380 + } + + span.PRP{ + background-color:#ff8533 + } + + span.PRP${ + background-color:#e65c00 + } + + span.RB{ + background-color:#ff8080 + } + + span.RBR{ + background-color:#ff4d4d + } + + span.RBS{ + background-color:#e60000 + } + + span.RP{ + background-color:#992600 + } + + span.SYM{ + background-color:#99ff33 + } + + span.TO{ + + background-color: black + } + + span.UH{ + background-color:#ffff00 + } + + span.VB{ + background-color: #000099 + } + + span.VBD{ + + background-color: #0000e6 + } + + span.VBG{ + background-color:#1a1aff + } + + span.VBN{ + background-color: #4d4dff + } + + span.VBP{ + background-color: #b3b3ff + } + + span.VBZ{ + background-color: #ccccff + } + + span.WDT{ + background-color:#ccffff + } + + span.WP{ + background-color:#66ffff + } + span.WP${ + background-color:#00e6e6 + } + + span.WRB{ + background-color: #008080 + } + + .dot{ + color: black; + } /* Rules for everything */ @@ -40,15 +197,9 @@ } - p{ - text-align: left; - font-size: 12px; - line-height: 15.5px; - } - - h1{ - text-align: center; - } +span{ + color: white +} } \ No newline at end of file diff --git a/speech/index.js b/speech/index.js index 0b4be8d..5e7f8e4 100644 --- a/speech/index.js +++ b/speech/index.js @@ -46,7 +46,7 @@ resetStorage.addEventListener("click", () => { // Reset everything!!! let saveButton = document.getElementById("save"); // This will let you save the results in your desktop through a button saveButton.addEventListener("click", () => { - download("speech.html", localStorage.getItem("speech")); + download("speech.txt", localStorage.getItem("speech")); }); function download(filename, text) { @@ -103,7 +103,8 @@ function startConverting() { // console.log(event.results[i][0]); transcript.replace("\n", "
"); if (event.results[i].isFinal) { - finalTranscripts += ''+transcript+''; + // finalTranscripts += ' '+transcript+' \n'; + finalTranscripts += transcript+'\n'; } else { // There are also shown the interim results and according to their "confidence" (the percentage of how much the word is correct) the color of each word could change interimTranscripts += transcript; allTheInterim += `