Skip to content

Instantly share code, notes, and snippets.

Avatar

Tyler Bui-Palsulich tbpalsulich

View GitHub Profile
@tbpalsulich
tbpalsulich / abc.fst.txt
Created May 15, 2015
Sample input OpenFST transducer
View abc.fst.txt
0 1 a a
1 2 b b
2 2 c c
2
@tbpalsulich
tbpalsulich / make_T.py
Created May 15, 2015
Python script to create an edit transistor
View make_T.py
# ε = lowercase epsilon
alphabet = "abc"
weight = {
"delete": 1.0,
"insert": 1.0,
"sub": 1.0
}
# No edit
for l in alphabet:
@tbpalsulich
tbpalsulich / draw
Created May 15, 2015
Function to draw OpenFST transducers
View draw
function draw {fstdraw --isymbols=ascii.syms --osymbols=ascii.syms $1.fst | dot -Tpng -Eheadport=e -Etailport=w > $1.png}
@tbpalsulich
tbpalsulich / bc.fst.txt
Created May 14, 2015
OpenFST Transducer to replace 'b's with 'z's
View bc.fst.txt
0 0 b z
0 0 c c
0
@tbpalsulich
tbpalsulich / uppercase.fst.txt
Created May 14, 2015
Uppercasing OpenFST transducer
View uppercase.fst.txt
0 0 a A
0 0 A A
0 0 b B
0 0 B B
0 0 c C
0 0 C C
0
@tbpalsulich
tbpalsulich / ab.fst.txt
Created May 13, 2015
Simple replacement OpenFST transducer
View ab.fst.txt
0 0 a b
0 0 b b
0 0 c c
0
@tbpalsulich
tbpalsulich / regex.w.fst.txt
Created May 12, 2015
Simple weighted OpenFST automaton
View regex.w.fst.txt
0 1 ε .5
0 2 ε .5
2 2 a 1
2 1 ε .7
1 3 b .4
3 3 b .6
3 4 ε .1
3 4 c .1
4
@tbpalsulich
tbpalsulich / regex.fst.txt
Created May 12, 2015
Simple OpenFST formatted automaton for "a*b+c?"
View regex.fst.txt
0 1 ε
0 2 ε
2 2 a
2 1 ε
1 3 b
3 3 b
3 4 ε
3 4 c
4
@tbpalsulich
tbpalsulich / ascii.syms
Created May 12, 2015
Symbols file for common ascii characters to use with OpenFST
View ascii.syms
ε 0
<del> 1
<ins> 2
<sub> 3
_ 32
! 33
" 34
# 35
$ 36
% 37
You can’t perform that action at this time.