src.dackar.utils.opm.OPLparser

Created on May 3, 2021

@author: mandd

Classes

OPMobject

Functions

checkAcronym(s)

This method separates an OPM object if an acronym is defined

removeAcronym(s)

This method returns only the OPM object if an acronym is defined

Module Contents

class src.dackar.utils.opm.OPLparser.OPMobject(filename)[source]

Bases: object

filename[source]
objectList = [][source]
processList = [][source]
edge_colors = [][source]
node_colors = [][source]
sentences = None[source]
opmGraph = None[source]
links2OPMs = [][source]
acronyms[source]
OPLentityParser()[source]

This method extracts all the form and function entities out of the OPL html file and it puts them in two separate lists:

  • self.objectList

  • self.processList

This process is performed by parsing the html file and identify color-coded entities.

OPLtextParser()[source]

This method extracts all the sentences out of the OPL html file and it puts them in a list (self.sentences)

OPLparser()[source]

This method translates all the sentences (see self.sentences) and creates a graph structure (self.opmGraph)

This method returns the links to other external OPM models

returnGraph()[source]

This method returns the networkx graph

returnObjectList()[source]

This method returns the the list of objects

returnProcessList()[source]

This method returns the the list of processes

returnAttributeList()[source]

This method returns the the list of attributes

returnAcronym()[source]
src.dackar.utils.opm.OPLparser.checkAcronym(s)[source]

This method separates an OPM object if an acronym is defined For example:

‘travelling screen (TWS)’ –> (‘travelling screen’, ‘TWS’) ‘travelling screen’ –> (‘travelling screen’, None)

src.dackar.utils.opm.OPLparser.removeAcronym(s)[source]

This method returns only the OPM object if an acronym is defined For example: ‘travelling screen (TWS) failed’ –> ‘travelling screen failed’