This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************************************************************** | |
Public Domain | |
To the extent possible under law, Aaron Madlon-Kay has waived all | |
copyright and related or neighboring rights to this work. | |
This work is published from: Japan | |
**************************************************************************/ | |
package org.amk; | |
import java.util.ArrayList; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A simple phrase extractor | |
Usage: cat file.txt | python phraseextractor.py [max_ngram] [min_count] | |
Options: | |
max_ngram: Maximum phrase length in words (default: 5) | |
min_count: Minimum number of phrase occurrences (default: 3) | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
'''Like Miyagawa's cute "生 & 死 = 愛" trick? | |
https://gist.github.com/miyagawa/2212589 | |
This script generates every (jōyō) kanji & kanji = ? combination (no | |
args) or the result for supplied strings. | |
Note: A "wide" build of Python is required to handle surrogate chars | |
correctly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Convert the parallel corpora available at | |
# http://www2.nict.go.jp/univ-com/multi_trans/member/mutiyama/manual/index.html | |
# to TMX format | |
import os | |
import re | |
import tarfile | |
import urllib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
Generate randomize rings of kanji with a shared component a la the classic | |
吾、唯、足るを知る: | |
五 | |
矢口隹 | |
止 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.swift | |
// doservice | |
// | |
// Created by Aaron Madlon-Kay on 6/2/16. | |
// Copyright © 2016 Aaron Madlon-Kay. All rights reserved. | |
// | |
import Foundation | |
import AppKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>io.jenkins.slave</string> | |
<key>ProgramArguments</key> | |
<array> | |
<!-- If authentication is not required, you can launch via Java Web Start directly in the plist. | |
Otherwise you need a script like below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import re | |
dict_url = 'http://openlab.jp/skk/skk/dic/SKK-JISYO.L' | |
data = urllib2.urlopen(dict_url).read().decode('euc-jp') | |
words = set([l.split('/')[1].split(';')[0] | |
for l in data.split('\n') | |
if '/' in l and not l.startswith(';;')]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Making strings of "normal" Unicode is pretty easy: | |
// Unicode Scalar literal | |
"\u{2603}" // "☃" | |
// From int | |
String(UnicodeScalar(0x2603)) // "☃" | |
// Maybe you want to test how your app handles weird Unicode input, like naked surrogates. | |
// But Swift makes it pretty hard to create such strings. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
# Data from Quandl: https://www.quandl.com/resources/useful-lists | |
data = ['https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/SP500.csv', | |
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/dowjonesIA.csv', | |
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/NASDAQComposite.csv', | |
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/nasdaq100.csv', | |
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/NYSEComposite.csv', | |
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/nyse100.csv', | |
'https://s3.amazonaws.com/quandl-static-content/Ticker+CSV%27s/Indicies/FTSE100.csv'] |