Skip to content

Instantly share code, notes, and snippets.

View sandmark's full-sized avatar
📙
reading: CODE COMPLETE 2E

sandmark sandmark

📙
reading: CODE COMPLETE 2E
View GitHub Profile
@sandmark
sandmark / learn_cat.py
Created September 11, 2018 20:22
青空文庫の「吾輩は猫である」をUnmoに読み込ませる
from unmo import Unmo
import morph
DEBUG = True
name = ',/wagahaiwa_nekodearu.txt'
with open(name, encoding='utf-8') as f:
s = f.read()
@sandmark
sandmark / regexp_replacement.groovy
Last active March 31, 2017 04:51
Pattern based replacement script using Regular Expression for OmegaT
// --------------------------------------------------
regexp = /Sample segment named (.+) could be replaced with (.*)./
replacer = 'サンプル分節$1が$2に置き換えられます。'
// --------------------------------------------------
import static javax.swing.JOptionPane.*
import groovy.swing.SwingBuilder
import java.awt.Component
import javax.swing.JButton
import javax.swing.JTable
@sandmark
sandmark / Dictionary.rb
Created March 13, 2012 00:06
Sixamo-Rails
class Dictionary < ActiveRecord::Base
after_initialize :dictionary_initialize
DICT_INIT = "line_num: 0\n"
attr_reader :text, :trie
LTL = 3
WindowSize = 500
# def Dictionary.load(dirname)
# dic = Dictionary.new(dirname)