-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
87 lines (71 loc) · 2.42 KB
/
Copy pathmain.py
File metadata and controls
87 lines (71 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
from flask import Flask, render_template, request, redirect
from frekans import count_words
from anahtar import key_words
from benzerlik import benzerlik_orani
from indexleme import indexle_sirala
from semantic_es import indexle_sirala1
app = Flask(__name__)
app.debug = True
@app.route('/')
def home():
return render_template("index.html")
@app.route('/frekans_hesaplama', methods=['GET', 'POST'])
def frekans_hesaplama():
web = None
if request.method == 'POST':
web = request.form['url']
web = count_words(web)
print(web)
return render_template("frekans_hesaplama.html", web=web)
@app.route("/anahtar_kelime", methods=['GET', 'POST'])
def anahtar_kelime():
web = None
if request.method == 'POST':
web = request.form['url']
web = key_words(web)
print(web)
return render_template("anahtar_kelime.html", web=web)
@app.route("/benzerlik_skorlamasi", methods=['GET', 'POST'])
def benzerlik_skorlamasi():
web1 = None
web2 = None
key1 = None
key2 = None
oran = None
if request.method == 'POST':
web1 = request.form['url1']
web2 = request.form['url2']
key1 = key_words(web1)
key2 = key_words(web2)
oran = benzerlik_orani(key1, key2)
return render_template("benzerlik_skorlamasi.html", oran=oran, key1=key1, key2=key2)
@app.route("/indexleme_siralama", methods=['GET', 'POST'])
def indexleme_siralama():
ana_url = None
kume_url = None
html_text = None
if request.method == 'POST':
ana_url = request.form['url']
kume_url = request.form['urlqueue']
try:
html_text = indexle_sirala(ana_url, kume_url)
html_text = html_text.split('\n')
except:
html_text = "VERİLEN SAYFALARLA İŞLEM YAPILAMIYOR"
return render_template("indexleme_siralama.html", html_text=html_text)
@app.route("/semantik_analiz", methods=['GET', 'POST'])
def semantik_analiz():
ana_url = None
kume_url = None
html_text = None
if request.method == 'POST':
ana_url = request.form['url']
kume_url = request.form['urlqueue']
try:
html_text = indexle_sirala1(ana_url, kume_url)
html_text = html_text.split('\n')
except:
html_text = "VERİLEN SAYFALARLA İŞLEM YAPILAMIYOR"
return render_template("semantik_analiz.html", html_text=html_text)
if __name__ == "__main__":
app.run()