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
9ea332d4
Commit
9ea332d4
authored
13 years ago
by
Bartosz Broda
Browse files
Options
Downloads
Patches
Plain Diff
add bool ops simple indexing
parent
97bff541
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libmwereader/mweparser.cpp
+29
-1
29 additions, 1 deletion
libmwereader/mweparser.cpp
libmwereader/mweparser.h
+9
-2
9 additions, 2 deletions
libmwereader/mweparser.h
with
38 additions
and
3 deletions
libmwereader/mweparser.cpp
+
29
−
1
View file @
9ea332d4
...
...
@@ -14,7 +14,32 @@ namespace Corpus2 {
MWEBuilder
::
MWEBuilder
(
const
Tagset
&
tagset
)
:
tagset_
(
tagset
),
parser_
(
tagset
)
{
}
MWEBuilder
::
BoolOpPtr
MWEBuilder
::
get_head_condition
(
const
std
::
string
&
headcond
)
{
return
get_condition
(
headcond
,
head_conditions_
);
}
MWEBuilder
::
BoolOpPtr
MWEBuilder
::
get_mwe_condition
(
const
std
::
string
&
cond
)
{
return
get_condition
(
cond
,
main_conditions_
);
}
MWEBuilder
::
BoolOpPtr
MWEBuilder
::
get_condition
(
const
std
::
string
&
cond
,
value_type
&
where
)
{
value_type
::
iterator
search
=
where
.
find
(
cond
);
if
(
search
!=
where
.
end
())
return
search
->
second
;
BoolOpPtr
op
=
parser_
.
parseBoolOperator
(
cond
);
where
[
cond
]
=
op
;
return
op
;
}
MWEParser
::
MWEParser
(
MWEIndex
&
index
)
...
...
@@ -29,7 +54,10 @@ namespace Corpus2 {
void
MWEParser
::
create_mwe
()
{
MWEBuilder
::
BoolOpPtr
main
=
mwe_builder_
->
get_mwe_condition
(
wccl_operator_
);
MWEBuilder
::
BoolOpPtr
head
=
mwe_builder_
->
get_head_condition
(
head_cond_
);
}
std
::
string
MWEParser
::
get_attribute
(
const
AttributeList
&
attributes
,
...
...
This diff is collapsed.
Click to expand it.
libmwereader/mweparser.h
+
9
−
2
View file @
9ea332d4
...
...
@@ -6,7 +6,7 @@
#include
<boost/unordered_map.hpp>
#include
<libwccl/parser/Parser.h>
#include
<libwccl/ops/operator.h>
#include
"mwe.h"
namespace
Corpus2
{
...
...
@@ -14,11 +14,18 @@ namespace Corpus2 {
class
MWEBuilder
{
public:
typedef
boost
::
shared_ptr
<
Wccl
::
Operator
<
Wccl
::
Bool
>
>
BoolOpPtr
;
MWEBuilder
(
const
Tagset
&
tagset
);
BoolOpPtr
get_head_condition
(
const
std
::
string
&
);
BoolOpPtr
get_mwe_condition
(
const
std
::
string
&
);
private:
typedef
boost
::
unordered_map
<
std
::
string
,
std
::
string
>
value_type
;
typedef
boost
::
unordered_map
<
std
::
string
,
BoolOpPtr
>
value_type
;
BoolOpPtr
get_condition
(
const
std
::
string
&
cond
,
value_type
&
where
);
const
Tagset
&
tagset_
;
/// str -> ptr to ccl operator
...
...
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