Skip to content

Commit

Permalink
Merge pull request #4 from hammer-code/terserah_brain_update
Browse files Browse the repository at this point in the history
Update Brain And Add Percentage Your Deadly Girlfriend :v
  • Loading branch information
sofyan48 authored Oct 5, 2017
2 parents 4feadee + a13bcb7 commit 05dbaeb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 29 deletions.
15 changes: 13 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,30 @@ def say():
}]

rule =''

if request.method == 'POST':
g_code = request.form['g_code']
g_say = request.form['g_say']
count = 0
n_count = 0
for w_dict in diction:
if w_dict['kode'] == g_code:

for k_dict in w_dict['subject']:
rule = '(\w+) '+k_dict['kata']
print rule
rule = r''+k_dict['kata']
found = re.search(rule,g_say)
if found:
count += 1
else:
n_count += 1
else:
pass
else:
pass
# return redirect(url_for(''))

print count
print n_count
return render_template('say.html')

if __name__ == '__main__':
Expand Down
26 changes: 0 additions & 26 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,8 @@
<link rel="stylesheet" href="{{ url_for('static', filename = 'bootstrap/css/bootstrap.min.css') }}"/>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="">YOU SAY GIRL</a>
</div>

<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">

</ul>
<ul class="nav navbar-nav navbar-right">

</ul>
</div>
</div>
</nav>
<br><br><br>
{% block content %} {% endblock %}
<script src="{{ url_for('static', filename = 'jquery/jquery.min.js') }}"></script>
<script src="{{ url_for('static', filename = 'plugin/popper.min.js') }}"></script>
<script src="{{ url_for('static', filename = 'bootstrap/js/bootstrap.min.js') }}"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion templates/say.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="container">
<div class="row">
<div class="col-md-12">
{{ say }}

</div>
</div>
</div>
Expand Down

0 comments on commit 05dbaeb

Please sign in to comment.