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
637e84d9
Commit
637e84d9
authored
Nov 16, 2010
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
PositionRef is not a Value anymore.
parent
a500f182
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
libwccl/ops/equals.h
+0
-54
0 additions, 54 deletions
libwccl/ops/equals.h
libwccl/values/positionref.cpp
+0
-1
0 additions, 1 deletion
libwccl/values/positionref.cpp
libwccl/values/positionref.h
+1
-2
1 addition, 2 deletions
libwccl/values/positionref.h
with
1 addition
and
57 deletions
libwccl/ops/equals.h
+
0
−
54
View file @
637e84d9
...
...
@@ -112,60 +112,6 @@ protected:
}
};
/**
* Predicate that checks for equality of PositionRefs, given sentence context
*/
template
<
>
class
Equals
<
PositionRef
>
:
public
Predicate
{
public:
typedef
boost
::
shared_ptr
<
Function
<
PositionRef
>
>
ArgFunctionPtr
;
Equals
(
const
ArgFunctionPtr
&
arg1_expr
,
const
ArgFunctionPtr
&
arg2_expr
)
:
arg1_expr_
(
arg1_expr
),
arg2_expr_
(
arg2_expr
)
{
BOOST_ASSERT
(
arg1_expr_
);
BOOST_ASSERT
(
arg2_expr_
);
}
virtual
std
::
string
to_string
(
const
Corpus2
::
Tagset
&
tagset
)
const
{
return
BinaryFunctionFormatter
::
to_string
(
tagset
,
*
this
,
*
arg1_expr_
,
*
arg2_expr_
);
}
virtual
std
::
string
to_raw_string
()
const
{
return
BinaryFunctionFormatter
::
to_raw_string
(
*
this
,
*
arg1_expr_
,
*
arg2_expr_
);
}
virtual
const
std
::
string
raw_operator_name
()
const
{
return
"equals"
;
}
protected
:
const
ArgFunctionPtr
arg1_expr_
;
const
ArgFunctionPtr
arg2_expr_
;
typedef
FunctionBase
::
BaseRetValPtr
BaseRetValPtr
;
/**
* Take values of arguments from expressions and return True if they are equal,
* False otherwise.
*/
virtual
BaseRetValPtr
apply_internal
(
const
SentenceContext
&
context
)
const
{
boost
::
shared_ptr
<
PositionRef
>
arg1
=
this
->
arg1_expr_
->
apply
(
context
);
boost
::
shared_ptr
<
PositionRef
>
arg2
=
this
->
arg2_expr_
->
apply
(
context
);
if
(
arg1
->
equals
(
*
arg2
))
{
return
Predicate
::
True
->
apply
(
context
);
}
else
{
//in the given context both position refs can still point nowhere
//even if they have different underlying value
int
abs_pos1
=
context
.
get_abs_position
(
*
arg1
);
int
abs_pos2
=
context
.
get_abs_position
(
*
arg2
);
if
(
!
context
.
is_inside
(
abs_pos1
)
&&
!
context
.
is_inside
(
abs_pos2
))
{
return
Predicate
::
True
->
apply
(
context
);
}
}
return
Predicate
::
False
->
apply
(
context
);
}
};
}
/* end ns Wccl */
#endif // LIBWCCL_OPS_EQUALS_H
This diff is collapsed.
Click to expand it.
libwccl/values/positionref.cpp
+
0
−
1
View file @
637e84d9
...
...
@@ -3,7 +3,6 @@
namespace
Wccl
{
const
char
*
PositionRef
::
type_name
=
"PositionRef"
;
std
::
string
PositionRef
::
to_raw_string
()
const
{
...
...
This diff is collapsed.
Click to expand it.
libwccl/values/positionref.h
+
1
−
2
View file @
637e84d9
...
...
@@ -6,10 +6,9 @@
namespace
Wccl
{
class
PositionRef
:
public
Value
class
PositionRef
{
public:
WCCL_VALUE_PREAMBLE
explicit
PositionRef
(
const
boost
::
shared_ptr
<
Position
>&
base
,
int
offset
=
0
)
...
...
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