Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CombinedClassifier {
- private:
- FastClassifier * FastCl;
- MainClassifier * MainCl;
- string strFast;
- string strMain;
- public:
- CombinedClassifier(const string& s1, const string& s2) : strFast(s1), strMain(s2) {
- }
- double classify(const string& s) {
- try {
- std::unique_ptr<FastClassifier> FastCl(new FastClassifier(strFast));
- double res1 = FastCl->classify(s);
- return res1;
- } catch (TooHardObjectException) {
- std::unique_ptr<MainClassifier> MainCl(new MainClassifier(strMain));
- double res2 = MainCl->classify(s);
- return res2;
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement