Skip to content

Instantly share code, notes, and snippets.

View ikegami-yukino's full-sized avatar

IKEGAMI Yukino ikegami-yukino

View GitHub Profile
@ikegami-yukino
ikegami-yukino / build-mozc-on-macos-10.13.6.md
Last active April 11, 2020 17:24 — forked from akirakubo/build-mozc-on-macos-10.13.6.md
Build Mozc with/without Qt on macOS 10.13.6 (or later)

Build Mozc with/without Qt on macOS 10.13.6 (or later)

環境

  • macOS 10.13.6
  • Xcode 10.1 (10B61)

ビルドエラーへの対処

いつの間にかビルドがうまく出来なくなったので対処。

@ikegami-yukino
ikegami-yukino / check_es_synonym.py
Last active March 26, 2020 04:56
Elasticsearch同義語辞書確認用コード
import os
import shutil
import tempfile
import tcptest
from elasticsearch import Elasticsearch
SYNONYMS_PATH = "/tmp/wikipedia_synonym.txt"
settings = {
@ikegami-yukino
ikegami-yukino / anti_lou
Created March 27, 2012 08:04
Bilingual Emacspeak Project(BEP)辞書からルー語臭さをなるべく取り除く
perl -pe 's/(?=[ドト])ゥ(?<!ー)//g;s/(?<=[キシチニヒミリィ])イ/ー/g;s/(?<=[ァゥェォ])ィ/イ/g;s/イション/ーション/g;s/ォウ/ォー/g;s/スィ/シー/g;s/ロウ/ロー/g;s/゛//g;s/ウカ/ーカ/g;s/トギャザー/トゥゲザー/g;s/ボキャビュラリー/ボキャブラリー/g;' < bep-eng.dic.txt
@ikegami-yukino
ikegami-yukino / install_byobu_yum.sh
Last active February 11, 2020 07:14
Install byobu to CentOS and Amazon Linux
sudo yum install byobu -y --enablerepo=epel-testing
@ikegami-yukino
ikegami-yukino / mac_word2vec_install.sh
Last active May 28, 2019 19:41
Install word2vec to Mac OS X later than 10.9
pushd . &> /dev/null
cd /tmp
git clone --depth=1 https://github.com/tmikolov/word2vec
cd word2vec
sed -i -e 's/malloc.h/stdlib.h/g' *.c
make
rm *.c* *.txt makefile LICENSE
cp * /usr/local/bin
popd &> /dev/null
@ikegami-yukino
ikegami-yukino / translate_sentiwordnet.py
Last active May 10, 2019 10:45
SentiWordNet を日本語化する
import re
import sqlite3
import time
import requests
DB_PATH = 'wnjpn.db'
SWN_PATH = 'SentiWordNet_3.0.0_20130122.txt'
URL = 'https://script.google.com/macros/s/Please_write_here/exec?text=%s&source=en&target=ja'
RESULT_PATH = 'result.csv'
@ikegami-yukino
ikegami-yukino / install_cabocha.sh
Last active February 10, 2019 21:07
CaboChaとそのPythonバインディングを入れる
#!/usr/bin/sh
git clone --depth=1 -b patch https://github.com/humem/cabocha /tmp/cabocha
cd /tmp/cabocha
./configure --with-charset=utf8
make
make install
pip install git+https://github.com/taku910/cabocha.git#subdirectory=python
@ikegami-yukino
ikegami-yukino / jabstract.py
Created December 14, 2018 17:20 — forked from nakagami/jabstract.py
Japanese summarization module using LexRank algorithm.
#!/usr/bin/env python
# The MIT License (MIT)
# Copyright © 2015 Recruit Technologies Co.,Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@ikegami-yukino
ikegami-yukino / parse_csj.py
Last active November 22, 2018 04:58
Convert CSJ's xml to plain text
import glob
import html
import re
import sys
import jaconv
re_ogt = re.compile(' OrthographicTranscription="([^"]+)"')
re_a = re.compile('\;([^\)]+)\)?')
re_semicolon = re.compile(';([^\)]+)\)?')
@ikegami-yukino
ikegami-yukino / randomsplit.sh
Last active July 31, 2018 03:01
ファイルを行ごとにランダムにソートして、指定した数のファイルに分割する。randomly sort and split given file in given number.
#!/bin/bash
# usage:
# ./randomsplit.sh [FILE] [division number]
#
# Check the number of parameters
if [ $# -ne 2 ]; then
echo "usage: ./randomsplit.sh [FILE] [division number]" 1>&2
exit 1