Commit e954b1c7 by Yolanda Nainggolan

Final Project

parent b3b033bf
......@@ -2,7 +2,7 @@
<DOC>
<DOCNO> 1 </DOCNO>
<RANK> 1 </RANK>
<SONG> Woly Bully </SONG>
<SONG> Woly Bully 1998 </SONG>
<ARTIST> Sam the Sham and the Pharaohs </ARTIST>
<YEAR> 1965 </YEAR>
<LYRICS> Sam the sham miscellaneous wooly bully wooly bully sam the sham the pharaohs domingo samudio uno dos one two tres quatro matty told hatty about a thing she saw had two big horns and a wooly jaw wooly bully wooly bully wooly bully wooly bully wooly bully hatty told matty lets dont take no chance lets not belseven come and learn to dance wooly bully wooly bully wooly bully wooly bully wooly bully matty told hatty thats the thing to do get you someone really to pull the wool with you wooly bully wooly bully wooly bully wooly bully wooly bully lseven the letter l and the number 7 when typed they form a rough square l7 so the lyrics mean lets not be square </LYRICS>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -45,12 +45,17 @@ def show_dataframe(parse_data):
for i in range(0, len(nomornya)):
nomornya[i] = int(nomornya[i])
lagunya = [sublist[0] for sublist in nilai]
artisnya = [sublist[1] for sublist in nilai]
#artisnya = [sublist[1] for sublist in nilai]
liriknya = [sublist[2] for sublist in nilai]
context = {"DOCNO": nomornya, "SONG": lagunya, "ARTIST": artisnya, "LYRICS": liriknya}
res = {}
for key in lagunya:
for value in liriknya:
res[key] = value
liriknya.remove(value)
break
return context
return res
##############N_DOC########################
def data_var(tree):
......@@ -208,14 +213,8 @@ def proximity(dcmnt_xml, query):
tokens_doc[i] = to_lower(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = stop_word_token(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = ([w for w in tokens_doc[i] if not any(j.isdigit() for j in w)])
for i in range(N_DOC):
tokens_doc[i] = stemming(tokens_doc[i])
all_tokens =[]
for i in range(N_DOC):
for j in tokens_doc[i]:
......@@ -343,14 +342,8 @@ def phrase(dcmnt_xml, query):
tokens_doc[i] = to_lower(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = stop_word_token(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = ([w for w in tokens_doc[i] if not any(j.isdigit() for j in w)])
for i in range(N_DOC):
tokens_doc[i] = stemming(tokens_doc[i])
all_tokens =[]
for i in range(N_DOC):
for j in tokens_doc[i]:
......
......@@ -32,12 +32,14 @@
<center><p style="font-size:40px;"><strong>Data</strong></p>
<table>
<tr>
<th>LYRICS</th>
<th>Title</th>
<th>Lyric</th>
</tr>
{% for i in LYRICS %}
{% for key, values in res.items %}
<tr>
<td>{{ i }}</td>
<td>{{ key }}</td>
<td>{{ values }}</td>
</tr>
{% endfor %}
</table>
......@@ -60,6 +62,21 @@
function pageRedirect_next() {
window.location.href = "/preprocessing";
}
var tables = document.getElementsByTagName('table');
var table = tables[tables.length - 1];
var rows = table.rows;
for(var i = 0, td; i < rows.length; i++){
td = document.createElement('td');
if(i == 0){
td.appendChild(document.createTextNode("DocNo"));
}
else{
td.appendChild(document.createTextNode(i));
}
rows[i].insertBefore(td, rows[i].firstChild);
}
</script>
</html>
......@@ -19,7 +19,7 @@
<main>
<div id="content">
<article class="card">
<center><h1>Pilih Metode Searching</h1><br>
<center><br>
<table>
<tr>
<td><button onclick="data()"class="button" style="vertical-align:middle"><span> Mulai </span></button></td>
......
......@@ -27,7 +27,7 @@
<nav class="navbar navbar-light bg-light static-top">
<div class="container">
<a class="navbar-brand" href="/">Search Simulator</a>
<a class="navbar-brand" href="/search">Search Simulator</a>
</div>
</nav>
......
......@@ -29,7 +29,7 @@
</div>
</div>
<center><p style="font-size:40px;"><strong>Text Preprocessing - 3</strong></p>
<p><strong>After Stopwords Removal</strong></p><br></center>
<p><strong>After Numbers Removal</strong></p><br></center>
<table style="width:100%">
<tr>
<th>All tokens for each document</th>
......@@ -57,7 +57,7 @@
}
function pageRedirect_next() {
window.location.href = "/preprocessing4";
window.location.href = "/search";
}
</script>
......
......@@ -26,7 +26,7 @@
<body>
<nav class="navbar navbar-light bg-light static-top">
<div class="container">
<a class="navbar-brand" href="/">Search Simulator</a>
<a class="navbar-brand" href="/search">Search Simulator</a>
</div>
</nav>
......
......@@ -36,7 +36,7 @@
<script>
function pageRedirect_prev() {
window.location.href = "/preproseccing4";
window.location.href = "/preprocessing3";
}
function proximity() {
......
......@@ -24,7 +24,11 @@ def home(request):
def dataframe(request):
parse_data = et.parse("InvertedIndexSimulator/data/dataset_STBI.xml")
context = main.show_dataframe(parse_data)
res = main.show_dataframe(parse_data)
context = {
"res": res
}
return render(request, 'apps/dataframe.html', context)
......@@ -75,9 +79,6 @@ def preprocessing3(request):
tokens_doc[i] = main.to_lower(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = main.stop_word_token(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = ([w for w in tokens_doc[i] if not any(j.isdigit() for j in w)])
context = {
......@@ -99,9 +100,6 @@ def preprocessing4(request):
tokens_doc[i] = main.to_lower(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = main.stop_word_token(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = ([w for w in tokens_doc[i] if not any(j.isdigit() for j in w)])
for i in range(N_DOC):
......@@ -125,14 +123,11 @@ def indexing(request):
tokens_doc.append(main.remove_punc_tokenize(all_sentence_doc_sample[i]))
for i in range(N_DOC):
tokens_doc[i] = main.stop_word_token(tokens_doc[i])
tokens_doc[i] = main.to_lower(tokens_doc[i])
for i in range(N_DOC):
tokens_doc[i] = ([w for w in tokens_doc[i] if not any(j.isdigit() for j in w)])
for i in range(N_DOC):
tokens_doc[i] = main.stemming(tokens_doc[i])
res = main.indexing(N_DOC, tokens_doc, all_doc_no)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment