Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. class CombinedClassifier {
  2. private:
  3. FastClassifier * FastCl;
  4. MainClassifier * MainCl;
  5. string strFast;
  6. string strMain;
  7. public:
  8. CombinedClassifier(const string& s1, const string& s2) : strFast(s1), strMain(s2) {
  9. }
  10.  
  11. double classify(const string& s) {
  12. try {
  13. std::unique_ptr<FastClassifier> FastCl(new FastClassifier(strFast));
  14. double res1 = FastCl->classify(s);
  15. return res1;
  16. } catch (TooHardObjectException) {
  17. std::unique_ptr<MainClassifier> MainCl(new MainClassifier(strMain));
  18. double res2 = MainCl->classify(s);
  19. return res2;
  20. }
  21. }
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement