From cf8168c55c8262c3cb48e5d0d87d373b2f304868 Mon Sep 17 00:00:00 2001 From: ilor <kailoran@gmail.com> Date: Thu, 26 May 2011 13:11:26 +0200 Subject: [PATCH] wrap Parser::parseWcclFileFromPath --- swig/parser.i | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/swig/parser.i b/swig/parser.i index 2da5c3a..e8a0c9b 100644 --- a/swig/parser.i +++ b/swig/parser.i @@ -133,7 +133,19 @@ namespace Wccl { const std::string& file_contents_string, const std::string& search_path = ".") const; - /* --------------------------------------------------------------------- */ + %exception { + try { + $action + } catch (PwrNlp::PwrNlpError &e) { + PyErr_SetString(PyExc_IndexError, e.info().c_str()); + return NULL; + } + } + shared_ptr<WcclFile> parseWcclFileFromPath( + const std::string& filename, + const std::string& search_path = ".") const; + +/* --------------------------------------------------------------------- */ const Corpus2::Tagset& tagset() const; }; -- GitLab