Skip to content
GitLab
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
PhonoDrop
Commits
5ff56aea
Commit
5ff56aea
authored
Jan 30, 2022
by
Sylvain Coulange
🌼
Browse files
ajout yuan /a/, yan /e/ dans sinosyllabes2api.js
parent
2e4732c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
public/scripts/sinosyllabe.js
View file @
5ff56aea
...
...
@@ -27,7 +27,7 @@ function makeSyll(code) {
if
(
code
==
100
)
[
initiale
,
glide
,
tonale
,
finale
]
=
[
0
,
2
,
0
,
0
]
if
(
code
==
101
)
[
initiale
,
glide
,
tonale
,
finale
]
=
[
0
,
3
,
0
,
3
]
//
console.log(code, initiale,glide,tonale,finale)
console
.
log
(
code
,
initiale
,
glide
,
tonale
,
finale
)
document
.
getElementById
(
'
initiale
'
).
classList
.
remove
(
"
_1
"
,
"
_2
"
,
"
_3
"
,
"
_4
"
)
document
.
getElementById
(
'
glide
'
).
classList
.
remove
(
"
_1
"
,
"
_2
"
,
"
_3
"
,
"
_4
"
)
document
.
getElementById
(
'
tonale
'
).
classList
.
remove
(
"
_1
"
,
"
_2
"
,
"
_3
"
,
"
_4
"
)
...
...
@@ -70,7 +70,7 @@ function togglePart(part) {
currentTone
=
0
function
toggleTone
(
nb
)
{
if
(
nb
==
currentTone
||
nb
==
5
)
{
//
console.log("Réinitialisation du ton")
console
.
log
(
"
Réinitialisation du ton
"
)
// réinitialisation si clique sur ton déjà actif
currentTone
=
0
document
.
getElementById
(
'
ton1
'
).
style
.
display
=
"
none
"
...
...
@@ -129,7 +129,7 @@ function toggleTone(nb) {
document
.
getElementById
(
'
ton8
'
).
style
.
display
=
"
none
"
}
}
//
console.log("Ton:", currentTone)
console
.
log
(
"
Ton:
"
,
currentTone
)
}
let
listinitiales
=
[
...
...
@@ -215,7 +215,7 @@ var possibleOutputs = {} // pour le pinyin : pour chaque pinyin potentiel → <s
function
zhPhon
(
identifiant
)
{
let
phon
=
identifiant
.
replace
(
'
rect_
'
,
'
phon_
'
).
replace
(
'
-t
'
,
''
).
replace
(
'
-f
'
,
''
)
if
(
gradientToRight
.
includes
(
phon
))
{
phon
=
phon
+
'
-h
'
}
// gradients à l'horizontal pour affriquées
//
console.log("zhPhon",identifiant, phon)
console
.
log
(
"
zhPhon
"
,
identifiant
,
phon
)
if
(
listinitiales
.
includes
(
identifiant
))
{
if
(
document
.
getElementById
(
'
initiale
'
).
classList
.
contains
(
phon
))
{
...
...
@@ -290,11 +290,11 @@ function zhPhon(identifiant) {
// ÉCRITURE PINYIN
var
currentSyllonAPI
=
document
.
getElementById
(
'
pinyinLabAPI
'
).
innerText
;
//
console.log('Current syll:',currentSyllonAPI,possibleCurrentSyll);
console
.
log
(
'
Current syll:
'
,
currentSyllonAPI
,
possibleCurrentSyll
);
phon
=
phon
.
replace
(
'
-h
'
,
''
)
var
phonApi
=
phon2api
[
phon
];
//
console.log('PINYIN:',phon,phonApi);
console
.
log
(
'
PINYIN:
'
,
phon
,
phonApi
);
// syllabe API attestée ?
...
...
@@ -305,7 +305,7 @@ function zhPhon(identifiant) {
possibleSyllonApi2pinyin
[
x
]
=
syllonAPI2pinyin
[
x
];
}
}
//
console.log("Syllons API possibles:",possibleSyllonApi2pinyin);
console
.
log
(
"
Syllons API possibles:
"
,
possibleSyllonApi2pinyin
);
document
.
getElementById
(
'
pinyinLabAPI
'
).
innerHTML
+=
phonApi
;
var
pinyinLab
=
document
.
getElementById
(
'
pinyinLabAPI
'
).
innerHTML
;
...
...
@@ -350,7 +350,7 @@ function zhPhon(identifiant) {
xph
++
;
}
//
console.log("pp=",ph);
console
.
log
(
"
pp=
"
,
ph
);
for
(
xpi
in
api2pinyin
[
ph
])
{
// pour chaque graphie pi possible pour cet api
...
...
@@ -366,11 +366,11 @@ function zhPhon(identifiant) {
if
(
booboo
)
{
// Cas du yu/yuan/yue, ne pas prendre la première graphie si yuan/yue
if
(
pi
==
"
y
"
&&
[
"
ɥɛn
"
,
"
ɥɛ
"
].
includes
(
pinyinLab
))
{
if
(
pi
==
"
y
"
&&
[
"
ɥɛn
"
,
"
ɥɛ
"
,
"
ɥan
"
,
"
ɥa
"
].
includes
(
pinyinLab
))
{
continue
;
}
else
{
var
tonale
=
""
;
//
console.log(ph);
console
.
log
(
ph
);
if
(
tonalesApi
.
includes
(
ph
))
tonale
=
"
tonale
"
;
pinyinEnCoursHtml
+=
"
<span class='
"
+
api2class
[
ph
]
+
tonale
+
"
'>
"
+
pi
+
"
</span>
"
;
pinyinEnCours
+=
pi
;
...
...
@@ -426,26 +426,26 @@ function recupTone(identifiant) {
var
inPin
=
document
.
getElementById
(
'
pinyinLab
'
).
innerText
;
var
inSyll
=
inPin
+
myton
;
if
(
Object
.
keys
(
syllons
).
includes
(
inSyll
))
{
//
console.log("Syllon attesté !")
console
.
log
(
"
Syllon attesté !
"
)
var
nods
=
document
.
getElementById
(
'
pinyinLab
'
).
childNodes
nods
.
forEach
((
nod
)
=>
{
if
([
"
a
"
,
"
e
"
,
"
i
"
,
"
o
"
,
"
u
"
,
"
ü
"
,
"
er
"
,
"
yu
"
,
"
wu
"
,
"
yi
"
].
includes
(
nod
.
innerText
)
&&
nod
.
classList
.
contains
(
'
tonale
'
))
{
var
thisVoy
=
nod
.
innerText
;
//
console.log("TONALE!",thisVoy)
console
.
log
(
"
TONALE!
"
,
thisVoy
)
nod
.
innerText
=
nod
.
innerText
.
replace
(
thisVoy
,
tons
[
myton
][
thisVoy
])
}
})
document
.
getElementById
(
'
pinyinLabAPI
'
).
innerHTML
+=
myton
;
document
.
getElementById
(
'
pinyinLab
'
).
classList
.
add
(
"
pinyinAtteste
"
);
}
else
{
//
console.log("Syllon non attesté.");
console
.
log
(
"
Syllon non attesté.
"
);
document
.
getElementById
(
'
pinyinLab
'
).
classList
.
remove
(
"
pinyinAtteste
"
);
}
}
function
rmPart
(
thisEl
,
syllid
)
{
if
(
thisEl
.
classList
.
contains
(
"
actif
"
))
{
//
console.log("rm", syllid, currentSyll[syllid].rect)
console
.
log
(
"
rm
"
,
syllid
,
currentSyll
[
syllid
].
rect
)
zhPhon
(
currentSyll
[
syllid
].
rect
)
}
}
...
...
public/scripts/syllonAPI2pinyin.js
View file @
5ff56aea
...
...
@@ -517,6 +517,7 @@ let syllonAPI2pinyin = {
"
jaw
"
:
"
yao
"
,
"
je
"
:
"
ye
"
,
"
jɛ
"
:
"
ye
"
,
"
jɛn
"
:
"
yan
"
,
"
i
"
:
"
yi
"
,
"
ji
"
:
"
yi
"
,
"
jin
"
:
"
yin
"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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