From 23f0e7e32d7e7b4a68e10f263fcbb682708631a9 Mon Sep 17 00:00:00 2001 From: jvdhorst Date: Tue, 27 Mar 2018 11:44:49 +0200 Subject: [PATCH] Changed css for pint --- Makefile | 8 ++++-- .../{print.css => print-entity.css} | 11 +++----- src/reading_structure/print-neutral.css | 2 +- src/reading_structure/print-noun.css | 2 +- src/reading_structure/print-stopword.css | 5 +--- src/reading_structure/reading_structure.py | 2 +- src/reading_structure/script.js | 28 +++++++++---------- src/reading_structure/style.css | 4 +-- src/reading_structure/template.html | 2 +- 9 files changed, 31 insertions(+), 33 deletions(-) rename src/reading_structure/{print.css => print-entity.css} (88%) diff --git a/Makefile b/Makefile index 5caefe7..45054d4 100644 --- a/Makefile +++ b/Makefile @@ -77,9 +77,13 @@ reading_structure: ocr/output.txt ## Analyzes OCR'ed text using a Part of Speech cp src/reading_structure/jquery.min.js output/reading_structure cp src/reading_structure/script.js output/reading_structure cp src/reading_structure/style.css output/reading_structure - cp src/reading_structure/print.css output/reading_structure cat $< | python3 src/reading_structure/reading_structure.py - weasyprint -s output/reading_structure/print.css output/reading_structure/index.html output/reading_structure/poster.pdf + weasyprint -s src/reading_structure/print-noun.css output/reading_structure/index.html output/reading_structure/poster_noun.pdf + weasyprint -s src/reading_structure/print-adv.css output/reading_structure/index.html output/reading_structure/poster_adv.pdf + weasyprint -s src/reading_structure/print-dppt.css output/reading_structure/index.html output/reading_structure/poster_dppt.pdf + weasyprint -s src/reading_structure/print-stopword.css output/reading_structure/index.html output/reading_structure/poster_stopword.pdf + weasyprint -s src/reading_structure/print-neutral.css output/reading_structure/index.html output/reading_structure/poster_neutral.pdf + weasyprint -s src/reading_structure/print-entity.css output/reading_structure/index.html output/reading_structure/poster_named_entities.pdf x-www-browser output/reading_structure/index.html output/chatbot.txt: ocr/output.txt ## Comments a text with a simple chatbot. Dependencies: python3's chatterbot diff --git a/src/reading_structure/print.css b/src/reading_structure/print-entity.css similarity index 88% rename from src/reading_structure/print.css rename to src/reading_structure/print-entity.css index eb35a92..82702fb 100644 --- a/src/reading_structure/print.css +++ b/src/reading_structure/print-entity.css @@ -7,7 +7,7 @@ display: table; @bottom-center { - content: 'make output/reading_structure'; + content: 'make reading_structure'; font-family: 'Ubuntu Mono', monospace; white-space: pre; color: #000; @@ -22,19 +22,16 @@ --- */ -span.word_label, .stopword .word { +span.word_label, .known_entity .word, .pronoun .word { display: block; opacity: 0; width: 100%; font-size: 1rem; } -.stopword > .wordtype:hover, { - opacity: 1; -} -.stopword > .wordtype { - color: #b83e54; +.known_entity > .ner, .pronoun > .pos { + color: #00cccc; } diff --git a/src/reading_structure/print-neutral.css b/src/reading_structure/print-neutral.css index 17edefb..c092874 100644 --- a/src/reading_structure/print-neutral.css +++ b/src/reading_structure/print-neutral.css @@ -30,7 +30,7 @@ span.word_label, .neutral .word { } .neutral > .sentiment { - color: #8491a5; + color: #a500ff; } diff --git a/src/reading_structure/print-noun.css b/src/reading_structure/print-noun.css index 1a921ec..569eaeb 100644 --- a/src/reading_structure/print-noun.css +++ b/src/reading_structure/print-noun.css @@ -7,7 +7,7 @@ display: table; @bottom-center { - content: 'make output/reading_structure'; + content: 'make reading_structure'; font-family: 'Ubuntu Mono', monospace; white-space: pre; color: #000; diff --git a/src/reading_structure/print-stopword.css b/src/reading_structure/print-stopword.css index eb35a92..084f07a 100644 --- a/src/reading_structure/print-stopword.css +++ b/src/reading_structure/print-stopword.css @@ -7,7 +7,7 @@ display: table; @bottom-center { - content: 'make output/reading_structure'; + content: 'make reading_structure'; font-family: 'Ubuntu Mono', monospace; white-space: pre; color: #000; @@ -29,9 +29,6 @@ span.word_label, .stopword .word { font-size: 1rem; } -.stopword > .wordtype:hover, { - opacity: 1; -} .stopword > .wordtype { color: #b83e54; diff --git a/src/reading_structure/reading_structure.py b/src/reading_structure/reading_structure.py index 115235a..2efdfba 100644 --- a/src/reading_structure/reading_structure.py +++ b/src/reading_structure/reading_structure.py @@ -129,7 +129,7 @@ def ner_tagger(list): #print(word.ent_type_) if word.ent_type_ == "PERSON": - ner_tag = 'geographical entity' + ner_tag = 'person' elif word.ent_type_ == 'NORP': ner_tag = 'group' elif word.ent_type_ == 'FACILITY': diff --git a/src/reading_structure/script.js b/src/reading_structure/script.js index 892081d..ac1a7f2 100644 --- a/src/reading_structure/script.js +++ b/src/reading_structure/script.js @@ -60,17 +60,17 @@ $(document).ready(function(){ stopword_word.removeClass('word_label'); stopword_label.addClass('invisible'); - $("#poster").prop("href", "poster-neutral.pdf") + $("#poster").prop("href", "poster_neutral.pdf") - known_entity_word.addClass('word_label'); - known_entity_label.removeClass('invisible'); + neutral_word.addClass('word_label'); + neutral_label.removeClass('invisible'); } if (state == 2) { - known_entity_word.removeClass('word_label'); - known_entity_label.addClass('invisible'); + neutral_word.removeClass('word_label'); + neutral_label.addClass('invisible'); - $("#poster").prop("href", "poster-neutral.pdf") + $("#poster").prop("href", "poster_noun.pdf") noun_word.addClass('word_label'); noun_label.removeClass('invisible'); @@ -80,7 +80,7 @@ $(document).ready(function(){ noun_word.removeClass('word_label'); noun_label.addClass('invisible'); - $("#poster").prop("href", "poster-neutral.pdf") + $("#poster").prop("href", "poster_adv.pdf") ad_word.addClass('word_label'); ad_label.removeClass('invisible'); @@ -90,7 +90,7 @@ $(document).ready(function(){ ad_word.removeClass('word_label'); ad_label.addClass('invisible'); - $("#poster").prop("href", "poster-neutral.pdf") + $("#poster").prop("href", "poster_dppt.pdf") dppt_word.addClass('word_label'); dppt_label.removeClass('invisible'); @@ -100,17 +100,17 @@ $(document).ready(function(){ dppt_word.removeClass('word_label'); dppt_label.addClass('invisible'); - $("#poster").prop("href", "poster-neutral.pdf") + $("#poster").prop("href", "poster_named_entities.pdf") - neutral_word.addClass('word_label'); - neutral_label.removeClass('invisible'); + known_entity_word.addClass('word_label'); + known_entity_label.removeClass('invisible'); } if (state == 6) { - neutral_word.removeClass('word_label'); - neutral_label.addClass('invisible'); + known_entity_word.removeClass('word_label'); + known_entity_label.addClass('invisible'); - $("#poster").prop("href", "poster-neutral.pdf") + $("#poster").prop("href", "poster_stopword.pdf") stopword_word.addClass('word_label'); stopword_label.removeClass('invisible'); diff --git a/src/reading_structure/style.css b/src/reading_structure/style.css index ac77e74..943e7fb 100644 --- a/src/reading_structure/style.css +++ b/src/reading_structure/style.css @@ -120,11 +120,11 @@ span.word_label { } .neutral .sentiment { - color: #8491a5; + color: #a500ff; } .known_entity .ner, .pronoun .pos { - color: #44a889; + color: #00cccc; } .adjective .pos, .adverb .pos { diff --git a/src/reading_structure/template.html b/src/reading_structure/template.html index 359af73..b2f763f 100644 --- a/src/reading_structure/template.html +++ b/src/reading_structure/template.html @@ -27,7 +27,7 @@

Export data as json

-

Print this as a poster

+

Print this as a poster