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
def tokenize_en(text) | |
# modified https://github.com/luismsgomes/mosestokenizer/blob/master/src/mosestokenizer/tokenizer-v1.1.perl | |
text = " #{text.chomp} " | |
text.gsub!(/\s+/, ' ') | |
text.gsub!(/[\000-\037]/, '') | |
text.gsub!(/([^\p{Alnum}\s\.\'\`\,\-])/, ' \1 ') | |
text.gsub!(/\.([\.]+)/, 'DOTMULTI\1') | |
while text =~ /DOTMULTI\./ | |
text.gsub!(/DOTMULTI\.([^\.])/, 'DOTDOTMULTI \1') | |
text.gsub!(/DOTMULTI\./, 'DOTDOTMULTI') |
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'?> | |
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
<fontconfig> | |
<match> | |
<test name="lang" compare="contains"> | |
<string>th</string> | |
</test> | |
<edit mode="prepend" name="family"> | |
<string>Noto Sans Thai</string> | |
</edit> |
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
year(math, 60). | |
year(ai, 62). | |
year(english, 65). | |
str_rev(S, T) :- string_codes(S, SCODES), reverse(SCODES, TCODES), string_codes(T, TCODES). | |
can_register(STUDENT_ID, SUBJECT) :- str_rev(STUDENT_ID, REV_STUDENT_ID), | |
sub_string(REV_STUDENT_ID, 0, 2, _, REV_YEAR_STR), | |
str_rev(REV_YEAR_STR, YEAR_STR), | |
number_string(YEAR, YEAR_STR), |
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
year(math, 60). | |
year(ai, 62). | |
year(english, 65). | |
can_register(STUDENT_ID, SUBJECT) :- sub_string(STUDENT_ID, 0, 2, _, YEAR_STR), | |
number_string(YEAR, YEAR_STR), | |
year(SUBJECT, REQ_YEAR), | |
YEAR =< REQ_YEAR. |
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
male(tom). | |
male(bob). | |
male(jim). | |
female(liz). | |
female(pat). | |
female(ann). | |
female(pam). | |
parent(pam,bob). | |
parent(tom,bob). | |
parent(tom,liz). |
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
#!/bin/bash | |
rm -rf fast_align | |
git clone https://github.com/clab/fast_align.git | |
pushd fast_align | |
cmake . | |
make -j $(nproc) | |
popd |
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
[build-system] | |
requires = ["setuptools>=42", "wheel"] | |
build-backend = "setuptools.build_meta" | |
[project] | |
name = "thai2nmt" | |
version = "0.0.1" | |
authors = [{name = "VISTEC", email = "[email protected]"}] | |
description = "thai2nmt: English-Thai Machine Translation Models" | |
readme = "README.md" |
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
postgres=# CREATE TABLE citizen (name text); | |
CREATE TABLE | |
postgres=# INSERT INTO citizen VALUES ('เเซม'); | |
INSERT 0 1 | |
postgres=# SELECT name FROM citizen WHERE name = 'แซม'; | |
name | |
------ | |
(0 rows) | |
postgres=# CREATE OR REPLACE FUNCTION normalize_thai_name(name text) RETURNS text AS $$ |
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
require "gtk3" | |
app = Gtk::Application.new "rocks.veer66.Halo", :flags_none | |
app.signal_connect :activate do |app| | |
window = Gtk::ApplicationWindow.new(app) | |
window.set_title "Halo" | |
vbox = Gtk::Box.new(Gtk::Orientation::VERTICAL) | |
t1 = Gtk::TextView.new |
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/wish | |
grid [text .t1 -width 80 -height 30] | |
grid [ttk::button .b1 -text "chow BOYD" -command {.t1 insert end [exec "ls"]; .t1 insert end "\n\n"}] | |
grid [ttk::button .b2 -text "chow Tapemodel"] | |
grid [ttk::button .b3 -text "chow matrix"] | |
grid [ttk::button .b4 -text "chow kick"] | |
grid [ttk::button .b5 -text "Exit" -command {exit 0}] |
NewerOlder