Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
b221b57c
Commit
b221b57c
authored
Apr 28, 2011
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
to_string and write_to for TagRuleSequence.
parent
454e3945
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
libwccl/ops/tagrulesequence.cpp
+27
-0
27 additions, 0 deletions
libwccl/ops/tagrulesequence.cpp
libwccl/ops/tagrulesequence.h
+5
-1
5 additions, 1 deletion
libwccl/ops/tagrulesequence.h
with
32 additions
and
1 deletion
libwccl/ops/tagrulesequence.cpp
+
27
−
0
View file @
b221b57c
...
...
@@ -41,4 +41,31 @@ int TagRuleSequence::execute_until_done(const boost::shared_ptr<Corpus2::Sentenc
return
iter_no
;
}
std
::
string
TagRuleSequence
::
to_string
(
const
Corpus2
::
Tagset
&
tagset
)
const
{
std
::
ostringstream
os
;
os
<<
"rules("
;
for
(
size_t
i
=
0
;
i
<
size
();
++
i
)
{
if
(
i
!=
0
)
{
os
<<
",
\n
"
;
}
os
<<
at
(
i
).
to_string
(
tagset
);
}
os
<<
")"
;
return
os
.
str
();
}
std
::
ostream
&
TagRuleSequence
::
write_to
(
std
::
ostream
&
os
)
const
{
os
<<
"rules("
;
for
(
size_t
i
=
0
;
i
<
size
();
++
i
)
{
if
(
i
!=
0
)
{
os
<<
",
\n
"
;
}
os
<<
at
(
i
);
}
os
<<
")"
;
return
os
;
}
}
/* end ns Wccl */
This diff is collapsed.
Click to expand it.
libwccl/ops/tagrulesequence.h
+
5
−
1
View file @
b221b57c
...
...
@@ -11,7 +11,7 @@ namespace Wccl {
* for all positions of a Sentence.
* @note The class methods are not thread-safe
*/
class
TagRuleSequence
:
public
std
::
vector
<
TagRule
>
class
TagRuleSequence
:
public
std
::
vector
<
TagRule
>
,
public
Expression
{
public:
TagRuleSequence
(
std
::
vector
<
TagRule
>
rules
);
...
...
@@ -65,6 +65,10 @@ public:
* @see execute_once() - Executes Rules but only once
*/
int
execute_until_done
(
const
boost
::
shared_ptr
<
Corpus2
::
Sentence
>&
sentence
,
int
max_iter
=
1000
);
std
::
string
to_string
(
const
Corpus2
::
Tagset
&
tagset
)
const
;
protected:
std
::
ostream
&
write_to
(
std
::
ostream
&
os
)
const
;
};
...
...
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