From 1d481414a2fa8505a2591c88e2b7b8f86a682ca2 Mon Sep 17 00:00:00 2001 From: Victor Chahuneau Date: Fri, 27 Jul 2012 22:25:15 -0400 Subject: [python] conversion from cdec.sa.Rule to cdec.TRule + remove configobj dependency + re-structure packages (no more top-level library) + "const" stuff + use __new__ instead of constructor for some objects --- python/src/sa/_sa.pyx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 python/src/sa/_sa.pyx (limited to 'python/src/sa/_sa.pyx') diff --git a/python/src/sa/_sa.pyx b/python/src/sa/_sa.pyx new file mode 100644 index 00000000..710f8cb4 --- /dev/null +++ b/python/src/sa/_sa.pyx @@ -0,0 +1,29 @@ +import logging +import resource +import gzip + +cdef float monitor_cpu(): + return (resource.getrusage(resource.RUSAGE_SELF).ru_utime+ + resource.getrusage(resource.RUSAGE_SELF).ru_stime) + +def gzip_or_text(char* filename): + if filename.endswith('.gz'): + return gzip.GzipFile(filename) + else: + return open(filename) + +logger = logging.getLogger('cdec.sa') + +include "float_list.pxi" +include "int_list.pxi" +include "str_map.pxi" +include "data_array.pxi" +include "alignment.pxi" +include "bilex.pxi" +include "veb.pxi" +include "lcp.pxi" +include "sym.pxi" +include "rule.pxi" +include "precomputation.pxi" +include "suffix_array.pxi" +include "rulefactory.pxi" -- cgit v1.2.3