Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon
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
Container Registry
Model registry
Operate
Environments
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
Franck Dary
macaon
Commits
8749d5f3
Commit
8749d5f3
authored
5 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
splitword cannot happen if current form is not empty
parent
5c114f0c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
reading_machine/include/Action.hpp
+1
-1
1 addition, 1 deletion
reading_machine/include/Action.hpp
reading_machine/src/Action.cpp
+3
-3
3 additions, 3 deletions
reading_machine/src/Action.cpp
reading_machine/src/Transition.cpp
+3
-2
3 additions, 2 deletions
reading_machine/src/Transition.cpp
with
7 additions
and
6 deletions
reading_machine/include/Action.hpp
+
1
−
1
View file @
8749d5f3
...
...
@@ -58,7 +58,7 @@ class Action
static
Action
setRoot
();
static
Action
updateIds
();
static
Action
endWord
();
static
Action
assertI
dI
sEmpty
();
static
Action
assertIsEmpty
(
const
std
::
string
&
colName
);
static
Action
attach
(
Object
governorObject
,
int
governorIndex
,
Object
dependentObject
,
int
dependentIndex
);
static
Action
addCurCharToCurWord
();
static
Action
ignoreCurrentCharacter
();
...
...
This diff is collapsed.
Click to expand it.
reading_machine/src/Action.cpp
+
3
−
3
View file @
8749d5f3
...
...
@@ -370,7 +370,7 @@ Action Action::ignoreCurrentCharacter()
return
{
Type
::
MoveChar
,
apply
,
undo
,
appliable
};
}
Action
Action
::
assertI
dI
sEmpty
()
Action
Action
::
assertIsEmpty
(
const
std
::
string
&
colName
)
{
auto
apply
=
[](
Config
&
,
Action
&
)
{
...
...
@@ -380,9 +380,9 @@ Action Action::assertIdIsEmpty()
{
};
auto
appliable
=
[](
const
Config
&
config
,
const
Action
&
)
auto
appliable
=
[
colName
](
const
Config
&
config
,
const
Action
&
)
{
return
util
::
isEmpty
(
config
.
getAsFeature
(
Config
::
idC
olName
,
config
.
getWordIndex
()));
return
util
::
isEmpty
(
config
.
getAsFeature
(
c
olName
,
config
.
getWordIndex
()));
};
return
{
Type
::
Check
,
apply
,
undo
,
appliable
};
...
...
This diff is collapsed.
Click to expand it.
reading_machine/src/Transition.cpp
+
3
−
2
View file @
8749d5f3
...
...
@@ -164,7 +164,7 @@ void Transition::initEndWord()
void
Transition
::
initAddCharToWord
()
{
sequence
.
emplace_back
(
Action
::
assertI
dI
sEmpty
());
sequence
.
emplace_back
(
Action
::
assertIsEmpty
(
Config
::
idColName
));
sequence
.
emplace_back
(
Action
::
addLinesIfNeeded
(
0
));
sequence
.
emplace_back
(
Action
::
addCurCharToCurWord
());
sequence
.
emplace_back
(
Action
::
moveCharacterIndex
(
1
));
...
...
@@ -191,7 +191,8 @@ void Transition::initAddCharToWord()
void
Transition
::
initSplitWord
(
std
::
vector
<
std
::
string
>
words
)
{
auto
&
consumedWord
=
words
[
0
];
sequence
.
emplace_back
(
Action
::
assertIdIsEmpty
());
sequence
.
emplace_back
(
Action
::
assertIsEmpty
(
Config
::
idColName
));
sequence
.
emplace_back
(
Action
::
assertIsEmpty
(
"FORM"
));
sequence
.
emplace_back
(
Action
::
addLinesIfNeeded
(
words
.
size
()));
sequence
.
emplace_back
(
Action
::
consumeCharacterIndex
(
consumedWord
));
for
(
unsigned
int
i
=
0
;
i
<
words
.
size
();
i
++
)
...
...
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