Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
news
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sartika Aritonang
news
Commits
9e8210f4
Commit
9e8210f4
authored
May 28, 2020
by
Sartika Aritonang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload File
parent
5cb996bb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
views.py
project/news_site/views.py
+51
-0
No files found.
project/news_site/views.py
0 → 100644
View file @
9e8210f4
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
news_site.proximity
import
proximity
# Create your views here.
# def index(request):
# return HttpResponse("Hello, world. You're at the polls index.")
def
home
(
request
):
return
render
(
request
,
'index.html'
)
def
result
(
request
):
return
render
(
request
,
'result.html'
)
def
simulator_data
(
request
):
return
render
(
request
,
'simulator_data.html'
)
def
simulator_kueri
(
request
):
return
render
(
request
,
'simulator_kueri.html'
)
def
result_next
(
request
):
return
render
(
request
,
'resutl_next.html'
)
def
result
(
request
):
global
content
if
request
.
method
==
'POST'
:
query
=
request
.
POST
[
'querysearch'
]
proximitys
=
proximity
.
results
(
query
)
content
=
{
'proximitys'
:
proximitys
,
'query'
:
query
}
return
render
(
request
,
'result.html'
,
content
)
def
result_next
(
request
):
content
return
render
(
request
,
'result_next.html'
,
content
)
def
simulator_data
(
request
):
read_xml
=
proximity
.
parse_xml
()
tokenize
=
proximity
.
get_token
(
read_xml
)
stopword_removal
=
proximity
.
stopwordRemove
(
tokenize
)
number_removal
=
proximity
.
numberRemove
(
stopword_removal
)
stemming
=
proximity
.
stemming
(
number_removal
)
#indexing = proximity.createIndex(read_xml, stemming)
indexing
=
proximity
.
open_indexing
()
contents
=
{
'read_xml'
:
read_xml
,
'tokenize'
:
tokenize
,
'stopword_removal'
:
stopword_removal
,
'number_removal'
:
number_removal
,
'stemming'
:
stemming
,
'indexing'
:
indexing
}
return
render
(
request
,
'simulator_data.html'
,
contents
)
def
simulator_kueri
(
request
):
content
return
render
(
request
,
'simulator_kueri.html'
,
content
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment