Example #1
0
            public FindClassifierReq(VisualRecognition service, string classifierName, OnFindClassifier callback)
            {
                if (callback == null)
                {
                    throw new ArgumentNullException("callback");
                }
                if (string.IsNullOrEmpty(classifierName))
                {
                    throw new WatsonException("classifierName required");
                }
                if (string.IsNullOrEmpty(mp_ApiKey))
                {
                    mp_ApiKey = Config.Instance.GetAPIKey(SERVICE_ID);
                }
                if (string.IsNullOrEmpty(mp_ApiKey))
                {
                    throw new WatsonException("FindClassifier - VISUAL_RECOGNITION_API_KEY needs to be defined in config.json");
                }

                Service        = service;
                ClassifierName = classifierName;
                Callback       = callback;

                Service.GetClassifiers(OnGetClassifiers);
            }
Example #2
0
            public FindClassifierReq(NaturalLanguageClassifier service, string classifierName, OnFindClassifier callback)
            {
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (string.IsNullOrEmpty(classifierName))
                {
                    throw new ArgumentNullException("classifierName");
                }
                if (callback == null)
                {
                    throw new ArgumentNullException("callback");
                }

                Service        = service;
                ClassifierName = classifierName;
                Callback       = callback;

                Service.GetClassifiers(GetClassifiers);
            }
Example #3
0
 /// <summary>
 /// Finds a classifier by classifier name.
 /// </summary>
 /// <param name="classifierName">Classifier name.</param>
 /// <param name="callback">Callback.</param>
 public void FindClassifier(string classifierName, OnFindClassifier callback)
 {
     new FindClassifierReq(this, classifierName, callback);
 }