Application(type, *args, **kwargs) Create an application instance of any type. Parameters: type (str): application type, can be 'graph', 'word graph', 'knowledge graph' or 'visualization'
| 1369 | |
| 1370 | |
| 1371 | class Application(object): |
| 1372 | """ |
| 1373 | Application(type, *args, **kwargs) |
| 1374 | Create an application instance of any type. |
| 1375 | |
| 1376 | Parameters: |
| 1377 | type (str): application type, |
| 1378 | can be 'graph', 'word graph', 'knowledge graph' or 'visualization' |
| 1379 | """ |
| 1380 | |
| 1381 | application = { |
| 1382 | "graph": GraphApplication, |
| 1383 | "word graph": WordGraphApplication, |
| 1384 | "knowledge graph": KnowledgeGraphApplication, |
| 1385 | "visualization": VisualizationApplication |
| 1386 | } |
| 1387 | |
| 1388 | def __new__(cls, type, *args, **kwargs): |
| 1389 | if type in cls.application: |
| 1390 | return cls.application[type](*args, **kwargs) |
| 1391 | else: |
| 1392 | raise ValueError("Unknown application `%s`" % type) |
| 1393 | |
| 1394 | __all__ = [ |
| 1395 | "Application", |
nothing calls this directly
no outgoing calls
no test coverage detected