Git Product home page Git Product logo

frak's People

Contributors

arrdem avatar guns avatar joelittlejohn avatar noprompt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frak's Issues

Limitation on maximum string size that frak can handle

As soon as string size in file goes beyong 205 character, stack overflow error is reported,

StackOverflowError clojure.lang.AFn.applyToHelper (AFn.java:155)

Do you have workaround or solution?
Is there any static allocation which causes the frak to accept strings smaller than particular size.?

0.1.3 RuntimeException

When I replace [frak "0.1.2"] with [frak "0.1.3"] I get an exception

; project.clj

(defproject regard "1.0.0-SNAPSHOT"
  :description "Spits out regexps, given keywords"
  :dependencies [[org.clojure/clojure "1.3.0"]
                [frak "0.1.3"]]
  :main regard.core)

; core.clj
(ns regard.core)

(require 'frak)

(defn -main [& args]
  "I don't do a whole lot."
  (println (apply str args)))
$ lein repl
REPL started; server listening on localhost port 15186
CompilerException java.lang.RuntimeException: Unable to resolve symbol: mapv in this context, compiling:(frak.clj:157) 
clojure.core=> 

Generalizing regexes

Nice project.

If I understand correctly, frak will generate a regex that matches the exact set of strings it was fed, right? It would also be nice to add a learning/generalization ability, so that e.g. if you feed it "foo1" and "foo2", etc., it can generalize to /foo\d+/ rather than the strict /foo[12]/.

At my previous job, I developed such a system but unfortunately the code never got out of the corporate walls. I'd feed the system a set of many thousands of legal citation strings (like "726 N.W.2d 852" or "42 U.S.C. § 405(c)(2)(C)" - see http://www.law.cornell.edu/citation/ for many more such examples) and it would create a regular expression to recognize these strings and any strings "in the same family". The idea was to combine a lexer (something that knew about the lexemes that could occur in the language - e.g. numbers, roman numerals, publication names, state names, etc.) with a regex generator based on the lexeme classes rather than raw characters.

Some of the difficulties involved figuring out just how much to generalize, which of course depends on the problem domain. There were also ambiguous lexemes - for example, "MD" is both a roman numeral and a state abbreviation, so I had to sense which made better sense in context.

The regexes got pretty big, even with the generalization (which tends to make them smaller), so I made one FSM per jurisdiction and fed them to GraphViz for some killer pictures. =)

Anyway, food for thought if you ever want to take this project in another direction.

Make this a command line tool

Hi Joel,

Nice work! In order to make this piece of code more widely usable, can you make this compiled into a command line tool?

Much appreciate it!

Ye

Dictionary Regex

Firstly, an epic tool, very nice!

What engine are you using?

I just want to confirm whether the /usr/share/dict/words generated expression works? I've tried it twice but it's never matched anything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.