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
wikicolor
Commits
3ebe17b4
Commit
3ebe17b4
authored
Nov 19, 2020
by
Sylvain Coulange
Browse files
complément de doc sur textPhonographer.py
parent
065d4741
Changes
1
Hide whitespace changes
Inline
Side-by-side
colorapp/textPhonographer.py
View file @
3ebe17b4
...
...
@@ -251,6 +251,12 @@ def mimi(mot, lang):
return
result
def
getEntryByWord
(
m
,
mc
,
t
,
tc
,
lang
):
# m = mot (contenu de la barre de recherche "mot"),
# mc = motCond (condition de recherche : contient, est égal à, commence par, finit par),
# t = trans (contenu de la barre de recherche "transcription phonétique"),
# tc = transCond (condition de recherche : contient, est égal à, commence par, finit par),
# lang = langue cible ('fr' ou 'en')
if
lang
==
"fr"
:
word2trans
=
word2transFr
phon2graph
=
phon2graphFr
...
...
@@ -282,7 +288,7 @@ def getEntryByWord(m,mc,t,tc,lang):
tc2
=
r
'$'
for
entree
,
transList
in
word2trans
.
items
():
# if len(result) >= 1000:
# if len(result) >= 1000:
# seulement si besoin de stopper la recherche quand plus de 1000 résultats
# break
if
re
.
match
(
mc1
+
m
+
mc2
,
entree
):
transOK
=
False
...
...
@@ -290,7 +296,7 @@ def getEntryByWord(m,mc,t,tc,lang):
if
re
.
match
(
tc1
+
t
+
tc2
,
trans
.
replace
(
'.'
,
''
)):
transOK
=
True
if
transOK
:
result
[
entree
]
=
transList
return
sorted
(
result
.
items
(),
key
=
lambda
M
:
locale
.
strxfrm
(
M
[
0
]))
#
OrderedDict(sorted(result.items())
)
return
sorted
(
result
.
items
(),
key
=
lambda
M
:
locale
.
strxfrm
(
M
[
0
]))
#
mise dans l'ordre alphabétique français (ex. é après e, et pas après z
)
def
modifEntry
(
user
,
mot
,
newTransList
,
lang
):
if
lang
==
"fr"
:
...
...
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