当前位置: 首页>>代码示例>>Python>>正文


Python ArchiLib.ArchiLib类代码示例

本文整理汇总了Python中al_lib.ArchiLib.ArchiLib的典型用法代码示例。如果您正苦于以下问题:Python ArchiLib类的具体用法?Python ArchiLib怎么用?Python ArchiLib使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ArchiLib类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: requirementAnalysis

def requirementAnalysis(fileArchimate=None):

    if fileArchimate is None:
        fileArchimate = u"/Users/morrj140/Documents/SolutionEngineering/Archimate Models/DVC v38.archimate"

    al = ArchiLib(fileArchimate)

    conceptsFile = fileConceptsRequirements

    searchTypes = list()
    searchTypes.append(u"archimate:Requirement")
    nl = al.getTypeNodes(searchTypes)

    logger.info(u"Find Words in Requirements...")
    concepts = Concepts(u"Requirement", u"Requirements")
    n = 0
    for sentence in nl:
        n += 1
        logger.debug(u"%s" % sentence)

        c = concepts.addConceptKeyType(u"Document" + str(n), u"Document")
        d = c.addConceptKeyType(sentence, u"Sentence" + str(n))

        if True and sentence is not None:
            cleanSentence = ' '.join([word for word in sentence.split(u" ") if word not in stop])
            for word, pos in nltk.pos_tag(nltk.wordpunct_tokenize(cleanSentence)):
                if len(word) > 1 and pos[0] == u"N":
                    e = d.addConceptKeyType(word, u"Word")
                    f = e.addConceptKeyType(pos, u"POS")

    Concepts.saveConcepts(concepts, conceptsFile)
    logger.info(u"Saved : %s" % conceptsFile)

    chunks = Chunks(concepts)
    chunks.createChunks()
开发者ID:Darth-Neo,项目名称:ArchiConcepts,代码行数:35,代码来源:al_RequirementAnalysis.py

示例2: test_ArchiCounts

def test_ArchiCounts(cleandir, fileArchimate):
    assert (os.path.isfile(fileArchimate) is True)

    al = ArchiLib(fileArchimateTest)

    lc = al.logTypeCounts()

    assert (len(lc) > 0)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:8,代码来源:test_all_phases.py

示例3: createRelations

def createRelations(fileArchimate=fileArchimateTest):

    start_time = ArchiLib.startTimer()

    cr = CreateRelationsInArchi(fileArchimate)

    cr.createRelations()

    ArchiLib.stopTimer(start_time)
开发者ID:Darth-Neo,项目名称:ArchiConcepts,代码行数:9,代码来源:al_CreateRelations.py

示例4: namedEntityAnalysis

def namedEntityAnalysis(fileArchimate=fileArchimateTest, fileConceptsRequirements=fileConceptsRequirements):

    start_time = ArchiLib.startTimer()

    ane = AnalyzeNamedEntities(fileArchimate, fileConceptsRequirements)

    ane.analyzeNamedEntities()

    ArchiLib.stopTimer(start_time)
开发者ID:Darth-Neo,项目名称:ArchiConcepts,代码行数:9,代码来源:al_NamedEntityAnalysis.py

示例5: __init__

    def __init__(self, fileArchimate):
        self.fileAchimate = fileArchimate
        self.n = 0
        self.al = ArchiLib(fileArchimate)

        self.start_time = ArchiLib.startTimer()

        self.width = u"120"
        self.height = u"55"
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:9,代码来源:al_DrawModel.py

示例6: exportArchi

def exportArchi(fileArchimate, fileConceptsExport):

    start_time = ArchiLib.startTimer()

    ea = ExportArchi(fileArchimate, fileConceptsExport)

    ea.exportArchi()

    ArchiLib.stopTimer(start_time)
开发者ID:latestalexey,项目名称:ArchiConcepts,代码行数:9,代码来源:al_ExportArchi.py

示例7: exportArchiFolderModels

def exportArchiFolderModels(fileArchimate, fileConceptsExport, folder):

    start_time = ArchiLib.startTimer()

    eafm = ExportArchiFolderModels(fileArchimate, fileConceptsExport)

    eafm.exportArchiFolderModels(folder)

    ArchiLib.stopTimer(start_time)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:9,代码来源:al_ExportArchiFolderModels.py

示例8: analyzeGraph

def analyzeGraph(gdb):
    concepts = None

    start_time = ArchiLib.startTimer()

    ag = AnalyzeGraph(gdb)

    ag.analyzeNetworkX(concepts, fileConceptsExport)

    ArchiLib.stopTimer(start_time)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:10,代码来源:al_AnalyzeGraph.py

示例9: createTagCloud

def createTagCloud(conceptFile, topic):

    start_time = ArchiLib.startTimer()

    concepts = Concepts.loadConcepts(conceptFile)

    tc = TopicCloud(concepts, font_path=u"/Users/morrj140/Fonts/DroidSans.ttf", imageFile=u"Topics.png")

    tc.createTagCloud(topic)

    ArchiLib.stopTimer(start_time)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:11,代码来源:al_CreateTagCloud.py

示例10: exportArchiModel

def exportArchiModel(fileArchimate, fileConceptsExport, model, fileCSVExport):

    start_time = ArchiLib.startTimer()

    eam = ExportArchiModel(fileArchimate, fileConceptsExport, fileCSVExport)

    listMTE = list()
    listMTE.append(model)

    eam.exportArchiModel(listMTE)

    ArchiLib.stopTimer(start_time)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:12,代码来源:al_ExportArchiModel.py

示例11: exportNeo4j

def exportNeo4j(gdb):

    # measure process time, wall time
    start_time = ArchiLib.startTimer()

    concepts = Concepts(u"Neo4J", u"Neo4J Graph DB")

    nj = Neo4JLib(gdb)

    nj.exportNeo4JToConcepts(concepts)

    ArchiLib.stopTimer(start_time)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:12,代码来源:al_ExportNeo4j.py

示例12: dependancyAnalysisFromArchi

def dependancyAnalysisFromArchi(fileArchimate):

    start_time = ArchiLib.startTimer()

    da = DependancyAnalysis(fileArchimate)

    concepts, listTSort = da.collectDependancyAnalysisNodes()

    da.dependancyAnalysis(listTSort)

    concepts.logConcepts()

    ArchiLib.stopTimer(start_time)
开发者ID:Darth-Neo,项目名称:ArchiConcepts,代码行数:13,代码来源:al_DependancyAnalysisFromArchi.py

示例13: importWSDL

def importWSDL():

    start_time = ArchiLib.startTimer()

    etree.QName(ArchiLib.ARCHIMATE_NS, u"model")
    treeArchi = etree.parse(fileArchimateTest)

    al = ArchiLib()

    dirWSDL = u"/Users/morrj140/Documents/SolutionEngineering/Jawa/Jawa_v2_rc37"

    for root, dirs, files in os.walk(dirWSDL, topdown=True):
        for name in files:
            nameFile = os.path.join(root, name)
            logger.info(u"Checking File : %s" % name)

            if nameFile[-4:].lower() == u"wsdl":
                nFile = name[:-5]
                logger.info(u"nFile : %s" % nFile)
                tree = etree.parse(nameFile)

                xp = u"//@schemaLocation"
                txp = tree.xpath(xp)

                for x in txp:
                    method = x[4:-4]
                    logger.info(u"x : %s" % method)

                    al.insertTwoColumns(
                        treeArchi, u"Application", u"New Jawa", u"archimate:ApplicationService", nFile, method
                    )

    al.outputXML(treeArchi)

    ArchiLib.stopTimer(start_time)
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:35,代码来源:al_ImportWSDL.py

示例14: createArchimateConcepts

def createArchimateConcepts(fileArchimate, fileConceptsArch):

    logger.info(u"Using : %s" % fileArchimate)

    concepts = Concepts(fileArchimateModel, u"Archimate")

    al = ArchiLib(fileArchimate)

    al.logTypeCounts()

    #
    # Create Concepts from Archimate
    #
    al.folderConcepts(concepts)
    Concepts.saveConcepts(concepts, fileConceptsArch)
    logger.info(u"Saved concepts to : %s" % fileConceptsArch)
开发者ID:Darth-Neo,项目名称:ArchiConcepts,代码行数:16,代码来源:al_CreateArchimateConcepts.py

示例15: importConceptsIntoArchi

def importConceptsIntoArchi():

    logger.info(u"Using : %s" % fileArchimateTest)

    conceptFile = fileConceptsBatches
    logger.info(u"Loading :" + conceptFile)
    concepts = Concepts.loadConcepts(conceptFile)

    al = ArchiLib()

    # Create Subfolder
    folder = u"Implementation & Migration"
    subfolder = u"Dependancy Analysis - %s" % time.strftime(u"%Y%d%m_%H%M%S")

    attrib = dict()
    attrib[u"id"] = al.getID()
    attrib[u"name"] = subfolder
    al.insertNode(u"folder", folder, attrib)

    logger.info(u"--- Insert Nodes ---")
    insertConceptNode(al, concepts, subfolder)

    logger.info(u"--- Insert Relations ---")
    insertConceptRelation(al, concepts)

    al.outputXMLtoFile(filename=u"import_concepts.archimate")
开发者ID:RichDijk,项目名称:ArchiConcepts,代码行数:26,代码来源:al_ImportConceptsIntoArchi.py


注:本文中的al_lib.ArchiLib.ArchiLib类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。