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
a0dc7768
Commit
a0dc7768
authored
2 years ago
by
Mathieu Loiseau
Browse files
Options
Downloads
Patches
Plain Diff
Subdef's examples
parent
29e6f6ae
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
wikstraktor.py
+4
-7
4 additions, 7 deletions
wikstraktor.py
with
4 additions
and
7 deletions
wikstraktor.py
+
4
−
7
View file @
a0dc7768
...
...
@@ -599,24 +599,21 @@ class Wikstraktor:
pattern_ex
=
self
.
constants
[
'
sense_pattern
'
][
0
][
"
add_subdef
"
]
+
self
.
constants
[
'
sense_pattern
'
][
0
][
"
ex
"
]
#Process examples
a
=
0
#print(sub_items)# DEBUG:
for
item_list
in
sub_items
:
# print(a, item_list.pattern, 'vs', pattern_ex)# DEBUG:
if
item_list
.
pattern
==
pattern_ex
:
for
item
in
item_list
.
items
:
newSense
.
add_example
(
self
.
process_example
(
item
))
#Si on veut traiter les sous items (ex traductions), on peut utiliser
#item_list.sublists(a)
# print(a, item_list.pattern, 'vs', pattern_subdef, item_list.items, len(item_list.sublists()))# DEBUG:
# print(item_list.sublists(a))# DEBUG:
if
def_level
and
item_list
.
pattern
==
pattern_subdef
:
b
=
0
for
item
in
item_list
.
items
:
try
:
sub_sub
=
item_list
.
sublists
(
a
)
sub_sub
=
item_list
.
sublists
(
b
)
except
IndexError
as
err
:
sub_sub
=
[]
#
print(
sub_sub, item_list.sublists()
)
print
(
f
"
There is an error in the selection of subitems:
\n\t
{
b
}
th item of
\n\t
{
itm_list
.
sublists
()
}
\n
triggered
{
err
}
"
)
newSense
.
add_subsense
(
self
.
process_definition
(
item
,
sub_sub
,
False
))
b
+=
1
a
+=
1
return
newSense
...
...
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