paragraphs

master
Castro0o 5 years ago
parent a8ea89ace4
commit f9aac615b7

@ -0,0 +1,20 @@
from nltk import word_tokenize, pos_tag
# faceapp_file = open('faceapp.txt','r')
with open('tos_file/faceapp.txt', 'r') as faceapp_file:
faceapp_text = faceapp_file.read()
faceapp_text_list = faceapp_text.split("\n\n")
for paragraph in faceapp_text_list:
tokenized = word_tokenize(paragraph)
tagged = pos_tag(tokenized)
print('<p>')
for word, pos in tagged:
print('<span class="{}">{}</span>'.format(
pos.replace('.', 'DOT'), word))
print('</p>')
print('</div>')

File diff suppressed because one or more lines are too long

@ -284,65 +284,43 @@ print('''<!DOCTYPE html>
<body>
<script>
$(document).ready(function() {
if ($('.TO, .DT, .IN, .WDT, .WP, .MD, .PRP, .CC').click(
$('.TO, .DT, .IN, .WDT, .WP, .MD, .PRP, .CC').click(
function() {
$('.TO, .DT, .IN, .WDT, .WP, .MD, .PRP, .CC').toggleClass('hide'); // reset
}));
})
});
$(document).ready(function() {
if ($('.JJ').click(
$('.JJ').click(
function() {
$('.JJ').toggleClass('adjective'); // reset
}));
})
});
$(document).ready(function() {
if ($('.NN, .NNS').click(
$('.NN, .NNS').click(
function() {
$('.NN, .NNS').toggleClass('noun'); // reset
}));
})
});
$(document).ready(function() {
if ($('.NNP, .NNPS').click(
$('.NNP, .NNPS').click(
function() {
$('.NNP, .NNPS').toggleClass('propernoun'); // reset
}));
})
});
$(document).ready(function() {
if ($('.RB').click(
$('.RB').click(
function() {
$('.RB').toggleClass('adverb'); // reset
}));
})
});
$(document).ready(function() {
if ($('.RBR, .JJR').click(
$('.RBR, .JJR').click(
function() {
$('.RBR, .JJR').toggleClass('adverb-comparative'); // reset
}));
})
});
$(document).ready(function() {
if ($('.RBS').click(
$('.RBS').click(
function() {
$('.RBS').toggleClass('adverb-superlative'); // reset
}));
});
})
</script>
''')
</script>''')
# $('div.t_chosen_words_{0}').mouseover(function(){
@ -380,26 +358,27 @@ print('</div></div>')
print('<div class ="paragraph">')
# for paragraph in faceapp_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 faceapp_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>')
#faceapp_text
tokenized = word_tokenize(faceapp_text)
tagged = pos_tag(tokenized)
print('<p>')
for word, pos in tagged:
print('<span class="{}">{}</span>'.format(pos, word))
print('</p>')
print('</div>')
# #faceapp_text
# tokenized = word_tokenize(faceapp_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"><div class="top_words_title" style="-webkit-text-decoration-line: underline; text-decoration-line: underline;" >colonial words:</div>')

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save