Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Pédagogies Multimodales
GrammaColor
Commits
ff1f07d4
Commit
ff1f07d4
authored
Aug 27, 2020
by
Sylvain Coulange
Browse files
add mandarin prototype
parent
fe2ad659
Changes
5
Hide whitespace changes
Inline
Side-by-side
grammacolorapp/__pycache__/views.cpython-36.pyc
View file @
ff1f07d4
No preview for this file type
grammacolorapp/views.py
View file @
ff1f07d4
...
...
@@ -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
)
el
se
:
nlpText
=
"WHAT LANGUAGE IS THAT?"
el
if
lang
==
"zh"
:
nlpText
=
nlpZh
(
text
)
outText
=
[]
...
...
static/js/coloriser.js
View file @
ff1f07d4
...
...
@@ -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
=
{
...
...
static/styles/styles.css
View file @
ff1f07d4
...
...
@@ -6,6 +6,13 @@ body {
text-align
:
center
;
}
.choixLang
{
position
:
absolute
;
top
:
15px
;
right
:
15px
;
background-color
:
white
;
}
/* .inText {
color: white;
background-color: black;
...
...
templates/coloriser.html
View file @
ff1f07d4
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
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