Skip to content

Instantly share code, notes, and snippets.

View ikegami-yukino's full-sized avatar

IKEGAMI Yukino ikegami-yukino

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#define NUM_PATTERN 5
#define MAX_LENGTH 255
char user_input;
int idx;
char response[NUM_PATTERN][MAX_LENGTH]={
{"さすがですね!"},
@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 / 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(';([^\)]+)\)?')
def mergesort(l):
if len(l) > 1:
mid = len(l) // 2
left = l[:mid]
right = l[mid:]
left = mergesort(left)
right = mergesort(right)
i = 0
def quicksort(x):
if not x:
return []
pivot = x[0]
smaller = quicksort([a for a in x[1:] if a <= pivot])
bigger = quicksort([a for a in x[1:] if a > pivot])
return(smaller + [pivot] + bigger)
@ikegami-yukino
ikegami-yukino / pixiv_novel.py
Created December 17, 2017 01:48
Pixiv小説のクロール
# -*- coding: utf-8 -*-
import re
from robobrowser import RoboBrowser
PIXIV_BASE_URL = 'https://www.pixiv.net'
TAG = '巴マミ'
MAX_PAGE = 190
browser = RoboBrowser(parser='lxml', history=True)
browser.open('https://accounts.pixiv.net/login')
@ikegami-yukino
ikegami-yukino / julius.py
Created November 18, 2017 07:37
Python script of Julius on Windows
# coding:utf-8
import re
import socket
import subprocess
import time
HOST = "127.0.0.1"
PORT = 10500
JULIUS_DIR = 'C:\Program Files (x86)\julius-4.4.2-win32bin\\'