Commit ff1f07d4 authored by Sylvain Coulange's avatar Sylvain Coulange

add mandarin prototype

parent fe2ad659
......@@ -3,6 +3,7 @@ from django.http import JsonResponse
import re, json, spacy
nlpFr = spacy.load('fr_core_news_md')
nlpZh = spacy.load('zh_core_web_md')
def home(request):
return render(request, 'coloriser.html')
......@@ -14,8 +15,8 @@ def runSpacy(request):
if lang == "fr":
nlpText = nlpFr(text)
else:
nlpText = "WHAT LANGUAGE IS THAT?"
elif lang == "zh":
nlpText = nlpZh(text)
outText = []
......
......@@ -11,7 +11,7 @@ async function runSpacy() {
//document.getElementById('loader').style.display = "block";
var inText = document.getElementById('inText').value;
var lang = 'fr' //document.getElementById('choixLang').value;
var lang = document.getElementById('choixLang').value;
// ON EMBALLE TOUT ÇA
var colis = {
......
......@@ -6,6 +6,13 @@ body {
text-align: center;
}
.choixLang {
position: absolute;
top: 15px;
right: 15px;
background-color: white;
}
/* .inText {
color: white;
background-color: black;
......
......@@ -10,6 +10,12 @@
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
</head>
<body>
<div class="choixLang">
<select id="choixLang" onchange="selectLang(this.value)">
<option value="fr">Français</option>
<option value="zh">中文</option>
</select>
</div>
<h1>GrammaColor (proto)</h1>
......
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