Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
old_macaon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Franck Dary
old_macaon
Commits
abcc9be5
Commit
abcc9be5
authored
5 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Removed signature
parent
dd1c5a40
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
transition_machine/src/Oracle.cpp
+16
-40
16 additions, 40 deletions
transition_machine/src/Oracle.cpp
with
16 additions
and
40 deletions
transition_machine/src/Oracle.cpp
+
16
−
40
View file @
abcc9be5
...
@@ -360,18 +360,16 @@ void Oracle::createDatabase()
...
@@ -360,18 +360,16 @@ void Oracle::createDatabase()
[](
Config
&
c
,
Oracle
*
)
[](
Config
&
c
,
Oracle
*
)
{
{
if
(
c
.
pastActions
.
size
()
==
0
)
if
(
c
.
pastActions
.
size
()
==
0
)
return
std
::
string
(
"MOVE
signature
0"
);
return
std
::
string
(
"MOVE
tagger
0"
);
std
::
string
previousState
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
first
);
std
::
string
previousState
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
first
);
std
::
string
previousAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
second
.
name
);
std
::
string
previousAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
second
.
name
);
std
::
string
newState
;
std
::
string
newState
;
int
movement
=
0
;
int
movement
=
0
;
if
(
previousState
==
"signature"
)
if
(
previousState
==
"tagger"
||
previousState
==
"error_tagger"
)
newState
=
"tagger"
;
else
if
(
previousState
==
"tagger"
||
previousState
==
"error_tagger"
)
{
{
newState
=
"
signature
"
;
newState
=
"
tagger
"
;
movement
=
1
;
movement
=
1
;
}
}
...
@@ -432,27 +430,17 @@ void Oracle::createDatabase()
...
@@ -432,27 +430,17 @@ void Oracle::createDatabase()
std
::
string
previousState
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
first
);
std
::
string
previousState
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
first
);
std
::
string
previousAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
second
.
name
);
std
::
string
previousAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
second
.
name
);
std
::
string
newState
;
std
::
string
newState
=
"tokenizer"
;
int
movement
=
0
;
int
movement
=
0
;
if
(
previousState
==
"signature
"
)
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"splitword
"
)
{
{
newState
=
"token
ize
r"
;
int
nbSplit
=
util
::
split
(
util
::
split
(
previousAction
,
' '
)[
1
],
'@'
).
s
ize
()
;
movement
=
1
;
movement
=
nbSplit
;
}
}
else
if
(
previousState
==
"tokenizer"
)
else
if
(
previousAction
==
"endword"
)
{
movement
=
1
;
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"splitword"
||
util
::
split
(
previousAction
,
' '
)[
0
]
==
"endword"
)
newState
=
"signature"
;
else
newState
=
"tokenizer"
;
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"splitword"
)
{
int
nbSplit
=
util
::
split
(
util
::
split
(
previousAction
,
' '
)[
1
],
'@'
).
size
();
movement
=
nbSplit
-
1
;
}
}
return
"MOVE "
+
newState
+
" "
+
std
::
to_string
(
movement
);
return
"MOVE "
+
newState
+
" "
+
std
::
to_string
(
movement
);
},
},
[](
Config
&
,
Oracle
*
,
const
std
::
string
&
)
[](
Config
&
,
Oracle
*
,
const
std
::
string
&
)
...
@@ -474,12 +462,10 @@ void Oracle::createDatabase()
...
@@ -474,12 +462,10 @@ void Oracle::createDatabase()
std
::
string
newState
;
std
::
string
newState
;
int
movement
=
0
;
int
movement
=
0
;
if
(
previousState
==
"signature"
)
if
(
previousState
==
"tokenizer"
)
newState
=
"tagger"
;
else
if
(
previousState
==
"tokenizer"
)
{
{
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"splitword"
||
util
::
split
(
previousAction
,
' '
)[
0
]
==
"endword"
)
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"splitword"
||
util
::
split
(
previousAction
,
' '
)[
0
]
==
"endword"
)
newState
=
"
signature
"
;
newState
=
"
tagger
"
;
else
else
newState
=
"tokenizer"
;
newState
=
"tokenizer"
;
...
@@ -506,23 +492,18 @@ void Oracle::createDatabase()
...
@@ -506,23 +492,18 @@ void Oracle::createDatabase()
[](
Config
&
c
,
Oracle
*
)
[](
Config
&
c
,
Oracle
*
)
{
{
if
(
c
.
pastActions
.
size
()
==
0
)
if
(
c
.
pastActions
.
size
()
==
0
)
return
std
::
string
(
"MOVE
signature
0"
);
return
std
::
string
(
"MOVE
parser
0"
);
std
::
string
previousState
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
first
);
std
::
string
previousState
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
first
);
std
::
string
previousAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
second
.
name
);
std
::
string
previousAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
second
.
name
);
std
::
string
newState
;
std
::
string
newState
;
int
movement
=
0
;
int
movement
=
0
;
if
(
previousState
==
"signature"
)
if
(
previousState
==
"parser"
)
newState
=
"parser"
;
else
if
(
previousState
==
"parser"
)
{
{
newState
=
"parser"
;
newState
=
"parser"
;
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"shift"
||
util
::
split
(
previousAction
,
' '
)[
0
]
==
"right"
)
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"shift"
||
util
::
split
(
previousAction
,
' '
)[
0
]
==
"right"
)
{
movement
=
1
;
movement
=
1
;
newState
=
"signature"
;
}
if
(
movement
>
0
&&
c
.
endOfTapes
())
if
(
movement
>
0
&&
c
.
endOfTapes
())
movement
=
0
;
movement
=
0
;
...
@@ -535,10 +516,7 @@ void Oracle::createDatabase()
...
@@ -535,10 +516,7 @@ void Oracle::createDatabase()
newState
=
"parser"
;
newState
=
"parser"
;
std
::
string
previousParserAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
1
).
second
.
name
);
std
::
string
previousParserAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
1
).
second
.
name
);
if
(
util
::
split
(
previousParserAction
,
' '
)[
0
]
==
"shift"
||
util
::
split
(
previousParserAction
,
' '
)[
0
]
==
"right"
)
if
(
util
::
split
(
previousParserAction
,
' '
)[
0
]
==
"shift"
||
util
::
split
(
previousParserAction
,
' '
)[
0
]
==
"right"
)
{
newState
=
"signature"
;
movement
=
1
;
movement
=
1
;
}
}
}
return
"MOVE "
+
newState
+
" "
+
std
::
to_string
(
movement
);
return
"MOVE "
+
newState
+
" "
+
std
::
to_string
(
movement
);
...
@@ -555,16 +533,14 @@ void Oracle::createDatabase()
...
@@ -555,16 +533,14 @@ void Oracle::createDatabase()
[](
Config
&
c
,
Oracle
*
)
[](
Config
&
c
,
Oracle
*
)
{
{
if
(
c
.
pastActions
.
size
()
==
0
)
if
(
c
.
pastActions
.
size
()
==
0
)
return
std
::
string
(
"MOVE
signature
0"
);
return
std
::
string
(
"MOVE
tagger
0"
);
std
::
string
previousState
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
first
);
std
::
string
previousState
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
first
);
std
::
string
previousAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
second
.
name
);
std
::
string
previousAction
=
util
::
noAccentLower
(
c
.
pastActions
.
getElem
(
0
).
second
.
name
);
std
::
string
newState
;
std
::
string
newState
;
int
movement
=
0
;
int
movement
=
0
;
if
(
previousState
==
"signature"
)
if
(
previousState
==
"tagger"
)
newState
=
"tagger"
;
else
if
(
previousState
==
"tagger"
)
newState
=
"morpho"
;
newState
=
"morpho"
;
else
if
(
previousState
==
"morpho"
)
else
if
(
previousState
==
"morpho"
)
newState
=
"lemmatizer_lookup"
;
newState
=
"lemmatizer_lookup"
;
...
@@ -583,7 +559,7 @@ void Oracle::createDatabase()
...
@@ -583,7 +559,7 @@ void Oracle::createDatabase()
{
{
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"shift"
||
util
::
split
(
previousAction
,
' '
)[
0
]
==
"right"
)
if
(
util
::
split
(
previousAction
,
' '
)[
0
]
==
"shift"
||
util
::
split
(
previousAction
,
' '
)[
0
]
==
"right"
)
{
{
newState
=
"
signature
"
;
newState
=
"
tagger
"
;
if
(
c
.
endOfTapes
())
if
(
c
.
endOfTapes
())
newState
=
"parser"
;
newState
=
"parser"
;
movement
=
1
;
movement
=
1
;
...
...
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