From 5b42d1a10db62af890e83c22f11beede530d45de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pawe=C5=82=20K=C4=99dzia?= <pawel.kedzia@pwr.wroc.pl>
Date: Mon, 4 Apr 2011 14:29:29 +0200
Subject: [PATCH] Added wrapper for Corpus2::Lexeme

---
 swig/libcorpuslexeme.i | 43 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 swig/libcorpuslexeme.i

diff --git a/swig/libcorpuslexeme.i b/swig/libcorpuslexeme.i
new file mode 100644
index 0000000..8575536
--- /dev/null
+++ b/swig/libcorpuslexeme.i
@@ -0,0 +1,43 @@
+#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 */
-- 
GitLab