Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
interface
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container 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
homeostasis
interface
Commits
21e2463b
Commit
21e2463b
authored
10 years ago
by
Benoit Favre
Browse files
Options
Downloads
Patches
Plain Diff
add new xml; fix bug in validation
parent
add1e4fa
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README
+4
-3
4 additions, 3 deletions
README
data/homeostasis_9fevr.xml
+635
-0
635 additions, 0 deletions
data/homeostasis_9fevr.xml
validate.py
+9
-5
9 additions, 5 deletions
validate.py
with
648 additions
and
8 deletions
README
+
4
−
3
View file @
21e2463b
...
...
@@ -47,10 +47,11 @@ DONE add thread for slu
DONE remove section changer UI
DONE change xml view to reflect already performed actions, already recognized text
DONE add global keybindings (1-9 for sections, y/n)...
DONE events = click action or words to resynchronize ?
add slu model selector
add UI to edit phonetizations
events = click action or words to resynchronize ?
click line = synchronize to that line
click action = synchronize to the next line
insert timer in main ui, use it for logger
add logger
move slu to asr
...
...
This diff is collapsed.
Click to expand it.
data/homeostasis_9fevr.xml
0 → 100644
+
635
−
0
View file @
21e2463b
This diff is collapsed.
Click to expand it.
validate.py
+
9
−
5
View file @
21e2463b
...
...
@@ -15,10 +15,10 @@ class VerifyException(Exception):
return
str
(
self
)
def
is_int
(
text
):
return
re
.
match
(
r
'
^\d+$
'
,
text
)
return
text
!=
None
and
re
.
match
(
r
'
^\d+$
'
,
text
)
def
has_blank
(
text
):
return
re
.
search
(
r
'
\s
'
,
text
)
return
text
!=
None
and
re
.
search
(
r
'
\s
'
,
text
)
def
verify_keyword
(
node
):
global
seen_actions
,
warnings
...
...
@@ -64,9 +64,9 @@ def verify_section(node):
if
has_blank
(
node
.
get
(
'
action
'
)):
raise
VerifyException
(
'
spaces not allowed in action
"
%s
"'
%
node
.
get
(
'
action
'
),
node
)
if
not
is_int
(
node
.
get
(
'
id
'
)):
raise
VerifyException
(
'
only integers allowed for section id
"
%s
"'
%
node
.
get
(
'
id
'
))
raise
VerifyException
(
'
only integers allowed for section id
"
%s
"'
%
node
.
get
(
'
id
'
)
,
node
)
if
node
.
get
(
'
id
'
)
in
seen_section_ids
:
raise
VerifyException
(
'
repeated section id
"
%s
"'
%
node
.
get
(
'
id
'
))
raise
VerifyException
(
'
repeated section id
"
%s
"'
%
node
.
get
(
'
id
'
)
,
node
)
seen_section_ids
[
node
.
get
(
'
id
'
)]
=
True
for
child
in
node
:
if
child
.
tag
==
'
sequence
'
:
...
...
@@ -119,7 +119,11 @@ def validate_xml(filename):
except
Exception
as
e
:
if
len
(
warnings
)
>
0
:
warnings
.
append
(
'
--------------
'
)
return
(
False
,
'
\n
'
.
join
(
warnings
)
+
'
\n
'
+
str
(
e
))
if
isinstance
(
e
,
VerifyException
):
return
(
False
,
'
\n
'
.
join
(
warnings
)
+
'
\n
'
+
str
(
e
))
else
:
import
traceback
,
sys
return
(
False
,
'
\n
'
.
join
(
warnings
)
+
'
\n
'
+
traceback
.
format_exc
(
e
))
if
len
(
warnings
)
>
0
:
warnings
.
append
(
'
--------------
'
)
return
(
True
,
'
\n
'
.
join
(
warnings
)
+
'
\n
successfuly validated
"
%s
"
\n
found %d sections, %d types of action
'
%
(
filename
,
len
(
seen_section_ids
),
len
(
seen_actions
)))
...
...
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