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
97bff541
Commit
97bff541
authored
Jun 11, 2011
by
Bartosz Broda
Browse files
Options
Downloads
Patches
Plain Diff
add antrl dependencies in tester
parent
44625c67
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
libmwereader/CMakeLists.txt
+4
-2
4 additions, 2 deletions
libmwereader/CMakeLists.txt
libmwereader/mweparser.cpp
+13
-4
13 additions, 4 deletions
libmwereader/mweparser.cpp
libmwereader/mweparser.h
+9
-1
9 additions, 1 deletion
libmwereader/mweparser.h
with
26 additions
and
7 deletions
libmwereader/CMakeLists.txt
+
4
−
2
View file @
97bff541
...
...
@@ -25,13 +25,15 @@ include_directories(${LibXML++_INCLUDE_DIRS})
link_directories
(
${
LibXML++_LIBRARY_DIRS
}
)
set
(
LIBS
${
LIBS
}
${
LibXML++_LIBRARIES
}
)
set
(
LIBS
${
LIBS
}
corpus2 wccl
)
add_library
(
corpus2_mwereader SHARED mwereader.cpp mwe.cpp mweparser.cpp
)
target_link_libraries
(
corpus2_mwereader
corpus2
)
target_link_libraries
(
corpus2_mwereader
${
LIBS
}
)
add_executable
(
mwertest mwertest.cpp mweparser.cpp
)
target_link_libraries
(
mwertest corpus2_mwereader
${
LIBS
}
)
target_link_libraries
(
mwertest corpus2_mwereader
${
LIBS
}
antlr
)
set_target_properties
(
corpus2_mwereader PROPERTIES
VERSION
"
${
libmwereader_major
}
.
${
libmwereader_minor
}
"
...
...
This diff is collapsed.
Click to expand it.
libmwereader/mweparser.cpp
+
13
−
4
View file @
97bff541
...
...
@@ -3,6 +3,7 @@
#include
<libpwrutils/foreach.h>
#include
<libcorpus2/tagsetmanager.h>
#include
<libxml++/libxml++.h>
#include
<libxml2/libxml/parser.h>
#include
<boost/make_shared.hpp>
...
...
@@ -11,7 +12,7 @@
namespace
Corpus2
{
MWEBuilder
::
MWEBuilder
(
const
Tagset
&
tagset
)
:
tagset_
(
tagset
)
:
tagset_
(
tagset
)
,
parser_
(
tagset
)
{
}
...
...
@@ -21,6 +22,16 @@ namespace Corpus2 {
{
}
MWEParser
::~
MWEParser
()
{
// TODO: something to do?
}
void
MWEParser
::
create_mwe
()
{
}
std
::
string
MWEParser
::
get_attribute
(
const
AttributeList
&
attributes
,
const
std
::
string
&
name
)
const
{
...
...
@@ -96,9 +107,7 @@ namespace Corpus2 {
state_
=
MWEGROUP
;
}
else
if
(
state_
==
MWE
&&
name
==
"MWE"
){
state_
=
INSTANCES
;
// TODO: tworzenie jednostki
print_current_mwe
(
true
);
create_mwe
();
}
else
if
(
state_
==
VAR
&&
name
==
"var"
){
state_
=
MWE
;
variables_
[
var_name_
]
=
finish_get_text
();
...
...
This diff is collapsed.
Click to expand it.
libmwereader/mweparser.h
+
9
−
1
View file @
97bff541
...
...
@@ -5,6 +5,8 @@
#include
<libcorpus2/io/sax.h>
#include
<boost/unordered_map.hpp>
#include
<libwccl/parser/Parser.h>
#include
"mwe.h"
namespace
Corpus2
{
...
...
@@ -13,23 +15,29 @@ class MWEBuilder
{
public:
MWEBuilder
(
const
Tagset
&
tagset
);
typedef
boost
::
unordered_map
<
std
::
string
,
std
::
string
>
value_type
;
private:
typedef
boost
::
unordered_map
<
std
::
string
,
std
::
string
>
value_type
;
const
Tagset
&
tagset_
;
/// str -> ptr to ccl operator
value_type
main_conditions_
;
/// str -> ptr to ccl operator
value_type
head_conditions_
;
Wccl
::
Parser
parser_
;
};
class
MWEParser
:
public
BasicSaxParser
{
public:
MWEParser
(
MWEIndex
&
index
);
~
MWEParser
();
protected:
void
create_mwe
();
typedef
std
::
map
<
std
::
string
,
std
::
string
>
str_map
;
void
on_start_element
(
const
Glib
::
ustring
&
name
,
const
AttributeList
&
attributes
);
...
...
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