Skip to content

Instantly share code, notes, and snippets.

View vchahun's full-sized avatar

Victor Chahuneau vchahun

View GitHub Profile
@vchahun
vchahun / e-ins.ipynb
Created October 7, 2012 18:25
E insertion
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vchahun
vchahun / edit.ipynb
Created October 17, 2012 23:15
Edit distance FSTs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vchahun
vchahun / alignment_matrix.ipynb
Created November 6, 2012 21:23
Alignment matrix
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vchahun
vchahun / dsplit.py
Created November 13, 2012 03:32
Deterministic dataset splitter
#!/usr/bin/env python
import sys
from hashlib import sha1
MAX = 1000000
def main():
if len(sys.argv) < 2:
sys.stderr.write('Usage: {0} prop1:fname1 prop2:fname2...\n'.format(sys.argv[0]))
sys.exit(1)
@vchahun
vchahun / image.png
Created December 5, 2012 05:29
Image gist
image.png
@vchahun
vchahun / KeytermPipeline.png
Created December 12, 2012 23:19
Images for hw2
KeytermPipeline.png
@vchahun
vchahun / intlist.pyx
Created December 19, 2012 00:49
Shared memory with Cython
from libc.stdio cimport FILE, fopen, fwrite, fclose
from libc.stdlib cimport malloc
from posix.fcntl cimport open, O_RDONLY
from posix.unistd cimport close, read, off_t
cdef extern from "sys/mman.h":
void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
enum:
PROT_READ
MAP_FILE
@vchahun
vchahun / fst-replace.ipynb
Created December 26, 2012 00:46
RTNs with pyfst
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vchahun
vchahun / abbrev.txt
Last active December 11, 2015 12:28
A list of Russian abbreviations
### One-letter abbreviations
ул. # улица (street)
г. # город, год (city, year)
обл. # область (region)
гг. # годы (years)
в. # век (century)
вв. # века (centuries)
мин. # минута (minute)
ч. # час (hour)
тыс. # тысяч (1000)
@vchahun
vchahun / client.py
Created February 5, 2013 23:47
A client/server translator with cdec Requires pycdec, pyzmq
def translate(sentence):
socket = zmq.Context().socket(zmq.REQ)
socket.connect('tcp://%s:%d' % (config.tserver_host, config.tserver_port))
socket.send_string(sentence)
translation = socket.recv_string()
socket.close()
return sentence