Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus2
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
corpus2
Commits
b0f6246a
Commit
b0f6246a
authored
Apr 27, 2011
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
Wrapper for Corpus2::TokenWriter
parent
2855f14f
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
swig/Makefile
+19
-6
19 additions, 6 deletions
swig/Makefile
swig/libcorpustokenwriter.i
+57
-0
57 additions, 0 deletions
swig/libcorpustokenwriter.i
with
76 additions
and
6 deletions
swig/Makefile
+
19
−
6
View file @
b0f6246a
...
...
@@ -18,7 +18,8 @@ CBIN=libcorpustag.o \
libcorpustagsetmanager.o
\
libcorpuslexeme.o
\
libcorpussentence.o
\
libcorpuschunk.o
libcorpuschunk.o
\
libcorpustokenwriter.o
CBINOUT
=
_boost_shared_ptr.so
\
_libcorpustag.so
\
...
...
@@ -27,7 +28,8 @@ CBINOUT=_boost_shared_ptr.so \
_libcorpuslexeme.so
\
_libcorpustoken.so
\
_libcorpussentence.so
\
_libcorpuschunk.so
_libcorpuschunk.so
\
_libcorpustokenwriter.so
CWRAP
=
boost_shared_ptr_wrap.cxx
\
libcorpustag_wrap.cxx
\
...
...
@@ -36,7 +38,8 @@ CWRAP=boost_shared_ptr_wrap.cxx \
libcorpuslexeme_wrap.cxx
\
libcorpustoken_wrap.cxx
\
libcorpussentence_wrap.cxx
\
libcorpuschunk_wrap.cxx
libcorpuschunk_wrap.cxx
\
libcorpustokenwriter_wrap.cxx
CWRAPBIN
=
boost_shared_ptr_wrap.o
\
libcorpustag_wrap.o
\
...
...
@@ -45,7 +48,8 @@ CWRAPBIN=boost_shared_ptr_wrap.o \
libcorpuslexeme_wrap.o
\
libcorpustoken_wrap.o
\
libcorpussentence_wrap.o
\
libcorpuschunk_wrap.o
libcorpuschunk_wrap.o
\
libcorpustokenwriter_wrap.o
PYMODULES
=
boost_shared_ptr.py
\
libcorpustag.py
\
...
...
@@ -54,7 +58,8 @@ PYMODULES=boost_shared_ptr.py \
libcorpuslexeme.py
\
libcorpustoken.py
\
libcorpussentence.py
\
libcorpuschunk.py
libcorpuschunk.py
\
libcorpustokenwriter.py
PYCBIN
=
boost_shared_ptr.pyc
\
libcorpustag.pyc
\
...
...
@@ -63,7 +68,8 @@ PYCBIN=boost_shared_ptr.pyc \
libcorpuslexeme.pyc
\
libcorpustoken.pyc
\
libcorpussentence.pyc
\
libcorpuschunk.pyc
libcorpuschunk.pyc
\
libcorpustokenwriter.pyc
# -----------------------------------------------------------------------------
all
:
boost_shared_ptr.o $(CBIN)
...
...
@@ -125,6 +131,13 @@ libcorpussentence.o:
$(
CPP
)
-shared
libcorpussentence_wrap.o
\
$(
PWRUTILBIN
)
$(
CORPUS2BIN
)
-o
_libcorpussentence.so
# TokenWriter
libcorpustokenwriter.o
:
$(
SWIG
)
$(
SWIGOPTS_LANG
)
libcorpustokenwriter.i
$(
CPP
)
-c
libcorpustokenwriter_wrap.cxx
-I
$(
PYTHONDIR
)
$(
CPPFLAGS
)
$(
CPP
)
-shared
libcorpustokenwriter_wrap.o
\
$(
PWRUTILBIN
)
$(
CORPUS2BIN
)
-o
_libcorpustokenwriter.so
# -----------------------------------------------------------------------------
clean
:
rm
-f
$(
CBIN
)
$(
CBINOUT
)
$(
CWRAP
)
$(
CWRAPBIN
)
$(
PYMODULES
)
$(
PYCBIN
)
This diff is collapsed.
Click to expand it.
swig/libcorpustokenwriter.i
0 → 100644
+
57
−
0
View file @
b0f6246a
#
ifndef
SWIG_LIBCORPUS2_TOKENWRITER_I
#
define
SWIG_LIBCORPUS2_TOKENWRITER_I
%
module
libcorpustokenwriter
%
{
#include <libcorpus2/io/writer.h>
%}
%
include
"
libcorpustag.i
"
%
include
"
libcorpustoken.i
"
%
include
"
libcorpuschunk.i
"
%
include
"
libcorpustagset.i
"
%
include
"
libcorpussentence.i
"
%
include
"
std_string.i
"
%
include
"
boost_shared_ptr.i
"
%
nodefaultctor
Corpus2
::
TokenWriter
;
%
template
(
TokenWriterPtr
)
boost
::
shared_ptr
<
Corpus2
::
TokenWriter
>
;
namespace
Corpus2
{
class TokenWriter {
public:
typedef boost::shared_ptr<TokenWriter> TokenWriterPtr;
/* --------------------------------------------------------------------- */
TokenWriter();
// TokenWriter(std::ostream& os, const Tagset& tagset, const string_range_vector& params);
~TokenWriter();
/* --------------------------------------------------------------------- */
virtual void write_token(const Token& t) = 0;
void write_token_dispose(Token* t);
virtual void write_sentence(const Sentence& s) = 0;
virtual void write_chunk(const Chunk& p) = 0;
/* --------------------------------------------------------------------- */
// std::ostream& os();
const Tagset& tagset();
void finish();
/* --------------------------------------------------------------------- */
static TokenWriterPtr create_stream_writer(
const std::string& class_id_params,
std::ostream& os, const Tagset&
tagset);
static TokenWriterPtr create_path_writer(
const std::string& class_id_params,
const std::string& path,
const Tagset& tagset);
};
}
using
namespace
std
;
using
namespace
Corpus2
;
#
endif
/* SWIG_LIBCORPUS2_TOKENWRITER_I */
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