def classes(self, resourceId): cherrypy.response.headers["Access-Control-Allow-Origin"] = "*" cherrypy.response.headers["Access-Control-Allow-Methods"] = "GET, POST, OPTIONS" cherrypy.response.headers[ "Access-Control-Allow-Headers" ] = "Cache-Control, X-Proxy-Authorization, X-Requested-With" resourceId = resourceId.lower() classifier = Classifier(resourceId) return json.dumps(classifier.getClassesJsonDummy(resourceId))
class TestClassifier(TestInterface): def __init__(self): self.classifier = Classifier() pass def classifyRandom20(self): import pprint pprinter = pprint.PrettyPrinter() resourceIds = self.getRandom20Resources() for resourceId in resourceIds: print resourceId try: pprinter.pprint(self.classifier.getClasses(resourceId)) except BaseException as e: print str(e)
def _getEntities(self, resourceId): classifier = Classifier() return classifier.getClassesJson(resourceId)
def __init__(self): self.classifier = Classifier() pass