Commit d93bdca0 authored by Sylvain Coulange's avatar Sylvain Coulange

ajout générateur d'exemples

parent 1130aa3c
......@@ -72,4 +72,12 @@ async function runSpacy() {
var outText = document.getElementById('outText');
outText.innerHTML = result;
}
function getExample() {
var lang = document.getElementById('choixLang').value;
var inText = document.getElementById('inText');
inText.value = textExamples[lang];
}
\ No newline at end of file
var textExamples = {
"fr":"L'apprentissage consiste à acquérir ou à modifier une représentation d'un environnement de façon à permettre avec celui-ci des interactions ou des relations efficaces ou de plus en plus efficaces.",
"zh":"在古埃及,中国和所有其他的文明中都留下很多文字。\n在中世纪的末期,因为封建领主想占据法理上的优势,推动了对古代文本的研究。"
}
\ No newline at end of file
......@@ -11,7 +11,6 @@ body {
top: 15px;
right: 15px;
background-color: white;
padding: 4px;
}
/* .inText {
......
......@@ -11,7 +11,7 @@
</head>
<body>
<div class="choixLang">
<select id="choixLang" onchange="selectLang(this.value)">
<select id="choixLang" onchange="selectLang(this.value)" style="height: 35px;">
<option value="fr">Français</option>
<option value="zh">中文</option>
</select>
......@@ -21,6 +21,9 @@
<div class="inputDiv">
<h2>Entrez du texte à analyser :</h2>
<div class="param">
<button onclick="getExample()">Générer un exemple</button>
</div>
<textarea class="inText" id="inText"></textarea>
<button onclick="runSpacy()">Analyser</button>
</div>
......@@ -33,6 +36,7 @@
<script type="text/javascript" src="{% static 'js/colors.js' %}"></script>
<script type="text/javascript" src="{% static 'js/textExamples.js' %}"></script>
<script type="text/javascript" src="{% static 'js/coloriser.js' %}"></script>
</body>
</html>
\ No newline at end of file
{% load static %}
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GrammaColor</title>
<link rel="shortcut icon" type="image/png" href="{% static 'wikicolor.ico' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'styles/styles.css'%}">
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
</head>
<body>
<h1>GrammaColor (proto)</h1>
<h2>Activités</h2>
<div class="divConsigne">
<p>Pointez la phrase que vous entendez</p>
</div>
<script type="text/javascript" src="{% static 'js/colors.js' %}"></script>
<script type="text/javascript" src="{% static 'js/coloriser.js' %}"></script>
</body>
</html>
\ No newline at end of file
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