Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus2
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
corpus2
Commits
485a1a43
Commit
485a1a43
authored
13 years ago
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
Corpus2::Sentece wrapper
parent
a20fbd21
Branches
Branches containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
swig/Makefile
+19
-6
19 additions, 6 deletions
swig/Makefile
swig/libcorpussentence.i
+51
-0
51 additions, 0 deletions
swig/libcorpussentence.i
with
70 additions
and
6 deletions
swig/Makefile
+
19
−
6
View file @
485a1a43
...
...
@@ -16,42 +16,48 @@ CPPFLAGS=-fPIC -O2
CBIN
=
libcorpustag.o
\
libcorpustagset.o
\
libcorpustagsetmanager.o
\
libcorpuslexeme.o
libcorpuslexeme.o
\
libcorpussentence.o
CBINOUT
=
_boost_shared_ptr.so
\
_libcorpustag.so
\
_libcorpustagset.so
\
_libcorpustagsetmanager.so
\
_libcorpuslexeme.so
\
_libcorpustoken.so
_libcorpustoken.so
\
_libcorpussentence.so
CWRAP
=
boost_shared_ptr_wrap.cxx
\
libcorpustag_wrap.cxx
\
libcorpustagset_wrap.cxx
\
libcorpustagsetmanager_wrap.cxx
\
libcorpuslexeme_wrap.cxx
\
libcorpustoken_wrap.cxx
libcorpustoken_wrap.cxx
\
libcorpussentence_wrap.cxx
CWRAPBIN
=
boost_shared_ptr_wrap.o
\
libcorpustag_wrap.o
\
libcorpustagset_wrap.o
\
libcorpustagsetmanager_wrap.o
\
libcorpuslexeme_wrap.o
\
libcorpustoken_wrap.o
libcorpustoken_wrap.o
\
libcorpussentence_wrap.o
PYMODULES
=
boost_shared_ptr.py
\
libcorpustag.py
\
libcorpustagset.py
\
libcorpustagsetmanager.py
\
libcorpuslexeme.py
\
libcorpustoken.py
libcorpustoken.py
\
libcorpussentence.py
PYCBIN
=
boost_shared_ptr.pyc
\
libcorpustag.pyc
\
libcorpustagset.pyc
\
libcorpustagsetmanager.pyc
\
libcorpuslexeme.pyc
\
libcorpustoken.pyc
libcorpustoken.pyc
\
libcorpussentence.pyc
# -----------------------------------------------------------------------------
all
:
boost_shared_ptr.o $(CBIN)
...
...
@@ -99,6 +105,13 @@ libcorpuslexeme.o:
$(
CPP
)
-shared
libcorpuslexeme_wrap.o
\
$(
PWRUTILBIN
)
$(
CORPUS2BIN
)
-o
_libcorpuslexeme.so
# Sentence
libcorpussentence.o
:
$(
SWIG
)
$(
SWIGOPTS_LANG
)
libcorpussentence.i
$(
CPP
)
-c
libcorpussentence_wrap.cxx
-I
$(
PYTHONDIR
)
$(
CPPFLAGS
)
$(
CPP
)
-shared
libcorpussentence_wrap.o
\
$(
PWRUTILBIN
)
$(
CORPUS2BIN
)
-o
_libcorpussentence.so
# -----------------------------------------------------------------------------
clean
:
rm
-f
$(
CBIN
)
$(
CBINOUT
)
$(
CWRAP
)
$(
CWRAPBIN
)
$(
PYMODULES
)
$(
PYCBIN
)
This diff is collapsed.
Click to expand it.
swig/libcorpussentence.i
0 → 100644
+
51
−
0
View file @
485a1a43
#
ifndef
SWIG_LIBCORPUS2_SENTENCE_I
#
define
SWIG_LIBCORPUS2_SENTENCE_I
%
module
libcorpussentence
%
{
#include <libcorpus2/sentence.h>
%}
%
include
"
std_string.i
"
%
include
"
libcorpustoken.i
"
%
include
"
boost_shared_ptr.i
"
%
template
(
Ptr
)
boost
::
shared_ptr
<
Corpus2
::
Sentence
>
;
%
template
(
ConstPtr
)
boost
::
shared_ptr
<
const
Corpus2
::
Sentence
>
;
namespace
Corpus2
{
class Sentence {
public:
typedef boost::shared_ptr<Sentence> Ptr;
typedef boost::shared_ptr<const Sentence> ConstPtr;
/* --------------------------------------------------------------------- */
Sentence();
~Sentence();
/* --------------------------------------------------------------------- */
virtual Ptr clone_shared() const;
void release_tokens();
bool empty() const;
size_t size() const;
%rename(GetToken) operator[];
Token* operator[](size_t idx);
%rename(GetConstToken) operator[];
const Token* operator[](size_t idx) const;
const std::vector<Token*>& tokens() const;
std::vector<Token*>& tokens();
virtual void append(Token* t);
const Token* first_token() const;
};
}
using
namespace
std
;
using
namespace
Corpus2
;
#
endif
/* SWIG_LIBCORPUS2_SENTENCE_I */
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