Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |


This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### One-letter abbreviations | |
ул. # улица (street) | |
г. # город, год (city, year) | |
обл. # область (region) | |
гг. # годы (years) | |
в. # век (century) | |
вв. # века (centuries) | |
мин. # минута (minute) | |
ч. # час (hour) | |
тыс. # тысяч (1000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |