Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
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
WCCL
Commits
82f23ae5
Commit
82f23ae5
authored
11 years ago
by
michal
Browse files
Options
Downloads
Patches
Plain Diff
przechwytywanie bledow WcclError w pythonie dla metody apply_all
parent
7e046918
Branches
Branches containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
swig/exception.i
+1
-13
1 addition, 13 deletions
swig/exception.i
swig/matchrulesequence.i
+26
-1
26 additions, 1 deletion
swig/matchrulesequence.i
swig/wccl.i
+1
-0
1 addition, 0 deletions
swig/wccl.i
with
28 additions
and
14 deletions
swig/exception.i
+
1
−
13
View file @
82f23ae5
#
ifndef
LIBWCCL_EXCEPTION_H
#
define
LIBWCCL_EXCEPTION_H
%
module
lib
corpus
exception
%
module
lib
wccl
exception
%
{
#include <libpwrutils/exception.h>
%}
...
...
@@ -31,18 +31,6 @@ namespace Wccl {
std::string arg_name;
std::string reason;
};
%exception {
try {
$action
} catch (Wccl::InvalidArgument &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
} catch (PwrNlp::PwrNlpError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
}
using
namespace
std
;
...
...
This diff is collapsed.
Click to expand it.
swig/matchrulesequence.i
+
26
−
1
View file @
82f23ae5
...
...
@@ -32,14 +32,39 @@ namespace Matching {
void operator()(const shared_ptr<Corpus2::AnnotatedSentence>& sentence);
/* --------------------------------------------------------------------- */
%exception {
try {
$action
} catch (Wccl::WcclError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
void apply_all(const shared_ptr<Corpus2::AnnotatedSentence>& sentence);
%exception {
try {
$action
} catch (Wccl::WcclError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
void apply_all_sentence_wrapper(const shared_ptr<Corpus2::Sentence>& sentence);
/* --------------------------------------------------------------------- */
std::string to_string(const Corpus2::Tagset& tagset) const;
};
%exception {
try {
$action
} catch (Wccl::WcclError &e) {
PyErr_SetString(PyExc_IndexError, e.info().c_str());
return NULL;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
swig/wccl.i
+
1
−
0
View file @
82f23ae5
...
...
@@ -34,5 +34,6 @@
%
include
"
lexicon.i
"
%
include
"
lexicons.i
"
%
include
"
wcclfile.i
"
%
include
"
exception.i
"
#
endif
/* SWIG_LIBWCCL_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