readme file test

master
bootje 4 years ago
parent 1a48ffc4d8
commit c8a503fd7f

File diff suppressed because one or more lines are too long

@ -39,6 +39,8 @@ all_stopwords = default_stopwords | custom_stopwords
print('''<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.5.0.min.js"></script>
<meta charset="utf-8">
<title></title>
<style>
@ -182,19 +184,20 @@ print('''<!DOCTYPE html>
<p id="text" style="display:none">Checkbox is CHECKED!</p>
<script>
function myFunction() {
// Get the checkbox
var checkBox = document.getElementById("myCheck");
// Get the output text
var text = document.getElementById("text");
// If the checkbox is checked, display the output text
if (checkBox.checked == true){
text.style.display = "block";
} else {
text.style.display = "none";
}
}
$(document).ready(function(){
$('span').click(
function(){
var selectedclass = $(this).attr('class');
$('span').css('background-color', 'white').css('color','black'); // reset
$('span.' + selectedclass).css('background-color', 'red'); //highlighting the select
});
})
</script>
@ -226,19 +229,21 @@ print('</div>')
#ToS text
print('<div class ="paragraph">')
for paragraph in text_list:
tokenized = word_tokenize(paragraph)
tagged = pos_tag(tokenized)
print('<p>')
for word, pos in tagged:
print('<span class="{}">{}</span>'.format(pos, word))
print('</p>')
print('</div>')
# for paragraph in text_list:
tokenized = word_tokenize(text)
tagged = pos_tag(tokenized)
print('<p>')
for word, pos in tagged:
print('<span class="{}">{}</span>'.format(pos, word))
print('</p>')
print('</div>')
#colonial words list
print('<div class="top_words" > <span style="-webkit-text-decoration-line: underline; text-decoration-line: underline;" >colonial words:</span>')
print('<div class="top_words"> <span style="-webkit-text-decoration-line: underline; text-decoration-line: underline;" >colonial words:</span>')
tokens_without_stopwords = nltk.FreqDist(words.lower() for words in tokenized if words.lower() not in all_stopwords)
frequency_word = FreqDist(tokens_without_stopwords)
@ -253,9 +258,6 @@ print('</div>')
#t_wrapper (second wrapper)
print('</div><div class="t_wrapper">')
@ -290,6 +292,7 @@ t_tagged = pos_tag(t_tokenized)
for t_word, t_pos in t_tagged:
print('<span class="{}">{}</span>'.format(t_pos, t_word))
print('<p>')
print('</div>')

Loading…
Cancel
Save