Advertisement
Guest User

Untitled

a guest
Oct 28th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. %module(directors="1") crfsuite
  2.  
  3. %{
  4. #include "crfsuite_api.hpp"
  5. %}
  6.  
  7. %include "std_string.i"
  8. %include "std_vector.i"
  9. %include "exception.i"
  10.  
  11. %template(Item) std::vector<CRFSuite::Attribute>;
  12. %template(ItemSequence) std::vector<CRFSuite::Item>;
  13. %template(StringList) std::vector<std::string>;
  14.  
  15. %feature("director") Trainer;
  16.  
  17. %exception {
  18. try {
  19. $action
  20. } catch(const std::invalid_argument& e) {
  21. SWIG_exception(SWIG_IOError, e.what());
  22. } catch(const std::runtime_error& e) {
  23. SWIG_exception(SWIG_RuntimeError, e.what());
  24. } catch (const std::exception& e) {
  25. SWIG_exception(SWIG_RuntimeError, e.what());
  26. } catch(...) {
  27. SWIG_exception(SWIG_RuntimeError,"Unknown exception");
  28. }
  29. }
  30.  
  31. %include "crfsuite_api.hpp"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement