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 collections import Counter, defaultdict | |
import madoka | |
NUM_DOCS_INDEX = '[[NUM_DOCS]]' | |
ALL_WORD_INDEX = '[[ALL]]' | |
class TFIDF(object): |
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
wget http://ftp.kddilabs.jp/infosystems/apache/pig/latest/pig-0.13.0.tar.gz | |
tar -xvf pig-0.13.0.tar.gz | |
sudo mv pig-0.13.0 /usr/local/pig | |
rm pig-0.13.0.tar.gz | |
echo 'export PIG_HOME=/usr/local/pig' >> ~/.bashrc | |
echo 'export PATH=$PATH:$PIG_HOME/bin' >> ~/.bashrc | |
echo 'export PIG_CLASSPATH=$HADOOP_HOME/conf/' >> ~/.bashrc | |
source ~/.bashrc | |
pig -h |
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
#!/bin/sh | |
git clone https://github.com/motus/pig.vim.git /tmp/pig.vim | |
mkdir ~/.vim/syntax/ | |
mkdir ~/.vim/ftdetect/ | |
cp /tmp/pig.vim/syntax/pig.vim ~/.vim/syntax/ | |
cp /tmp/pig.vim/ftdetect/pig.vim ~/.vim/ftdetect/ | |
rm -r /tmp/pig.vim |
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
def to_ngrams(s, minimum_n): | |
"""Generate n-grams (len(string) >= n >= minimum) from string | |
Params: | |
<str> s | |
<int> minimum | |
Return: | |
<set <str>> ngrams | |
""" | |
ngrams = [] | |
length = len(s) |
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 re | |
import MeCab | |
from MeCab import MECAB_ANY_BOUNDARY, MECAB_INSIDE_TOKEN, MECAB_TOKEN_BOUNDARY | |
DICINFO_KEYS = ('charset', 'filename', 'lsize', 'rsize', 'size', 'type', 'version') | |
class Tagger(MeCab.Tagger): |
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
''' | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. |
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
*** jpcommon/jpcommon_label.c.old 2015-02-27 03:35:32.000000000 +0900 | |
--- jpcommon/jpcommon_label.c 2015-02-27 03:36:34.000000000 +0900 | |
*************** static int index_accent_phrase_in_breath | |
*** 296,301 **** | |
--- 296,302 ---- | |
if (index == a) | |
break; | |
} | |
+ if (i > 3) i = 3; | |
return i; |
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
function notify() { | |
echo -e "display notification \"$1\" with title \"Terminal\" subtitle \"`date +"%F %T"`\"" | osascript | |
} |
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
session = requests.Session() | |
session.mount('http://', requests.adapters.HTTPAdapter(max_retries=3)) | |
session.mount('https://', requests.adapters.HTTPAdapter(max_retries=3)) | |
response = session.get(lp, headers={'User-agent': UA}, timeout=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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Blue Component</key> | |
<real>0.0</real> | |
<key>Green Component</key> | |
<real>0.0</real> |
OlderNewer