Skip to content

Instantly share code, notes, and snippets.

View amake's full-sized avatar
🌵

Aaron Madlon-Kay amake

🌵
View GitHub Profile
@amake
amake / TMXTimekeeper.py
Last active December 13, 2015 20:39
A script to analyze a TMX file and try to figure out how much time has been spent translating.
'''
TMXTimekeeper.py
Analyze a TMX file and try to figure out how much time
has been spent translating. Assume a minimum of 5 minutes
for translating "sessions".
Created on 2013/02/17
@author: Aaron Madlon-Kay
@amake
amake / ParseCLI.java
Last active December 16, 2015 16:49
A function for correctly parsing CLI commands with quotes and escape characters, on Windows, Linux, and OS X.
/**************************************************************************
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;
@amake
amake / TMX2Corpus.py
Last active January 7, 2022 21:10
A script to convert TMXs into parallel corpuses for machine translation (e.g. Moses) training
'''
Created on Dec 19, 2013
A script to convert TMXs into parallel corpuses for machine
translation (e.g. Moses: http://www.statmt.org/moses/) training.
Pass in either paths to TMX files, or directories containing TMX files.
The script will recursively traverse directories and process all TMXs.
To perform tokenization or to filter the output, use the convert() method
@amake
amake / lg2tmx.xsl
Last active April 26, 2022 01:31
An XSLT to convert Apple *.lg glossaries into TMX
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Convert Apple *.lg glossaries to TMX. Usage:
xsltproc [-o <output file>] [-\-stringparam srclang <source lang>] lg2tmx.xsl <input file>
If not specified, the TMX header's srclang attribute defaults to "*all*".
Get glossaries at https://developer.apple.com/downloads/?name=glossaries -->
<xsl:output method="xml" indent="yes" encoding="UTF-8" />
<xsl:param name="srclang" select="'*all*'" />
<xsl:template match="/">
<tmx version="1.4">
@amake
amake / xyj-count.py
Created August 24, 2014 12:09
Journey to the West (西游记) character count
'''
Count the number of characters in Journey to the West
'''
import urllib2
URL = 'http://www.sdmz.net/xy/%03d.htm'
CHAPTERS = 100
def do_count():
@amake
amake / init.el
Last active August 29, 2015 14:06
My emacs init.el
;; Increase default font size.
(set-face-attribute 'default nil :height 180)
;; Set decent default fonts for Japanese and Chinese,
;; but *only* if in a graphical context.
;; Set Japanese second so that Japanese glyphs override Chinese
;; when both charsets cover the same codepoints.
(if (fboundp 'set-fontset-font)
(progn
(set-fontset-font
@amake
amake / google-japanese-dict.txt
Created September 17, 2014 00:49
Google Japanese Input User Dictionary
m — 記号 em dash
ん – 記号 en dash
おー ō アルファベット
おー Ō アルファベット
うー ū アルファベット
うー Ū アルファベット
@amake
amake / Android-strings-to-TMX.pln
Last active November 10, 2015 05:39
Okapi Rainbow pipeline for converting Android strings to TMX
<?xml version="1.0" encoding="UTF-8"?>
<!--
Pipeline for converting pairs of raw Android SDK values*/strings.xml
files into TMX (for translation reference, etc.).
Load this pipeline into Okapi Rainbow and set the input files, e.g.:
Input List 1: $ANDROID_HOME/.../values/strings.xml
Input List 2: $ANDROID_HOME/.../values-ja/strings.xml
Use the [email protected] filter config included
@amake
amake / launch-uihierarchy.json
Created April 21, 2015 07:35
Instruments UI hierarchy on launch
{
"@": {
"name": "SpringBoard",
"label": " ",
"value": null,
"dom": null,
"enabled": true,
"valid": true,
"visible": true,
"hint": null,

Keybase proof

I hereby claim:

  • I am amake on github.
  • I am amake (https://keybase.io/amake) on keybase.
  • I have a public key whose fingerprint is 4D1F C6E6 A5CC 3779 61F6 0A00 8518 D800 A1C6 CEF9

To claim this, I am signing this object: