Skip to content

Commit

Permalink
Merge pull request #12 from kpdyer/dev
Browse files Browse the repository at this point in the history
Merge for 0.10 release
  • Loading branch information
kpdyer committed Sep 17, 2014
2 parents b1b3ad5 + 7dc6ee9 commit 58734a5
Show file tree
Hide file tree
Showing 269 changed files with 513 additions and 103,982 deletions.
875 changes: 201 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

87 changes: 0 additions & 87 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion fte/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.4
0.1.0
173 changes: 0 additions & 173 deletions fte/automata.py

This file was deleted.

15 changes: 1 addition & 14 deletions fte/bit_ops.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of libfte.
#
# libfte is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# libfte is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with libfte. If not, see <http://www.gnu.org/licenses/>.


import binascii

Expand Down
44 changes: 10 additions & 34 deletions fte/cDFA.cc
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
// This file is part of libfte.
//
// libfte is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// libfte is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with libfte. If not, see <http://www.gnu.org/licenses/>.

#include <Python.h>
#include <structmember.h>

Expand Down Expand Up @@ -90,8 +75,18 @@ static PyObject * DFA__unrank(PyObject *self, PyObject *args) {
//PyNumber to mpz_class
int base = 16;
PyObject* b64 = PyNumber_ToBase(c, base);
if (!b64) {
return NULL;
}
const char* the_c_str = PyString_AsString(b64);
if (!the_c_str) {
Py_DECREF(b64);
return NULL;
}
mpz_class to_unrank(the_c_str, 0);

Py_DECREF(b64);
Py_DECREF(the_c_str);

// Verify our environment is sane and perform unranking.
DFAObject *pDFAObject = (DFAObject*)self;
Expand Down Expand Up @@ -146,24 +141,6 @@ static PyObject * DFA__getNumWordsInLanguage(PyObject *self, PyObject *args) {
}


// On input of a PCRE, outputs a non-minimized AT&T FST-formated DFA.
static PyObject *
__attFstFromRegex(PyObject *self, PyObject *args) {
const char *regex;
if (!PyArg_ParseTuple(args, "s", &regex))
return NULL;

// Convert our input char* to a string and call attFstFromRegex.
const std::string str_regex = std::string(regex);
std::string result = attFstFromRegex(str_regex);

// Return the result as a python string.
PyObject* retval = Py_BuildValue("s", result.c_str());

return retval;
}


// Boilerplat python object alloc.
static PyObject *
DFA_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
Expand Down Expand Up @@ -274,7 +251,6 @@ static PyTypeObject DFAType = {

// Methods in our fte.cDFA package
static PyMethodDef ftecDFAMethods[] = {
{"attFstFromRegex", __attFstFromRegex, METH_VARARGS, NULL},
{NULL, NULL, 0, NULL}
};

Expand Down
15 changes: 1 addition & 14 deletions fte/conf.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of libfte.
#
# libfte is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# libfte is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with libfte. If not, see <http://www.gnu.org/licenses/>.


import os
import sys
Expand Down
Loading

0 comments on commit 58734a5

Please sign in to comment.