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
module LDIX | |
class Parser | |
def initialize | |
end | |
def parse_tag(raw) | |
if raw.nil? | |
[] | |
else | |
raw.map{|t| t[1..-2]} |
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
# Copyright (C) 2014 Vee Satayamas | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to | |
# the following conditions: | |
# |
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
<spectre> <def-cat n="unknown"> | |
<spectre> <cat-item tags=""/> | |
<spectre> </def-cat> |
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
module Apertium | |
OUTSIDE_WORD = 0 | |
INSIDE_WORD = 1 | |
class B | |
attr_reader :text | |
def initialize(text) | |
@text = text | |
end | |
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 "nokogiri" | |
require "pp" | |
include Nokogiri | |
class Extra | |
def initialize | |
end | |
def child2txt(t) |
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 | |
LOGPREFIX=log_rbmt200_$$ | |
ENGBIN=data/agri200p.dix.eng.trimmed.bin | |
BIDIX="data/agri200p.dix.engtha.bin" | |
LRX="data/eng-tha.lrx.bin" | |
T1X=data/_eng-tha.t1x | |
T1XBIN=data/_eng-tha.t1x.bin | |
T2X=data/eng-tha.t2x | |
T2XBIN=data/eng-tha.t2x.bin |
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 json | |
import sys | |
import re | |
import pprint | |
import copy | |
pp = pprint.PrettyPrinter(indent=4) | |
class Node(object): | |
def __init__(self, label, s=None, e=None, is_terminal=False, maxe=None): |
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
[package] | |
name = "titi" | |
version = "0.0.1" | |
authors = ["Vee Satayamas <v@v.v>"] | |
[[bin]] | |
name = "x" | |
test = false | |
doc = false |
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 "sinatra" | |
$p = IO.popen("lt-proc -z eng.automorf.bin | cg-proc -z eng-tha.rlx.bin", "r+") | |
def escape_stream(t) | |
t.gsub /([\^\$\/])/, '\\\\\1' | |
end | |
def tag(line) | |
$p.write escape_stream(line.chomp) |
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
pw = nil | |
pc = 0 | |
$stdin.each do |line| | |
line.chomp! | |
w, year, c1, c2 = line.split(/\t/) | |
if not pw.nil? and pw != w | |
puts "#{pw}\t#{pc}" | |
pw = nil | |
end |