kpdyer / regex2dfa Goto Github PK
View Code? Open in Web Editor NEWpython/JS/C++/CLI interface for converting regexes to AT&T FSTs
License: Apache License 2.0
python/JS/C++/CLI interface for converting regexes to AT&T FSTs
License: Apache License 2.0
This file, when compiled
#include "fst/fstlib.h"
#include "re2/re2.h"
int main () {
}
results in the following error.
$ g++ -o test -Ipath/to/re2 -Ipath/to/openfst test.cc
...
third_party/openfst/src/include/fst/log.h:50:9: note: previous definition is here
#define LOG(type) LogMessage(#type).stream()
^
In file included from test.cc:1:
In file included from third_party/re2/re2/regexp.h:89:
In file included from third_party/re2/util/util.h:118:
third_party/re2/util/logging.h:49:7: error: redefinition of 'LogMessage'
class LogMessage {
^
third_party/openfst/src/include/fst/log.h:34:7: note: previous definition is here
class LogMessage {
^
This is a placeholder issue to raise an issue against re2 and openfst, they should use namespaces.
Create a Python API for regex2dfa.
Currently, regex2dfa
depends upon fstcompile
, fstprint
, and fstminimize
being in the system path. This is not okay --- regex2dfa should be a stand-alone executable.
Use emscripten to compile regex2dfa to JS.
We don't yet have Makefile targets for static/dynamic libraries.
The regex2dfa repo needs to expose a C++ API. In order to complete this, we need to:
Currently dot .
is not matching newline, which results in unexpected behavior. Specifically we have that the dfa for ^.*$
and ^\C*$
are not equal:
$ ./bin/regex2dfa -r "^.*$"
0 0 0 0
0 0 1 1
0 0 2 2
0 0 3 3
0 0 4 4
0 0 5 5
0 0 6 6
0 0 7 7
0 0 8 8
0 0 9 9
0 0 11 11
$ ./bin/regex2dfa -r "^\\C*$"
0 0 0 0
0 0 1 1
0 0 2 2
0 0 3 3
0 0 4 4
0 0 5 5
0 0 6 6
0 0 7 7
0 0 8 8
0 0 9 9
0 0 10 10
0 0 11 11
notice the missing line 0 0 10 10
for ^.*$
.
Figure out a way to remove our (patched) re2 from the third_party directory.
The following regular expression, the DNS regex from l7, fails to compile to a DFA with regex2dfa 0.1.4.
^.?.?.?.?[\x01\x02].?.?.?.?.?.?[\x01-?][a-z0-9][\x01-?a-z]*[\x02-\x06][a-z][a-z][fglmoprstuvz]?[aeop]?(um)?[\x01-\x10\x1c][\x01\x03\x04\xFF]
Figure out a way to remove openfst from the third_party directory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.