readme file test

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

Loading…
Cancel
Save