src.dackar.utils.opm.OPLparser ============================== .. py:module:: src.dackar.utils.opm.OPLparser .. autoapi-nested-parse:: Created on May 3, 2021 @author: mandd Classes ------- .. autoapisummary:: src.dackar.utils.opm.OPLparser.OPMobject Functions --------- .. autoapisummary:: src.dackar.utils.opm.OPLparser.checkAcronym src.dackar.utils.opm.OPLparser.removeAcronym Module Contents --------------- .. py:class:: OPMobject(filename) Bases: :py:obj:`object` .. py:attribute:: filename .. py:attribute:: objectList :value: [] .. py:attribute:: processList :value: [] .. py:attribute:: edge_colors :value: [] .. py:attribute:: node_colors :value: [] .. py:attribute:: sentences :value: None .. py:attribute:: opmGraph :value: None .. py:attribute:: links2OPMs :value: [] .. py:attribute:: acronyms .. py:method:: OPLentityParser() 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. .. py:method:: OPLtextParser() This method extracts all the sentences out of the OPL html file and it puts them in a list (self.sentences) .. py:method:: OPLparser() This method translates all the sentences (see self.sentences) and creates a graph structure (self.opmGraph) .. py:method:: returnsExternalLinks() This method returns the links to other external OPM models .. py:method:: returnGraph() This method returns the networkx graph .. py:method:: returnObjectList() This method returns the the list of objects .. py:method:: returnProcessList() This method returns the the list of processes .. py:method:: returnAttributeList() This method returns the the list of attributes .. py:method:: returnAcronym() .. py:function:: checkAcronym(s) This method separates an OPM object if an acronym is defined For example: 'travelling screen (TWS)' --> ('travelling screen', 'TWS') 'travelling screen' --> ('travelling screen', None) .. py:function:: removeAcronym(s) This method returns only the OPM object if an acronym is defined For example: 'travelling screen (TWS) failed' --> 'travelling screen failed'