From 690035d2f6ff4cda0bef3a4b45f2e96332a2f7b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <pawel.kedzia@pwr.wroc.pl> Date: Wed, 4 May 2011 10:22:57 +0200 Subject: [PATCH] Removed corpus2 wrappers from wccl wrappers (wccl includes corpus2 wrappers from /usr/share/swig1.3/libcorpus) --- swig/libcorpuslexeme.i | 43 ------------------- swig/libcorpussentence.i | 46 -------------------- swig/libcorpustag.i | 58 ------------------------- swig/libcorpustagset.i | 81 ----------------------------------- swig/libcorpustagsetmanager.i | 31 -------------- swig/libcorpustoken.i | 54 ----------------------- 6 files changed, 313 deletions(-) delete mode 100644 swig/libcorpuslexeme.i delete mode 100644 swig/libcorpussentence.i delete mode 100644 swig/libcorpustag.i delete mode 100644 swig/libcorpustagset.i delete mode 100644 swig/libcorpustagsetmanager.i delete mode 100644 swig/libcorpustoken.i diff --git a/swig/libcorpuslexeme.i b/swig/libcorpuslexeme.i deleted file mode 100644 index 8575536..0000000 --- a/swig/libcorpuslexeme.i +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef SWIG_LIBCORPUS2_LEXEME_I -#define SWIG_LIBCORPUS2_LEXEME_I - -%module libcorpuslexeme -%{ - #include <unicode/unistr.h> - #include <libcorpus2/lexeme.h> -%} - -%include "libcorpustag.i" - -%include "std_string.i" -%include "std_vector.i" - -%feature("notabstract") Corpus2::Lexeme; - -%rename(__op_eq__) Corpus2::Lexeme::operator==(const Lexeme& other) const; -%rename(__op_lw__) Corpus2::Lexeme::operator<(const Lexeme& other) const; - -namespace Corpus2 { - class Lexeme { - public: - Lexeme(); - Lexeme(const UnicodeString& lemma, const Tag& tag); - - static Lexeme create(const UnicodeString& lemma, const Tag& tag); - const UnicodeString& lemma() const; - void set_lemma(const UnicodeString& l); - const std::string lemma_utf8() const; - const Tag& tag() const; - void set_tag(const Tag& tag); - bool is_null() const; - void set_disamb(bool value); - bool is_disamb() const; - bool operator<(const Lexeme& other) const; - bool operator==(const Lexeme& other) const; - }; -} - -using namespace std; -using namespace Corpus2; - -#endif /* SWIG_LIBCORPUS2_LEXEME_I */ diff --git a/swig/libcorpussentence.i b/swig/libcorpussentence.i deleted file mode 100644 index 89f3c0a..0000000 --- a/swig/libcorpussentence.i +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef SWIG_LIBCORPUS2_SENTENCE_I -#define SWIG_LIBCORPUS2_SENTENCE_I - -%module libcorpussentence -%{ - #include <libcorpus2/sentence.h> -%} - -%include "libcorpustoken.i" - -%include "std_string.i" -%include "std_vector.i" - -%include "boost_shared_ptr.i" - -%feature("notabstract") Corpus2::Sentence; - -%rename(__op_get__) Corpus2::Sentence::operator[](size_t idx) const; - -namespace Corpus2 { - class Sentence { - public: - Sentence(); - virtual ~Sentence(); - - virtual boost::shared_ptr<Sentence> clone_shared() const; - - void release_tokens(); - bool empty() const; - size_t size() const; - Token* operator[](size_t idx); - const std::vector<Token*>& tokens() const; - std::vector<Token*>& tokens(); - virtual void append(Token* t); - const Token* first_token() const; - - }; -} - -%template(SentenceSharedPtr) boost::shared_ptr<Corpus2::Sentence>; - -using namespace boost; -using namespace std; -using namespace Corpus2; - -#endif /* SWIG_LIBCORPUS2_SENTENCE_I */ diff --git a/swig/libcorpustag.i b/swig/libcorpustag.i deleted file mode 100644 index 0197662..0000000 --- a/swig/libcorpustag.i +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef SWIG_LIBCORPUS2_TAG_I -#define SWIG_LIBCORPUS2_TAG_I - -%module libcorpustag -%{ - #include <libcorpus2/tag.h> - #include <boost/cstdint.hpp> -%} - -%include "std_string.i" -%include "std_vector.i" - -/* Typedefs */ -%inline %{ - typedef std::bitset<64> mask_t; -%} - -%feature("notabstract") Corpus2::Tag; - -%rename(__op_eq__) Corpus2::Tag::operator==(const Tag& other) const; -%rename(__op_lw__) Corpus2::Tag::operator<(const Tag& other) const; - -namespace Corpus2 { - class Tag { - public: - Tag(); - explicit Tag(mask_t pos); - Tag(mask_t pos, mask_t values); - - /* --------------------------------------------------------------------- */ - ~Tag(); - - /* --------------------------------------------------------------------- */ - bool is_null() const; - int pos_count() const; - int get_pos_index() const; - - mask_t get_values() const; - mask_t get_pos() const; - - Tag& combine_with(const Tag& other); - Tag get_combined(const Tag& other) const; - Tag& mask_with(const Tag& other); - Tag get_masked(const Tag& other); - - std::string raw_dump() const; - bool operator<(const Tag& other) const; - bool operator==(const Tag& other) const; - }; - - size_t hash_value(const Tag &tag); -} - -using namespace std; -using namespace Corpus2; - - -#endif /* SWIG_LIBCORPUS2_TAG_I */ diff --git a/swig/libcorpustagset.i b/swig/libcorpustagset.i deleted file mode 100644 index daae5be..0000000 --- a/swig/libcorpustagset.i +++ /dev/null @@ -1,81 +0,0 @@ -#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, /// Check for presence of required attributes - ParseAllowExtra = 2, /// Allow extra attributes - ParseCheckSingular = 4, /// Check tag singularity - - ParseDefault = ParseCheckRequired, /// Default mode - ParseRequiredWithExtra = ParseCheckRequired | ParseAllowExtra, - ParseStrict = ParseCheckRequired | ParseCheckSingular, - ParseLoose = ParseAllowExtra - }; - - Tagset(); - static Tagset from_data(const char*); - - /* --------------------------------------------------------------------- */ - Tag parse_symbol(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 */ diff --git a/swig/libcorpustagsetmanager.i b/swig/libcorpustagsetmanager.i deleted file mode 100644 index 07dcbbe..0000000 --- a/swig/libcorpustagsetmanager.i +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef SWIG_LIBCORPUS2_TAGSETMANAGER_I -#define SWIG_LIBCORPUS2_TAGSETMANAGER_I - -%module libcorpustagsetmanager -%{ - #include <libcorpus2/tagsetmanager.h> -%} - -%include "libcorpustagset.i" - -%include "std_string.i" -%include "std_vector.i" - -%feature("notabstract") Corpus2::TagsetManager; - -namespace Corpus2 { - class TagsetManager { - public: - TagsetManager(); - ~TagsetManager(); - - /* --------------------------------------------------------------------- */ - }; - - inline const Tagset& get_named_tagset(const std::string& name); -} - -using namespace std; -using namespace Corpus2; - -#endif /* SWIG_LIBCORPUS2_TAGSETMANAGER_I */ diff --git a/swig/libcorpustoken.i b/swig/libcorpustoken.i deleted file mode 100644 index 664123c..0000000 --- a/swig/libcorpustoken.i +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef SWIG_LIBCORPUS2_TOKEN_I -#define SWIG_LIBCORPUS2_TOKEN_I - -%module libcorpustoken -%{ - #include <unicode/unistr.h> - #include <libcorpus2/token.h> -%} - -%include "libcorpuslexeme.i" -%include "libcorpustagset.i" - -%include "std_pair.i" -%include "std_string.i" -%include "std_vector.i" - -%feature("notabstract") Corpus2::Token; - -%rename(__op_eq__) Corpus2::Token::operator==(const Token& other) const; - -namespace Corpus2 { - class Token { - public: - Token(); - Token(const UnicodeString& orth, PwrNlp::Whitespace::Enum wa); - Token* clone() const; - - const UnicodeString& orth() const; - std::string orth_utf8() const; - void set_orth(const UnicodeString& orth); - const PwrNlp::Whitespace::Enum& wa() const; - void set_wa(const PwrNlp::Whitespace::Enum& wa); - const std::vector<Lexeme>& lexemes() const; - std::vector<Lexeme>& lexemes(); - void add_lexeme(const Lexeme& lex); - const Lexeme& get_preferred_lexeme(const Tagset& tagset) const; - size_t get_preferred_lexeme_index(const Tagset& tagset) const; - void make_ign(const Tagset& tagset); - void add_ign(const Tagset& tagset); - bool operator==(const Token& other) const; - bool check_duplicate_lexemes() const; - bool remove_duplicate_lexemes(); - bool has_disamb_lexeme() const; - int count_disamb_lexemes() const; - - // std::pair<lexeme_filter_iterator, lexeme_filter_iterator> disamb_lexemes() const; - }; -} - -using namespace std; -using namespace Corpus2; - - -#endif /* SWIG_LIBCORPUS2_TOKEN_I */ -- GitLab