Package dev.yasint.regexsynth.synthesis
Class TrieExpression
java.lang.Object
dev.yasint.regexsynth.synthesis.TrieExpression
- All Implemented Interfaces:
Expression
public class TrieExpression extends java.lang.Object implements Expression
Synthesis :: String minimization
-
Constructor Summary
Constructors Constructor Description TrieExpression() -
Method Summary
Modifier and Type Method Description voidinsert(java.lang.String word)Inserts one word into the trie.voidinsertAll(java.util.Collection<java.lang.String> words)Inserts a collection of words into the trie.java.lang.StringBuildertoRegex()Synthesizes a given specification into a regular expression.
-
Constructor Details
-
TrieExpression
public TrieExpression()
-
-
Method Details
-
insert
public void insert(java.lang.String word)Inserts one word into the trie. O(N) complexity- Parameters:
word- string input
-
insertAll
public void insertAll(java.util.Collection<java.lang.String> words)Inserts a collection of words into the trie. O(N)- Parameters:
words- string inputs
-
toRegex
public java.lang.StringBuilder toRegex()Description copied from interface:ExpressionSynthesizes a given specification into a regular expression. The implementing class can control what should be in the regex by simply wrapping it in a object or a higher-order function.- Specified by:
toRegexin interfaceExpression- Returns:
- regex equivalent
-