Skip to content

Instantly share code, notes, and snippets.

View lasta's full-sized avatar
🐬
Kotlin

Atsushi Koshikizawa lasta

🐬
Kotlin
View GitHub Profile
@lasta
lasta / RomanToKatakana.kt
Created February 24, 2019 07:04
Hepburn romanization to Katakana map.
val ROMAN_TO_KANA = mapOf(
"a" to "ア", "i" to "イ", "u" to "ウ", "e" to "エ", "o" to "オ",
"la" to "ァ", "li" to "ィ", "lu" to "ゥ", "le" to "ェ", "lo" to "ォ",
"xa" to "ァ", "xi" to "ィ", "xu" to "ゥ", "xe" to "ェ", "xo" to "ォ",
"ka" to "カ", "ki" to "キ", "ku" to "ク", "ke" to "ケ", "ko" to "コ",
"kya" to "キャ", "kyi" to "キィ", "kyu" to "キュ", "kye" to "キェ", "kyo" to "キョ",
"kwa" to "クァ", "kwi" to "クィ", "kwu" to "クゥ", "kwe" to "クェ", "kwo" to "クォ",
"qa" to "カ", "qi" to "キ", "qu" to "ク", "qe" to "ケ", "qo" to "コ",
"qwa" to "クァ", "qwi" to "クィ", "qwu" to "クゥ", "qwe" to "クェ", "qwo" to "クォ",
"ca" to "カ", "ci" to "シ", "cu" to "ク", "ce" to "セ", "co" to "コ",
@lasta
lasta / ModelGenerator
Last active August 9, 2018 00:19
Kotlin と OpenNLP を用いて日本語文章の固有表現抽出をしてみた (学習モデル作成〜抽出) ref: https://qiita.com/lasta/items/5261280d347c4d3d8d0d
<START:名詞-数> 二 <END> <START:名詞-接尾-助数詞> 人 <END> の 若い <START:名詞-一般> 紳士 <END> が 、 すっかり <START:名詞-固有名詞-地域-国> イギリス <END> の <START:名詞-一般> 兵隊 <END> の <START:名詞-一般> かたち <END> を し て 、 ぴかぴか する <START:名詞-一般> 鉄砲 <END> を かつい で 、 <START:名詞-一般> 白熊 <END> の <START:名詞-非自立-助動詞語幹> よう <END> な <START:名詞-一般> 犬 <END> を <START:名詞-数> 二 <END> <START:名詞-一般> 疋 <END> つれ て 、 だいぶ <START:名詞-一般> 山奥 <END> の 、 <START:名詞-一般> 木の葉 <END> の かさかさ し た <START:名詞-一般> とこ <END> を 、 こんな <START:名詞-非自立-一般> こと <END> を 云い ながら 、 ある い て おり まし た 。
@lasta
lasta / file0.txt
Created April 22, 2018 13:21
単独で実行可能な Ktor アプリケーション の jar を生成する ref: https://qiita.com/lasta/items/2c25ae5a875ba8da4f8a
java -jar yourapplication.jar
@lasta
lasta / r2k.py
Created November 27, 2015 09:54
#! /bin/sh
# coding: utf-8
""":"
exec python "$0" ${1+"$@"}
"""
# 直接入力をかな入力で入力されたと想定して変換します
# 濁音、半濁音には対応していません
import sys
@lasta
lasta / .vimrc
Created June 13, 2014 06:43
vim-quickrun for swift
let g:quickrun_config = {
\ 'swift' : {
\ 'command' : 'swift',
\ 'exec': ['%c %o %s -o %s:p:r', '%s:p:r %a'],
\ 'tempfile' : '%{tempname()}',
\ 'hook/sweep/files': '%S:p:r',
\ },
\ }
@lasta
lasta / newDiary
Created May 25, 2014 10:38
Copy diary_file and edit new one.
#!/bin/bash
set -euxo pipefail
## usage
# cd /path/to/diary_files/
# ./newDiary
# if you pass any value, new_diary_file will be opened with diary_editor
diary_editor="/Applications/MacVim.app/Contents/MacOS/Vim -g"
last_diary_file=`ls -1t 201[0-9]*.mkd | head -n 1`
@lasta
lasta / pwd2dir
Last active August 29, 2015 14:01
Convert OS X style path to Windows on Parallels style path.
#!/bin/bash
set -euo pipefail
# pwd : ~/path/to/dir
# dir : \\psf\path\to\dir
osx_dir_name=`pwd`
win_dir_name=`echo ${osx_dir_name} | cut -f4- -d "/" | sed -e 's/\\//\\\/g'`
echo "\\\\psf\\${win_dir_name}" | pbcopy
unset osx_dir_name
unset win_dir_name