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 scipy as sp | |
import numpy as np | |
import math | |
import optparse | |
import tempfile | |
import wave | |
from itertools import izip |
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/ruby -Kw | |
$KCODE="UTF-8" | |
require "CaboCha" | |
require "kconv" | |
class DepAnalyzeByCabocha | |
@cabo | |
def initialize(args=[]) | |
@cabo = CaboCha::Parser.new(args) | |
end |
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
#!/opt/local/bin/python | |
# module power iteration clustering | |
import numpy as NP | |
from scipy.cluster.vq import kmeans2 | |
def calcNorm1(v): | |
return NP.sum(NP.fabs(v)) | |
def calcDelta(v,v2): |
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/ruby | |
class MCL | |
def initialize(path,min=0.00001,minpred=0.1) | |
@minimum=min | |
@minimunPred=minpred | |
@matrix=Hash.new | |
id=0 | |
edgelist=Array.new |
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 -*- | |
import math | |
import numpy as NP | |
from scipy.maxentropy import logsumexp | |
from operator import itemgetter | |
class NewmanEM: | |
def __init__(sel): | |
pass |
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 -*- | |
import numpy as np | |
import Image | |
import sys | |
def from_pil(pimg): | |
pimg = pimg.convert(mode='RGB') | |
nimg = np.asarray(pimg) | |
nimg.flags.writeable = True | |
return nimg |
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 -*- | |
import numpy as np | |
from scipy.special.basic import digamma | |
import logging | |
class NpGraph(): | |
def __init__(self,T=10,C=(1.0,1.0),phi=0.001,thresh=0.001,niter = 500): | |
self._T = T#最大クラスタ数 | |
self._c1 = C[0] | |
self._c2 = C[1] | |
self._phi0=phi |
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 -*- | |
import CaboCha | |
import chardet | |
import syslog | |
import math | |
from collections import defaultdict | |
import unicodedata | |
syslog.openlog('cabocha_wrapper',syslog.LOG_PID|syslog.LOG_PERROR,syslog.LOG_SYSLOG) | |
AVG_LENGTH = 200.0 |
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 -*- | |
import numpy as np | |
cimport numpy as np | |
from libc.math cimport log | |
from scipy.misc import logsumexp | |
cdef double digamma(double x): | |
cdef double result = 0.0 | |
cdef double xx, xx2, xx4 | |
assert x>=0, "digamma error" |
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 -*- | |
from BeautifulSoup import BeautifulSoup | |
import urllib2 | |
import re | |
URL = "http://kohaumotu.org/rongorongo_org/translit/%s.html" | |
for i in range(97,123): | |
url = URL % chr(i) | |
html = urllib2.urlopen(url).read() |
OlderNewer