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
eb4f0d8e
Commit
eb4f0d8e
authored
13 years ago
by
Paweł Kędzia
Browse files
Options
Downloads
Patches
Plain Diff
Wrapper for Corpus2::Tagset
parent
2de71d7b
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/libcorpustagset.i
+82
-0
82 additions, 0 deletions
swig/libcorpustagset.i
with
101 additions
and
6 deletions
swig/Makefile
+
19
−
6
View file @
eb4f0d8e
...
...
@@ -13,22 +13,28 @@ ANTLRLIB=/usr/lib/libantlr-pic.a
CPPFLAGS
=
-fPIC
-O2
CBIN
=
libcorpustag.o
CBIN
=
libcorpustag.o
\
libcorpustagset.o
CBINOUT
=
_boost_shared_ptr.so
\
_libcorpustag.so
_libcorpustag.so
\
_libcorpustagset.so
CWRAP
=
boost_shared_ptr_wrap.cxx
\
libcorpustag_wrap.cxx
libcorpustag_wrap.cxx
\
libcorpustagset_wrap.cxx
CWRAPBIN
=
boost_shared_ptr_wrap.o
\
libcorpustag_wrap.o
libcorpustag_wrap.o
\
libcorpustagset_wrap.o
PYMODULES
=
boost_shared_ptr.py
\
libcorpustag.py
libcorpustag.py
\
libcorpustagset.py
PYCBIN
=
boost_shared_ptr.pyc
\
libcorpustag.pyc
libcorpustag.pyc
\
libcorpustagset.pyc
# -----------------------------------------------------------------------------
all
:
boost_shared_ptr.o $(CBIN)
...
...
@@ -55,6 +61,13 @@ libcorpustag.o:
$(
CPP
)
-shared
libcorpustag_wrap.o
\
$(
PWRUTILBIN
)
$(
CORPUS2BIN
)
-o
_libcorpustag.so
# Tagset
libcorpustagset.o
:
$(
SWIG
)
$(
SWIGOPTS_LANG
)
libcorpustagset.i
$(
CPP
)
-c
libcorpustagset_wrap.cxx
-I
$(
PYTHONDIR
)
$(
CPPFLAGS
)
$(
CPP
)
-shared
libcorpustagset_wrap.o
\
$(
PWRUTILBIN
)
$(
CORPUS2BIN
)
-o
_libcorpustagset.so
# -----------------------------------------------------------------------------
clean
:
rm
-f
$(
CBIN
)
$(
CBINOUT
)
$(
CWRAP
)
$(
CWRAPBIN
)
$(
PYMODULES
)
$(
PYCBIN
)
This diff is collapsed.
Click to expand it.
swig/libcorpustagset.i
0 → 100644
+
82
−
0
View file @
eb4f0d8e
#
ifndef
SWIG_LIBCORPUS2_TAGSET_I
#
define
SWIG_LIBCORPUS2_TAGSET_I
%
module
libcorpustagset
%
{
#include <libcorpus2/tagset.h>
%}
%
include
"
libcorpustag.i
"
%
include
"
std_string.i
"
%
include
"
std_vector.i
"
%
feature
(
"
notabstract
"
)
Corpus2
::
Tagset
;
namespace
Corpus2
{
class Tagset {
public:
enum ParseMode {
ParseCheckRequired = 1,
ParseAllowExtra = 2,
ParseCheckSingular = 4,
ParseDefault = ParseCheckRequired,
ParseRequiredWithExtra = ParseCheckRequired | ParseAllowExtra,
ParseStrict = ParseCheckRequired | ParseCheckSingular,
ParseLoose = ParseAllowExtra
};
Tagset();
static Tagset from_data(const char*);
/* --------------------------------------------------------------------- */
Tag parse_symbol(const std::string& s) const;
Tag parse_symbol_string(const std::string& s) const;
/* --------------------------------------------------------------------- */
std::vector<Tag> parse_tag(const char* c, ParseMode m = ParseDefault) const;
Tag parse_simple_tag(const char* c, ParseMode mode = ParseDefault) const;
Tag make_ign_tag() const;
/* --------------------------------------------------------------------- */
std::string tag_to_string(const Tag& tag) const;
std::string tag_to_no_opt_string(const Tag &tag) const;
/* --------------------------------------------------------------------- */
std::vector<std::string> tag_to_symbol_string_vector(const Tag& tag, bool
compress_attribites = true) const;
std::string tag_to_symbol_string(const Tag& tag,
bool compress_attribites = true) const;
/* --------------------------------------------------------------------- */
size_t tag_size(const Tag& tag) const;
bool tag_is_singular(const Tag& tag) const;
/* --------------------------------------------------------------------- */
std::vector<Tag> split_tag(const Tag& tag) const;
/* --------------------------------------------------------------------- */
int pos_count() const;
int attribute_count() const;
int value_count() const;
size_t size() const;
double size_extra() const;
/* --------------------------------------------------------------------- */
std::string name() const;
void set_name(const std::string& name);
std::string id_string() const;
std::string id_string(const Tag& tag) const;
};
}
using
namespace
std
;
using
namespace
Corpus2
;
#
endif
/* SWIG_LIBCORPUS2_TAGSET_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