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 | |
#-*- coding:utf-8 -*- | |
__doc__ = u""" | |
指定したコーパスから文章を生成します | |
ファイルを読み込んでsplit /[、。]/で分割 | |
""" | |
__usage__ = u""" | |
USAGE: |
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
#-*- coding:utf-8 -*- | |
__author__ = 'junk' | |
import unittest | |
import re | |
re_hiragana = re.compile(ur"^[ぁ-ゞ]$") | |
re_kana = re.compile(ur"^[ァ-ヾ]$") | |
re_kanji = re.compile(ur'^[一-龠]$') | |
re_number = re.compile(ur'^[-+]?(([1-9]\d+|\d)(?:\.\d+)?)$') |
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
#-*- coding:utf-8 -*- | |
__author__ = 'bluele' | |
class SubUnicode(unicode): | |
def __new__(cls, val, meta={}): | |
self = unicode.__new__(cls, val) | |
self.__meta = meta | |
return self |
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
#-*- coding:utf-8 -*- | |
__author__ = 'bluele' | |
from os.path import exists as op_exists, join as op_join, dirname as op_dirname, basename as op_basename,\ | |
normpath as op_normpath, split as op_split, normcase as op_normcase, splitext as op_splittext | |
class Path(object): | |
def __init__(self, path, is_relative=False): |
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
#-*- coding:utf-8 -*- | |
__author__ = 'bluele' | |
import unittest | |
class SuffixArray(object): | |
def __init__(self, string): | |
self.string = string |
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 | |
#-*- coding:utf-8 -*- | |
__author__ = 'bluele' | |
__version__ = '0.10' | |
__license__ = 'MIT' | |
__doc__ = """ | |
# simple running | |
$ hserve |
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
#-*- coding:utf-8 -*- | |
__author__ = 'bluele' | |
from BeautifulSoup import BeautifulSoup as bs | |
import requests | |
import re | |
url = 'http://program.tv.jp.msn.com/tv.php?site=032&mode=06&category=g&area=013&template=program&sdate=20130321&lhour=7&shour=05' | |
host = 'http://program.tv.jp.msn.com/tv.php' |
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
#-*- coding:utf-8 -*- | |
__author__ = 'bluele' | |
from BeautifulSoup import BeautifulSoup as bs | |
import urllib | |
import requests | |
import re | |
class Project(object): |
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
#-*- coding:utf-8 -*- | |
from BeautifulSoup import BeautifulSoup as b | |
from urllib import quote_plus as q, unquote_plus as unq, urlencode | |
from urllib2 import build_opener, urlopen, HTTPCookieProcessor | |
from cookielib import CookieJar | |
import urlparse | |
import re | |
__author__ = 'bluele' |
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
package main | |
import ( | |
"archive/tar" | |
"compress/gzip" | |
"io/ioutil" | |
"log" | |
"os" | |
"path" | |
) |
OlderNewer