Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
f88f97eb
Commit
f88f97eb
authored
14 years ago
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
MatchOperator to act more like a function (FunExecContext).
parent
f886a617
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libwccl/ops/match/matchoperator.cpp
+2
-4
2 additions, 4 deletions
libwccl/ops/match/matchoperator.cpp
libwccl/ops/match/matchoperator.h
+14
-15
14 additions, 15 deletions
libwccl/ops/match/matchoperator.h
with
16 additions
and
19 deletions
libwccl/ops/match/matchoperator.cpp
+
2
−
4
View file @
f88f97eb
...
...
@@ -4,11 +4,9 @@
namespace
Wccl
{
const
char
*
MatchOperator
::
IterationPosVarName
=
"$_"
;
boost
::
shared_ptr
<
MatchVector
>
MatchOperator
::
execute
(
boost
::
shared_ptr
<
Match
>
MatchOperator
::
apply
(
boost
::
shared_ptr
<
Position
>
iter_pos
,
const
Actio
nExecContext
&
context
)
const
const
Fu
nExecContext
&
context
)
const
{
boost
::
shared_ptr
<
MatchVector
>
matches
(
new
MatchVector
());
int
orig_iter_pos
=
iter_pos
->
get_value
();
...
...
This diff is collapsed.
Click to expand it.
libwccl/ops/match/matchoperator.h
+
14
−
15
View file @
f88f97eb
...
...
@@ -12,8 +12,6 @@ namespace Wccl {
class
MatchOperator
:
public
Expression
{
public:
static
const
char
*
IterationPosVarName
;
MatchOperator
(
const
std
::
vector
<
boost
::
shared_ptr
<
const
MatchCondition
>
>&
conditions
)
:
_conditions
(
conditions
)
{
}
...
...
@@ -30,6 +28,20 @@ public:
*/
std
::
string
to_string
(
const
Corpus2
::
Tagset
&
tagset
)
const
;
/**
* Applies the operator to the given context.
* @returns Vector of matches corresponding to match conditions,
* if all conditions were met. In such case position $_ points one position
* ahead of matched tokens.
* Empty MatchVector is returned if any of the conditions was not met.
* In such case Position $_ is advanced by 1.
* @param iter_pos Pointer to the variable $_ from context's Variables
* @param context Execution context - current sentence and Variables to operate on
*/
boost
::
shared_ptr
<
Match
>
apply
(
boost
::
shared_ptr
<
Position
>
iter_pos
,
const
FunExecContext
&
context
)
const
;
protected
:
/**
* Writes string representation of the operator to
...
...
@@ -39,19 +51,6 @@ protected:
*/
std
::
ostream
&
write_to
(
std
::
ostream
&
ostream
)
const
;
/**
* Executes the operator on given context.
* @returns Vector of matches corresponding to match conditions,
* if all conditions were met. In such case position $_ is advanced past matched tokens.
* Empty MatchVector is returned if any of conditions was not met.
* In such case Position $_ is advanced by 1.
* @param iter_pos Pointer to the variable $_ from context's Variables
* @param context Execution context - current sentence and Variables to operate on
*/
boost
::
shared_ptr
<
MatchVector
>
execute
(
boost
::
shared_ptr
<
Position
>
iter_pos
,
const
ActionExecContext
&
context
)
const
;
private
:
const
std
::
vector
<
boost
::
shared_ptr
<
const
MatchCondition
>
>
_conditions
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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