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
    void insert​(java.lang.String word)
    Inserts one word into the trie.
    void insertAll​(java.util.Collection<java.lang.String> words)
    Inserts a collection of words into the trie.
    java.lang.StringBuilder toRegex()
    Synthesizes a given specification into a regular expression.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface dev.yasint.regexsynth.api.Expression

    debug
  • Constructor Details

  • 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: Expression
      Synthesizes 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:
      toRegex in interface Expression
      Returns:
      regex equivalent