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