Skip to content

Instantly share code, notes, and snippets.

Avatar

IKEGAMI Yukino ikegami-yukino

View GitHub Profile
View sugoi_dialogue_system.c
#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 Apr 11, 2020 — forked from akirakubo/build-mozc-on-macos-10.13.6.md
Build Mozc with/without Qt on macOS 10.13.6 (or later)
View build-mozc-on-macos-10.13.6.md

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
SentiWordNet を日本語化する
View translate_sentiwordnet.py
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 Feb 10, 2019
CaboChaとそのPythonバインディングを入れる
View install_cabocha.sh
#!/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 Dec 14, 2018 — forked from nakagami/jabstract.py
Japanese summarization module using LexRank algorithm.
View jabstract.py
#!/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 Nov 22, 2018
Convert CSJ's xml to plain text
View parse_csj.py
import glob
import html
import re
import sys
import jaconv
re_ogt = re.compile(' OrthographicTranscription="([^"]+)"')
re_a = re.compile('\;([^\)]+)\)?')
re_semicolon = re.compile(';([^\)]+)\)?')
View mergesort.py
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
View quicksort.py
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 Dec 17, 2017
Pixiv小説のクロール
View pixiv_novel.py
# -*- 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 Nov 18, 2017
Python script of Julius on Windows
View julius.py
# 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\\'