Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GrammaColor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pédagogies Multimodales
GrammaColor
Commits
fe2ad659
Commit
fe2ad659
authored
Aug 27, 2020
by
Sylvain Coulange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mise à jour souligné pour ADP_DET + styles codés en dur pour copier-coller
parent
09a269ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
4 deletions
+28
-4
grammacolor/__pycache__/settings.cpython-36.pyc
grammacolor/__pycache__/settings.cpython-36.pyc
+0
-0
static/js/coloriser.js
static/js/coloriser.js
+28
-4
No files found.
grammacolor/__pycache__/settings.cpython-36.pyc
View file @
fe2ad659
No preview for this file type
static/js/coloriser.js
View file @
fe2ad659
...
...
@@ -29,20 +29,44 @@ async function runSpacy() {
body
:
JSON
.
stringify
(
colis
)
};
//
ENVOI
//
REQUÊTAGE SERVEUR
const
response
=
await
fetch
(
'
/runSpacy/
'
,
options
)
console
.
log
(
'
En attente de réponse...
'
);
const
data
=
await
response
.
json
();
console
.
log
(
data
);
// AFFICHAGE DU RÉSULTAT
var
result
=
""
;
var
stylesCommuns
=
"
font-family: Palatino, Times, Calibri; font-size: 35pt; font-weight: bold; background-color: black;
"
;
var
stylesUnderline
=
"
text-decoration: underline; text-decoration-thickness: 6px;
"
;
for
(
i
=
0
;
i
<
data
.
outText
.
length
;
i
++
)
{
if
(
pos
[
data
.
outText
[
i
].
pos
].
color
==
''
)
col
=
"
#ccc
"
;
else
col
=
pos
[
data
.
outText
[
i
].
pos
].
color
;
// saut de ligne
if
(
data
.
outText
[
i
].
text
==
"
\n
"
)
result
=
result
+
"
<br>
"
;
else
if
(
data
.
outText
[
i
].
text
==
"
"
)
result
=
result
+
"
<span> </span>
"
;
else
result
=
result
+
'
<span style="color:
'
+
col
+
'
" title="
'
+
data
.
outText
[
i
].
tag
+
'
">
'
+
data
.
outText
[
i
].
text
+
'
</span>
'
;
// espace
else
if
(
data
.
outText
[
i
].
text
==
"
"
)
result
=
result
+
"
<span style='
"
+
stylesCommuns
+
"
'> </span>
"
;
// bicolores → soulignage
else
if
(
data
.
outText
[
i
].
pos
==
"
DET
"
&&
data
.
outText
[
i
].
tag
.
slice
(
0
,
7
)
==
"
ADP_DET
"
)
{
result
=
result
+
'
<span style="color:
'
+
col
+
'
;
'
+
stylesCommuns
+
stylesUnderline
+
'
text-decoration-color:
'
+
pos
[
"
ADP
"
].
color
+
'
" title="
'
+
data
.
outText
[
i
].
tag
+
'
">
'
+
data
.
outText
[
i
].
text
+
'
</span>
'
;
}
// tout le reste
else
result
=
result
+
'
<span style="color:
'
+
col
+
'
;
'
+
stylesCommuns
+
'
" title="
'
+
data
.
outText
[
i
].
tag
+
'
">
'
+
data
.
outText
[
i
].
text
+
'
</span>
'
;
}
var
outText
=
document
.
getElementById
(
'
outText
'
);
...
...
Write
Preview
Markdown
is supported
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