Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wikstraktor
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lex gaMe
wikstraktor
Commits
850941e6
Commit
850941e6
authored
2 years ago
by
Enzo Simonnet
Browse files
Options
Downloads
Patches
Plain Diff
Replace en_en.py
parent
966c7930
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parsers/en_en.py
+24
-12
24 additions, 12 deletions
parsers/en_en.py
with
24 additions
and
12 deletions
parsers/en_en.py
+
24
−
12
View file @
850941e6
...
@@ -41,6 +41,12 @@ class En_en_straktor(Wikstraktor):
...
@@ -41,6 +41,12 @@ class En_en_straktor(Wikstraktor):
global
debugEty
global
debugEty
debugEty
+=
1
debugEty
+=
1
return
"
Etymology
"
+
str
(
debugEty
)
return
"
Etymology
"
+
str
(
debugEty
)
def
process_POS
(
self
,
parsedwikitext
):
pos
=
None
if
parsedwikitext
in
self
.
constants
[
'
POS
'
].
keys
():
pos
=
self
.
constants
[
'
POS
'
][
parsedwikitext
]
return
pos
def
process_senses
(
self
,
entry
,
pos
,
sensesContent
):
def
process_senses
(
self
,
entry
,
pos
,
sensesContent
):
baseId
=
f
"
{
entry
}
_
{
pos
}
_
"
baseId
=
f
"
{
entry
}
_
{
pos
}
_
"
...
@@ -52,32 +58,38 @@ class En_en_straktor(Wikstraktor):
...
@@ -52,32 +58,38 @@ class En_en_straktor(Wikstraktor):
if
l
[
i
].
pattern
==
'
\\
#
'
:
if
l
[
i
].
pattern
==
'
\\
#
'
:
nombreDef
+=
1
nombreDef
+=
1
newSense
=
Sense
(
f
"
{
baseId
}{
nombreDef
}
"
)
newSense
=
Sense
(
f
"
{
baseId
}{
nombreDef
}
"
)
if
len
(
l
[
i
].
templates
)
>
0
:
newSense
.
set_domain
(
l
[
i
].
templates
[
-
1
].
arguments
[
-
1
].
value
)
#We could use the second parameter for a comment
newSense
.
add_def
(
self
.
wiki_language
,
self
.
wtp
.
parse
(
l
[
i
].
items
[
0
]).
plain_text
().
strip
())
newSense
.
add_def
(
self
.
wiki_language
,
self
.
wtp
.
parse
(
l
[
i
].
items
[
0
]).
plain_text
().
strip
())
elif
l
[
i
].
pattern
==
'
\\
#:
'
:
elif
l
[
i
].
pattern
==
'
\\
#:
'
:
for
j
in
l
[
i
].
items
:
for
j
in
l
[
i
].
items
:
if
len
(
self
.
wtp
.
parse
(
j
).
templates
)
>
0
:
k
=
0
newSense
.
add_example
(
self
.
wtp
.
parse
(
j
).
templates
[
0
].
arguments
[
-
1
].
value
)
isEx
=
0
else
:
while
k
<
len
(
self
.
wtp
.
parse
(
j
).
templates
)
and
isEx
==
0
:
if
(
self
.
wtp
.
parse
(
j
).
templates
[
k
].
normal_name
()
in
self
.
constants
[
'
t_ex
'
]):
newSense
.
add_example
(
self
.
wtp
.
parse
(
j
).
templates
[
0
].
arguments
[
-
1
].
value
)
isEx
=
1
k
+=
1
if
isEx
==
0
:
newSense
.
add_example
(
self
.
wtp
.
parse
(
j
).
plain_text
().
strip
())
newSense
.
add_example
(
self
.
wtp
.
parse
(
j
).
plain_text
().
strip
())
if
i
==
len
(
l
)
-
1
or
l
[
i
+
1
].
pattern
==
'
\\
#
'
or
l
[
i
+
1
].
pattern
==
'
\\
##
'
:
if
i
==
len
(
l
)
-
1
or
l
[
i
+
1
].
pattern
==
'
\\
#
'
or
l
[
i
+
1
].
pattern
==
'
\\
##
'
:
senses
.
append
(
newSense
)
senses
.
append
(
newSense
)
cnt
=
0
cnt
=
0
nombreSousDef
=
0
nombreSousDef
=
0
while
l
[
i
].
level
==
3
and
i
<
len
(
l
)
:
while
i
<
len
(
l
)
and
l
[
i
].
level
==
3
:
cnt
+=
1
cnt
+=
1
if
l
[
i
].
pattern
==
'
\\
##
'
:
if
l
[
i
].
pattern
==
'
\\
##
'
:
nombreSousDef
+=
1
nombreSousDef
+=
1
newSense2
=
Sense
(
f
"
{
baseId
}{
nombreDef
}{
nombreSousDef
}
"
)
newSense2
=
Sense
(
f
"
{
baseId
}{
nombreDef
}
_
{
nombreSousDef
}
"
)
if
len
(
l
[
i
].
templates
)
>
0
:
newSense2
.
set_domain
(
l
[
i
].
templates
[
-
1
].
arguments
[
-
1
].
value
)
#We could use the second parameter for a comment
newSense2
.
add_def
(
self
.
wiki_language
,
self
.
wtp
.
parse
(
l
[
i
].
items
[
0
]).
plain_text
().
strip
())
newSense2
.
add_def
(
self
.
wiki_language
,
self
.
wtp
.
parse
(
l
[
i
].
items
[
0
]).
plain_text
().
strip
())
elif
l
[
i
].
pattern
==
'
\\
##:
'
:
elif
l
[
i
].
pattern
==
'
\\
##:
'
:
for
j
in
l
[
i
].
items
:
for
j
in
l
[
i
].
items
:
if
len
(
self
.
wtp
.
parse
(
j
).
templates
)
>
0
:
k
=
0
newSense2
.
add_example
(
self
.
wtp
.
parse
(
j
).
templates
[
0
].
arguments
[
-
1
].
value
)
isEx
=
0
else
:
while
k
<
len
(
self
.
wtp
.
parse
(
j
).
templates
)
and
isEx
==
0
:
if
(
self
.
wtp
.
parse
(
j
).
templates
[
k
].
normal_name
()
in
self
.
constants
[
'
t_ex
'
]):
newSense2
.
add_example
(
self
.
wtp
.
parse
(
j
).
templates
[
0
].
arguments
[
-
1
].
value
)
isEx
=
1
k
+=
1
if
isEx
==
0
:
newSense2
.
add_example
(
self
.
wtp
.
parse
(
j
).
plain_text
().
strip
())
newSense2
.
add_example
(
self
.
wtp
.
parse
(
j
).
plain_text
().
strip
())
if
i
==
len
(
l
)
-
1
or
l
[
i
+
1
].
pattern
==
'
\\
#
'
or
l
[
i
+
1
].
pattern
==
'
\\
##
'
:
if
i
==
len
(
l
)
-
1
or
l
[
i
+
1
].
pattern
==
'
\\
#
'
or
l
[
i
+
1
].
pattern
==
'
\\
##
'
:
senses
.
append
(
newSense2
)
senses
.
append
(
newSense2
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment