Skip to content

Instantly share code, notes, and snippets.

@yu-tang
yu-tang / open_segmentation_customizer_with_large_font.groovy
Last active August 29, 2015 13:55
OmegaT scripting: Open segmentation customizer with large font
/*
* Open segmentation customizer with large font
*
* @author Yu Tang
* @date 2013-01-31
* @version 0.2
*/
import java.awt.Component;
import java.awt.event.WindowAdapter;
@yu-tang
yu-tang / testJRA.bas
Created March 2, 2014 01:47
WebScraper for VBA examples
Option Explicit
Sub JRA_Test01()
Dim req As WSHttpRequest
Dim proc As WSProcessReExecute
Dim ret As Collection
Dim token As String
' 騎手データ > リーディングの HTML から
' 「浜中 俊」のリンク先トークンを取得(週ごとに変動する模様)
@yu-tang
yu-tang / svn_commit_source_files.groovy
Last active August 29, 2015 13:56
OmegaT scripting: Upload source files to SVN remote repository
/**
* Commit source file changes to SVN remote repository
*
* Supported basic operations are shown in the next list.
*
* 1. svn add for manually added (unversioned) files/folders.
* 2. svn delete for manually deleting (missing) files/folders.
* 3. modified files.
*
* copy, move, merge or any other svn commands are not available.
@yu-tang
yu-tang / BinaryReader.cls
Last active August 29, 2015 13:59
BinaryReader for VBA
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
END
Attribute VB_Name = "BinaryReader"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Compare Binary
@yu-tang
yu-tang / MergeDocs.vbs
Last active August 29, 2015 14:06
Merge two .docx files paragraph-by-paragraph.
'*********************************************************************
' MergeDocs.vbs
' Merge two .docx files paragraph-by-paragraph.
'---------------------------------------------------------------------
' Author : Yu Tang
' Version : 0.1.1
' Lisence : GPLv3
' Required : Microsoft Word installed.
' Usage : 1. D&D source file from OmegaT project source dir.
' or
@yu-tang
yu-tang / trc2tmx.groovy
Last active August 29, 2015 14:10
翻訳Atlas の対訳ファイル(.trc)を TMX ファイルに変換する OmegaT 用スクリプト
/** :name=.trc を TMX に変換 :description=翻訳Atlas の対訳ファイル(.trc)を TMX ファイルに変換する
*
* 翻訳Atlas の対訳ファイル(.trc)を TMX ファイルに変換する OmegaT 用スクリプト
*
* .trc のデータ形式は、下記を参照した。
*
* ATLAS で gettext PO ファイルの翻訳をしたい その2
* http://ta-memo.blogspot.jp/2011/05/atlas-gettext-po-2.html
*
* 使い方:
@yu-tang
yu-tang / enable_jython.groovy
Last active August 29, 2015 14:11
Allow to support Jython for OmegaT Scripting
/*
* Allow to support Jython for OmegaT Scripting
*
* Usage: step 1. Get embedding Jython from http://www.jython.org/
* step 2. Adjust config setting and run this script
* Note : It's enabling Jython just while current session.
* Hint : Put this script to <ScriptsDir>/application_startup folder
* to automatically execution at every time OmT launching.
* Caution: This script is very hacky. Proceed at your own risk.
*
@yu-tang
yu-tang / PoC_segment_shortcut.groovy
Last active August 29, 2015 14:11
PoC for segment shortcut
/*
* PoC for segment shortcut
*
* Related RFE : http://sourceforge.net/p/omegat/feature-requests/1038/
* Hint : Put this script to <ScriptsDir>/application_startup folder
* to automatically execution at every time OmT launching.
*
* @author Yu Tang
* @date 2014-12-21
* @version 0.1
@yu-tang
yu-tang / result.txt
Created June 5, 2015 16:47
test for OmegaT tokenizers
org.omegat.tokenizer.LuceneEnglishTokenizer
--------------------
0. "fooled"
1. "by"
2. "a"
3. "smile"
org.omegat.tokenizer.LuceneJapaneseTokenizer
--------------------
0. "fooled"
@yu-tang
yu-tang / KeyTextList.groovy
Created June 24, 2015 16:47
getKeyText の中身を列挙
//def res = new sun.awt.resources.awt_ja()
def res = new sun.awt.resources.awt()
res.getContents().each {console.println "${it[0]}, ${it[1]}"}