This page contains the J_Hybrid_Fa Package documentation.
Module for pattern match: algorithm for Hybrid Finite Automat.
Bases: netbench.pattern_match.b_automaton.b_Automaton
Class for Hybrid Finite Automat.
Indexes in self.tran_aut reffer to self.nfas list for particular NFA tails.
Approach split each input regular expression to DFA prefix and NFA suffix by blow up pattern. It is the pattern where autmaton reachs much more states than before. For example pattern: /ab[a-z]*cd/ has blow up pattern [a-z]* and it will be split into /ab/ pattern to DFA part and /[a-z]*.cd/ pattern to be set into NFA tail. DFA part is determinised as usual and than are joined NFA tails.
Approach works with input text file and split input patterns - not input NFA. This idea comes from Jaroslav Suchodol <xsucho04@stud.fit.vutbr.cz>
This function is used to create automaton from set of regular expressions.
This method is forbidden because approach work with input text file. Set parser instance by set_parser() method and input file with regular expressions by load_file().
Parameter: | nfa_parser_class (nfa_parser) – An instation of nfa_parser class. |
---|---|
Returns: | False if creation of automaton failed or True if creation was successful. |
Return type: | boolean |
This method sets _compute to False, and get_compute() will return False until compute() is called.
Raises: | general_not_implemented() |
---|
Create automaton from nfa_data object.
This method is forbidden because approach work with input text file. Set parser instance by set_parser() method and input file with regular expressions by load_file().
Parameters: |
|
---|
This method sets _compute to False, and get_compute() will return False until compute() is called.
Raises: | general_not_implemented() |
---|
DFA head of automaton is save in self.dfa, NFA tails are in self.nfas. Read instruction in __init__ method.
Raises: | empty_automaton_exception() |
---|
Return number of states in Hybrid automaton.
Returns: | Number of states in Hybrid automaton |
---|---|
Return type: | int |
Return number of transitions in Hybrid automaton.
Returns: | Number of transitions in Hybrid automaton |
---|---|
Return type: | int |
Set path to file with regular expression.
Parameter: | file_name (string) – Path to file with regular expression |
---|
Report consumed memory in bytes. Read documentaion in b_dfa and b_nfa methods for more information.
Returns: | Returns number of bytes. |
---|---|
Return type: | int |
Report consumed memory in bytes. Read documentaion in b_dfa and b_nfa methods for more information.
Returns: | Returns number of bytes. |
---|---|
Return type: | int |
DFA head of automaton is save in self.dfa, NFA tails are in self.nfas. Read instruction in __init__ method.
Raises: | empty_automaton_exception() |
---|
Function will find patterns in the given string.
Parameters: |
|
---|---|
Returns: | Bitmap of matched regular expressions. |
Return type: | list(int) |
Set parser instance to be used in approach.
Parameter: | parser_instance (nfa_parser) – Parser instance to be used in approach. |
---|
Print states, alphabet, start, transitions, final, Flags of DFA part and NFA parts. And save graphviz dot file, representing graphical structure of nfa_data.
Parameter: | file_name (string) – Name of output DOT file |
---|
Bases: unittest.TestCase
Test module for class JHybridFA.