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
f4144bc6
Commit
f4144bc6
authored
Aug 28, 2020
by
Sylvain Coulange
Browse files
ajout bicolore pour pronoms adverbiaux
parent
b0547d2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
static/js/coloriser.js
View file @
f4144bc6
...
...
@@ -52,6 +52,7 @@ async function runSpacy() {
else
if
(
data
.
outText
[
i
].
text
==
"
"
)
result
=
result
+
"
<span style='
"
+
stylesCommuns
+
"
'> </span>
"
;
// bicolores → soulignage
// déterminants prépositionnels (du des...)
else
if
(
data
.
outText
[
i
].
tag
.
slice
(
0
,
7
)
==
"
ADP_DET
"
)
{
result
=
result
+
'
<span style="color:
'
+
pos
[
"
DET
"
].
color
+
'
;
'
...
...
@@ -61,6 +62,16 @@ async function runSpacy() {
+
'
">
'
+
data
.
outText
[
i
].
text
+
'
</span>
'
;
}
// pronoms adverbiaux (en et y)
else
if
(
data
.
outText
[
i
].
text
.
lower
()
==
"
en
"
||
data
.
outText
[
i
].
text
.
lower
()
==
"
y
"
&&
data
.
outText
[
i
].
pos
==
"
PRON
"
)
{
result
=
result
+
'
<span style="color:
'
+
pos
[
"
PRON
"
].
color
+
'
;
'
+
stylesCommuns
+
stylesUnderline
+
'
text-decoration-color:
'
+
pos
[
"
ADV
"
].
color
+
'
" title="
'
+
data
.
outText
[
i
].
tag
+
'
">
'
+
data
.
outText
[
i
].
text
+
'
</span>
'
;
}
// tout le reste
else
result
=
result
+
'
<span style="color:
'
+
col
+
'
;
'
...
...
static/js/colors.js
View file @
f4144bc6
...
...
@@ -8,7 +8,7 @@ pos = {
"
DET
"
:
{
"
color
"
:
"
#f3eb20
"
,
"
nom
"
:
""
,
"
forme
"
:
""
},
"
INTJ
"
:
{
"
color
"
:
"
#8a9092
"
,
"
nom
"
:
""
,
"
forme
"
:
""
},
"
NOUN
"
:
{
"
color
"
:
"
#980086
"
,
"
nom
"
:
""
,
"
forme
"
:
""
},
"
NUM
"
:
{
"
color
"
:
""
,
"
nom
"
:
""
,
"
forme
"
:
""
},
"
NUM
"
:
{
"
color
"
:
"
#f3eb20
"
,
"
nom
"
:
""
,
"
forme
"
:
""
},
"
PART
"
:
{
"
color
"
:
""
,
"
nom
"
:
""
,
"
forme
"
:
""
},
"
PRON
"
:
{
"
color
"
:
"
#a56026
"
,
"
nom
"
:
""
,
"
forme
"
:
""
},
"
PROPN
"
:
{
"
color
"
:
"
#a56026
"
,
"
nom
"
:
""
,
"
forme
"
:
""
},
...
...
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