This file contains 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 -*- | |
# Gisty 使えるかテスト |
This file contains 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 -*- | |
""" | |
pykf_wrapper.py | |
pykf を使いやすくするためのラッパー | |
使い方 |
This file contains 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 -*- | |
""" | |
feature_vector.py | |
指定されたファイル中の文章を解析して | |
単語とその出現頻度を返す | |
使い方(コマンドラインから) | |
% python feature_vector.py file |
This file contains 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 -*- | |
""" | |
connect_four.py | |
重力付き四目並べをシミュレートする | |
""" | |
import random | |
## 戦略を表現 |
This file contains 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 -*- | |
import socket | |
import urllib2 | |
import re | |
from html5lib import HTMLParser,treebuilders | |
headers = { | |
"User-Agent":"Mozilla/4.0 (compatileb; MSIE 7.0; Windows NT 5.1)" | |
} |
This file contains 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 -*- | |
import re | |
import MeCab | |
class Word(object): | |
def __init__(self,surface,feature): | |
self.surface = surface | |
self.feature = feature |
This file contains 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 -*- | |
import sys | |
import MySQLdb | |
con = MySQLdb.connect(db='webpage_test',user='',passwd='', | |
use_unicode=True,charset='utf8') | |
cur = con.cursor() | |
first = int(sys.argv[1]) |
This file contains 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 -*- | |
import MeCab | |
from collections import Counter | |
def func(): | |
m = MeCab.Tagger() | |
c = Counter() | |
for i in xrange(100000): |
This file contains 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 -*- | |
from datetime import date | |
import datetime | |
import time | |
from mechanize import Browser | |
from BeautifulSoup import BeautifulSoup, NavigableString, Declaration, Comment | |
def getNavigableStrings(soup): | |
if isinstance(soup, NavigableString): |
This file contains 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 -*- | |
# twisted imports | |
from twisted.words.protocols import irc | |
from twisted.internet import reactor, protocol | |
# system imports | |
import time, sys | |
from yonobot import yonobot |
OlderNewer