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 python2 | |
# coding: utf-8 | |
import nltk | |
def get_available_corpora(): | |
for element in dir(nltk.corpus): | |
if element[0] == '_': | |
continue | |
elements_type = str(type(getattr(nltk.corpus, element))) |
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
try: | |
# Old versions of unidecode are licensed under Artistic License | |
# (not GPL) so it may be OK for NLTK to rely on them. | |
from unidecode import unidecode | |
def transliterate(txt): | |
return unidecode(txt).encode('ascii') | |
except ImportError: | |
try: | |
# text-unidecode is an another Text::Unidecode port that is licensed |
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
import pprint | |
import pymorphy | |
import sys | |
sysenc = 'utf-8' | |
def enc(*y): | |
for x in y: | |
if isinstance(x, unicode): |
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 fabric.api import local, settings | |
from taskset import task_method | |
from fab_deploy.utils import define_apps | |
from fab_deploy.project import WebProject | |
from fab_deploy.webserver.nginx import Nginx | |
from fab_deploy.webserver.apache import Apache | |
from fab_deploy.django import Django | |
from fab_deploy import system | |
from fab_deploy.db import postgres |
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 fabric.api import local, settings | |
from taskset import task_method | |
from fab_deploy.utils import define_host, define_apps | |
from fab_deploy.project import WebProject | |
from fab_deploy.webserver.nginx import Nginx | |
from fab_deploy.webserver.apache import Apache | |
from fab_deploy.django import Django | |
from fab_deploy import system | |
from fab_deploy.db import postgres |
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 fabric.api import local, settings | |
from taskset import task_method | |
from fab_deploy.utils import define_host, define_apps | |
from fab_deploy.project import WebProject | |
from fab_deploy.webserver.nginx import Nginx | |
from fab_deploy.webserver.apache import Apache | |
from fab_deploy.django import Django | |
from fab_deploy import system | |
from fab_deploy.db import postgres |
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 fab_deploy import define_host, has_apps | |
from fab_deploy.db import Mysql | |
from fab_deploy.webservers import Nginx, Apache | |
from fab_deploy.vcs import Git | |
@has_apps( | |
nginx = Nginx(), | |
apache = Apache(), | |
db = Mysql() | |
) |
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
import functools | |
class UnicodeMixin(object): | |
"""Mixin class to handle defining the proper __str__/__unicode__ | |
methods in Python 2 or 3.""" | |
if PY3: | |
def __str__(self): | |
return self.__unicode__() | |
else: |